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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f0f1a;
    color: #e0e0e0;
    line-height: 1.6;
    min-height: 100vh;
}

main {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

.breadcrumb {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.75rem;
}

.breadcrumb a {
    color: #4ecca3;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

h1 {
    text-align: center;
    color: #4ecca3;
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

/* ── Game container ─────────────────────────────────── */

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    background: #1a1a2e;
    border-radius: 12px;
    border: 1px solid #2a2a4e;
    padding: 1.25rem;
}

/* ── Chips bar ──────────────────────────────────────── */

.chips-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    font-size: 1rem;
}

.chips-label {
    color: #888;
}

.chips-amount {
    color: #4ecca3;
    font-size: 1.2rem;
    font-weight: 700;
}

.round-result {
    margin-left: auto;
    font-size: 1rem;
    font-weight: 700;
    min-width: 120px;
    text-align: right;
    min-height: 1.4em;
    transition: color 0.3s;
}

.round-result.win  { color: #4ecca3; }
.round-result.lose { color: #e94560; }
.round-result.push { color: #f0a000; }
.round-result.bj   { color: #f0f000; }

/* ── Play area ─────────────────────────────────────── */

.play-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hand-section {
    width: 100%;
}

.hand-label {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hand-total {
    font-weight: 700;
    color: #e0e0e0;
    font-size: 1rem;
    text-transform: none;
    letter-spacing: normal;
}

.hand {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 80px;
    align-items: flex-start;
}

/* ── Cards ─────────────────────────────────────────── */

.card {
    width: 58px;
    height: 84px;
    background: #f5f5f0;
    border-radius: 6px;
    border: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 4px 5px;
    position: relative;
    font-family: Georgia, 'Times New Roman', serif;
    box-shadow: 2px 3px 6px rgba(0,0,0,0.5);
    flex-shrink: 0;
    animation: dealCard 0.2s ease-out;
}

@keyframes dealCard {
    from { opacity: 0; transform: translateY(-12px) scale(0.92); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.card.red-suit {
    color: #cc2222;
}

.card.black-suit {
    color: #111;
}

.card-rank-top {
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
    align-self: flex-start;
}

.card-suit-center {
    font-size: 1.5rem;
    line-height: 1;
}

.card-rank-bottom {
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
    align-self: flex-end;
    transform: rotate(180deg);
}

/* Face-down card */
.card.face-down {
    background: #1a3a7a;
    border-color: #2a4a9a;
    background-image:
        repeating-linear-gradient(
            45deg,
            rgba(255,255,255,0.04) 0px,
            rgba(255,255,255,0.04) 2px,
            transparent 2px,
            transparent 8px
        );
}

.card.face-down .card-rank-top,
.card.face-down .card-suit-center,
.card.face-down .card-rank-bottom {
    visibility: hidden;
}

/* ── Bet controls ──────────────────────────────────── */

.bet-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.bet-label {
    font-size: 0.9rem;
    color: #888;
}

.chip-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.chip-btn {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    background: #12122a;
    color: #f0a000;
    border: 2px solid #f0a000;
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.chip-btn:hover:not(:disabled) {
    background: #f0a000;
    color: #0f0f1a;
}

.chip-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.bet-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.bet-label-inline {
    font-size: 0.95rem;
    color: #888;
    flex: 1;
    min-width: 120px;
}

.bet-label-inline strong {
    color: #f0a000;
    font-size: 1.05rem;
}

/* ── Action buttons ────────────────────────────────── */

.action-controls {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.action-controls.hidden,
.bet-controls.hidden,
.new-round-controls.hidden,
.no-chips.hidden {
    display: none;
}

.action-btn {
    padding: 0.6rem 1.4rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    border: 2px solid;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.action-btn.primary {
    background: #4ecca3;
    color: #0f0f1a;
    border-color: #4ecca3;
}

.action-btn.primary:hover:not(:disabled) {
    background: #3db892;
    border-color: #3db892;
}

.action-btn.primary:disabled {
    background: #2a3a3a;
    color: #4a6a6a;
    border-color: #2a3a3a;
    cursor: not-allowed;
}

.action-btn.secondary {
    background: transparent;
    color: #e0e0e0;
    border-color: #4a4a6e;
}

.action-btn.secondary:hover:not(:disabled) {
    background: #2a2a4e;
    border-color: #6a6a8e;
}

.action-btn.double {
    background: transparent;
    color: #f0a000;
    border-color: #f0a000;
}

.action-btn.double:hover:not(:disabled) {
    background: #f0a000;
    color: #0f0f1a;
}

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

/* ── New round / No chips ──────────────────────────── */

.new-round-controls {
    width: 100%;
    display: flex;
    justify-content: center;
}

.no-chips {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid #e94560;
    border-radius: 8px;
    width: 100%;
    text-align: center;
}

.no-chips p {
    color: #e94560;
    font-weight: 700;
    font-size: 1.1rem;
}

/* ── Content / SEO article ──────────────────────── */

.content {
    padding-top: 1.5rem;
    border-top: 1px solid #2a2a4e;
}

.disclaimer {
    background: #1a1a2e;
    border-left: 3px solid #f0a000;
    padding: 0.6rem 0.9rem;
    border-radius: 0 6px 6px 0;
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 1rem;
}

.last-updated {
    font-size: 0.8rem;
    color: #555;
    margin-bottom: 0.75rem;
}

.content h2 {
    color: #4ecca3;
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem;
}

.content h2:first-of-type {
    margin-top: 1rem;
}

.content p {
    margin-bottom: 0.75rem;
    color: #c0c0c0;
}

.content ul {
    margin: 0.5rem 0 1rem 1.5rem;
    color: #c0c0c0;
}

.content li {
    margin-bottom: 0.5rem;
}

.faq {
    margin: 0.5rem 0 1.5rem;
}

.faq dt {
    font-weight: 700;
    color: #e0e0e0;
    margin-top: 1rem;
}

.faq dd {
    color: #aaa;
    margin-left: 0;
    margin-top: 0.25rem;
}

.related-games {
    margin-top: 1.5rem;
}

.related-games h3 {
    color: #4ecca3;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.game-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.game-links a {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    background: #1a1a2e;
    color: #4ecca3;
    border: 1px solid #2a2a4e;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s, border-color 0.2s;
}

.game-links a:hover {
    background: #2a2a4e;
    border-color: #4ecca3;
}

/* ── Responsive ──────────────────────────────────── */

@media (min-width: 600px) {
    main {
        padding: 2rem;
    }

    h1 {
        font-size: 2rem;
    }

    .card {
        width: 68px;
        height: 96px;
    }

    .card-rank-top,
    .card-rank-bottom {
        font-size: 1rem;
    }

    .card-suit-center {
        font-size: 1.8rem;
    }

    .game-container {
        padding: 1.5rem;
    }
}

@media (max-width: 380px) {
    .card {
        width: 50px;
        height: 72px;
    }

    .card-rank-top,
    .card-rank-bottom {
        font-size: 0.75rem;
    }

    .card-suit-center {
        font-size: 1.2rem;
    }

    .chip-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    main { padding-top: 0.5rem; }
    h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
    .game-container { padding: 0.75rem; gap: 0.65rem; }
}
