.chess-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 1480px;
    margin-top: 28px;
}

.muted {
    color: var(--muted);
}

.chess-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(540px, 1fr) minmax(260px, 320px);
    gap: 18px;
    align-items: start;
    position: relative;
}

.chess-page .card {
    border-radius: 8px;
    padding: 18px;
}

.connection,
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.connection,
.right-column {
    position: relative;
    z-index: 5;
}

.right-column {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

.chess-page .right-column .clock-card {
    display: grid;
    gap: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.capture-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    min-height: 28px;
    padding: 0 0 6px;
}

.capture-cell {
    display: grid;
    align-items: center;
    min-width: 0;
}

.capture-line {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    min-width: 0;
}

.capture-pieces {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1px;
    min-width: 0;
}

.capture-piece {
    font-family: "Times New Roman", Georgia, serif;
    font-size: 22px;
    line-height: 1;
}

.capture-piece.white {
    color: #f6f0e5;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.capture-piece.black {
    color: #171a20;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.58), 0 1px 2px rgba(0, 0, 0, 0.24);
}

.material-score {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 13px;
}

.clock-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    gap: 12px;
    transform: translateY(1px);
    position: relative;
    z-index: 1;
}

.clock-panel {
    position: relative;
    display: grid;
    gap: 4px;
    min-width: 0;
    min-height: 58px;
    box-sizing: border-box;
    padding: 4px 10px 6px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px 8px 0 0;
    background: #171a22;
}

.clock-panel.active {
    border-color: rgba(62, 243, 168, 0.58);
    background: #172118;
}

.clock-panel.active::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 4px;
    background: var(--accent);
}

.clock-panel.flagged {
    border-color: rgba(248, 113, 113, 0.78);
    background: #241515;
}

.clock-time {
    align-self: center;
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: clamp(24px, 4.4vw, 42px);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-vs-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding: 14px 18px 16px;
    border: 1px solid var(--border);
    border-radius: 8px 8px 0 0;
    background: var(--panel);
    color: var(--muted);
    font-size: 12px;
}

.clock-grid:not([hidden]) + .player-vs-row {
    border-radius: 0;
}

.player-vs-row strong {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-vs-row strong:last-child {
    text-align: right;
}

.player-vs-row strong.active::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(62, 243, 168, 0.48);
    vertical-align: 1px;
}

.right-column .sidebar {
    border-top: 0;
    border-radius: 0 0 8px 8px;
    padding-top: 18px;
}

.connection-head {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.page-title {
    margin: 0 0 4px;
    font-size: 26px;
    line-height: 1.1;
    letter-spacing: 0;
}

.muted {
    font-size: 12px;
    margin: 0;
}

.action-row,
.button-row,
.mode-options {
    display: flex;
    gap: 10px;
    align-items: center;
}

.action-row,
.button-row {
    flex-wrap: wrap;
}

.lobby-actions {
    display: grid;
    grid-template-columns: repeat(var(--lobby-action-count, 2), minmax(0, 1fr));
    gap: 8px;
}

.lobby-actions button {
    min-width: 0;
    width: 100%;
    padding: 8px 6px;
    font-size: 13px;
}

.action-row button,
.button-row button,
.mode-options button {
    white-space: nowrap;
}

[hidden] {
    display: none !important;
}

.invite-panel {
    border-top: 1px solid var(--border);
    padding-top: 14px;
}

.copy-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    color: var(--text);
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-align: left;
}

.copy-heading:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 6px;
}

.copy-heading::after {
    content: "Copy";
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
    text-transform: uppercase;
}

.copy-heading[data-copy-state="copied"]::after {
    content: "Copied";
    color: var(--accent);
}

.copy-heading[data-copy-state="failed"]::after {
    content: "Select";
    color: var(--accent-2);
}

.invite-panel input {
    margin-top: 8px;
    width: 100%;
    box-sizing: border-box;
}

