/* fed-chess.ru — Bento theme (concept 02) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg: #f5f5f7;
    --surface: #ffffff;
    --text: #1d1d1f;
    --muted: #6e6e73;
    --line: rgba(0, 0, 0, 0.06);
    --line-strong: #e5e5ea;
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --success-bg: #e8f5e9;
    --success-text: #1b5e20;
    --warn-bg: #fff8e1;
    --warn-text: #8a6d00;
    --danger-text: #b00020;
    --radius: 20px;
    --radius-sm: 12px;
    --font: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --body: 17px;
    --sq-light: #f0d9b5;
    --sq-dark: #b58863;
    --sq-highlight: rgba(155, 199, 0, 0.41);
    --board-radius: 12px;
    --board-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --tap: 44px;
    --max: 980px;
    --tile-bg: #ffffff;
    --tile-text: #1d1d1f;
    --tile-muted: #6e6e73;
    --tile-border: rgba(0, 0, 0, 0.08);
    --card: var(--surface);
    --border: var(--line-strong);
    --surface-2: #f5f5f7;
    --accent-soft: #eef6ff;
    --accent-soft-text: #174ea6;
    --danger-bg: #fdecea;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body.theme-bento {
    font-family: var(--font);
    font-size: var(--body);
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-wrap {
    max-width: var(--max);
    margin: 0 auto;
    padding: 20px 16px 48px;
}

.site-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 28px;
}

.site-logo {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    letter-spacing: -0.02em;
}

.site-logo:hover { text-decoration: none; }

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    font-size: 0.95rem;
    color: var(--muted);
}

.site-nav a { color: var(--muted); font-weight: 500; }
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a.active { color: var(--accent); font-weight: 600; }

.site-nav-sep {
    color: var(--line-strong);
    user-select: none;
}

.site-back {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    padding: 0 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
}
.site-back:hover { text-decoration: none; background: #fafafa; }

.hero h1 {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin-bottom: 8px;
}

.hero .sub {
    color: var(--muted);
    font-size: 1.1rem;
}

.hero .auth-line {
    margin-top: 16px;
    font-size: 0.95rem;
    color: var(--muted);
}

.bento {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(120px, auto);
    margin-top: 28px;
}

.bento-tile {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 120px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bento-tile:hover {
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
}

.bento-tile h2 {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.bento-tile p {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 4px;
}

.bento-tile .tile-icon {
    font-size: 1.75rem;
    margin-bottom: auto;
    padding-bottom: 12px;
    line-height: 1;
}

.bento-tile.w2 { grid-column: span 2; }
.bento-tile.h2 { grid-row: span 2; min-height: 252px; }

.bento-tile.feature {
    background: var(--surface);
    color: var(--text);
    border-color: var(--line);
}

.bento-tile.feature p { color: var(--muted); }

.bento-tile.feature .tile-cta {
    display: inline-flex;
    align-items: center;
    margin-top: 14px;
    min-height: var(--tap);
    padding: 0 18px;
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    width: fit-content;
}

.bento-tile.inactive {
    opacity: 0.62;
    cursor: default;
    pointer-events: none;
    position: relative;
}

.bento-tile.inactive:hover {
    transform: none;
    box-shadow: none;
}

.bento-tile .tile-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
    color: var(--muted);
}

@media (max-width: 700px) {
    .bento { grid-template-columns: 1fr 1fr; }
    .bento-tile.w2 { grid-column: span 2; }
    .bento-tile.h2 {
        grid-column: span 2;
        grid-row: span 1;
        min-height: 140px;
    }
}

.stats-strip {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.stats-strip .stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
}

.stats-strip .stat strong {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
}

.stats-strip .stat span {
    font-size: 0.8rem;
    color: var(--muted);
}

@media (max-width: 600px) {
    .stats-strip { grid-template-columns: repeat(2, 1fr); }
}

.site-footer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--line-strong);
    font-size: 0.88rem;
    color: var(--muted);
    text-align: center;
    line-height: 1.7;
}

.callout {
    margin-top: 20px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--muted);
    line-height: 1.5;
}

.callout strong { color: var(--text); }

.game-page { max-width: 900px; margin: 0 auto; padding: 16px 16px 40px; }

.game-header { margin-bottom: 16px; }
.game-header h1 { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }
.game-header p { color: var(--muted); font-size: 0.95rem; margin-top: 4px; }

.game-layout { display: grid; gap: 16px; }

@media (min-width: 768px) {
    .game-layout { grid-template-columns: 1fr 300px; align-items: start; }
}

.game-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--line);
}

.game-card .board-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.game-card #board {
    width: 100%;
    max-width: 100%;
}

.game-card .board-b72b1 {
    border-radius: var(--board-radius);
    box-shadow: var(--board-shadow);
}

/* chessboard.js — клетки берут цвета из темы профиля */
.board-b72b1 {
    border-color: var(--sq-dark) !important;
}

