.mind-page {
    width: min(100%, 1040px);
}

.mind-hero {
    padding: clamp(22px, 5vw, 44px) 0 clamp(18px, 4vw, 28px);
    text-align: center;
}

.mind-hero h1 {
    margin-top: 16px;
    font-size: clamp(2.1rem, 6vw, 3.8rem);
    line-height: 1.02;
    letter-spacing: -0.03em;
}

.mind-hero h1 span {
    background: linear-gradient(100deg, #7c6cff 0%, #ff5f9e 55%, #feca57 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.mind-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.mind-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background:
        radial-gradient(360px 220px at 0% 0%, rgba(124, 108, 255, 0.2), transparent 70%),
        rgba(255, 255, 255, 0.045);
}

.mind-card-info {
    background: rgba(255, 255, 255, 0.03);
}

.mind-card-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.mind-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(124, 108, 255, 0.35), rgba(255, 95, 158, 0.22));
    font-size: 1.35rem;
}

.mind-card h2 {
    font-size: 1.12rem;
    letter-spacing: -0.01em;
}

.mind-card-head p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

.mind-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mind-label {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mind-seg {
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.055);
}

.mind-seg button {
    padding: 7px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
}

.mind-seg button.active {
    background: rgba(124, 108, 255, 0.34);
    color: var(--text);
}

.mind-start {
    width: 100%;
    margin-top: auto;
}

.mind-hint {
    color: rgba(238, 240, 255, 0.42);
    font-size: 0.72rem;
    line-height: 1.4;
}

.mind-hero-note {
    padding: 9px 11px;
    border: 1px solid rgba(29, 209, 161, 0.35);
    border-radius: 11px;
    background: rgba(29, 209, 161, 0.08);
    color: #c9ffef;
    font-size: 0.76rem;
    font-weight: 700;
}

/* ===== Oczekiwanie ===== */
.mind-wait-box {
    max-width: 460px;
    margin: clamp(30px, 7vw, 70px) auto;
    padding: 30px 22px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.045);
    text-align: center;
}

.mind-wait-box h2 {
    margin-top: 16px;
    font-size: 1.35rem;
}

.mind-wait-box p {
    margin: 8px 0 18px;
}

.mind-spinner {
    width: 44px;
    height: 44px;
    margin: 0 auto;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.12);
    border-top-color: #7c6cff;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Gra ===== */
.mind-hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.045);
}

.mind-hud-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 86px;
}

.mind-hud-side strong {
    font-size: 1.7rem;
    line-height: 1;
}

.mind-hud-opp strong {
    color: #ff8f8f;
}

