/**
 * Blackjack Game Styles
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a472a 0%, #0d2818 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 1rem 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.game-container {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.chips-display {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
}

.chip-icon {
    font-size: 1.25rem;
}

.chips-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffd700;
}

.best-chips {
    color: #90ee90;
    font-size: 0.8rem;
    min-height: 1rem;
}

/* Table */
.table {
    width: 100%;
    background: rgba(0, 100, 0, 0.3);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 280px;
}

.hand {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hand-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

.score {
    color: #ffd700;
    margin-left: 0.5rem;
}

.cards {
    display: flex;
    gap: -30px;
    min-height: 80px;
    flex-wrap: wrap;
}

.card {
    width: 55px;
    height: 80px;
    background: #fff;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4px 6px;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    margin-right: -20px;
    animation: dealCard 0.3s ease-out;
}

.card:last-child {
    margin-right: 0;
}

@keyframes dealCard {
    from {
        transform: translateY(-50px) rotate(-10deg);
        opacity: 0;
    }
    to {
        transform: translateY(0) rotate(0);
        opacity: 1;
    }
}

.card.hidden {
    background: linear-gradient(135deg, #c41e3a 0%, #8b0000 100%);
    color: transparent;
}

.card.hidden::before {
    content: '🂠';
    font-size: 3rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.card.red {
    color: #c41e3a;
}

.card.black {
    color: #1a1a1a;
}

.card-top, .card-bottom {
    display: flex;
    align-items: center;
    gap: 2px;
}

.card-bottom {
    align-self: flex-end;
    transform: rotate(180deg);
}

.card-center {
    font-size: 1.5rem;
    text-align: center;
}

/* Result message */
.result-message {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    min-height: 1.75rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.result-message.win {
    color: #90ee90;
}

.result-message.lose {
    color: #ff6b6b;
}

.result-message.push {
    color: #ffd700;
}

/* Betting area */
.bet-area {
    width: 100%;
    text-align: center;
}

.bet-area.hidden {
    display: none;
}

.bet-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.bet-buttons {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.bet-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #ffd700;
    background: linear-gradient(145deg, #2d5a3d, #1a3a25);
    color: #ffd700;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.bet-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.bet-btn:active {
    transform: translateY(0);
}

.bet-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* Action buttons */
.action-area, .continue-area, .gameover-area {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.action-area.hidden, .continue-area.hidden, .gameover-area.hidden {
    display: none;
}

.action-btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 90px;
}

.action-btn:active {
    transform: scale(0.98);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-btn.hit {
    background: #3b82f6;
    color: #fff;
}

.action-btn.stand {
    background: #ef4444;
    color: #fff;
}

.action-btn.double {
    background: #f59e0b;
    color: #fff;
}

.action-btn.continue {
    background: #22c55e;
    color: #fff;
}

.action-btn.restart {
    background: #8b5cf6;
    color: #fff;
}

.gameover-message {
    color: #ff6b6b;
    font-size: 1.25rem;
    font-weight: 700;
    width: 100%;
    text-align: center;
    margin-bottom: 0.5rem;
}

/* Home link */
.home-link {
    margin-top: 0.5rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.2s;
}

.home-link:hover {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
}

.home-link:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Responsive */
@media (max-width: 360px) {
    .card {
        width: 48px;
        height: 70px;
        font-size: 0.85rem;
        margin-right: -18px;
    }

    .card-center {
        font-size: 1.25rem;
    }

    .bet-btn {
        width: 50px;
        height: 50px;
        font-size: 0.9rem;
    }

    .action-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
        min-width: 80px;
    }
}
