@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@400;600;700&family=Noto+Serif:wght@700&display=swap');

:root {
    --bg: #0f0f14;
    --surface: #1a1a24;
    --surface2: #22222f;
    --border: #2e2e40;
    --gold: #c9a84c;
    --gold2: #e8c96a;
    --text: #e8e6df;
    --muted: #7a7890;
    --green: #2ecc71;
    --red: #e74c3c;
    --blue: #3a9fe8;
    --orange: #e87c3a;
    --noir: #e8e6df;
    --cell-size: 56px;
    --mini-size: 17px;
    --pair-cell-bg: rgba(155, 89, 182, .22);
    --methode-pair-bg: rgba(200, 140, 220, .45);
    --methode-chain-bg: rgba(38, 166, 154, .45);
}

body.light {
    --bg: #b5a87a;
    --surface: #faf8f4;
    --surface2: #ede8df;
    --border: #cec8bb;
    --text: #1c1a16;
    --muted: #6b6458;
    --noir: #1c1a16;
    --gold: #a07828;
    --gold2: #c49a3c;
    --green: #1a7a45;
    --red: #b83228;
    --blue: #1e6ea0;
    --orange: #b05a18;
    --pair-cell-bg: rgba(142, 68, 173, .14);
    --methode-pair-bg: rgba(155, 89, 182, .32);
    --methode-chain-bg: rgba(0, 121, 107, .30);
}

body,
header,
footer,
.panel-card,
.modal-box,
.sudoku-grid,
.cell,
.numpad button,
.tab-btn,
.action-btn,
.level-pill,
.grid-item,
.status-bar,
.auth-card,
.auth-deco,
.victory-card,
.scores-section,
.stat-card,
.level-stat-card,
.scores-table th,
.scores-table td,
.color-option {
    transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
}

body.light header {
    background: #faf8f4;
    border-bottom: 2px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

body.light .logo {
    color: var(--gold);
}

body.light .logo span {
    color: var(--text);
}

body.light .tab-btn {
    color: var(--muted);
}

body.light .tab-btn.active,
body.light .tab-btn:hover {
    color: var(--gold);
    border-bottom-color: var(--gold);
    background: transparent;
}

body.light

.sudoku-grid {
    background: var(--surface);
    border-color: var(--text);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
}

body.light .cell {
    background: var(--surface);
    color: var(--text);
    border-color: #d9541a;
}

body.light .cell[data-col="3"],
body.light .cell[data-col="6"],
body.light .cell[data-row="3"],
body.light .cell[data-row="6"] {
    border-color: #d9541a;
}

body.light

.cell.given {
    background: #e8e3d8;
    color: #1c1a16;
    font-weight: 700;
}

body.light .cell.editable:hover {
    background: #ede8df;
}

body.light .cell.editable:focus,
body.light

.cell.selected {
    background: #ddd5c4;
    outline: 2px solid var(--gold);
}

body.light

.cell.correct {
    background: #d4edda;
}

body.light

.cell.wrong {
    background: #f8d7da;
}

body.light .cell.highlight {
    background: #e8e3d8;
}

body.light .numpad button {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

body.light .numpad button:hover {
    background: var(--surface2);
    border-color: var(--gold);
    color: var(--gold);
}

body.light .numpad button.erase {
    background: #f8d7da;
    border-color: #e8b0b0;
    color: var(--red);
}

body.light .numpad button.erase:hover {
    background: #f5c0c0;
}

body.light

.panel-card {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
}

body.light .panel-card h3 {
    color: var(--gold);
    border-bottom-color: var(--border);
}

body.light

.level-pill {
    background: var(--surface2);
    border-color: var(--border);
    color: var(--muted);
}

body.light .level-pill:hover {
    border-color: var(--gold);
    color: var(--gold);
}

body.light .level-pill.active {
    background: var(--gold);
    border-color: var(--gold);
    color: #faf8f4;
}

body.light .level-pill .count {
    color: inherit;
    opacity: .75;
}

body.light

.grid-item {
    background: var(--surface2);
    border-color: var(--border);
    color: var(--text);
}

.grid-edit-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: .8rem;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: .5;
    transition: opacity .15s;
}
.grid-edit-btn:hover { opacity: 1; }

.grid-delete-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: .8rem;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: .5;
    transition: opacity .15s, background .15s;
    line-height: 1;
}

.grid-delete-btn:hover {
    opacity: 1;
    background: rgba(231, 76, 60, .15);
}

body.light .grid-item:hover {
    border-color: var(--gold);
    background: #e8e3d8;
}

body.light .grid-item.active {
    border-color: var(--gold);
    background: #e0d8c8;
    color: var(--gold);
}

body.light .grid-item .date {
    color: var(--muted);
}

body.light

.action-btn {
    background: var(--surface2);
    border-color: var(--border);
    color: var(--text);
}

body.light .btn-gold {
    background: var(--gold);
    border-color: var(--gold);
    color: #faf8f4;
}

body.light .btn-gold:hover {
    background: var(--gold2);
    border-color: var(--gold2);
}

body.light .btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

body.light .btn-outline:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: transparent;
}

body.light .btn-green {
    background: transparent;
    border-color: #2ecc71;
    color: #27ae60;
}

body.light .btn-green:hover {
    background: #2ecc71;
    color: #fff;
}

body.light .btn-danger {
    background: #f8d7da;
    border-color: #e8b0b0;
    color: var(--red);
}

body.light .btn-danger:hover {
    background: #f5c0c0;
    border-color: var(--red);
}

body.light .btn-blue {
    background: #d4e8f7;
    border-color: #a8cce8;
    color: var(--blue);
}

body.light .btn-yellow {
    background: #fef9e7;
    border-color: #f0d060;
    color: #806010;
}

body.light

.status-bar {
    background: var(--surface);
    border-color: var(--border);
}

body.light .status-timer strong {
    color: var(--gold);
}

body.light .color-option {
    background: var(--surface2);
    border-color: var(--border);
}

body.light .color-option:hover {
    border-color: var(--gold);
    background: #e8e3d8;
}

body.light .color-option.active {
    border-color: var(--gold);
    background: #e0d8c8;
    box-shadow: 0 0 0 2px rgba(160, 120, 40, .2);
}

body.light .paires-result {
    background: #fef9e7;
    border-color: #f0d060;
    color: #604800;
}

body.light

.toast {
    background: var(--text);
    color: var(--surface);
}

body.light

.victory {
    background: rgba(0, 0, 0, .35);
}

body.light .victory-card {
    background: var(--surface);
    border-color: var(--gold);
    box-shadow: 0 8px 40px rgba(0, 0, 0, .12), 0 0 0 1px rgba(160, 120, 40, .2);
}

body.light .victory-card h2 {
    color: var(--gold);
}

body.light .victory-sub {
    color: var(--muted);
}

body.light .vstat {
    background: var(--surface2);
    border-color: var(--border);
}

body.light .vstat-value {
    color: var(--text);
}

body.light .vstat-value.gold {
    color: var(--gold);
}

body.light .victory-rank {
    background: rgba(160, 120, 40, .08);
    border-color: rgba(160, 120, 40, .3);
    color: var(--gold);
}

body.light .scores-section {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
}

body.light .scores-title {
    color: var(--gold);
}

body.light .stat-card {
    background: var(--surface2);
    border-color: var(--border);
}

body.light .stat-num {
    color: var(--gold);
}

body.light .stat-label {
    color: var(--muted);
}

body.light .level-stat-card {
    background: var(--surface2);
    border-color: var(--border);
}

body.light .lsc-name {
    color: var(--gold);
}

body.light .lsc-row {
    color: var(--muted);
}

body.light .lsc-row strong {
    color: var(--text);
}

body.light .lsc-row strong.gold {
    color: var(--gold);
}

body.light .scores-table th {
    background: var(--surface2);
    color: var(--gold);
    border-bottom-color: var(--border);
}

body.light .scores-table td {
    color: var(--muted);
    border-bottom-color: var(--border);
}

body.light .scores-table tr:hover td {
    background: var(--surface2);
}

body.light .scores-table tr.row-me td {
    background: rgba(160, 120, 40, .07);
    color: var(--text);
}

body.light .score-val {
    color: var(--gold);
}

body.light .badge-level {
    background: var(--surface2);
    border-color: var(--border);
    color: var(--muted);
}

body.light .you-badge {
    background: var(--gold);
    color: #faf8f4;
}

body.light .lb-filter {
    background: var(--surface2);
    border-color: var(--border);
    color: var(--muted);
}

body.light .lb-filter:hover {
    border-color: var(--gold);
    color: var(--gold);
}

body.light .lb-filter.active {
    background: var(--gold);
    border-color: var(--gold);
    color: #faf8f4;
}

body.light .empty-row {
    color: var(--muted);
}

body.light

.modal-overlay {
    background: rgba(0, 0, 0, .4);
}

body.light .modal-box {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: 0 12px 48px rgba(0, 0, 0, .14);
}

body.light .modal-box h2 {
    color: var(--gold);
}

body.light .modal-content h3 {
    color: var(--gold);
}

body.light .modal-content p {
    color: var(--muted);
}

body.light .modal-content strong {
    color: var(--text);
}

body.light .modal-content a {
    color: var(--gold);
}

body.light .modal-close {
    border-color: var(--border);
    color: var(--muted);
}

body.light .modal-close:hover {
    background: var(--red);
    color: #fff;
}

body.light footer {
    background: var(--surface);
    border-top-color: var(--border);
}

body.light .footer-logo {
    color: var(--gold);
}

body.light .footer-by {
    color: var(--muted);
}

body.light .footer-center {
    color: var(--muted);
}

body.light .footer-right {
    color: var(--muted);
}

body.light .footer-legal {
    color: var(--muted);
}

body.light .footer-legal a {
    color: var(--gold);
}

body.light .footer-sep {
    color: var(--border);
}