.mind-hud-name {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mind-hud-center {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.mind-question-label {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
}

.mind-timer-bar {
    height: 8px;
    margin-top: 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.mind-timer-bar span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #1dd1a1, #7c6cff);
    transition: width 0.12s linear;
}

.mind-timer-bar span.low {
    background: linear-gradient(90deg, #ffb84d, #ff5f9e);
}

.mind-timer-text {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.68rem;
    font-variant-numeric: tabular-nums;
}

.mind-status-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 4px 0;
}

.mind-streak,
.mind-opp-status {
    color: var(--gold);
    font-size: 0.76rem;
    font-weight: 800;
}

.mind-opp-status {
    color: var(--muted);
}

.mind-question-card {
    margin-top: 12px;
    padding: clamp(18px, 4vw, 28px);
    border: 1px solid var(--line);
    border-radius: 24px;
    background:
        radial-gradient(600px 300px at 50% -20%, rgba(124, 108, 255, 0.24), transparent 70%),
        rgba(255, 255, 255, 0.045);
}

.mind-type {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(124, 108, 255, 0.18);
    color: #c9c1ff;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.mind-question-text {
    margin: 14px 0 18px;
    font-size: clamp(1.05rem, 3.2vw, 1.4rem);
    font-weight: 800;
    line-height: 1.45;
    white-space: pre-line;
}

.mind-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.mind-option {
    min-height: 54px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.14s, background 0.14s, transform 0.1s;
}

.mind-option:hover:not(:disabled) {
    border-color: rgba(124, 108, 255, 0.6);
    background: rgba(124, 108, 255, 0.14);
}

.mind-option:active:not(:disabled) {
    transform: scale(0.985);
}

.mind-option:disabled {
    cursor: default;
    opacity: 0.85;
}

.mind-option.correct {
    border-color: rgba(29, 209, 161, 0.7);
    background: rgba(29, 209, 161, 0.2);
}

.mind-option.wrong {
    border-color: rgba(255, 95, 158, 0.7);
    background: rgba(255, 95, 158, 0.18);
}

.mind-feedback {
    min-height: 1.4em;
    margin-top: 14px;
    font-size: 0.86rem;
    font-weight: 800;
    text-align: center;
}

.mind-feedback.good { color: var(--green); }
.mind-feedback.bad { color: #ff8f8f; }
.mind-feedback.info { color: var(--muted); }

/* ===== Przesuwanka ===== */
.slide-wrap {
    display: flex;
    justify-content: center;
    margin-top: 14px;
}

.slide-board {
    display: grid;
    gap: 7px;
    width: min(100%, 430px);
    aspect-ratio: 1 / 1;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background:
        radial-gradient(420px 300px at 50% 0%, rgba(124, 108, 255, 0.22), transparent 70%),
        rgba(255, 255, 255, 0.045);
    touch-action: manipulation;
}

.slide-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 13px;
    background: linear-gradient(145deg, rgba(124, 108, 255, 0.38), rgba(255, 95, 158, 0.25));
    color: #fff;
    font-family: inherit;
    font-size: clamp(1.15rem, 5vw, 2rem);
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.1s, background 0.14s;
    -webkit-tap-highlight-color: transparent;
}

.slide-tile:active {
    transform: scale(0.96);
}

.slide-tile.correct {
    border-color: rgba(29, 209, 161, 0.5);
    background: linear-gradient(145deg, rgba(29, 209, 161, 0.35), rgba(124, 108, 255, 0.22));
}

.slide-tile.blank {
    visibility: hidden;
    pointer-events: none;
}

.slide-hint {
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.45;
    text-align: center;
}

.slide-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.slide-actions .btn {
    width: auto;
}

/* ===== Nowe gry Mind ===== */
.mind-game-card {
    position: relative;
    overflow: hidden;
}

.mind-game-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
}

.mind-game-actions .btn {
    flex: 1 1 auto;
}

.mind-new-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    padding: 3px 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, #feca57, #ff5f9e);
    color: #1a1024;
    font-size: 0.56rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(255, 95, 158, 0.35);
}

.minigame-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

.minigame-top h2 {
    margin-top: 4px;
    font-size: clamp(1.4rem, 4.4vw, 2rem);
    letter-spacing: -0.02em;
}