#board .white-1e1d7,
.board-b72b1 .white-1e1d7 {
    background-color: var(--sq-light) !important;
    color: var(--sq-dark) !important;
}

#board .black-3c85d,
.board-b72b1 .black-3c85d {
    background-color: var(--sq-dark) !important;
    color: var(--sq-light) !important;
}

#board .highlight1-32417,
#board .highlight2-9c5d2,
.board-b72b1 .highlight1-32417,
.board-b72b1 .highlight2-9c5d2 {
    box-shadow: inset 0 0 3px 3px var(--sq-highlight, #ff0) !important;
}

.status-pill {
    width: 100%;
    text-align: center;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    background: var(--accent-soft);
    color: var(--text);
    margin-top: 12px;
}

.status-pill.ok { background: var(--success-bg); color: var(--success-text); }
.status-pill.bad { background: var(--danger-bg); color: var(--danger-text); }
.status-pill.hint,
.status-pill.thinking { background: var(--warn-bg); color: var(--warn-text); }
.status-pill.over { background: var(--success-bg); color: var(--success-text); }

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    width: 100%;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--tap);
    padding: 0 18px;
    border: none;
    border-radius: 999px;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--accent);
    color: #fff;
}

.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }

.btn.secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line-strong);
}

.btn.secondary:hover { background: #fafafa; }

.game-side h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 14px;
}

.meta-list { display: flex; flex-direction: column; gap: 8px; }