body.light .add-grid-wrapper select,
body.light .add-grid-wrapper input[type="text"] {
    background: var(--surface2);
    border-color: var(--border);
    color: var(--text);
}

body.light .add-grid .sudoku-grid .cell {
    background: var(--surface2);
    border-color: #d9541a;
    color: var(--text);
}

body.light .add-grid .sudoku-grid .cell.has-val {
    background: var(--surface);
    color: var(--text);
}

body.light .add-grid .sudoku-grid .cell:hover {
    background: #e8e3d8;
}

body.light .add-grid .sudoku-grid .cell[data-col="3"],
body.light .add-grid .sudoku-grid .cell[data-col="6"] {
    border-left: 1px solid #d9541a;
}

body.light .add-grid .sudoku-grid .cell[data-col="2"],
body.light .add-grid .sudoku-grid .cell[data-col="5"] {
    border-right: 1px solid #d9541a;
}

body.light .add-grid .sudoku-grid .cell[data-row="3"],
body.light .add-grid .sudoku-grid .cell[data-row="6"] {
    border-top: 1px solid #d9541a;
}

body.light .add-grid .sudoku-grid .cell[data-row="2"],
body.light .add-grid .sudoku-grid .cell[data-row="5"] {
    border-bottom: 1px solid #d9541a;
}

body.light .add-grid .sudoku-grid

.cell.selected {
    background: #ddd5c4;
    outline-color: var(--gold);
}

body.light .methode-grid {
    border-color: #333;
    background: #fff;
}

body.light .mini-cell {
    background: #fff;
    border-color: #d9541a;
}

body.light .mini-cell.given-m {
    background: #e8e3d8 !important;
    color: #1c1a16 !important;
    border-color: #d9541a !important;
}

body.light .mini-cell[data-mc="8"],
body.light .mini-cell[data-mc="17"],
body.light .mini-cell.given-m[data-mc="7"],
body.light .mini-cell.given-m[data-mc="16"] {
    border-right: 4px solid #d9541a !important;
}

body.light .mini-cell[data-mr="8"],
body.light .mini-cell[data-mr="17"],
body.light .mini-cell.given-m[data-mr="7"],
body.light .mini-cell.given-m[data-mr="16"] {
    border-bottom: 4px solid #d9541a !important;
}

body.light .mini-cell.given-m[data-mc="10"],
body.light .mini-cell.given-m[data-mc="19"] {
    border-left: 4px solid #d9541a !important;
}

body.light .mini-cell.given-m[data-mr="10"],
body.light .mini-cell.given-m[data-mr="19"] {
    border-top: 4px solid #d9541a !important;
}

body.light .color-orange {
    color: #b8860b;
}

body.light .sw-orange {
    background: #b8860b;
}

body.light .color-vert {
    color: #1a7a45;
}

body.light .sw-vert {
    background: #1a7a45;
}

body.light .color-bleu {
    color: #1565c0;
}

body.light .sw-bleu {
    background: #1565c0;
}

body.light .cours-level-debut {
    color: #1a7a45;
}

body.light .cours-level-inter {
    color: #1565c0;
}

body.light .cours-level-avance {
    color: #a8531c;
}

body.light .hint-empty {
    color: var(--muted);
}

body.light .btn-theme {
    background: var(--surface2);
    border-color: var(--border);
    color: var(--text);
}

body.light .btn-theme:hover {
    background: var(--border);
    border-color: var(--gold);
}

body.light .btn-logout {
    border-color: var(--border);
    color: var(--muted);
}

body.light .btn-logout:hover {
    border-color: var(--red);
    color: var(--red);
}

.lang-menu {
    display: flex;
    gap: 3px;
    align-items: center;
}

.lang-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 4px 8px;
    border-radius: 5px;
    cursor: pointer;
    font-size: .72rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    letter-spacing: .5px;
    transition: all .2s;
}

.lang-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.lang-btn.active {
    background: var(--gold);
    border-color: var(--gold);
    color: #111;
}

body.light .lang-btn.active {
    color: #111;
}

body.light .auth-card {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: 0 4px 24px rgba(0, 0, 0, .08);
}

body.light .auth-deco {
    background: var(--surface);
    border-color: var(--border);
}

body.light .auth-tab {
    color: var(--muted);
}

body.light .auth-tab.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

body.light .input-wrap input {
    background: var(--surface2);
    border-color: var(--border);
    color: var(--text);
}

body.light .input-wrap input::placeholder {
    color: var(--muted);
}

body.light .input-wrap input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(160, 120, 40, .12);
}

body.light .field-group label {
    color: var(--muted);
}

body.light .strength-bar {
    background: var(--border);
}

body.light .pwd-rules li {
    color: var(--muted);
}

body.light .pwd-rules li::before {
    color: var(--border);
}

body.light .forgot-link {
    color: var(--muted);
}

body.light .forgot-link:hover {
    color: var(--gold);
}

body.light .auth-switch {
    color: var(--muted);
}

body.light .auth-switch a {
    color: var(--gold);
}

body.light .auth-form-desc {
    color: var(--muted);
}

body.light .header-tagline {
    color: var(--muted);
}

body.light .header-tagline strong {
    color: var(--text);
}

body {
    transition: background .25s, color .25s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.burger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 7px;
    cursor: pointer;
    padding: 7px 8px;
    transition: border-color .2s;
    flex-shrink: 0;
}

.burger-btn:hover {
    border-color: var(--gold);
}

.burger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--muted);
    border-radius: 2px;
    transition: all .25s ease;
    transform-origin: center;
}

.burger-btn.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
    background: var(--gold);
}

.burger-btn.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.burger-btn.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
    background: var(--gold);
}

.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 98;
    opacity: 0;
    transition: opacity .25s;
}

.nav-overlay.open {
    display: block;
    opacity: 1;
}

.nav-close-btn {
    display: none;
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--muted);
    font-size: 1rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    z-index: 102;
}

.nav-close-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.logo {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.8rem;
    letter-spacing: 2px;
    color: var(--gold);
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.logo span {
    color: var(--text);
}

.logo img {
    height: 38px;
    width: auto;
}

.logo-authors {
    font-family: 'Inter', sans-serif;
    font-size: .62rem;
    letter-spacing: .03em;
    color: var(--muted);
    font-weight: 400;
    margin-top: 2px;
}

.tab-nav {
    display: flex;
    gap: 6px;
}

.tab-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 7px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: .85rem;
    font-family: 'Inter', sans-serif;
    transition: all .2s;
}

.tab-btn.active,
.tab-btn:hover {
    background: var(--gold);
    color: #000;
    border-color: var(--gold);
    font-weight: 600;
}

.tab-content {
    display: none;
    flex: 1;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 16px;
    gap: 20px;
}

.game-wrapper {
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    max-width: 1100px;
    overflow-x: auto;
}

.grid-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.grid-label {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--gold);
    font-weight: 700;
}

.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(9, var(--cell-size));
    grid-template-rows: repeat(9, var(--cell-size));
    border: 4px solid var(--gold);
    border-radius: 4px;
    overflow: hidden;
    background: var(--surface2);
}

.cell {
    width: var(--cell-size);
    height: var(--cell-size);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Noto Serif', serif;
    border: 1px solid var(--border);
    cursor: default;
    position: relative;
    transition: background .15s;
    user-select: none;
}

.cell[data-col="3"],
.cell[data-col="6"] {
    border-left: 4px solid var(--gold);
}

.cell[data-row="3"],
.cell[data-row="6"] {
    border-top: 4px solid var(--gold);
}

.cell.given {
    color: var(--text);
    background: var(--surface);
}

.cell.editable {
    cursor: pointer;
    color: var(--blue);
}

.cell.editable:hover {
    background: #252535;
}

.cell.editable:focus {
    outline: none;
    background: #2a2a42;
    box-shadow: inset 0 0 0 2px var(--gold);
}

.cell.correct {
    background: #00a846;
    color: #ffffff;
}

.cell.wrong {
    background: #3d1a1a !important;
    color: var(--red) !important;
    animation: shake .3s;
}

.cell.selected {
    box-shadow: inset 0 0 0 2px var(--gold);
}

.cell.highlighted {
    background: #1e1e2e;
}

.cell.two-candidates {
    background: var(--pair-cell-bg);
}

@keyframes shake {
    0%,
    100% {
    transform: translateX(0);
    }

    25% {
    transform: translateX(-4px);
    }

    75% {
    transform: translateX(4px);
    }
}

.numpad {
    display: grid;
    grid-template-columns: repeat(3, 48px);
    gap: 6px;
}

.numpad button {
    width: 48px;
    height: 48px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
}

.numpad button:hover {
    background: var(--gold);
    color: #000;
    border-color: var(--gold);
}

.numpad button.erase {
    background: #2a1a1a;
    color: var(--red);
    border-color: #4a2a2a;
}

.numpad button.erase:hover {
    background: var(--red);
    color: #fff;
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 220px;
    max-width: 260px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    flex-shrink: 0;
}

.side-panel::-webkit-scrollbar {
    width: 4px;
}

.side-panel::-webkit-scrollbar-track {
    background: transparent;
}

.side-panel::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.panel-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
}

.panel-card h3 {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gold);
    margin-bottom: 12px;
}