.session-strip {
    display: grid;
    gap: 6px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.players-line,
.connection-line {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.players-line {
    font-size: 14px;
}

.players-line strong,
.connection-line span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.players-line span,
.connection-line {
    color: var(--muted);
}

.connection-line {
    justify-content: space-between;
    font-size: 11px;
}

#build-status {
    flex: 0 0 auto;
    color: var(--muted);
}

.label,
.setup-dialog label,
.sidebar label {
    display: block;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.connection-form {
    display: grid;
    gap: 12px;
    border-top: none;
    padding-top: 0;
}

.field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.field-help {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.setup-dialog input,
.setup-dialog select,
.sidebar textarea {
    width: 100%;
    box-sizing: border-box;
}

.setup-dialog input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

.setup-dialog input[type="number"]::-webkit-outer-spin-button,
.setup-dialog input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.custom-clock-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
}

.custom-clock-fields label {
    margin-bottom: 6px;
}

.mode-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.mode-option {
    padding: 9px 10px;
    border-radius: 8px;
}

.mode-option.active {
    border-color: rgba(96, 165, 250, 0.7);
    background: rgba(96, 165, 250, 0.12);
    color: #dbeafe;
}

.button-row {
    margin-top: 2px;
}

button.ghost {
    background: transparent;
    border-color: var(--border);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
    transform: none;
    box-shadow: none;
}

.board-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 0;
    position: relative;
    z-index: 1;
    background: transparent;
    border: none;
    box-shadow: none;
}

.board-shell {
    position: relative;
    width: min(78vmin, 760px);
    max-width: 760px;
    overflow: visible;
    perspective: 900px;
    perspective-origin: center;
    z-index: 2;
}

.cloth-surface {
    position: absolute;
    left: calc(-1 * var(--cloth-viewport-left, 0px));
    top: calc(-1 * var(--cloth-viewport-top, 0px));
    z-index: 0;
    width: var(--cloth-viewport-width, 100vw);
    height: var(--cloth-viewport-height, 100vh);
    border-radius: 0;
    opacity: 0;
    pointer-events: none;
    transform-origin: var(--cloth-board-center-x, 50%) var(--cloth-board-center-y, 50%);
    transform-style: preserve-3d;
}

.cloth-overlay {
    z-index: 3;
}

.cloth-surface.active {
    opacity: 1;
    transform:
        rotateX(var(--board-tilt-y, 0deg))
        rotateY(var(--board-tilt-x, 0deg))
        scale(var(--cloth-warp-scale, 0.996));
}

.board {
    --board-light: #dcd4c5;
    --board-dark: #59616d;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    background-color: var(--board-dark);
    background-image: conic-gradient(
        from 90deg,
        var(--board-dark) 25%,
        var(--board-light) 0 50%,
        var(--board-dark) 0 75%,
        var(--board-light) 0
    );
    background-size: 25% 25%;
    box-shadow: var(--shadow);
    justify-self: center;
    cursor: grab;
    position: relative;
    z-index: 1;
    touch-action: none;
    transform-style: preserve-3d;
    transition: transform 420ms cubic-bezier(0.18, 0.85, 0.22, 1.18);
    will-change: transform;
}

.board.warping {
    cursor: grabbing;
    overflow: visible;
    transform:
        rotateX(var(--board-tilt-y, 0deg))
        rotateY(var(--board-tilt-x, 0deg))
        scale(0.996);
}

.board.springing {
    overflow: visible;
    transform: none;
    transition: none;
}

.board.warping .square {
    transition: box-shadow 0.12s ease, background 0.12s ease;
}

.board.cloth-active {
    background: transparent;
    background-image: none;
    border-color: transparent;
    box-shadow: none;
}

.board.cloth-active .square {
    background: transparent;
    box-shadow: none !important;
}

.board.cloth-active.cloth-settled .square.last-move {
    background: #d8ac55;
}

.board.cloth-active .piece {
    opacity: 0;
}

.board.warping .piece {
    transition: transform 45ms linear;
    transform:
        translate3d(var(--warp-x, 0px), var(--warp-y, 0px), var(--warp-z, 0px))
        rotateX(var(--warp-rx, 0deg))
        rotateY(var(--warp-ry, 0deg))
        scale(var(--warp-scale, 1));
    backface-visibility: hidden;
    will-change: transform;
}

.board.springing .square {
    transition: box-shadow 0.14s ease, background 0.14s ease;
}

.board.springing .piece {
    transition: transform 520ms cubic-bezier(0.16, 0.9, 0.22, 1.2);
    transform:
        translate3d(var(--warp-x, 0px), var(--warp-y, 0px), var(--warp-z, 0px))
        rotateX(var(--warp-rx, 0deg))
        rotateY(var(--warp-ry, 0deg))
        scale(var(--warp-scale, 1));
    backface-visibility: hidden;
}

.board-toolbar {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
}

.board-toolbar .icon-button {
    background: #0f1117;
    border-color: rgba(45, 51, 66, 0.96);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.34);
}

.board-toolbar .icon-button:hover {
    background: #121822;
}

