/* Plinko Game Styles */

.game-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.game-info {
    flex: 1;
}

.game-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.game-title i {
    font-size: 2rem;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-title h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.game-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    margin: 0;
}

.balance-display {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.balance-info {
    text-align: center;
}

.balance-label {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.balance-amount {
    display: block;
    color: #10b981;
    font-size: 1.5rem;
    font-weight: 700;
}

.game-section {
    padding: 0;
}

.game-container {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Controls Panel */
.controls-panel {
    background: linear-gradient(145deg, rgba(30, 32, 47, 0.9), rgba(45, 48, 68, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    height: fit-content;
}

.controls-panel h3 {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.betting-section,
.risk-section,
.auto-play-section {
    margin-bottom: 2rem;
}

.bet-input-group {
    position: relative;
    margin-bottom: 1rem;
}

.bet-input-group input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.75rem 3rem 0.75rem 0.75rem;
    color: white;
    font-size: 1rem;
}

.bet-input-group input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.currency {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.bet-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 0.5rem;
}

.bet-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    padding: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bet-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #6366f1;
}

.risk-selector {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}

.risk-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    padding: 0.75rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.risk-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.risk-btn.active {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-color: transparent;
}

.auto-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: 0.3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background: linear-gradient(135deg, #6366f1, #a855f7);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.auto-label {
    color: white;
    font-size: 0.9rem;
}

.auto-settings {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.auto-input {
    margin-bottom: 0.75rem;
}

.auto-input label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.auto-input input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 0.5rem;
    color: white;
    font-size: 0.9rem;
}

.play-button {
    width: 100%;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.play-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.play-button:disabled {
    background: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Game Board */
.game-board {
    position: relative;
    background: linear-gradient(145deg, rgba(30, 32, 47, 0.9), rgba(45, 48, 68, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1rem 1rem 0.5rem 1rem; /* 底部縮小，讓獎勵列靠近畫布 */
    display: flex;
    flex-direction: column;
    align-items: center;
}

#plinko-canvas {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.multiplier-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
    
}

.multiplier-row .multiplier {
    min-width: 40px;
    padding: 6px 10px;
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.multiplier-row .multiplier.green { background: linear-gradient(135deg,#10b981,#059669); }
.multiplier-row .multiplier.yellow { background: linear-gradient(135deg,#f59e0b,#d97706); }
.multiplier-row .multiplier.red { background: linear-gradient(135deg,#dc2626,#991b1b); }

.multiplier {
    flex: 1;
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: white;
    text-align: center;
    padding: 6px 4px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 高亮落點格 */
.multiplier.active {
    outline: 2px solid #fff;
    box-shadow: 0 0 12px rgba(255,255,255,0.6);
}

.multiplier.green {
    background: linear-gradient(135deg, #10b981, #059669);
}

.multiplier.yellow {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.multiplier.red {
    background: linear-gradient(135deg, #dc2626, #991b1b);
}

/* Stats Panel */
.stats-panel {
    background: linear-gradient(145deg, rgba(30, 32, 47, 0.9), rgba(45, 48, 68, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    height: fit-content;
}

.stats-panel h3 {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.fairness-section,
.stats-section,
.recent-games {
    margin-bottom: 2rem;
}

.seed-info {
    margin-bottom: 1rem;
}

.seed-item {
    margin-bottom: 1rem;
}

.seed-item label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.seed-value {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.5rem;
    color: white;
    font-size: 0.8rem;
    font-family: monospace;
    word-break: break-all;
}

.seed-input-group {
    display: flex;
    gap: 0.5rem;
}

.seed-input-group input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 0.5rem;
    color: white;
    font-size: 0.8rem;
}

.seed-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.seed-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.verify-btn {
    width: 100%;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.verify-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.stat-grid {
    display: grid;
    gap: 0.75rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.stat-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.stat-value {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.games-list {
    max-height: 200px;
    overflow-y: auto;
}

.game-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.game-result:last-child {
    border-bottom: none;
}

.result-multiplier {
    font-weight: 600;
    font-size: 0.85rem;
}

.result-multiplier.win {
    color: #10b981;
}

.result-multiplier.loss {
    color: #dc2626;
}

.result-amount {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(145deg, rgba(30, 32, 47, 0.95), rgba(45, 48, 68, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    color: white;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .game-container {
        grid-template-columns: 280px 1fr 280px;
        gap: 1.5rem;
    }
}

@media (max-width: 992px) {
    .game-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    #plinko-canvas {
        width: 100%;
        max-width: 500px;
        height: auto;
    }
}

@media (max-width: 768px) {
    .game-header {
        padding: 1.5rem;
    }
    
    .game-title h1 {
        font-size: 2rem;
    }
    
    .controls-panel,
    .stats-panel {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .game-header {
        padding: 1rem;
    }
    
    .game-title {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .game-title h1 {
        font-size: 1.75rem;
    }
}