.level-pills {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.level-pill {
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: .85rem;
    transition: all .2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.level-pill:hover {
    border-color: var(--gold);
    background: var(--surface2);
}

.level-pill.active {
    background: var(--gold);
    color: #000;
    border-color: var(--gold);
    font-weight: 700;
}

.level-pill .count {
    font-size: .75rem;
    opacity: .7;
}

.grid-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 180px;
    overflow-y: auto;
}

.grid-list::-webkit-scrollbar {
    width: 4px;
}

.grid-list::-webkit-scrollbar-track {
    background: transparent;
}

.grid-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.grid-item {
    padding: 7px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: .82rem;
    display: flex;
    flex-direction: column;
    gap: 3px;
    transition: background .15s;
    border: 1px solid transparent;
}

.grid-item-info-text {
    font-size: .7rem;
    color: var(--muted);
    line-height: 1.4;
    word-break: break-word;
}

.grid-item:hover {
    background: var(--surface2);
}

.grid-item.active {
    background: var(--surface2);
    border-color: var(--gold);
    color: var(--gold);
}

.grid-item .date {
    font-size: .72rem;
    color: var(--muted);
}

.action-btn {
    width: 100%;
    padding: 10px;
    border-radius: 7px;
    border: none;
    cursor: pointer;
    font-size: .85rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    transition: all .2s;
    letter-spacing: .5px;
}

.btn-gold {
    background: var(--gold);
    color: #000;
}

.btn-gold:hover {
    background: var(--gold2);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
}

.btn-outline:hover {
    border-color: var(--gold);
    color: var(--gold);
}

#btn-paire-methode.active {
    background: var(--methode-pair-bg);
    border-color: var(--gold);
    color: var(--text);
}

#btn-chaine-methode.active {
    background: var(--methode-chain-bg);
    border-color: var(--gold);
    color: var(--text);
}

.btn-green {
    background: transparent;
    border: 1px solid #1a4a2a;
    color: #2ecc71;
}

.btn-green:hover {
    background: #2ecc71;
    color: #fff;
}

.btn-danger {
    background: transparent;
    border: 1px solid #4a2a2a;
    color: var(--red);
}

.btn-danger:hover {
    background: var(--red);
    color: #fff;
}

.status-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 16px;
    font-size: .82rem;
    color: var(--muted);
    display: flex;
    gap: 20px;
    align-items: center;
}

.status-bar .status-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-bar .status-item strong {
    color: var(--text);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot-green {
    background: var(--green);
}

.dot-blue {
    background: var(--blue);
}

.dot-gold {
    background: var(--gold);
}

.methode-container {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
    align-items: flex-start;
}

.methode-container>div:first-child {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

#methode-numpad {
    display: grid;
    grid-template-columns: repeat(3, 52px);
    gap: 6px;
    margin: 0 auto;
}

.methode-grid {
    display: grid;
    grid-template-columns: repeat(27, var(--mini-size));
    grid-template-rows: repeat(27, var(--mini-size));
    border: 4px solid var(--gold);
    border-radius: 2px;
    overflow: hidden;
    background: var(--surface);
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}

.mini-cell {
    width: var(--mini-size);
    height: var(--mini-size);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    font-weight: 700;
    background: var(--surface2);
    color: #2a7a2a;

    border-right: none;
    border-bottom: none;
    box-sizing: border-box;
    transition: background .1s;
}

.mini-cell[data-mc="2"],
.mini-cell[data-mc="5"],
.mini-cell[data-mc="8"],
.mini-cell[data-mc="11"],
.mini-cell[data-mc="14"],
.mini-cell[data-mc="17"],
.mini-cell[data-mc="20"],
.mini-cell[data-mc="23"],
.mini-cell[data-mc="26"] {
    border-right: 1px solid var(--border);
}

.mini-cell[data-mr="2"],
.mini-cell[data-mr="5"],
.mini-cell[data-mr="8"],
.mini-cell[data-mr="11"],
.mini-cell[data-mr="14"],
.mini-cell[data-mr="17"],
.mini-cell[data-mr="20"],
.mini-cell[data-mr="23"],
.mini-cell[data-mr="26"] {
    border-bottom: 1px solid var(--border);
}

.mini-cell[data-mc="8"],
.mini-cell[data-mc="17"] {
    border-right: 4px solid var(--gold) !important;
}

.mini-cell[data-mr="8"],
.mini-cell[data-mr="17"] {
    border-bottom: 4px solid var(--gold) !important;
}

.mini-cell.paire-methode {
    background: var(--methode-pair-bg);
}

.mini-cell.chaine-methode {
    background: var(--methode-chain-bg);
}

.mini-cell.given-m {
    background: var(--surface) !important;
    color: var(--text) !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    font-family: 'Noto Serif', serif !important;
    width: 100% !important;
    height: 100% !important;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
}

.mini-cell.given-m[data-mc="7"],
.mini-cell.given-m[data-mc="16"] {
    border-right: 4px solid var(--gold) !important;
}

.mini-cell.given-m[data-mc="10"],
.mini-cell.given-m[data-mc="19"] {
    border-left: 4px solid var(--gold) !important;
}

.mini-cell.given-m[data-mr="7"],
.mini-cell.given-m[data-mr="16"] {
    border-bottom: 4px solid var(--gold) !important;
}

.mini-cell.given-m[data-mr="10"],
.mini-cell.given-m[data-mr="19"] {
    border-top: 4px solid var(--gold) !important;
}

.mini-cell.correct-m {
    background: #4caf50;
    color: #111 !important;
}

.color-noir {
    color: var(--text);
}

.label-noir-dark {
    display: inline;
}

.label-noir-light {
    display: none;
}

body.light .label-noir-dark {
    display: none;
}

body.light .label-noir-light {
    display: inline;
}

.color-bleu {
    color: #3a9fe8;
}

.color-vert {
    color: #2ecc71;
}

.color-orange {
    color: #ffc107;
}

.color-rouge {
    color: #e74c3c;
}

.color-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: .82rem;
    transition: all .15s;
}

.color-option:hover {
    background: var(--surface2);
}

.color-option.active {
    border-color: currentColor;
    background: var(--surface2);
    font-weight: 700;
}

.color-swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

.sw-noir {
    background: var(--text);
    border: 1px solid var(--border);
}

body.light .sw-noir {
    background: #000;
}

.sw-bleu {
    background: #3a9fe8;
}

.sw-vert {
    background: #2ecc71;
}

.sw-orange {
    background: #ffc107;
}

.sw-rouge {
    background: #e74c3c;
}

.add-grid-wrapper {
    max-width: 800px;
    width: 100%;
}

.add-grid-row {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    justify-content: center;
}

.input-grid-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.add-grid .sudoku-grid .cell {
    cursor: pointer;
    background: var(--surface2);
    border-color: var(--gold);
}

.add-grid .sudoku-grid .cell.has-val {
    color: var(--gold);
}

.add-grid .sudoku-grid .cell:hover {
    background: #252535;
}

.add-grid .sudoku-grid

.cell.selected {
    box-shadow: inset 0 0 0 2px var(--gold);
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 22px;
    font-size: .85rem;
    font-weight: 600;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .5);
    z-index: 999;
    transition: transform .3s ease;
    pointer-events: none;
}

.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1200;
    background: var(--gold);
    color: #111;
    text-align: center;
    font-size: .82rem;
    font-weight: 700;
    padding: 7px 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    border-color: var(--green);
    color: var(--green);
}

.toast.error {
    border-color: var(--red);
    color: var(--red);
}

.toast.info {
    border-color: var(--gold);
    color: var(--gold);
}

.victory {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .85);
    z-index: 100;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
}

.victory.show {
    display: flex;
}

.victory h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 3.5rem;
    color: var(--gold);
    letter-spacing: 4px;
}

.victory p {
    color: var(--muted);
    font-size: 1rem;
}

.victory button {
    margin-top: 10px;
}

.form-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.form-row label {
    font-size: .78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 70px;
}

.form-row input,
.form-row select {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    padding: 7px 12px;
    font-size: .85rem;
    font-family: 'Inter', sans-serif;
    flex: 1;
    min-width: 120px;
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: var(--gold);
}

.hint-empty {
    color: var(--muted);
    font-size: .82rem;
    text-align: center;
    padding: 20px 0;
}

