body {
    min-height: 100vh;
    background: linear-gradient(135deg, #16213e 0%, #1a1a2e 48%, #0f3460 100%);
}

.game-container {
    max-width: 1180px;
}

.breadcrumb,
.breadcrumb a,
.header h1 {
    color: #f8fafc;
}

.game-area {
    background: rgba(255, 255, 255, 0.97);
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
    padding: 24px;
}

.status {
    margin: 12px auto 16px;
    min-height: 1.8em;
    color: #172554;
    font-size: 1.15rem;
    font-weight: 800;
    text-align: center;
}

.online-info,
.ai-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.ai-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    color: #1e3a8a;
    margin: 0 auto 12px;
    max-width: 460px;
    padding: 8px 12px;
}

.ai-info-label {
    font-weight: 800;
}

.difficulty-btn {
    padding: 7px 14px;
    box-shadow: none;
}

.difficulty-btn.active {
    background: #14532d;
}

.opponent-name {
    color: #475569;
    font-weight: 800;
}

.scoreboard {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.score-card {
    background: #f8fafc;
    border: 2px solid #dbeafe;
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
    color: #172554;
    padding: 14px;
}

.score-card.current {
    border-color: #22c55e;
    background: #ecfdf5;
}

.score-card.dealer {
    border-style: dashed;
}

.score-name {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 1rem;
    font-weight: 900;
}

.score-points {
    color: #166534;
    display: block;
    font-size: 1.75rem;
    font-weight: 900;
    line-height: 1.1;
    margin-top: 6px;
}

.score-meta {
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 700;
}

.peg-board {
    background: #1f2937;
    border: 4px solid #8b5a2b;
    border-radius: 22px;
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.08), 0 10px 24px rgba(15, 23, 42, 0.24);
    color: #f8fafc;
    margin-bottom: 18px;
    padding: 14px;
}

.peg-board-header,
.peg-legend {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.88rem;
    font-weight: 800;
}

.peg-track {
    display: grid;
    grid-template-columns: repeat(31, minmax(7px, 1fr));
    gap: 5px;
    margin: 12px 0;
}

.peg-hole {
    aspect-ratio: 1;
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    min-width: 7px;
    position: relative;
}

.peg-hole.milestone {
    background: #374151;
}

.peg-hole.player-one::before,
.peg-hole.player-two::after {
    border-radius: 50%;
    content: '';
    height: 80%;
    left: 10%;
    position: absolute;
    top: 10%;
    width: 80%;
}

.peg-hole.player-one::before,
.legend-peg.player-one {
    background: #ef4444;
}

.peg-hole.player-two::after,
.legend-peg.player-two {
    background: #3b82f6;
}

.peg-hole.player-one.player-two::before {
    clip-path: inset(0 50% 0 0);
}

.peg-hole.player-one.player-two::after {
    clip-path: inset(0 0 0 50%);
}

.legend-peg {
    border-radius: 50%;
    display: inline-block;
    height: 12px;
    margin-right: 5px;
    vertical-align: -1px;
    width: 12px;
}

.cribbage-table,
.hands-grid {
    display: grid;
    gap: 16px;
}

.cribbage-table {
    grid-template-columns: minmax(180px, 0.85fr) minmax(260px, 1.3fr) minmax(180px, 0.85fr);
    margin-bottom: 16px;
}

.hands-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 14px;
}

.round-panel,
.pegging-panel,
.crib-panel,
.hand-panel,
.score-log-panel {
    background: #f8fafc;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    padding: 14px;
}

.round-panel {
    display: grid;
    gap: 8px;
    color: #1e293b;
    font-weight: 700;
}

.starter-slot {
    display: grid;
    gap: 8px;
}

.mini-card-slot {
    background: #e0f2fe;
    border: 1px dashed #0284c7;
    border-radius: 10px;
    color: #075985;
    font-size: 0.9rem;
    font-weight: 800;
    padding: 8px;
    text-align: center;
}

.pegging-panel h2,
.crib-panel h2,
.zone-heading h2,
.score-log-panel h2 {
    color: #172554;
    font-size: 1.05rem;
    margin: 0;
}

.running-total {
    background: #eff6ff;
    border-radius: 12px;
    color: #1d4ed8;
    font-size: 1.35rem;
    font-weight: 900;
    margin: 10px 0;
    padding: 10px;
    text-align: center;
}

.played-history {
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 700;
    margin-top: 8px;
    min-height: 1.3em;
    text-align: center;
}

.crib-panel p {
    color: #64748b;
    font-weight: 800;
    margin: 8px 0;
    text-align: center;
}

.zone-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.zone-summary {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 800;
}

.card-row {
    align-content: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    min-height: 92px;
}

.card-row.compact {
    min-height: 72px;
}

.crib-card {
    align-items: center;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 5px 12px rgba(15, 23, 42, 0.15);
    color: #0f172a;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    font-weight: 900;
    height: 86px;
    justify-content: space-between;
    min-width: 58px;
    padding: 7px 5px;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
    width: 58px;
}

.card-row.compact .crib-card {
    height: 66px;
    min-width: 46px;
    width: 46px;
}

.crib-card:not(:disabled):hover,
.crib-card.selected {
    border-color: #22c55e;
    box-shadow: 0 10px 20px rgba(34, 197, 94, 0.22);
    transform: translateY(-6px);
}

.crib-card:disabled {
    cursor: default;
}

.crib-card.illegal {
    opacity: 0.45;
}

.crib-card .rank {
    font-size: 1.05rem;
    line-height: 1;
}

.crib-card .suit {
    font-size: 1.45rem;
    line-height: 1;
}

.crib-card.red-suit {
    color: #dc2626;
}

.crib-card.black-suit {
    color: #111827;
}

.card-back {
    background: repeating-linear-gradient(45deg, #1e3a8a, #1e3a8a 8px, #2563eb 8px, #2563eb 16px);
    border-color: #bfdbfe;
    color: #eff6ff;
    justify-content: center;
}

.action-buttons,
.game-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 14px 0;
}

.score-log-panel {
    margin-top: 14px;
}

.show-results {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 10px 0;
}

.show-result-card {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    color: #7c2d12;
    padding: 10px;
}

.show-result-card strong {
    display: block;
}

.show-result-card span {
    display: block;
    font-size: 0.84rem;
    margin-top: 4px;
}

.score-log {
    display: grid;
    gap: 6px;
    list-style: none;
    margin: 0;
    max-height: 180px;
    overflow: auto;
    padding: 0;
}

.score-log li {
    background: #eef2ff;
    border-left: 4px solid #4f46e5;
    border-radius: 8px;
    color: #312e81;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 8px 10px;
}

@media (max-width: 900px) {
    .cribbage-table,
    .hands-grid,
    .scoreboard,
    .show-results {
        grid-template-columns: 1fr;
    }

    .peg-track {
        grid-template-columns: repeat(22, minmax(7px, 1fr));
    }
}

@media (max-width: 560px) {
    .game-area {
        padding: 14px;
    }

    .peg-track {
        gap: 4px;
        grid-template-columns: repeat(16, minmax(7px, 1fr));
    }

    .crib-card {
        height: 74px;
        min-width: 50px;
        width: 50px;
    }
}