.board-toolbar .icon-button:disabled {
    background: #0d1017;
    border-color: rgba(35, 40, 52, 0.98);
    color: rgba(232, 234, 240, 0.42);
    opacity: 1;
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 8px;
}

.icon-button svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-button.pending {
    border-color: rgba(216, 172, 85, 0.9);
    background: #d8ac55;
    color: #171a20;
    transform: translateY(1px);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.22);
}

button.icon-button.pending:disabled {
    cursor: default;
    opacity: 1;
}

.icon-button.danger:hover {
    border-color: #f87171;
    box-shadow: 0 12px 30px rgba(248, 113, 113, 0.1);
}

.promotion-picker {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    place-items: center;
    background: rgba(7, 8, 12, 0.34);
}

.promotion-panel {
    display: grid;
    grid-template-columns: repeat(4, 56px);
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(15, 17, 23, 0.96);
    box-shadow: var(--shadow);
}

.promotion-panel button {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 8px;
    font-family: "Times New Roman", Georgia, serif;
    font-size: 34px;
    line-height: 1;
}

.square {
    display: grid;
    place-items: center;
    border: none;
    padding: 0;
    width: 100%;
    height: 100%;
    font-size: clamp(22px, 4vmin, 44px);
    line-height: 1;
    font-family: "Times New Roman", Georgia, serif;
    color: #e6e9f0;
    cursor: pointer;
    transition: background 0.12s ease, box-shadow 0.12s ease, transform 0.08s ease;
    border-radius: 0;
}

.square:hover {
    transform: none;
}

.square[data-piece="true"] {
    cursor: inherit;
}

.square[data-piece="true"] .piece {
    pointer-events: none;
}

.piece {
    display: inline-block;
    line-height: 1;
    font-size: inherit;
    pointer-events: none;
    transform-origin: center;
}

.piece.white {
    color: #f6f0e5;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.45), 0 2px 4px rgba(0, 0, 0, 0.35);
}

.piece.black {
    color: #171a20;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.55), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.square.light {
    background: var(--board-light);
}

.square.dark {
    background: var(--board-dark);
}

.square.selected {
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.85);
}

.square.warp-source {
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.85);
}

.square.warp-target {
    box-shadow: inset 0 0 0 4px rgba(216, 172, 85, 0.9), 0 0 24px rgba(216, 172, 85, 0.32);
}

.square.warp-target.legal {
    background: #53bc8a;
}

.square.last-move {
    background: #d8ac55;
}

.square.legal {
    background: #53bc8a;
}

.square.last-move.legal {
    background: #53bc8a;
}

.board:not(.cloth-active) .square:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.move-list {
    display: grid;
    gap: 5px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 6px;
    font-size: 13px;
}

.move-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    min-height: 24px;
}

.move-row span {
    color: var(--muted);
}

.move-row div {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.move-row .move-unknown {
    color: #d8ac55;
}

.sidebar textarea {
    resize: vertical;
    min-height: 120px;
    margin-top: 6px;
    background: #0c1017;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-family: var(--mono);
}

.export-row {
    margin-top: 0;
}

.export-details {
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.export-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    list-style: none;
    outline: none;
}

.export-details summary::-webkit-details-marker {
    display: none;
}

.export-details summary::after {
    content: "+";
    color: var(--muted);
    font-family: var(--mono);
    font-size: 16px;
}

.export-details[open] summary::after {
    content: "-";
}

.export-details summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 6px;
}