.meta-item {
    padding: 10px 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.meta-item strong { font-weight: 600; }

.moves-panel {
    margin-top: 14px;
    max-height: 280px;
    overflow: auto;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.65;
    color: var(--muted);
}

.form-error {
    margin-top: 10px;
    color: var(--danger-text);
    font-size: 0.9rem;
    min-height: 1.2em;
}

.eval-bar {
    height: 6px;
    background: #e5e5e5;
    border-radius: 3px;
    margin-bottom: 12px;
    overflow: hidden;
}

.eval-bar i {
    display: block;
    height: 100%;
    width: 50%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.eval-bar-tall {
    height: 10px;
    border-radius: 5px;
}

.analysis-eval-text {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0 0 8px;
}

.analyze-guest-hint {
    font-size: 0.88rem;
    color: var(--muted);
    margin: 4px 0 0;
    text-align: center;
    line-height: 1.45;
    max-width: 36rem;
}

.analyze-guest-hint a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.analyze-guest-hint a:hover {
    text-decoration: underline;
}

.analysis-moves .review-move {
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.analysis-moves .review-move:hover,
.analysis-moves .analysis-move-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.analysis-moves .review-move.active,
.analysis-moves .analysis-move-item.active {
    background: rgba(0, 0, 0, 0.07);
    font-weight: 600;
}

.review-nav {
    margin-top: 10px;
    margin-bottom: 8px;
}

.analysis-moves .mark-good { color: var(--success-text, #1a7f37); }
.analysis-moves .mark-inaccuracy { color: #b45309; }
.analysis-moves .mark-mistake { color: #c2410c; }
.analysis-moves .mark-blunder { color: var(--danger-text, #c41e3a); font-weight: 600; }

.eval-bar.is-loading i {
    opacity: 0.45;
    animation: eval-pulse 1s ease-in-out infinite;
}

@keyframes eval-pulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 1; }
}

.bento-home-4 { margin-top: 16px; }
.bento-home-secondary {
    margin-top: 12px;
    grid-template-columns: repeat(4, 1fr);
}

.tile-theme-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-top: 20px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.tile-theme-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--muted);
}

.tile-theme-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tile-theme-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.tile-theme-dot:hover { transform: scale(1.08); }

.tile-theme-dot.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent);
}

.tile-swatch { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; }
.bento-bots { grid-template-columns: repeat(2, 1fr); margin-top: 16px; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.card-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 12px; }
.muted { color: var(--muted); font-size: 0.95rem; }
.section-label { font-size: 0.85rem; font-weight: 600; margin: 16px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

.btn.secondary.active { outline: 2px solid var(--accent); color: var(--accent); }

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.profile-grid .w-full { grid-column: 1 / -1; }

.id-field { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line-strong, #e5e5ea); }
.id-field:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.id-field label { font-weight: 600; font-size: 0.95rem; display: block; margin-bottom: 4px; }
.id-field .id-hint { font-size: 0.8rem; color: var(--muted); margin: 0 0 8px; }
.id-field-view, .id-field-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.id-value { font-family: ui-monospace, monospace; font-size: 1rem; }
.id-value.empty { color: var(--muted); font-style: italic; font-family: inherit; }
.id-field-edit input { flex: 1; min-width: 140px; max-width: 220px; }
.id-field-input { flex: 1; min-width: 140px; max-width: 240px; display: flex; flex-direction: column; }
.id-field-input input { width: 100%; max-width: none; }
.alert-row {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    padding: 12px 0; border-bottom: 1px solid var(--line-strong, #e5e5ea);
}
.alert-row:last-child { border-bottom: none; }
.alert-row.inactive { opacity: 0.55; }
.profile-tabs {
    display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px;
}
.profile-tabs button {
    border: 1px solid var(--line-strong, #e5e5ea); background: var(--card, #fff);
    border-radius: 999px; padding: 8px 16px; font-weight: 600; cursor: pointer;
}
.profile-tabs button.active {
    background: var(--accent); color: #fff; border-color: var(--accent);
}
.profile-tab-panel[hidden] { display: none !important; }
.tournament-card {
    border: 1px solid var(--line-strong, #e5e5ea); border-radius: var(--radius-sm);
    padding: 14px; margin-bottom: 14px; background: var(--bg, #fafafa);
}
.tournament-card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.tournament-meta { font-size: 0.88rem; color: var(--muted); margin-bottom: 10px; }
.tournament-preview { font-size: 0.92rem; line-height: 1.45; }
.tournament-preview ul { margin: 8px 0; padding-left: 18px; }
.notify-toggles label { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 0.92rem; }
.tournament-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tournament-card.inactive { opacity: 0.55; }
.telegram-link-box {
    background: var(--surface-2, #f5f5f7); border-radius: 10px; padding: 12px 14px; margin-top: 12px;
}
.telegram-code { font-family: ui-monospace, monospace; font-size: 1.25rem; letter-spacing: 0.12em; font-weight: 700; }

.plain-list { margin: 0; padding-left: 1.2rem; color: var(--muted); }
.plain-list li { margin-bottom: 8px; }

.form-stack { display: flex; flex-direction: column; gap: 12px; }
.form-stack label { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; font-weight: 500; }
.form-stack input {
    min-height: var(--tap);
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    font: inherit;
}
.field-hint {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 4px 0 0;
    line-height: 1.35;
}
.field-hint.ok { color: var(--success-text); }
.form-msg { font-size: 0.9rem; min-height: 1.2em; }
.form-msg.ok { color: var(--success-text); }
.form-msg.err, .err-text { color: var(--danger-text); }

.theme-picker { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.theme-swatch {
    display: flex; align-items: center; gap: 12px;
    min-height: var(--tap); padding: 0 14px;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    background: var(--surface); cursor: pointer; font: inherit; text-align: left;
}
.theme-swatch.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.swatch { width: 28px; height: 28px; border-radius: 6px; overflow: hidden; display: inline-flex; }
.swatch::before, .swatch::after { content: ''; flex: 1; height: 100%; }
.swatch-brown::before { background: #f0d9b5; }
.swatch-brown::after { background: #b58863; }
.swatch-green::before { background: #eeeed2; }
.swatch-green::after { background: #769656; }
.swatch-blue::before { background: #dee3e6; }
.swatch-blue::after { background: #8ca2ad; }

.board-preview-wrap {
    margin: 16px 0 4px;
    display: flex;
    justify-content: center;
}

.board-preview {
    width: 100%;
    max-width: 220px;
}

.board-preview-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    aspect-ratio: 1;
    border-radius: var(--board-radius);
    overflow: hidden;
    box-shadow: var(--board-shadow);
    border: 1px solid rgba(0, 0, 0, 0.08);
    font-size: clamp(0.7rem, 2.8vw, 1.05rem);
    user-select: none;
}

.board-preview-sq {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    line-height: 1;
}

.board-preview-sq.light { background: var(--preview-sq-light, var(--sq-light)); }
.board-preview-sq.dark { background: var(--preview-sq-dark, var(--sq-dark)); }
.board-preview-sq.piece-w { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45); }
.board-preview-sq.piece-b { color: #1a1a1a; text-shadow: 0 1px 1px rgba(255, 255, 255, 0.35); }
.board-preview-sq.board-preview-hl {
    box-shadow: inset 0 0 0 3px var(--preview-sq-highlight, rgba(155, 199, 0, 0.5));
}

.board-preview-caption {
    margin-top: 10px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.badge-grid { display: grid; gap: 10px; }
.badge { padding: 12px; background: var(--bg); border-radius: var(--radius-sm); }
.badge strong { display: block; font-size: 0.95rem; }
.badge span { font-size: 0.85rem; color: var(--muted); }

.quest-list { list-style: none; }
.quest-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.quest-list li.done { color: var(--success-text); font-weight: 600; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th, .data-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.table-wrap { overflow-x: auto; }

@media (max-width: 700px) {
    .profile-grid { grid-template-columns: 1fr; }
    .stats-strip { grid-template-columns: 1fr 1fr; }
}

/* === Shared page blocks === */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }

.split-layout {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 300px;
    gap: 16px;
    align-items: start;
}
@media (max-width: 900px) { .split-layout { grid-template-columns: 1fr; } }

.game-clock {
    font-variant-numeric: tabular-nums;
    font-size: 1.7rem;
    font-weight: 700;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    margin: 8px 0;
    text-align: center;
}
.game-clock.active { outline: 2px solid var(--accent); }
.game-clock.low { color: var(--danger-text); }

.wait-box { text-align: center; padding: 40px 16px; }

.tasks-layout {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 300px;
    gap: 16px;
    align-items: start;
}
@media (max-width: 900px) { .tasks-layout { grid-template-columns: 1fr; } }

.tasks-layout #board { width: 100%; max-width: 480px; margin: 0 auto; aspect-ratio: 1 / 1; }

.guest-banner {
    background: var(--warn-bg);
    color: var(--warn-text);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.info-item {
    margin-bottom: 10px;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
}

.plan-goal-bar {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent-soft-text);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}
.plan-goal-bar.done { background: var(--success-bg); color: var(--success-text); }

.user-rating-line { font-size: 1.35rem; font-weight: 700; color: var(--accent); }
.user-rating-line .delta { font-size: 1rem; font-weight: 600; margin-left: 6px; }
.user-rating-line .delta.up { color: var(--success-text); }
.user-rating-line .delta.down { color: var(--danger-text); }
.user-rating-sub { font-size: 0.85rem; color: var(--muted); margin-top: 4px; }

.pick-mode-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.pick-mode-label { font-size: 0.85rem; color: var(--muted); }
.pick-mode-select {
    flex: 1; min-width: 160px; max-width: 100%;
    padding: 8px 10px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--surface);
    font: inherit; color: inherit;
}

.solution-replay {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.solution-replay.visible { display: flex; }
.solution-replay-counter {
    min-width: 4.5rem;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
}
.solution-replay .btn-icon {
    min-width: 44px;
    padding: 8px 12px;
    font-size: 1rem;
    line-height: 1;
}

.opponent-move-line { font-size: 1.05rem; font-weight: 600; letter-spacing: 0.02em; }

.rating-hero { text-align: center; padding: 8px 0; }
.rating-hero .num { font-size: 2.4rem; font-weight: 800; color: var(--accent); }
.rating-hero .delta.up { color: var(--success-text); }
.rating-hero .delta.down { color: var(--danger-text); }

.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.type-card {
    background: var(--surface);
    border: 2px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 18px;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}
.type-card:hover,
.type-card.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.type-card h3 { margin-bottom: 8px; font-size: 1.05rem; }
.type-card p { color: var(--muted); font-size: 0.9rem; }

/* Auth pages */
.login-wrap { max-width: 440px; margin: 0 auto; padding: 20px 16px 64px; }
.login-wrap h1 { margin-top: 16px; font-size: 1.75rem; letter-spacing: -0.02em; }
.login-lead { margin-top: 8px; }
.auth-tabs { display: flex; gap: 8px; margin: 20px 0 0; }
.auth-tabs .btn { flex: 1; }
.login-card { display: none; margin-top: 12px; }
.login-card.active { display: block; }
.login-card .form-stack { gap: 16px; }
.login-card .btn[type="button"],
.login-card button.btn { width: 100%; margin-top: 4px; }
.auth-footer {
    margin-top: 28px;
    padding: 16px 18px;
    font-size: 0.92rem;
    line-height: 1.55;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--muted);
}
.auth-footer p { margin: 0 0 10px; }
.auth-footer-links { font-size: 0.9rem; }
.auth-text-link {
    display: inline-block;
    margin-top: 4px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent);
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.auth-preview { margin-top: 8px; word-break: break-all; font-size: 0.88rem; color: var(--muted); }