@media (max-width: 900px) {
    :root {
    --cell-size: 46px;
        --mini-size: 14px;
    }

    .game-wrapper {
    flex-wrap: wrap;
        justify-content: center;
        overflow-x: visible;
    }

    .side-panel {
    max-width: 100%;
        min-width: 0;
        width: 100%;
        max-height: none;
        overflow-y: visible;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
    }

    .panel-card {
    flex: 1 1 200px;
        min-width: 160px;
    }

    .status-bar {
    flex-wrap: wrap;
        gap: 10px;
    }

    .methode-container {
    flex-direction: column;
        align-items: center;
    }

    .footer-content {
    flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .footer-center {
    min-width: 0;
    }
}

@media (max-width: 600px) {
    :root {
    --cell-size: 36px;
        --mini-size: 11px;
    }

    header {
    padding: 10px 14px;
        gap: 8px;
    }

    .logo {
    font-size: 1.2rem;
    }

    .logo img {
    height: 24px;
    }

    .tab-nav {
    gap: 4px;
    }

    .tab-btn {
    padding: 5px 8px;
        font-size: .72rem;
    }

    .tab-content.active {
    padding: 14px 10px;
        gap: 14px;
    }

    .game-wrapper {
    flex-direction: column;
        align-items: center;
        overflow-x: visible;
        gap: 14px;
    }

    .grid-section {
    gap: 10px;
    }

    .numpad {
    grid-template-columns: repeat(3, 44px);
        gap: 5px;
    }

    .numpad button {
    width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .side-panel {
    width: 100%;
        max-width: 100%;
        min-width: 0;
        max-height: none;
        overflow-y: visible;
        flex-direction: column;
        gap: 10px;
        padding-right: 0;
    }

    .panel-card {
    padding: 12px;
    }

    .panel-card h3 {
    margin-bottom: 8px;
    }

    .level-pills {
    display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .level-pill {
    flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 2px;
        padding: 8px 10px;
        min-width: 0;
    }

    .level-pill .count {
    white-space: nowrap;
    }

    .status-bar {
    flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 8px 12px;
    }

    .methode-container {
    flex-direction: column;
        align-items: center;
        gap: 14px;
    }

    .add-grid-row {
    flex-direction: column;
        align-items: center;
    }

    .footer-content {
    flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .footer-right {
    display: none;
    }

    .footer-logo-img {
    height: 22px;
    }

    .victory h2 {
    font-size: 2.5rem;
    }
}

.btn-blue {
    background: #1a2d3d;
    border: 1px solid #3a9fe8;
    color: #3a9fe8;
}

.btn-blue:hover {
    background: #3a9fe8;
    color: #fff;
}

.btn-yellow {
    background: #2a2510;
    border: 1px solid #f1c40f;
    color: #f1c40f;
}

.btn-yellow:hover {
    background: #f1c40f;
    color: #000;
}

.paires-result {
    margin-top: 10px;
    padding: 10px;
    background: var(--surface2);
    border: 1px solid #f1c40f44;
    border-radius: 6px;
    font-size: .72rem;
    color: #f1c40f;
    line-height: 1.8;
    max-height: 160px;
    overflow-y: auto;
}

.paires-result::-webkit-scrollbar {
    width: 3px;
}

.paires-result::-webkit-scrollbar-thumb {
    background: #f1c40f44;
    border-radius: 3px;
}

.btn-blue {
    background: #1a2d3d;
    border: 1px solid #3a9fe8;
    color: #3a9fe8;
}

.btn-blue:hover {
    background: #3a9fe8;
    color: #fff;
}

.btn-yellow {
    background: #2a2510;
    border: 1px solid #f1c40f;
    color: #f1c40f;
}

.btn-yellow:hover {
    background: #f1c40f;
    color: #000;
}

.paires-result {
    margin-top: 10px;
    padding: 10px;
    background: var(--surface2);
    border: 1px solid #f1c40f44;
    border-radius: 6px;
    font-size: .72rem;
    color: #f1c40f;
    line-height: 1.8;
    max-height: 160px;
    overflow-y: auto;
}

.paires-result::-webkit-scrollbar {
    width: 3px;
}

.paires-result::-webkit-scrollbar-thumb {
    background: #f1c40f44;
    border-radius: 3px;
}

.sol-given {
    background: var(--surface) !important;
    color: var(--text) !important;
    font-weight: 700;
}

.sol-cell:not(.sol-given) {
    background: var(--surface2) !important;
    color: var(--gold) !important;
    font-style: italic;
}

.color-legend {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .78rem;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 16px 28px;
    margin-top: auto;
    flex-shrink: 0;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    max-width: 1100px;
    margin: 0 auto;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.footer-logo {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 1px;
    color: var(--gold);
}

.footer-logo span {
    color: var(--text);
}

.footer-logo-img {
    height: 28px;
    width: auto;
}

.footer-by {
    font-size: .78rem;
    color: var(--muted);
}

.footer-by strong {
    color: var(--text);
}

.footer-center {
    flex: 1;
    font-size: .75rem;
    color: var(--muted);
    text-align: center;
    line-height: 1.5;
    min-width: 200px;
}

.footer-center strong {
    color: var(--gold);
}

.footer-right {
    font-size: .72rem;
    color: var(--muted);
    letter-spacing: 1px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.footer-social {
    display: flex;
    gap: 10px;
}

.footer-social-link {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    text-decoration: none;
    font-size: .75rem;
    letter-spacing: .5px;
    transition: color .15s;
}

.footer-social-link:hover {
    color: var(--gold);
}

.footer-social-link svg {
    flex-shrink: 0;
}

.color-legend {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .78rem;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: .72rem;
    color: var(--muted);
}

.footer-legal a {
    color: var(--gold);
    text-decoration: none;
    transition: color .15s;
}

.footer-legal a:hover {
    color: var(--gold2);
    text-decoration: underline;
}

.footer-sep {
    color: var(--muted);
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .75);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-box::-webkit-scrollbar {
    width: 4px;
}

.modal-box::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.modal-box h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.6rem;
    color: var(--gold);
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: .9rem;
    transition: all .15s;
}

.modal-close:hover {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}

.modal-content h3 {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gold);
    margin: 16px 0 6px;
}

.modal-content h3:first-child {
    margin-top: 0;
}

.modal-content p {
    font-size: .84rem;
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 4px;
}

.modal-content ul {
    font-size: .84rem;
    color: var(--muted);
    line-height: 1.9;
    margin-left: 20px;
}

.modal-content a {
    color: var(--gold);
    text-decoration: none;
}

.modal-content a:hover {
    text-decoration: underline;
}

.modal-content strong {
    color: var(--text);
}

@media (max-width: 600px) {
    .modal-box {
    padding: 20px 16px;
    }

    .modal-box h2 {
    font-size: 1.3rem;
    }
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.header-user-name {
    font-size: .82rem;
    color: var(--gold);
    font-weight: 600;
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: .78rem;
    font-family: 'Inter', sans-serif;
    transition: all .2s;
}

.btn-logout:hover {
    border-color: var(--red);
    color: var(--red);
}

.lang-menu {
    display: flex;
    gap: 3px;
    align-items: center;
}

.lang-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 4px 8px;
    border-radius: 5px;
    cursor: pointer;
    font-size: .72rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    letter-spacing: .5px;
    transition: all .2s;
}

.lang-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.lang-btn.active {
    background: var(--gold);
    border-color: var(--gold);
    color: #111;
}

body.light .lang-btn.active {
    color: #111;
}

.victory-card {
    background: var(--surface);
    border: 1px solid var(--gold);
    border-radius: 16px;
    padding: 36px 40px;
    max-width: 480px;
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-shadow: 0 0 60px rgba(201, 168, 76, .2);
}

.victory-emoji {
    font-size: 3rem;
}

.victory-card h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.8rem;
    color: var(--gold);
    letter-spacing: 4px;
}

.victory-sub {
    color: var(--muted);
    font-size: .88rem;
}

.victory-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    margin: 4px 0;
}

.vstat {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.vstat-label {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
}

.vstat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.vstat-value.gold {
    color: var(--gold);
    font-size: 1.3rem;
}

.victory-rank {
    display: none;
    font-size: .85rem;
    color: var(--gold);
    background: rgba(201, 168, 76, .1);
    border: 1px solid rgba(201, 168, 76, .3);
    border-radius: 6px;
    padding: 8px 16px;
    text-align: center;
}

.victory-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.status-timer strong {
    color: var(--gold);
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
}

.scores-wrapper {
    display: flex;
    flex-direction: column;
    gap: 28px;
    width: 100%;
    max-width: 900px;
}

.scores-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}

.scores-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.3rem;
    letter-spacing: 2px;
    color: var(--gold);
    margin-bottom: 16px;
}

.my-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-num {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: .72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.level-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.level-stat-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    flex: 1;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lsc-name {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 4px;
}

.lsc-row {
    display: flex;
    justify-content: space-between;
    font-size: .8rem;
    color: var(--muted);
}

.lsc-row strong {
    color: var(--text);
}

.lsc-row strong.gold {
    color: var(--gold);
}

.lsc-rank {
    margin-top: 4px;
    font-size: .78rem;
    color: var(--gold);
    font-weight: 600;
}

.scores-table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--gold) transparent;
}

.scores-table-wrap::-webkit-scrollbar {
    height: 6px;
}

.scores-table-wrap::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 4px;
}

.scores-table-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.scores-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
}

.scores-table th {
    background: var(--surface2);
    padding: 10px 14px;
    text-align: left;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gold);
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.scores-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    vertical-align: middle;
}

.scores-table tr:last-child td {
    border-bottom: none;
}

.scores-table tr:hover td {
    background: var(--surface2);
}

.scores-table tr.row-me td {
    background: rgba(201, 168, 76, .07);
    color: var(--text);
}

.score-val {
    color: var(--gold);
    font-weight: 700;
}

.empty-row {
    text-align: center;
    color: var(--muted);
    font-style: italic;
    padding: 24px !important;
}

.badge-level {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: .72rem;
    font-weight: 600;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--muted);
    white-space: nowrap;
}

.you-badge {
    font-size: .65rem;
    background: var(--gold);
    color: #000;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 700;
    margin-left: 4px;
}

.leaderboard-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.lb-filter {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: .78rem;
    font-family: 'Inter', sans-serif;
    transition: all .15s;
}

.lb-filter:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.lb-filter.active {
    background: var(--gold);
    color: #000;
    border-color: var(--gold);
    font-weight: 700;
}

@media (max-width: 700px) {
    .my-stats {
    grid-template-columns: 1fr 1fr;
    }

    .victory-stats {
    grid-template-columns: 1fr 1fr;
    }

    .victory-card {
    padding: 24px 20px;
    }
}

@media (max-width: 480px) {
    .my-stats {
    grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .scores-section {
    padding: 16px;
    }

    .scores-table th,
    .scores-table td {
    padding: 8px 10px;
    }

    .victory-card {
    padding: 24px 20px;
        width: 95%;
    }

    .victory-card h2 {
    font-size: 2.2rem;
    }
}

.btn-theme {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

.btn-theme:hover {
    background: var(--border);
    border-color: var(--gold);
}

body.light .methode-grid {
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}

body.light .mini-cell {
    background: #fff;
}

.header-user-name {
    cursor: pointer;
    transition: color .2s;
}

.header-user-name:hover {
    color: var(--text);
    text-decoration: underline;
}

.compte-section {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.compte-section h3 {
    font-size: .82rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 10px;
}

.compte-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: .85rem;
}

.compte-label {
    color: var(--muted);
}

.compte-value {
    font-weight: 600;
    color: var(--text);
}

.compte-form-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.compte-form-row input {
    flex: 1;
    padding: 7px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    font-size: .85rem;
    font-family: 'Inter', sans-serif;
}

.compte-form-row input:focus {
    outline: none;
    border-color: var(--gold);
}

.compte-form-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.compte-form-col input {
    padding: 7px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    font-size: .85rem;
    font-family: 'Inter', sans-serif;
}

.compte-form-col input:focus {
    outline: none;
    border-color: var(--gold);
}

.grid-item-infos {
    font-size: .68rem;
    color: var(--muted);
    font-style: italic;
}

@media (max-width: 900px) {
    #methode-numpad {
    display: grid;
        justify-content: center;
    }

    #add-numpad-sol,
    #add-numpad-jeu {
    justify-content: center;
    }
}

