body {
    min-height: 100vh;
}

.game-container {
    text-align: center;
}

.game-area {
    background: var(--card-background, #fff);
    padding: 24px;
    border-radius: var(--border-radius, 8px);
    box-shadow: var(--shadow, 0 4px 6px rgba(0,0,0,0.1));
    max-height: 85vh;
    overflow-y: auto;
}

.status {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary-color, #2c3e50);
    min-height: 1.6em;
    margin-bottom: 12px;
}

.domino-meta {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.domino-meta span {
    background: #eef6fc;
    color: #1f5d86;
    border: 1px solid #cfe6f7;
    border-radius: 999px;
    padding: 6px 12px;
    font-weight: 700;
    font-size: 0.9rem;
}

.players-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.player-panel {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px;
    color: #334155;
}

.player-panel.active {
    border-color: #27ae60;
    background: #ecfdf5;
}

.player-panel.me {
    box-shadow: inset 0 0 0 2px rgba(41, 128, 185, 0.16);
}

.player-panel .name {
    font-weight: 800;
    margin-bottom: 4px;
}

.player-panel .count,
.player-panel .pips {
    font-size: 0.85rem;
    color: #64748b;
}

.action-log {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    color: #9a3412;
    font-weight: 600;
    min-height: 2.4em;
    padding: 10px 12px;
    margin-bottom: 16px;
}

.layout-area {
    margin-bottom: 18px;
}

.layout-area h3,
.hand-area h3 {
    color: #475569;
    font-size: 1rem;
    margin-bottom: 10px;
}

.domino-layout {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    min-height: 96px;
    padding: 12px;
    background: linear-gradient(135deg, #14532d 0%, #166534 100%);
    border: 4px solid #7c2d12;
    border-radius: 18px;
    box-shadow: inset 0 2px 12px rgba(0,0,0,0.22);
}

.empty-layout {
    width: 100%;
    color: #dcfce7;
    font-weight: 700;
}

.domino-tile {
    display: inline-flex;
    align-items: stretch;
    justify-content: center;
    min-width: 86px;
    height: 44px;
    border: 2px solid #111827;
    border-radius: 10px;
    background: #fffaf0;
    color: #111827;
    box-shadow: 0 3px 0 #6b7280;
    user-select: none;
    overflow: hidden;
}

.domino-tile.double {
    background: #fef3c7;
}

.tile-half {
    width: 42px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    font-weight: 900;
}

.tile-half + .tile-half {
    border-left: 2px solid #111827;
}

.tile-value {
    font-size: 1.05rem;
    line-height: 1;
}

.pip-mini {
    min-height: 11px;
    font-size: 0.55rem;
    letter-spacing: -1px;
    color: #475569;
    line-height: 1;
}

.hand {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    min-height: 72px;
    margin-bottom: 14px;
}

.hand .domino-tile {
    height: 54px;
    min-width: 98px;
    cursor: pointer;
    border-color: #475569;
    box-shadow: 0 4px 0 #94a3b8;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.hand .domino-tile.playable {
    border-color: #27ae60;
    background: #f0fdf4;
}

.hand .domino-tile.playable:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(39, 174, 96, 0.22);
}

.hand .domino-tile.selected {
    border-color: #e74c3c;
    background: #fff1f2;
    transform: translateY(-7px);
}

.hand .domino-tile.disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.end-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 14px;
    font-weight: 700;
}

.end-controls button {
    background: #2563eb;
    color: #fff;
}

.turn-actions,
.game-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.turn-actions button {
    min-width: 160px;
}

.online-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.opponent-name {
    color: var(--text-muted, #666);
    font-weight: 700;
}

.interstitial-screen {
    background: var(--card-background, #fff);
    padding: 40px;
    border-radius: var(--border-radius, 8px);
    box-shadow: var(--shadow, 0 4px 6px rgba(0,0,0,0.1));
    max-width: 420px;
    margin: 40px auto;
    text-align: center;
}

.interstitial-content h2 {
    color: var(--secondary-color, #2c3e50);
    margin-bottom: 14px;
}

.next-player-name {
    font-size: 2rem;
    color: var(--primary-color, #2980b9);
    font-weight: 900;
    margin: 16px 0 24px;
}

.score-results {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    margin: 16px auto;
    max-width: 520px;
    text-align: left;
}

.score-results h3 {
    text-align: center;
    color: #1f2937;
    margin-bottom: 10px;
}

.score-results ul {
    list-style: none;
    padding: 0;
}

.score-results li {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 700;
}

.score-results li:last-child {
    border-bottom: none;
}

@media (max-width: 700px) {
    .game-container {
        padding: 12px;
    }

    .game-area {
        padding: 14px;
    }

    .domino-layout {
        min-height: 86px;
        padding: 10px;
    }

    .domino-tile {
        min-width: 74px;
        height: 40px;
    }

    .hand .domino-tile {
        min-width: 82px;
        height: 50px;
    }

    .tile-half {
        width: 37px;
    }

    .tile-value {
        font-size: 0.95rem;
    }

    .pip-mini {
        font-size: 0.48rem;
    }

    .turn-actions button,
    .game-buttons button {
        width: 100%;
    }
}