.export-content {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.setup-modal {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(7, 8, 12, 0.64);
}

.setup-dialog {
    display: grid;
    gap: 16px;
    width: min(420px, calc(100vw - 32px));
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    box-sizing: border-box;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #10131b;
    box-shadow: var(--shadow);
}

.join-dialog {
    width: min(360px, calc(100vw - 32px));
}

.action-dialog {
    width: min(380px, calc(100vw - 32px));
    gap: 14px;
}

.action-message {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

button.danger-action {
    border-color: rgba(248, 113, 113, 0.72);
    background: linear-gradient(135deg, #321a1a, #201014);
}

button.danger-action:hover {
    border-color: #f87171;
    box-shadow: 0 12px 30px rgba(248, 113, 113, 0.12);
}

.setup-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.setup-head h2 {
    margin: 0;
    font-size: 18px;
    letter-spacing: 0;
}

.setup-actions {
    margin-top: 0;
}

@media (max-width: 1180px) {
    .chess-layout {
        grid-template-columns: minmax(250px, 320px) minmax(480px, 1fr);
    }

    .right-column {
        grid-column: 1 / -1;
    }

    .board-shell {
        width: min(78vmin, 680px);
    }
}

@media (max-width: 860px) {
    .chess-page {
        margin-top: 22px;
    }

    .chess-layout {
        grid-template-columns: 1fr;
    }

    .board-card {
        order: 1;
    }

    .connection {
        order: 2;
    }

    .right-column {
        order: 3;
        grid-column: auto;
    }

    .board-shell {
        width: min(94vw, 620px);
    }
}

@media (max-width: 600px) {
    .chess-layout {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .chess-page {
        padding: 0 12px;
    }

    .chess-page .card {
        padding: 14px;
    }

    .action-row,
    .button-row {
        align-items: stretch;
    }

    .lobby-actions {
        grid-template-columns: 1fr;
    }

    .button-row button,
    .action-row button {
        width: 100%;
    }

    .board-shell {
        width: calc(100vw - 24px);
    }

    .right-column {
        gap: 12px;
    }
}

/* Checkbox label alignment */
.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: inherit;
}

.toggle-label input[type="checkbox"] {
    margin: 0;
    width: auto;
    height: auto;
}

/* Help button */
.help-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--muted, #888);
    background: transparent;
    color: var(--muted, #888);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    margin-left: 10px;
    vertical-align: middle;
}

.help-button:hover {
    border-color: var(--text, #fff);
    color: var(--text, #fff);
}

/* Help modal */
.help-dialog {
    max-height: 80vh;
    overflow-y: auto;
}

.help-content {
    padding: 4px 0 16px 0;
}

.help-section {
    margin-bottom: 20px;
}

.help-section h3 {
    font-size: 1.15em;
    margin-bottom: 6px;
    color: var(--accent, #4fc3f7);
}

.help-section h4 {
    font-size: 1em;
    margin-top: 14px;
    margin-bottom: 4px;
}

.help-section p {
    margin: 6px 0;
    line-height: 1.5;
}

.help-section ul {
    margin: 6px 0 6px 18px;
    padding: 0;
}

.help-section li {
    margin-bottom: 4px;
    line-height: 1.4;
}

.help-section code {
    background: rgba(255,255,255,0.08);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.92em;
}

/* Tutorial button */
.tutorial-button {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    border: 2px solid var(--accent, #4fc3f7);
    background: transparent;
    color: var(--accent, #4fc3f7);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    margin-left: 8px;
    vertical-align: middle;
}

.tutorial-button:hover {
    background: var(--accent, #4fc3f7);
    color: #000;
}

/* Tutorial panel */
.tutorial-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 15, 22, 0.95);
    border-top: 2px solid var(--accent, #4fc3f7);
    padding: 0;
}

.tutorial-inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px 20px;
    text-align: center;
}

.tutorial-step-indicator {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted, #666);
    margin-bottom: 6px;
}

.tutorial-panel p {
    margin: 0 0 12px 0;
    font-size: 15px;
    line-height: 1.5;
}

.tutorial-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.tutorial-actions button {
    padding: 6px 18px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid var(--accent, #4fc3f7);
    background: transparent;
    color: var(--accent, #4fc3f7);
    transition: all 0.15s;
}

.tutorial-actions button:hover {
    background: var(--accent, #4fc3f7);
    color: #000;
}

/* Highlighted squares */
.square.tutorial-highlight {
    box-shadow: inset 0 0 0 3px var(--accent, #4fc3f7);
    z-index: 1;
    position: relative;
}

.square.tutorial-highlight-dark {
    box-shadow: inset 0 0 0 3px rgba(79, 195, 247, 0.5);
}

/* Game over overlay */
.game-over-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.game-over-dialog {
    background: var(--bg-card, #1a1d23);
    border: 1px solid var(--border, #333);
    border-radius: 12px;
    padding: 40px 48px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}

.game-over-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.game-over-dialog h2 {
    font-size: 24px;
    margin: 0 0 8px 0;
    color: var(--text, #fff);
}

.game-over-dialog p {
    font-size: 15px;
    color: var(--muted, #888);
    margin: 0 0 24px 0;
}

.game-over-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.game-over-actions button {
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

#game-over-new-game {
    background: var(--accent, #4fc3f7);
    color: #000;
    border: none;
}

#game-over-new-game:hover {
    filter: brightness(1.1);
}

.game-over-actions .ghost {
    background: transparent;
    color: var(--muted, #888);
    border: 1px solid var(--muted, #555);
}

.game-over-actions .ghost:hover {
    border-color: var(--text, #fff);
    color: var(--text, #fff);
}