@media (max-width: 600px) {
    #methode-numpad button,
    #add-numpad-sol button,
    #add-numpad-jeu button {
    width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .methode-container>div:first-child {
    display: flex;
        flex-direction: column;
        align-items: center;
    }

    #methode-numpad {
    grid-template-columns: repeat(3, 44px);
        gap: 5px;
    }
}

#mobile-numpad-drawer,
#mobile-numpad-overlay {
    display: none;
}

@media (max-width: 700px) {
    #mobile-numpad-drawer {
    display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 300;
        background: var(--surface);
        border-top: 2px solid var(--border);
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -6px 30px rgba(0, 0, 0, .4);
        transform: translateY(100%);
        transition: transform .25s cubic-bezier(.4, 0, .2, 1);
        padding-bottom: env(safe-area-inset-bottom, 8px);
    }

    #mobile-numpad-drawer.open {
    transform: translateY(0);
    }

    #mobile-numpad-close {
    display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 8px 0 4px;
        background: transparent;
        border: none;
        cursor: pointer;
        color: var(--muted);
        font-size: 1.4rem;
        line-height: 1;
    }

    #mobile-numpad-close::before {
    content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: var(--border);
        border-radius: 2px;
    }

    #mobile-numpad-grid {
    display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 0;
        padding: 6px 0 10px;
    }

    #mobile-numpad-grid button {
    height: 56px;
        font-size: 1.4rem;
        font-weight: 700;
        font-family: 'Noto Serif', serif;
        background: transparent;
        border: none;
        border-right: 1px solid var(--border);
        color: var(--text);
        cursor: pointer;
        transition: background .1s;
        -webkit-tap-highlight-color: transparent;
    }

    #mobile-numpad-grid button:last-child {
    border-right: none;
    }

    #mobile-numpad-grid button:active {
    background: var(--gold);
        color: #000;
    }

    #mobile-numpad-grid button.mob-erase {
    font-family: 'Inter', sans-serif;
        font-size: 1.1rem;
        color: var(--red);
    }

    #mobile-numpad-grid button.mob-erase:active {
    background: var(--red);
        color: #fff;
    }

    #mobile-numpad-overlay {
    display: none;
        position: fixed;
        inset: 0;
        z-index: 299;
        background: rgba(0, 0, 0, .2);
    }

    #mobile-numpad-overlay.open {
    display: block;
    }

    #numpad,
    #methode-numpad,
    #add-numpad-sol,
    #add-numpad-jeu {
    display: none !important;
    }

    body {
    padding-bottom: 0;
    }
}

.hist-del-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: .85rem;
    opacity: .65;
    transition: opacity .15s, background .15s;
    padding: 4px 6px;
    border-radius: 4px;
    color: var(--red);
}

.hist-del-btn:hover {
    opacity: 1;
    background: rgba(231, 76, 60, .2);
}

.search-history-wrap {
    margin-top: 10px;
}

.search-history-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 6px;
}

.search-history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.search-history-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 10px 4px 12px;
    font-size: .8rem;
    color: var(--text);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.search-history-tag:hover {
    border-color: var(--gold);
    background: rgba(201, 168, 76, .08);
}

.search-history-tag span {
    color: var(--gold);
    font-weight: 600;
}

.search-history-del {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: .75rem;
    padding: 0 2px;
    line-height: 1;
    transition: color .15s;
}

.search-history-del:hover {
    color: var(--red);
}

.cours-wrapper {
    display: flex;
    flex-direction: column;
    gap: 28px;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 8px 0 32px;
}

.cours-header {
    text-align: center;
    padding: 16px 0 8px;
}

.cours-main-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    letter-spacing: 3px;
    color: var(--gold);
    margin-bottom: 8px;
}

.cours-main-sub {
    font-size: .85rem;
    color: var(--muted);
    letter-spacing: .5px;
}

.cours-section-title {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.cours-section-title h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.6rem;
    letter-spacing: 2px;
    color: var(--gold);
    margin-bottom: 4px;
}

.cours-section-title p {
    font-size: .82rem;
    color: var(--muted);
}

.cours-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.cours-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px 22px 20px;
    cursor: pointer;
    transition: border-color .2s, transform .15s, box-shadow .2s;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cours-card:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
}

.cours-card-featured {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
    background: linear-gradient(135deg, var(--surface) 0%, rgba(201, 168, 76, .06) 100%);
    border-color: rgba(201, 168, 76, .4);
}

.cours-card-featured .cours-card-icon {
    font-size: 2.4rem;
    flex-shrink: 0;
}

.cours-card-featured .cours-card-desc {
    max-width: 600px;
}

.cours-card-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.cours-card-title {
    font-family: 'Inter', sans-serif;
    font-size: .95rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.cours-card-desc {
    font-size: .78rem;
    color: var(--muted);
    line-height: 1.6;
    flex: 1;
}

.cours-card-link {
    font-size: .75rem;
    color: var(--gold);
    font-weight: 600;
    margin-top: 4px;
    letter-spacing: .3px;
}

.cours-level-badge {
    display: inline-block;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 20px;
    width: fit-content;
}

.cours-level-debut {
    background: rgba(46, 204, 113, .15);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, .3);
}

.cours-level-inter {
    background: rgba(58, 159, 232, .15);
    color: #3a9fe8;
    border: 1px solid rgba(58, 159, 232, .3);
}

.cours-level-avance {
    background: rgba(232, 124, 58, .15);
    color: #e87c3a;
    border: 1px solid rgba(232, 124, 58, .3);
}

.cours-level-methode {
    background: rgba(201, 168, 76, .15);
    color: var(--gold);
    border: 1px solid rgba(201, 168, 76, .35);
}

.modal-cours-box {
    max-width: 720px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}

.modal-cours-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.cours-modal-icon {
    font-size: 2rem;
    line-height: 1;
}

.modal-cours-header h2 {
    font-size: 1.3rem;
    margin: 4px 0 0;
}

.modal-cours-content {
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
}

.cours-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.cours-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.cours-section h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1rem;
    letter-spacing: 1.5px;
    color: var(--gold);
    margin: 0 0 10px;
}

.cours-section p {
    font-size: .83rem;
    color: var(--muted);
    line-height: 1.75;
    margin: 0 0 10px;
}

.cours-section p:last-child {
    margin-bottom: 0;
}

.cours-rule-box {
    background: rgba(201, 168, 76, .08);
    border: 1px solid rgba(201, 168, 76, .25);
    border-left: 3px solid var(--gold);
    border-radius: 6px;
    padding: 12px 16px;
    font-size: .83rem;
    color: var(--text);
    line-height: 1.65;
    margin: 8px 0;
}

.cours-tip {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 14px;
    font-size: .78rem;
    color: var(--muted);
    line-height: 1.6;
    margin-top: 10px;
}

.cours-tip kbd {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: .75rem;
    font-family: monospace;
    color: var(--text);
}

.cours-example {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    margin: 10px 0;
}

.cours-example-title {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold);
    margin-bottom: 6px;
}

.cours-example p {
    margin: 0;
    font-size: .81rem;
}

.cours-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0;
}

.cours-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: .81rem;
    color: var(--muted);
    line-height: 1.6;
}

.cours-step-num {
    background: var(--gold);
    color: #111;
    font-weight: 700;
    font-size: .7rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.cours-grid-demo {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 10px 0;
}

.cours-grid-zone {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
}

.cours-grid-zone p {
    font-size: .76rem;
    margin: 0;
}

.cours-zone-label {
    font-weight: 700;
    font-size: .75rem;
    color: var(--gold);
    margin-bottom: 4px;
}

.cours-levels-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0;
}

.cours-level-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: .81rem;
    color: var(--muted);
    line-height: 1.5;
}

.cours-level-row .cours-level-badge {
    flex-shrink: 0;
    min-width: 90px;
    text-align: center;
}

.cours-colors-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 10px 0;
}

.cours-color-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.cours-color-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 2px;
}

.cours-color-row>div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cours-color-row strong {
    font-size: .83rem;
}

.cours-color-row p {
    font-size: .78rem;
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

body.light .cours-card {
    background: var(--surface);
}

body.light .cours-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, .1);
}

body.light .cours-rule-box {
    color: var(--text);
}

@media (max-width: 700px) {
    .cours-grid {
    grid-template-columns: 1fr;
    }

    .cours-card-featured {
    flex-direction: column;
    }

    .cours-grid-demo {
    grid-template-columns: 1fr;
    }

    .cours-level-row {
    flex-direction: column;
        gap: 4px;
    }

    .modal-cours-box {
    max-height: 95vh;
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
    }
}