.minigame-kicker {
    display: inline-block;
    color: var(--gold);
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.minigame-hud {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}

.mg-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 0.74rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.mg-chip.accent {
    border-color: rgba(124, 108, 255, 0.5);
    color: #d6d0ff;
}

.mg-chip.turn {
    border-color: rgba(29, 209, 161, 0.55);
    color: #b6ffe9;
}

.mg-chip.opp {
    color: #ffc4dd;
    border-color: rgba(255, 95, 158, 0.45);
}

.minigame-body {
    margin-top: 14px;
}

.minigame-status {
    min-height: 1.3em;
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
}

.minigame-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.minigame-actions .btn {
    width: auto;
}

.mg-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

/* --- Mahjong --- */
.mahjong-wrap {
    overflow-x: auto;
    padding: 4px;
}

.mahjong-board {
    display: grid;
    gap: 5px;
    width: min(100%, 560px);
    margin: 0 auto;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background:
        radial-gradient(420px 260px at 50% 0%, rgba(29, 209, 161, 0.14), transparent 70%),
        rgba(255, 255, 255, 0.04);
    touch-action: manipulation;
}

.mahjong-tile {
    display: grid;
    place-items: center;
    aspect-ratio: 3 / 4;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: linear-gradient(150deg, #f4ecd8, #e2d3b0);
    color: #2c2410;
    font-family: inherit;
    font-size: clamp(0.8rem, 3.2vw, 1.25rem);
    cursor: pointer;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
    transition: transform 0.1s, box-shadow 0.1s, filter 0.1s;
    -webkit-tap-highlight-color: transparent;
}

.mahjong-tile.blocked {
    filter: brightness(0.62) saturate(0.7);
    cursor: default;
}

.mahjong-tile.selected {
    border-color: #7c6cff;
    box-shadow: 0 0 0 3px rgba(124, 108, 255, 0.45), 0 2px 0 rgba(0, 0, 0, 0.35);
    transform: translateY(-2px);
}

.mahjong-tile.hint {
    box-shadow: 0 0 0 3px rgba(254, 202, 87, 0.65);
}

.mahjong-tile.removed {
    visibility: hidden;
    pointer-events: none;
}

/* Mahjong dwuwarstwowy — „Wieża” */
.mahjong-board.layered {
    display: block;
    padding: 10px;
}

.mahjong-layers {
    position: relative;
    width: 100%;
    aspect-ratio: 8 / 6;
}

.mahjong-layer {
    position: absolute;
    display: grid;
    gap: 5px;
    /* Warstwa jest tylko kontenerem — nie może przechwytywać kliknięć
       w odsłonięte kamienie dolnej warstwy. */
    pointer-events: none;
}

.mahjong-layer.base {
    inset: 0;
    z-index: 1;
}

.mahjong-layer.top {
    transform: translate(-3px, -5px);
}

.mahjong-layer .mahjong-tile {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    font-size: clamp(0.68rem, 2.5vw, 1rem);
    pointer-events: auto;
}

.mahjong-layer .mahjong-tile.removed {
    pointer-events: none;
}

.mahjong-layer.top .mahjong-tile {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.45), 0 2px 0 rgba(0, 0, 0, 0.45);
}

/* --- Magazynier (Sokoban) --- */
.sokoban-board {
    display: grid;
    gap: 3px;
    width: min(100%, 430px);
    margin: 0 auto;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(5, 7, 15, 0.72);
    touch-action: manipulation;
}

.sokoban-cell {
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1;
    border-radius: 5px;
    font-size: clamp(0.7rem, 3vw, 1.1rem);
    line-height: 1;
}

.sokoban-cell.wall { background: #262c44; border: 1px solid #3a4266; }
.sokoban-cell.floor { background: #0e1324; }
.sokoban-cell.target { background: #10241f; box-shadow: inset 0 0 0 2px rgba(29, 209, 161, 0.6); }
.sokoban-cell.box { background: #6b4a1e; box-shadow: inset 0 0 0 2px #c58a37; }
.sokoban-cell.box-on-target { background: #1f7a5c; box-shadow: inset 0 0 0 2px #43ffb0; }
.sokoban-cell.player { background: #232b52; box-shadow: inset 0 0 0 2px #7c6cff; }

.mg-dpad {
    display: grid;
    grid-template-columns: repeat(3, 54px);
    grid-template-rows: repeat(2, 46px);
    gap: 6px;
    justify-content: center;
    margin-top: 12px;
}

.mg-dpad button {
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(124, 108, 255, 0.18);
    color: var(--text);
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 900;
    cursor: pointer;
}

.mg-dpad button:active {
    background: rgba(124, 108, 255, 0.38);
}

.mg-dpad .dpad-up { grid-column: 2; grid-row: 1; }
.mg-dpad .dpad-left { grid-column: 1; grid-row: 2; }
.mg-dpad .dpad-down { grid-column: 2; grid-row: 2; }
.mg-dpad .dpad-right { grid-column: 3; grid-row: 2; }

/* --- Sudoku --- */
.sudoku-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    width: min(100%, 460px);
    margin: 0 auto;
    border: 2px solid rgba(185, 178, 255, 0.55);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(5, 7, 15, 0.6);
    touch-action: manipulation;
}

.sudoku-cell {
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: clamp(0.8rem, 3.8vw, 1.25rem);
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.sudoku-cell:nth-child(9n) { border-right: none; }
.sudoku-cell:nth-child(n+73) { border-bottom: none; }
.sudoku-cell.box-right { border-right: 2px solid rgba(185, 178, 255, 0.5); }
.sudoku-cell.box-bottom { border-bottom: 2px solid rgba(185, 178, 255, 0.5); }
.sudoku-cell.given { background: rgba(124, 108, 255, 0.14); color: #d6d0ff; font-weight: 900; }
.sudoku-cell.selected { background: rgba(254, 202, 87, 0.22); box-shadow: inset 0 0 0 2px rgba(254, 202, 87, 0.7); }
.sudoku-cell.conflict { color: #ff8f8f; background: rgba(255, 95, 158, 0.16); }
.sudoku-cell.hinted { color: #43ffb0; }

.sudoku-pad {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 4px;
    width: min(100%, 460px);
    margin: 10px auto 0;
}

.sudoku-pad button {
    padding: 10px 0;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-family: inherit;
    font-size: 0.98rem;
    font-weight: 900;
    cursor: pointer;
}

.sudoku-pad button.erase {
    grid-column: span 9;
    background: rgba(255, 95, 158, 0.14);
    color: #ffc4dd;
}

/* --- Pamięć --- */
.memory-board {
    display: grid;
    gap: 7px;
    width: min(100%, 420px);
    margin: 0 auto;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background:
        radial-gradient(380px 240px at 50% 0%, rgba(124, 108, 255, 0.2), transparent 70%),
        rgba(255, 255, 255, 0.04);
    touch-action: manipulation;
}

.memory-card {
    display: grid;
    place-items: center;
    aspect-ratio: 3 / 4;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 11px;
    background: linear-gradient(150deg, rgba(124, 108, 255, 0.5), rgba(255, 95, 158, 0.28));
    color: #fff;
    font-family: inherit;
    font-size: clamp(1rem, 5vw, 1.7rem);
    cursor: pointer;
    transition: transform 0.14s, background 0.14s;
    -webkit-tap-highlight-color: transparent;
}

.memory-card .memory-face {
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.14s, transform 0.14s;
}

.memory-card.flipped,
.memory-card.matched {
    background: linear-gradient(150deg, #f4ecd8, #e2d3b0);
    color: #2c2410;
}

.memory-card.flipped .memory-face,
.memory-card.matched .memory-face {
    opacity: 1;
    transform: scale(1);
}

.memory-card.matched {
    border-color: rgba(29, 209, 161, 0.8);
    box-shadow: 0 0 0 2px rgba(29, 209, 161, 0.35);
}

.memory-card.mismatch {
    background: linear-gradient(150deg, rgba(255, 95, 158, 0.65), rgba(255, 95, 158, 0.35));
}

/* --- Domino --- */
.domino-opponent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
}

.domino-chain {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    min-height: 92px;
    padding: 10px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
    background:
        radial-gradient(360px 220px at 50% 0%, rgba(29, 209, 161, 0.12), transparent 70%),
        rgba(5, 7, 15, 0.62);
}

.domino-chain-empty {
    margin: 0 auto;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.domino-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 68px;
    height: 42px;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: linear-gradient(150deg, #f7f0de, #ded0ae);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}

.domino-tile.small {
    width: 54px;
    height: 34px;
    padding: 2px;
}

.domino-tile.vertical {
    flex-direction: column;
}

.domino-tile.double {
    box-shadow: 0 0 0 2px rgba(254, 202, 87, 0.6), 0 2px 0 rgba(0, 0, 0, 0.4);
}

.domino-half {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: 100%;
    height: 100%;
    padding: 2px;
    border-radius: 4px;
}

.domino-half + .domino-half {
    border-left: 1px solid rgba(44, 36, 16, 0.55);
}

.domino-pip {
    width: 4px;
    height: 4px;
    margin: auto;
    border-radius: 50%;
    background: #2c2410;
}

.domino-hand {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 6px;
    margin-top: 10px;
}

.domino-hand .domino-tile {
    width: 100%;
    height: 48px;
    padding: 3px;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.1s, box-shadow 0.12s;
}

.domino-hand .domino-tile:disabled {
    opacity: 0.5;
    cursor: default;
}

.domino-hand .domino-tile.playable {
    box-shadow: 0 0 0 2px rgba(29, 209, 161, 0.65), 0 2px 0 rgba(0, 0, 0, 0.4);
}

.domino-hand .domino-tile.selected {
    transform: translateY(-4px);
    box-shadow: 0 0 0 3px rgba(124, 108, 255, 0.7), 0 4px 10px rgba(0, 0, 0, 0.4);
}

.domino-ends {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.domino-ends button {
    padding: 9px 14px;
    border: 1px solid rgba(29, 209, 161, 0.5);
    border-radius: 11px;
    background: rgba(29, 209, 161, 0.16);
    color: #b6ffe9;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 900;
    cursor: pointer;
}

/* --- Ekran wyniku nowych gier --- */
/* --- Kółko i krzyżyk --- */
.mg-ttt-board {
    display: grid;
    grid-template-columns: repeat(3, 82px);
    grid-template-rows: repeat(3, 82px);
    gap: 6px;
    justify-content: center;
    margin: 8px auto 4px;
}

.mg-ttt-cell {
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(124, 108, 255, 0.1);
    color: var(--text);
    font: inherit;
    font-size: 2rem;
    font-weight: 900;
    cursor: pointer;
}

.mg-ttt-cell:hover:not(:disabled) {
    background: rgba(124, 108, 255, 0.22);
}

.mg-ttt-cell.x { color: #34e0ff; }
.mg-ttt-cell.o { color: #ff5f9e; }
.mg-ttt-cell.winning {
    border-color: #43ffb0;
    box-shadow: 0 0 0 2px rgba(67, 255, 176, 0.32);
    background: rgba(67, 255, 176, 0.12);
}
.mg-ttt-cell:disabled { cursor: default; opacity: 0.85; }

/* --- Statki --- */
.mg-bs-wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
    margin: 6px auto;
}

.mg-bs-side {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.mg-bs-side > strong {
    color: var(--text);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.mg-bs-board {
    display: grid;
    grid-template-columns: repeat(10, 27px);
    gap: 2px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.18);
}

.mg-bs-cell {
    width: 27px;
    height: 27px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    background: rgba(52, 224, 255, 0.04);
    cursor: default;
}

.mg-bs-cell.target {
    cursor: crosshair;
    background: rgba(52, 224, 255, 0.09);
}

.mg-bs-cell.target:hover {
    background: rgba(52, 224, 255, 0.24);
}

.mg-bs-cell.ship {
    background: rgba(124, 108, 255, 0.42);
    border-color: rgba(124, 108, 255, 0.7);
}

.mg-bs-cell.hit {
    background: rgba(255, 95, 158, 0.7);
    border-color: #ff5f9e;
}

.mg-bs-cell.miss {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.mg-bs-cell.revealed {
    background: rgba(124, 108, 255, 0.22);
    border-color: rgba(124, 108, 255, 0.45);
}

/* --- Warcaby --- */
.mg-ck-board {
    display: grid;
    grid-template-columns: repeat(8, 42px);
    grid-template-rows: repeat(8, 42px);
    gap: 0;
    width: max-content;
    margin: 8px auto 4px;
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    overflow: hidden;
}

.mg-ck-cell {
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    font: inherit;
    cursor: pointer;
}

.mg-ck-cell.light {
    background: #d9cbb1;
    cursor: default;
}

.mg-ck-cell.dark {
    background: #4a3a35;
}

.mg-ck-cell.legal {
    box-shadow: inset 0 0 0 3px rgba(67, 255, 176, 0.75);
}

.mg-ck-cell.selected {
    box-shadow: inset 0 0 0 3px rgba(52, 224, 255, 0.95);
}

.mg-ck-piece {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.45);
}

.mg-ck-piece.w {
    background: radial-gradient(circle at 35% 30%, #fff, #c9d8e5 70%);
    color: #28313d;
    border: 2px solid #f4f8ff;
}

.mg-ck-piece.b {
    background: radial-gradient(circle at 35% 30%, #5c6575, #1b2028 70%);
    color: #ffe28a;
    border: 2px solid #7c8799;
}

.mg-ck-piece.king {
    box-shadow: 0 0 0 2px #ffd479, 0 2px 5px rgba(0, 0, 0, 0.55);
}

@media (max-width: 700px) {
    .mg-bs-board { grid-template-columns: repeat(10, 22px); }
    .mg-bs-cell { width: 22px; height: 22px; }
    .mg-ttt-board { grid-template-columns: repeat(3, 68px); grid-template-rows: repeat(3, 68px); }
    .mg-ck-board { grid-template-columns: repeat(8, 34px); grid-template-rows: repeat(8, 34px); }
    .mg-ck-piece { width: 25px; height: 25px; }
}

.mg-result {
    max-width: 520px;
    margin: 8px auto;
    padding: clamp(18px, 4vw, 28px);
    border: 1px solid var(--line);
    border-radius: 20px;
    background:
        radial-gradient(460px 260px at 50% 0%, rgba(124, 108, 255, 0.24), transparent 70%),
        rgba(255, 255, 255, 0.045);
    text-align: center;
}

.mg-result h3 {
    margin: 4px 0 6px;
    font-size: clamp(1.4rem, 4.6vw, 2.1rem);
    letter-spacing: -0.02em;
}

.mg-result p {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 0.84rem;
}

.mg-result-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 12px 0 16px;
}

.mg-result-stat {
    min-width: 84px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.045);
}

.mg-result-stat span {
    display: block;
    color: var(--muted);
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.mg-result-stat strong {
    display: block;
    margin-top: 2px;
    font-size: 1.15rem;
}

.mg-result-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

/* ===== Koniec ===== */
.mind-end-box {
    max-width: 560px;
    margin: clamp(24px, 6vw, 56px) auto;
    padding: clamp(22px, 5vw, 34px);
    border: 1px solid var(--line);
    border-radius: 24px;
    background:
        radial-gradient(500px 280px at 50% 0%, rgba(124, 108, 255, 0.25), transparent 70%),
        rgba(255, 255, 255, 0.045);
    text-align: center;
}

.mind-end-box h1 {
    margin-top: 10px;
    font-size: clamp(1.7rem, 5vw, 2.6rem);
    letter-spacing: -0.03em;
}

.mind-end-stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.mind-end-stat {
    min-width: 100px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.045);
}

.mind-end-stat span {
    display: block;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.mind-end-stat strong {
    display: block;
    margin-top: 3px;
    font-size: 1.25rem;
}

.mind-end-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.mind-error {
    min-height: 1.2em;
    margin-top: 14px;
    color: #ff8f8f;
    font-size: 0.84rem;
    font-weight: 700;
    text-align: center;
}

@media (max-width: 560px) {
    .mind-options {
        grid-template-columns: 1fr;
    }

    .mind-hud {
        padding: 10px 12px;
    }

    .mind-hud-side {
        min-width: 62px;
    }

    .mind-hud-side strong {
        font-size: 1.35rem;
    }

    .mind-field {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mind-spinner {
        animation: none;
    }

    .mind-timer-bar span {
        transition: none;
    }
}
