:root {
    --cell-size: 28px;
    --color-bg: #edf2f7;
    --color-surface: rgba(255, 255, 255, 0.88);
    --color-border: #d4dee8;
    --color-text: #142235;
    --color-muted: #5f7187;
    --color-accent: #0f766e;
    --color-accent-strong: #115e59;
    --color-accent-soft: #d7f3ee;
    --color-win: #16a34a;
    --color-loss: #dc2626;
    --color-closed: #c0c0c0;
    --color-closed-hover: #d4d4d4;
    --color-opened: #e8e8e8;
    --color-flag: #ef4444;
    --color-mine: #1a1a1a;
    --shadow-soft: 0 12px 30px rgba(20, 34, 53, 0.08);
    --shadow-card: 0 16px 40px rgba(20, 34, 53, 0.12);
    --radius: 4px;
    --radius-lg: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "Segoe UI", "Aptos", system-ui, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.16), transparent 24rem),
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 18rem),
        linear-gradient(180deg, #f8fbfd 0%, var(--color-bg) 45%, #e6edf5 100%);
    color: var(--color-text);
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: var(--color-accent);
}

.page-shell {
    position: relative;
}

.page-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
    background-size: 36px 36px;
    opacity: 0.22;
    pointer-events: none;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(20, 34, 53, 0.88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.9rem 1.5rem;
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.navbar-brand {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.navbar-tag {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.83rem;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.navbar-auth-link {
    text-decoration: none;
}

.navbar-auth-btn {
    padding: 0.5rem 0.9rem;
    font-size: 0.84rem;
}

.container {
    width: min(100% - 2rem, 1680px);
    max-width: none;
    margin: 0 auto;
    padding: 2rem 0 3rem;
    position: relative;
    z-index: 1;
}

.hero-card {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.6rem 1.75rem;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(231, 246, 243, 0.96)),
        #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: 1rem;
}

.hero-copy {
    max-width: 44rem;
}

.hero-kicker {
    display: inline-block;
    margin-bottom: 0.45rem;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    background: var(--color-accent-soft);
    color: var(--color-accent-strong);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hero-card h1 {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.05;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    max-width: 42rem;
    color: var(--color-muted);
    font-size: 1rem;
}

.list-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-stat {
    min-width: 7rem;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: rgba(20, 34, 53, 0.94);
    color: #fff;
    box-shadow: 0 10px 24px rgba(20, 34, 53, 0.22);
}

.hero-stat-value {
    display: block;
    font-size: 1.8rem;
    line-height: 1;
    font-weight: 800;
}

.hero-stat-label {
    display: block;
    margin-top: 0.28rem;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.74);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.btn-secondary {
    padding: 0.7rem 1rem;
    font-size: 0.82rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.68);
    color: var(--color-text);
    border: 1px solid rgba(20, 34, 53, 0.08);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 8px 18px rgba(20, 34, 53, 0.08);
}

.btn-secondary:hover {
    background: #fff;
    border-color: rgba(15, 118, 110, 0.3);
    color: var(--color-accent-strong);
    transform: translateY(-1px);
}

.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    padding: 0.82rem 1.15rem;
    font-size: 0.9rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-accent), #139487);
    color: #fff;
    border: 1px solid rgba(17, 94, 89, 0.38);
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
    box-shadow: 0 12px 24px rgba(15, 118, 110, 0.22);
}

.btn-primary:hover {
    transform: translateY(-1px);
    filter: saturate(1.05);
    box-shadow: 0 16px 28px rgba(15, 118, 110, 0.28);
}

.btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-card {
    max-width: 32rem;
    margin: 2.5rem auto;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(244, 250, 251, 0.95)),
        #fff;
    border: 1px solid rgba(20, 34, 53, 0.08);
    border-radius: 22px;
    padding: 1.7rem;
    box-shadow: var(--shadow-card);
}

.auth-card h1 {
    margin: 0 0 0.45rem 0;
    font-size: clamp(1.6rem, 2.4vw, 2rem);
    line-height: 1.08;
}

.auth-kicker {
    margin: 0 0 0.4rem 0;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-muted);
    font-weight: 700;
}