@media (max-width: 820px) {
    .burger-btn {
    display: flex;
    }

    .tab-nav {
    position: fixed;
        top: 0;
        left: -100%;
        width: min(280px, 85vw);
        height: 100vh;
        background: var(--surface);
        border-right: 1px solid var(--border);
        flex-direction: column;
        gap: 6px;
        padding: 70px 16px 24px;
        z-index: 101;
        transition: left .28s cubic-bezier(.4, 0, .2, 1);
        box-shadow: 4px 0 20px rgba(0, 0, 0, .25);
        overflow-y: auto;
    }

    .nav-close-btn {
    display: flex;
    }

    .tab-nav.open {
    left: 0;
    }

    .tab-btn {
    width: 100%;
        text-align: left;
        padding: 12px 16px;
        font-size: .9rem;
        border-radius: 8px;
        border: 1px solid var(--border);
    }

    .tab-btn.active,
    .tab-btn:hover {
    background: var(--gold);
        color: #000;
        border-color: var(--gold);
    }

    header {
    padding: 10px 16px;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .logo {
    font-size: 1.4rem;
    }

    .logo img {
    height: 28px;
    }

    .logo-authors {
    display: none;
    }

    .lang-menu {
    gap: 2px;
    }

    .lang-btn {
    padding: 3px 6px;
        font-size: .68rem;
    }

    .btn-theme {
    width: 30px;
        height: 30px;
        font-size: .85rem;
    }

    .header-user {
    gap: 6px;
        flex-wrap: wrap;
        justify-content: flex-end;
        row-gap: 6px;
    }

    .btn-logout {
    font-size: 0;
        padding: 5px 8px;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .btn-logout::before {
    content: '⬅';
        font-size: .9rem;
    }

    .btn-notif {
    width: 30px;
        height: 30px;
        font-size: .85rem;
    }

    .header-user-name {
    max-width: 90px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: .75rem;
    }
}

@media (max-width: 600px) {
    .tab-content.active {
    padding: 12px 8px;
        gap: 12px;
    }

    .game-wrapper {
    flex-direction: column;
        align-items: center;
    }

    .side-panel {
    width: 100%;
        max-width: 100%;
    }

    .methode-container {
    flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .methode-container>div:first-child {
    align-items: center;
    }

    #methode-numpad {
    grid-template-columns: repeat(3, 44px);
        gap: 5px;
    }

    .methode-grid {
    max-width: 100%;
        overflow-x: auto;
    }

    .status-bar {
    flex-wrap: wrap;
        gap: 6px;
        justify-content: center;
    }

    .my-stats {
    grid-template-columns: repeat(2, 1fr);
    }

    .footer-content {
    flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .footer-center {
    min-width: 0;
    }

    .cours-grid {
    grid-template-columns: 1fr;
    }

    .cours-card-featured {
    flex-direction: column;
    }

    .modal-box {
    margin: 8px;
        max-height: 96vh;
    }
}

@media (max-width: 480px) {
    .header-user-name {
    max-width: 70px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: .7rem;
    }

    .lang-menu {
    display: none;
    }

    .header-user {
    gap: 4px;
    }

    .nav-lang-menu {
    display: flex;
        gap: 6px;
        margin-top: 8px;
        padding-top: 12px;
        border-top: 1px solid var(--border);
    }
}

.nav-lang-menu {
    display: none;
}

@media (max-width: 400px) {
    #methode-numpad {
    grid-template-columns: repeat(3, 40px);
        gap: 4px;
    }

    .tab-nav {
    width: 100vw;
    }

    .my-stats {
    grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 380px) {
    :root {
    --cell-size: 32px;
        --mini-size: 10px;
    }

    .victory-card h2 {
    font-size: 1.8rem;
        letter-spacing: 2px;
    }

    .tab-content.active {
    padding: 10px 6px;
    }
}

.btn-notif {
    position: relative;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

.btn-notif:hover {
    background: var(--border);
    border-color: var(--gold);
}

.notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--red);
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    pointer-events: none;
}

@media (max-width: 500px) {
    #modal-msg .modal-box,
    #modal-inbox .modal-box,
    #modal-notifs .modal-box,
    #modal-profile .modal-box {
    margin: 4px;
        max-width: calc(100vw - 8px);
        border-radius: 10px;
    }
}

.notif-item {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color .15s;
}

.notif-item.unread {
    border-color: var(--gold);
    background: rgba(201, 168, 76, .06);
}

.notif-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.notif-text {
    font-size: .84rem;
    color: var(--text);
    flex: 1;
    line-height: 1.4;
}

.notif-time {
    font-size: .72rem;
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.notif-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.notif-btn {
    padding: 4px 12px;
    border-radius: 5px;
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: .75rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    transition: all .15s;
    background: transparent;
    color: var(--muted);
}

.notif-btn.accept {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

.notif-btn.decline {
    background: transparent;
    border-color: var(--border);
    color: var(--muted);
}

.notif-btn.accept:hover {
    opacity: .85;
}

.notif-btn.decline:hover {
    border-color: var(--red);
    color: var(--red);
}

.notif-empty {
    text-align: center;
    color: var(--muted);
    font-size: .85rem;
    padding: 32px 0;
}

body.light .btn-notif {
    background: var(--surface2);
    border-color: var(--border);
    color: var(--text);
}

body.light .btn-notif:hover {
    background: var(--border);
    border-color: var(--gold);
}

body.light .notif-item {
    background: var(--surface2);
    border-color: var(--border);
}

body.light .notif-item.unread {
    border-color: var(--gold);
    background: rgba(160, 120, 40, .06);
}

body.light .compte-section {
    border-color: var(--border);
}

body.light .compte-section h3 {
    color: var(--gold);
}

body.light .compte-info-row {
    background: var(--surface2);
    border-color: var(--border);
}

body.light .compte-label {
    color: var(--muted);
}

body.light .compte-value {
    color: var(--text);
}

body.light #compte-new-pseudo,
body.light #compte-old-password,
body.light #compte-new-password,
body.light #compte-confirm-password {
    background: var(--surface2);
    border-color: var(--border);
    color: var(--text);
}

body.light .toast {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
}

body.light .inbox-item {
    background: var(--surface2);
    border-color: var(--border);
}

body.light .inbox-item:hover {
    background: var(--border);
}

body.light .inbox-name {
    color: var(--text);
}

body.light .inbox-preview {
    color: var(--muted);
}

body.light #msg-history {
    background: var(--bg);
}

body.light #msg-input {
    background: var(--surface2);
    border-color: var(--border);
    color: var(--text);
}

body.light #msg-reply-bar {
    background: var(--surface2);
    border-color: var(--border);
}

body.light #msg-reply-preview {
    color: var(--muted);
}

body.light #msg-emoji-btn {
    border-color: var(--border);
    color: var(--text);
    background: var(--surface2);
}

body.light #emoji-picker {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

body.light #msg-gif-btn {
    border-color: var(--border);
    color: var(--text);
    background: var(--surface2);
}

body.light #gif-picker {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

body.light #profile-stats {
    color: var(--muted);
}

body.light .header-user-name {
    color: var(--text);
}

body.light .notif-badge,
body.light .msg-badge {
    background: var(--red);
    color: #fff;
}

body.light .scores-table a {
    color: var(--gold);
}

body.light .burger-btn {
    border-color: var(--border);
    color: var(--text);
}

body.light .burger-btn span {
    background: var(--text);
}

body.light .mobile-nav {
    background: var(--surface);
    border-color: var(--border);
}

body.light .mobile-nav .tab-btn {
    color: var(--text);
    border-color: transparent;
}

body.light .mobile-nav .tab-btn.active {
    color: var(--gold);
    border-color: var(--gold);
}

@media (max-width: 480px) {
    .modal-box {
    max-width: calc(100vw - 24px) !important;
        max-height: 90vh;
        overflow-y: auto;
        margin: 0 12px;
    }

    .modal-box h2 {
    font-size: .95rem;
    }

    #modal-msg .modal-box {
    height: 92vh;
        max-height: 92vh;
    }

    #msg-history {
    max-height: none !important;
        flex: 1;
    }

    .header-user-name {
    font-size: .78rem;
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .scores-wrapper {
    padding: 0 2px;
    }

    .scores-section {
    padding: 16px 14px;
    }

    .my-stats {
    grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .action-btn {
    font-size: .8rem;
        padding: 9px 12px;
    }

    .tab-nav {
    overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }

    .tab-btn {
    flex-shrink: 0;
    }

    .compte-section {
    padding: 14px 0;
    }

    .compte-form-row {
    flex-direction: column;
    }

    .compte-form-row input {
    width: 100%;
    }
}

@media (max-width: 380px) {
    :root {
    --cell-size: 32px;
        --mini-size: 10px;
    }

    .tab-btn {
    font-size: .65rem;
        padding: 4px 6px;
    }

    .numpad {
    grid-template-columns: repeat(3, 40px);
    }

    .numpad button {
    width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

.stat-card-streak {
    border-color: var(--gold);
    background: linear-gradient(135deg, var(--surface2) 60%, rgba(201,168,76,.08));
    position: relative;
    overflow: hidden;
}

.my-stats {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

@keyframes badgeUnlock {
    0%   { transform: scale(.8); opacity: 0; }
    60%  { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

#badges-container [style*="border:1px solid var(--gold)"] {
    animation: badgeUnlock .4s ease both;
}

body.light #badges-container > div > div {
    background: var(--surface2);
}

@media (max-width: 480px) {
    #badges-container > div:last-child {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
}

.chart-filter-btn,
.chart-type-btn {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 6px;
    padding: 5px 12px;
    font-size: .75rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all .15s;
    letter-spacing: .3px;
}

.chart-filter-btn:hover,
.chart-type-btn:hover {
    border-color: var(--gold);
    color: var(--text);
}

.chart-filter-btn.active,
.chart-type-btn.active {
    background: var(--gold);
    border-color: var(--gold);
    color: #1a1a1a;
    font-weight: 700;
}

#progress-chart {
    cursor: crosshair;
}

#chart-tooltip {
    position: absolute;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: .75rem;
    color: var(--text);
    pointer-events: none;
    white-space: nowrap;
    display: none;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

body.light .chart-filter-btn,
body.light .chart-type-btn {
    background: var(--surface2);
    border-color: var(--border);
    color: var(--muted);
}

body.light .chart-filter-btn.active,
body.light .chart-type-btn.active {
    background: var(--gold);
    color: #fff;
}

body.light #chart-tooltip {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

@media (max-width: 480px) {
    #chart-filters,
    #chart-type-btns {
    gap: 4px;
    }

    .chart-filter-btn,
    .chart-type-btn {
    padding: 4px 8px;
        font-size: .7rem;
    }
}

.react-picker {
    position: fixed;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    display: flex;
    gap: 4px;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0,0,0,.35);
    animation: reactPickerIn .12s ease;
}

@keyframes reactPickerIn {
    from { transform: scale(.85); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.react-picker-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.4rem;
    padding: 4px 6px;
    border-radius: 8px;
    transition: transform .1s, background .1s;
    line-height: 1;
}

.react-picker-btn:hover {
    transform: scale(1.35);
    background: var(--surface2);
}

.react-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

.react-badge {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: .78rem;
    cursor: pointer;
    transition: all .15s;
    display: flex;
    align-items: center;
    gap: 3px;
    color: var(--text);
    font-family: inherit;
}

.react-badge:hover {
    border-color: var(--gold);
    background: var(--surface);
}

.react-badge-mine {
    background: rgba(201,168,76,.15);
    border-color: var(--gold);
    color: var(--gold);
    font-weight: 600;
}

body.light .react-picker {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
}

body.light .react-badge {
    background: var(--surface2);
    border-color: var(--border);
    color: var(--text);
}

body.light .react-badge-mine {
    background: rgba(160,120,40,.12);
    border-color: var(--gold);
    color: var(--gold);
}

#tutorial-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    z-index: 8000;
    opacity: 0;
    transition: opacity .3s;
    pointer-events: all;
}

#tutorial-overlay.tut-visible {
    opacity: 1;
}

#tutorial-highlight {
    position: absolute;
    border-radius: 10px;
    box-shadow: 0 0 0 4px var(--gold), 0 0 0 9999px rgba(0,0,0,.65);
    z-index: 8001;
    pointer-events: none;
    opacity: 0;
    transition: opacity .3s, top .3s, left .3s, width .3s, height .3s;
}

#tutorial-highlight.tut-visible {
    opacity: 1;
}

#tutorial-bubble {
    position: fixed;
    z-index: 8002;
    background: var(--surface);
    border: 1px solid var(--gold);
    border-radius: 14px;
    padding: 20px 22px;
    width: 320px;
    max-width: calc(100vw - 32px);
    box-shadow: 0 8px 32px rgba(0,0,0,.4);
    opacity: 0;
    transform: scale(.95) translateY(6px);
    transition: opacity .25s, transform .25s;
    pointer-events: all;
}

#tutorial-bubble.tut-visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.tut-progress {
    height: 3px;
    background: var(--border);
    border-radius: 3px;
    margin-bottom: 14px;
    overflow: hidden;
}

.tut-progress-fill {
    height: 100%;
    background: var(--gold);
    border-radius: 3px;
    transition: width .4s ease;
}

.tut-step-num {
    font-size: .68rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.tut-title {
    color: var(--gold);
    font-size: 1rem;
    margin-bottom: 10px;
    line-height: 1.3;
}

.tut-text {
    font-size: .84rem;
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 18px;
}

.tut-text strong {
    color: var(--gold);
}

.tut-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tut-btn-skip {
    background: none;
    border: none;
    color: var(--muted);
    font-size: .78rem;
    cursor: pointer;
    padding: 4px 0;
    font-family: inherit;
    transition: color .15s;
}

.tut-btn-skip:hover {
    color: var(--text);
}

.tut-btn-prev {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 7px;
    padding: 8px 14px;
    font-size: .82rem;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
}

.tut-btn-prev:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.tut-btn-next {
    background: var(--gold);
    border: none;
    color: #1a1a1a;
    border-radius: 7px;
    padding: 8px 16px;
    font-size: .84rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
}

.tut-btn-next:hover {
    background: #e0be62;
}

.tut-btn-finish {
    padding: 8px 14px;
    font-size: .8rem;
}

body.light #tutorial-bubble {
    background: var(--surface);
    border-color: var(--gold);
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
}

body.light .tut-text {
    color: var(--text);
}

body.light .tut-btn-prev {
    background: var(--surface2);
    border-color: var(--border);
    color: var(--text);
}

@media (max-width: 480px) {
    #tutorial-bubble {
    width: calc(100vw - 24px);
        bottom: 16px;
        left: 12px !important;
        top: auto !important;
    }
}

body.daltonien .color-bleu,
body.daltonien .mini-cell[data-color="bleu"] {
    color: #0072B2 !important;
}

body.daltonien .color-vert,
body.daltonien .mini-cell[data-color="vert"] {
    color: #009E73 !important;
}

body.daltonien .color-orange,
body.daltonien .mini-cell[data-color="orange"] {
    color: #E69F00 !important;
}

body.daltonien .color-rouge,
body.daltonien .mini-cell[data-color="rouge"] {
    color: #CC79A7 !important;
}