.auth-form {
    display: grid;
    gap: 0.95rem;
    margin-top: 1.25rem;
}

.auth-field {
    display: grid;
    gap: 0.38rem;
}

.auth-field span {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-text);
}

.auth-input {
    padding: 0.82rem 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--color-text);
    font-size: 0.95rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
    background: #fff;
}

.auth-submit {
    justify-self: start;
    min-width: 8.5rem;
}

.auth-footer {
    margin-top: 1.1rem;
    color: var(--color-muted);
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    padding: 1rem 1.1rem;
    background: var(--color-surface);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 1rem;
    backdrop-filter: blur(12px);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.filter-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-muted);
}

.filter-select,
.filter-input {
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--color-text);
}

.filter-select {
    cursor: pointer;
    min-width: 9rem;
}

.filter-input {
    min-width: 14rem;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.filter-clear {
    font-size: 0.8rem;
    color: var(--color-loss);
    text-decoration: none;
    align-self: center;
    padding: 0.35rem 0;
}

.filter-clear:hover {
    text-decoration: underline;
}

.table-shell {
    background: rgba(255, 255, 255, 0.56);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.68);
    box-shadow: var(--shadow-card);
    overflow: visible;
}

.table-scroll {
    overflow-x: auto;
    border-radius: 24px;
}

.game-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
}

.game-table th {
    position: sticky;
    top: 0;
    background: rgba(243, 248, 251, 0.96);
    backdrop-filter: blur(8px);
    text-align: left;
    padding: 0.8rem 1rem;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-muted);
    border-bottom: 1px solid rgba(20, 34, 53, 0.08);
}

.game-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(20, 34, 53, 0.06);
    font-size: 0.92rem;
    background: rgba(255, 255, 255, 0.54);
}

.game-row {
    cursor: pointer;
    transition: transform 0.12s ease, background 0.12s ease;
}

.game-row:hover td {
    background: rgba(233, 246, 243, 0.9);
}

.game-table tr:last-child td {
    border-bottom: none;
}

.game-link {
    color: var(--color-accent-strong);
    text-decoration: none;
    font-weight: 700;
}

.table-subtle {
    margin-top: 0.12rem;
    font-size: 0.75rem;
    color: var(--color-muted);
}

.board-pill,
.result-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4.25rem;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.board-pill {
    background: rgba(20, 34, 53, 0.08);
    color: var(--color-text);
}

.result-pill {
    background: rgba(20, 34, 53, 0.08);
}

.result-win {
    color: var(--color-win);
    font-weight: 600;
}

.result-loss {
    color: var(--color-loss);
    font-weight: 600;
}

.result-pill.result-win {
    background: rgba(22, 163, 74, 0.14);
}

.result-pill.result-loss {
    background: rgba(220, 38, 38, 0.12);
}

.note-cell {
    position: relative;
    cursor: pointer;
}

.note-icon {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.12);
    color: var(--color-accent-strong);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--color-text);
    transition: all 0.15s ease;
}

.page-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    transform: translateY(-1px);
}

.page-current {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}

.page-current:hover {
    background: var(--color-accent);
    color: #fff;
}

.page-ellipsis {
    padding: 0.35rem 0.3rem;
    color: var(--color-muted);
    font-size: 0.85rem;
}

.favorite-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem 0.35rem;
    color: var(--color-muted);
    transition: color 0.15s ease, transform 0.15s ease;
    border-radius: 999px;
}

.favorite-btn:hover {
    color: #fbbf24;
    transform: scale(1.08);
}

.favorite-btn[data-favorite="true"] {
    color: #fbbf24;
}

.empty-state {
    margin-top: 2rem;
    padding: 2rem;
    color: var(--color-muted);
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.76);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow-soft);
}

.empty-state a { color: var(--color-accent); }

.th-tip {
    cursor: default;
    border-bottom: 1px dashed var(--color-border);
}

.header-tooltip {
    position: fixed;
    left: 0;
    top: 0;
    background: rgba(26, 26, 26, 0.93);
    color: #fff;
    padding: 0.3rem 0.55rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 1000;
}

.header-tooltip.is-visible {
    opacity: 1;
}