body.daltonien .sw-bleu   { background: #0072B2; }
body.daltonien .sw-vert   { background: #009E73; }
body.daltonien .sw-orange { background: #E69F00; }
body.daltonien .sw-rouge  { background: #CC79A7; }

body.daltonien .mini-cell.correct-m {
    background: #0072B2 !important;
    color: #fff !important;
}

body.daltonien .color-option[data-color="bleu"]   .color-swatch::after { content: '■'; font-size: .6rem; color: #fff; display:flex; align-items:center; justify-content:center; }
body.daltonien .color-option[data-color="vert"]   .color-swatch::after { content: '▲'; font-size: .6rem; color: #fff; display:flex; align-items:center; justify-content:center; }
body.daltonien .color-option[data-color="orange"] .color-swatch::after { content: '●'; font-size: .6rem; color: #333; display:flex; align-items:center; justify-content:center; }
body.daltonien .color-option[data-color="rouge"]  .color-swatch::after { content: '★'; font-size: .6rem; color: #fff; display:flex; align-items:center; justify-content:center; }

body.daltonien .mini-cell[data-color="bleu"]::after   { content: '■'; font-size: .45rem; position: absolute; bottom: 0; right: 0; opacity: .6; }
body.daltonien .mini-cell[data-color="vert"]::after   { content: '▲'; font-size: .45rem; position: absolute; bottom: 0; right: 0; opacity: .6; }
body.daltonien .mini-cell[data-color="orange"]::after { content: '●'; font-size: .45rem; position: absolute; bottom: 0; right: 0; opacity: .6; }
body.daltonien .mini-cell[data-color="rouge"]::after  { content: '★'; font-size: .45rem; position: absolute; bottom: 0; right: 0; opacity: .6; }

body.daltonien .mini-cell {
    position: relative;
}

.daltonien-legend {
    display: none;
    font-size: .72rem;
    color: var(--muted);
    margin-top: 8px;
    padding: 8px 10px;
    background: var(--surface2);
    border-radius: 6px;
    border: 1px solid var(--border);
    line-height: 1.8;
}

body.daltonien .daltonien-legend {
    display: block;
}

body.light.daltonien .color-bleu   { color: #0060A0 !important; }
body.light.daltonien .color-vert   { color: #007A58 !important; }
body.light.daltonien .color-orange { color: #B07A00 !important; }
body.light.daltonien .color-rouge  { color: #A0508A !important; }

body.theme-bleu {
    --gold:    #4a9eff;
    --gold2:   #72b8ff;
    --bg:      #0a0f1a;
    --surface: #111828;
    --surface2:#182035;
    --border:  #1e2d4a;
    --muted:   #6a7fa0;
}

body.theme-bleu.light {
    --gold:    #1a6ec0;
    --gold2:   #2a8ee0;
    --bg:      #a8c0d8;
    --surface: #eef4fa;
    --surface2:#ddeaf5;
    --border:  #b8cfe0;
    --muted:   #4a6a88;
}

body.theme-violet {
    --gold:    #a855f7;
    --gold2:   #c084fc;
    --bg:      #0d0a14;
    --surface: #1a1228;
    --surface2:#221a35;
    --border:  #2e1f4a;
    --muted:   #7a6a90;
}

body.theme-violet.light {
    --gold:    #7c2dc8;
    --gold2:   #9a4de0;
    --bg:      #c0a8d8;
    --surface: #f5eefa;
    --surface2:#ede0f8;
    --border:  #d0b8e8;
    --muted:   #6a4a88;
}

body.theme-rouge {
    --gold:    #f43f5e;
    --gold2:   #fb7185;
    --bg:      #140a0a;
    --surface: #241212;
    --surface2:#301818;
    --border:  #4a1e1e;
    --muted:   #906a6a;
}

body.theme-rouge.light {
    --gold:    #c0102a;
    --gold2:   #e0203a;
    --bg:      #d8a8a8;
    --surface: #faeef0;
    --surface2:#f8e0e4;
    --border:  #e8c0c0;
    --muted:   #885050;
}

body.theme-emeraude {
    --gold:    #10b981;
    --gold2:   #34d399;
    --bg:      #0a1410;
    --surface: #111e18;
    --surface2:#162820;
    --border:  #1e3a2a;
    --muted:   #6a9080;
}

body.theme-emeraude.light {
    --gold:    #0a8a5a;
    --gold2:   #18aa72;
    --bg:      #a8d8c0;
    --surface: #eefaf4;
    --surface2:#daf5ea;
    --border:  #b8e8d0;
    --muted:   #4a8868;
}

.theme-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.theme-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all .2s;
    position: relative;
}

.theme-swatch:hover {
    transform: scale(1.15);
}

.theme-swatch.active {
    border-color: var(--text);
    transform: scale(1.1);
}

.theme-swatch.active::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .85rem;
    font-weight: 900;
    text-shadow: 0 1px 3px rgba(0,0,0,.5);
}

.theme-swatch-or       { background: linear-gradient(135deg, #c9a84c, #e8c96a); }
.theme-swatch-bleu     { background: linear-gradient(135deg, #4a9eff, #72b8ff); }
.theme-swatch-violet   { background: linear-gradient(135deg, #a855f7, #c084fc); }
.theme-swatch-rouge    { background: linear-gradient(135deg, #f43f5e, #fb7185); }
.theme-swatch-emeraude { background: linear-gradient(135deg, #10b981, #34d399); }

.btn-scroll-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gold);
    color: #1a1509;
    border: none;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,.35);
    transition: opacity .25s, transform .2s, background .2s;
    z-index: 900;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
}

.btn-scroll-top:hover {
    background: var(--gold2);
    transform: translateY(-3px);
}

.back-to-top-link {
    display: block;
    text-align: right;
    font-size: .78rem;
    color: var(--muted);
    text-decoration: none;
    padding-top: 18px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
    transition: color .15s;
}

.back-to-top-link:hover {
    color: var(--gold);
}

.panel-card-daily {
    background: linear-gradient(135deg, rgba(201,168,76,.12), rgba(201,168,76,.04));
    border-color: rgba(201,168,76,.35);
    padding: 12px;
}

.btn-daily {
    width: 100%;
    background: var(--gold);
    color: #111;
    font-weight: 700;
    font-size: .88rem;
    border: none;
    border-radius: 8px;
    padding: 11px 14px;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    letter-spacing: .02em;
}

.btn-daily:hover { opacity: .88; transform: translateY(-1px); }
.btn-daily:active { transform: translateY(0); }
.btn-daily:disabled { opacity: .5; cursor: default; transform: none; }
body.light .btn-daily { color: #fff; }

.btn-daily-scores {
    width: 100%;
    background: none;
    color: var(--gold);
    font-size: .78rem;
    border: 1px solid rgba(201,168,76,.4);
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    transition: background .15s;
}

.btn-daily-scores:hover { background: rgba(201,168,76,.1); }

.grid-item-daily-badge {
    font-size: .65rem;
    background: var(--gold);
    color: #111;
    border-radius: 4px;
    padding: 1px 5px;
    font-weight: 700;
    letter-spacing: .03em;
    flex-shrink: 0;
}

body.light .grid-item-daily-badge { color: #fff; }

.compte-tabs {
    display: flex;
    gap: 4px;
    margin: 0 0 0 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
    margin-bottom: 0;
}

.compte-tab-btn {
    flex: 1;
    padding: 9px 12px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: color .15s, border-color .15s;
    margin-bottom: -1px;
}

.compte-tab-btn:hover { color: var(--text); }
.compte-tab-btn.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

.compte-tab-content { display: none; }
.compte-tab-content.active { display: block; }

.friends-section-title {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--gold);
    font-weight: 700;
    margin: 14px 0 8px;
}

.friend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    background: var(--surface2);
    border: 1px solid var(--border);
    margin-bottom: 6px;
    font-size: .84rem;
}

.friend-item-pseudo {
    flex: 1;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-item-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.friend-btn {
    padding: 4px 9px;
    border-radius: 5px;
    border: 1px solid var(--border);
    background: none;
    cursor: pointer;
    font-size: .75rem;
    color: var(--text);
    transition: background .12s;
    white-space: nowrap;
}

.friend-btn:hover { background: var(--surface); }
.friend-btn-accept { color: var(--green); border-color: var(--green); }
.friend-btn-accept:hover { background: rgba(46,204,113,.1); }
.friend-btn-danger  { color: var(--red); border-color: transparent; }
.friend-btn-danger:hover { background: rgba(231,76,60,.1); }
.friend-btn-msg { color: var(--gold); border-color: var(--gold); }
.friend-btn-msg:hover { background: rgba(201,168,76,.1); }

.friends-empty {
    text-align: center;
    color: var(--muted);
    font-size: .82rem;
    padding: 20px 0;
}

.presence-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
    flex-shrink: 0;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

.presence-dot.online {
    background: #2ecc71;
    box-shadow: 0 0 0 2px rgba(46,204,113,.25);
    animation: presence-pulse 2.5s ease-in-out infinite;
}

.presence-dot.offline {
    background: var(--border);
}

@keyframes presence-pulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(46,204,113,.25); }
    50%       { box-shadow: 0 0 0 4px rgba(46,204,113,.1); }
}

.profile-presence {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .75rem;
    color: var(--muted);
    margin-top: 4px;
}

.profile-presence.online { color: #2ecc71; }

.profile-modal-box { position: relative; }

.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 24px 18px;
    background: linear-gradient(135deg, var(--surface2), var(--surface));
    border-bottom: 1px solid var(--border);
}

.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.profile-header-info { min-width: 0; }

.profile-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-presence-line {
    font-size: .75rem;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
}

.profile-since {
    font-size: .72rem;
    color: var(--muted);
}

.profile-body { padding: 18px 20px 20px; }

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.profile-stat-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 6px;
    text-align: center;
}

.profile-stat-num {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
    line-height: 1.2;
}

.profile-stat-label {
    font-size: .62rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-top: 3px;
}

.profile-section-label {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    font-weight: 600;
    margin-right: 8px;
}

.profile-fav-level-badge {
    font-size: .75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
    background: rgba(201,168,76,.15);
    color: var(--gold);
    border: 1px solid rgba(201,168,76,.3);
}

.profile-badges-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.profile-badge-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 3px 9px 3px 6px;
    font-size: .75rem;
    color: var(--text);
    transition: border-color .15s;
}

.profile-badge-chip:hover { border-color: var(--gold); }
.profile-badge-chip span:first-child { font-size: .95rem; }

.profile-actions { display: flex; flex-direction: column; gap: 8px; }

body.light .profile-header { background: linear-gradient(135deg, #f5f0e8, #faf7f0); }
body.light .profile-stat-card { background: #f0ece0; }

.mobile-panel-btn {
    display: none;
}

.mobile-panel-overlay {
    display: none;
}

@media (max-width: 700px) {

    .mobile-panel-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: 80px;
        left: 16px;
        z-index: 250;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: var(--surface);
        border: 1.5px solid var(--gold);
        color: var(--gold);
        font-size: 1.2rem;
        cursor: pointer;
        box-shadow: 0 4px 16px rgba(0,0,0,.4);
        transition: background .15s, transform .15s;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-panel-btn:active { transform: scale(.93); }

    .mobile-panel-overlay {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 251;
        background: rgba(0,0,0,.45);
    }

    .mobile-panel-overlay.open { display: block; }

    #tab-jeu .side-panel,
    #tab-methode .side-panel {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 252;
        width: 280px;
        max-width: 85vw;
        max-height: 100vh;
        max-height: 100dvh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: var(--bg);
        border-right: 1px solid var(--border);
        box-shadow: 4px 0 24px rgba(0,0,0,.5);
        transform: translateX(-100%);
        transition: transform .28s cubic-bezier(.4,0,.2,1);
        padding: 16px 12px 80px;
        flex-direction: column;
        gap: 12px;
    }

    #tab-jeu .side-panel.mobile-open,
    #tab-methode .side-panel.mobile-open {
        transform: translateX(0);
    }

    #tab-jeu .side-panel .panel-card,
    #tab-methode .side-panel .panel-card {
        flex: 0 0 auto;
        width: 100%;
        min-width: 0;
    }

    #tab-jeu .side-panel,
    #tab-methode .side-panel {
        flex-wrap: nowrap;
    }

    .status-bar {
        flex-wrap: wrap;
        gap: 6px 12px;
        padding: 8px 12px;
        font-size: .78rem;
    }

    .status-item { gap: 4px; }

    .game-wrapper {
        padding: 0;
        gap: 8px;
    }

    .grid-section {
        width: 100%;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .modal-box {
        max-height: 92vh;
        overflow-y: auto;
        margin: 4px;
    }

    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .status-bar {
        font-size: .72rem;
    }

    .compte-tabs { gap: 0; }
    .compte-tab-btn { font-size: .75rem; padding: 8px 6px; }
}

@media (max-width: 360px) {
    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .profile-stat-num { font-size: .95rem; }
    .profile-stat-label { font-size: .58rem; }

    .mobile-panel-btn { bottom: 72px; left: 10px; width: 42px; height: 42px; }
}

.help-box {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto 8px;
    animation: help-slide-in .3s ease;
}

.help-box.hidden { display: none; }

@keyframes help-slide-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.help-box-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(201,168,76,.12), rgba(201,168,76,.05));
    border: 1px solid rgba(201,168,76,.35);
    border-radius: 10px;
    padding: 12px 16px;
}

.help-icon { font-size: 1.4rem; flex-shrink: 0; }

.help-content { flex: 1; min-width: 0; }

.help-msg {
    font-size: .82rem;
    color: var(--text);
    margin: 0 0 8px;
    line-height: 1.4;
}

.help-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.help-btn {
    padding: 5px 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    font-size: .78rem;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
}

.help-btn:hover { background: var(--surface); }

.help-btn-gold {
    background: var(--gold);
    border-color: var(--gold);
    color: #111;
    font-weight: 600;
}

.help-btn-gold:hover { opacity: .88; background: var(--gold); }

.help-close {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    line-height: 1;
    transition: color .15s;
}

.help-close:hover { color: var(--text); }

@media (max-width: 600px) {
    .help-box-inner { flex-wrap: wrap; gap: 8px; }
    .help-actions { gap: 6px; }
    .help-btn { font-size: .75rem; padding: 5px 10px; }
}

.btn-shortcuts {
    background: none;
    border: 1.5px solid var(--border);
    color: var(--muted);
    border-radius: 6px;
    width: 28px;
    height: 28px;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .15s, color .15s;
    font-family: 'Inter', sans-serif;
    flex-shrink: 0;
}

.btn-shortcuts:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.shortcuts-box h2 { margin-bottom: 18px; font-size: 1rem; }

.shortcuts-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.shortcuts-section-title {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 10px;
}

.shortcut-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .82rem;
    color: var(--text);
    margin-bottom: 7px;
}

.shortcut-row span {
    color: var(--muted);
    margin-left: 4px;
}

kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    padding: 2px 6px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 5px;
    font-size: .75rem;
    font-family: 'Inter', monospace;
    color: var(--text);
    font-weight: 600;
    white-space: nowrap;
}

.sc-table { display: flex; flex-direction: column; gap: 6px; }

.sc-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: .82rem;
}

.sc-row:last-child { border-bottom: none; }

.sc-keys {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: .78rem;
}

.sc-desc { color: var(--muted); }