.note-tooltip {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateY(-100%);
    background: rgba(26, 26, 26, 0.95);
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 400;
    white-space: pre-wrap;
    max-width: 250px;
    word-wrap: break-word;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.note-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(26, 26, 26, 0.95);
}

.note-loading {
    color: #999;
    font-style: italic;
}

.col-fav {
    width: 36px;
    padding-right: 0;
}

.col-new {
    width: 44px;
    text-align: center;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

.badge-new {
    display: inline-block;
    padding: 0.1rem 0.38rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    background: var(--color-accent);
    color: #fff;
    border-radius: 999px;
    vertical-align: middle;
    box-shadow: 0 6px 14px rgba(15, 118, 110, 0.2);
}

.row-unread td {
    font-weight: 500;
    background: rgba(248, 252, 255, 0.92);
}

.col-stat {
    text-align: center;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    min-width: 40px;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.game-table th.col-stat {
    text-align: center;
}

.stat-bad {
    color: var(--color-loss);
    font-weight: 600;
}

.stat-good {
    color: var(--color-win);
}

.stat-mc {
    color: #db2777;
    font-weight: 600;
}

.stat-pending {
    color: var(--color-muted);
    letter-spacing: 0.08em;
    font-size: 0.75rem;
}

.stat-na {
    color: var(--color-border);
}

.detail-header {
    margin-bottom: 1rem;
}

.back-link {
    color: var(--color-accent);
    text-decoration: none;
    font-size: 0.85rem;
}

.detail-header h1 {
    margin-top: 0.25rem;
}

.game-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    padding: 0.75rem 1rem;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.replay-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.board-container {
    flex-shrink: 0;
    overflow: auto;
}

.replay-sidebar {
    flex: 1;
    min-width: 240px;
}

.cell {
    width: var(--cell-size);
    height: var(--cell-size);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    user-select: none;
    border: 1px solid #999;
    position: relative;
}

.cell-closed {
    background: var(--color-closed);
    border-top: 2px solid #fff;
    border-left: 2px solid #fff;
    border-right: 2px solid #808080;
    border-bottom: 2px solid #808080;
}

.cell-opened {
    background: var(--color-opened);
    border: 1px solid #bbb;
}

.cell-flag {
    background: var(--color-closed);
    border-top: 2px solid #fff;
    border-left: 2px solid #fff;
    border-right: 2px solid #808080;
    border-bottom: 2px solid #808080;
    color: var(--color-flag);
}

.cell-mine {
    background: var(--color-opened);
    border: 1px solid #bbb;
    color: var(--color-mine);
}

.cell-mine-hit {
    background: #ff4444;
    border: 1px solid #bbb;
    color: var(--color-mine);
}

.cell-clicked {
    outline: 2px solid var(--color-accent);
    outline-offset: -2px;
    z-index: 1;
}

.cell-next-click {
    outline: 2px dashed #93c5fd;
    outline-offset: -2px;
    z-index: 1;
}

.cell-ng-start::before,
.cell-ng-start::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 78%;
    height: 3px;
    background: #111827;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.75);
    pointer-events: none;
    z-index: 3;
}

.cell-ng-start::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.cell-ng-start::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.cell-n1 { color: #0000ff; }
.cell-n2 { color: #008000; }
.cell-n3 { color: #ff0000; }
.cell-n4 { color: #000080; }
.cell-n5 { color: #800000; }
.cell-n6 { color: #008080; }
.cell-n7 { color: #000000; }
.cell-n8 { color: #808080; }

.replay-controls {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 1rem;
}

.control-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.control-buttons button {
    padding: 0.4rem 0.8rem;
    font-size: 1rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.1s;
}

.control-buttons button:hover {
    background: #ddd;
}

.slider-row {
    margin-bottom: 0.75rem;
}

.slider-row input[type="range"] {
    width: 100%;
}

.speed-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.speed-btn {
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
}

.speed-btn.active {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

.move-info {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    font-size: 0.85rem;
}

.move-info h3 {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

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

.move-info-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 0.75rem;
}

.move-info-grid dt {
    color: var(--color-muted);
}

.analyser-btn {
    width: 100%;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s;
}

.analyser-btn:hover {
    background: #1d4ed8;
}

.analyser-btn-secondary {
    background: #64748b;
}

.analyser-btn-secondary:hover {
    background: #475569;
}

.analyser-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.cell-analysis {
    position: relative;
}

.cell-analysis-safe {
    background: rgba(34, 197, 94, 0.5) !important;
}

.cell-analysis-mine {
    background: rgba(239, 68, 68, 0.5) !important;
}

.analysis-label {
    font-size: 11px;
    font-weight: 700;
    color: #000;
    text-shadow: 0 0 2px #fff, 0 0 2px #fff;
    line-height: 1;
    pointer-events: none;
}

.analysis-info {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    font-size: 0.85rem;
}

.analysis-info h3 {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.game-analysis {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.game-analysis h3 {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

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

.mistake-nav,
.guess-nav,
.mine-count-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.mistake-nav button,
.guess-nav button,
.mine-count-nav button {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s;
}

.mistake-nav button {
    background: var(--color-accent);
}

.mistake-nav button:hover {
    background: #1d4ed8;
}

.guess-nav button {
    background: #6366f1;
}

.guess-nav button:hover {
    background: #4f46e5;
}

.mine-count-nav button {
    background: #ec4899;
}

.mine-count-nav button:hover {
    background: #db2777;
}

#mistake-counter,
#guess-counter,
#mine-count-counter {
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

.mistake-detail-card,
.guess-detail-card,
.mine-count-detail-card {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.analysis-perfect {
    color: var(--color-win);
    font-weight: 600;
    margin-top: 0.5rem;
}

.analysis-warning {
    color: var(--color-loss);
    font-weight: 600;
    margin-top: 0.5rem;
}

.analysis-error-banner {
    margin-bottom: 0.75rem;
    padding: 0.75rem 0.9rem;
    background: color-mix(in srgb, var(--color-loss) 10%, var(--color-surface));
    border: 1px solid color-mix(in srgb, var(--color-loss) 35%, var(--color-border));
    border-radius: var(--radius);
}

.analysis-progress p {
    margin-bottom: 0.4rem;
}

.analysis-progress .progress-bar {
    height: 6px;
    background: var(--color-border);
    border-radius: 3px;
    overflow: hidden;
}

.analysis-progress .progress-fill {
    height: 100%;
    background: var(--color-accent);
    transition: width 0.3s;
}

.cell-mistake-player {
    outline: 3px solid var(--color-loss) !important;
    outline-offset: -3px;
    z-index: 2;
}

.cell-solver-best {
    outline: 3px solid var(--color-win) !important;
    outline-offset: -3px;
    z-index: 2;
}

.cell-dependent-safe {
    outline: 3px solid #a855f7 !important;
    outline-offset: -3px;
    z-index: 2;
}

.cell-dependent-mine {
    outline: 3px solid #f97316 !important;
    outline-offset: -3px;
    z-index: 2;
}

.cell-assistant-flag {
    background: #d8d8d8;
    border: 1px solid #aaa;
}

.assistant-flag-icon {
    opacity: 0.45;
    font-size: 13px;
    line-height: 1;
}

.assistant-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid #999;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.assistant-toggle:hover {
    background: rgba(255, 255, 255, 0.85);
    border-color: #666;
}

.assistant-toggle.assistant-active {
    background: #fbbf24;
    border-color: #d97706;
    color: #78350f;
}

@media (max-width: 900px) {
    .hero-card,
    .list-header-actions,
    .navbar-inner,
    .filter-bar,
    .replay-layout {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-card {
        padding: 1.25rem;
    }

    .hero-stat {
        width: fit-content;
    }

    .filter-select,
    .filter-input {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 1.2rem 0.85rem 2rem;
    }

    .navbar {
        padding: 0.8rem 1rem;
    }

    .hero-card h1 {
        font-size: 1.8rem;
    }

    .game-table th,
    .game-table td {
        padding: 0.72rem 0.7rem;
    }

    .page-btn {
        min-width: 1.8rem;
        padding: 0.3rem 0.5rem;
    }
}
