:root {
    --bg: #ffffff;
    --bg2: #f5f5f5;
    --bg3: #eeeeee;
    --fg: #0a0a0a;
    --fg2: #333333;
    --fg3: #666666;
    --border: #d0d0d0;
    --accent: #111111;
    --accent-inv: #ffffff;
    --danger: #c0392b;
    --success: #27ae60;
    --warning: #e67e22;
    --play-bg: #111111;
    --play-text: #ffffff;
    --play-hover: #2a2a2a;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --radius: 3px;
    --font-body:
        "DM Sans", "Computer Modern", "Latin Modern", "STIX Two Text", Georgia,
        serif;
    --font-mono: "Courier New", monospace;
    --transition: 0.15s ease;
    --ink: #0a0a0a;
    --muted: #666666;
    --text: #0a0a0a;
    --text-muted: #666666;
    --card-bg: #ffffff;
    --bg-card: #ffffff;
    --wb-surface: #fafafa;
    --wb-grid: #d4d4d4;
    --tag-bg: #f5f5f5;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --hover-bg: rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] {
    --bg: #111111;
    --bg2: #1a1a1a;
    --bg3: #222222;
    --fg: #f0f0f0;
    --fg2: #bbbbbb;
    --fg3: #888888;
    --border: #333;
    --accent: #f0f0f0;
    --accent-inv: #111111;
    --play-bg: #f0f0f0;
    --play-text: #111111;
    --play-hover: #cccccc;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    --ink: #f0f0f0;
    --muted: #888888;
    --text: #f0f0f0;
    --text-muted: #888888;
    --card-bg: #1a1a1a;
    --bg-card: #1a1a1a;
    --wb-surface: #161616;
    --wb-grid: #333333;
    --tag-bg: #222222;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    --hover-bg: rgba(255, 255, 255, 0.04);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    line-height: 1.6;
    transition:
        background var(--transition),
        color var(--transition);
    display: flex;
    flex-direction: column;
    max-width: 100%;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    font-weight: normal;
    letter-spacing: -0.01em;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.4rem;
}

h3 {
    font-size: 1.1rem;
}

a {
    color: var(--fg);
    text-decoration: underline;
    text-underline-offset: 3px;
}

a:hover {
    opacity: 0.9;
}

img,
svg,
canvas,
video {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.hidden {
    display: none !important;
}

.social-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 8px 20px;
    background: var(--bg2);
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--fg2);
    overflow-x: auto;
}

.social-bar-item {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.social-bar-item strong {
    font-weight: 600;
    color: var(--fg);
}

.social-bar-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    display: inline-block;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

#page-match.active~footer,
#page-match.active~#socialBar,
body:has(#page-match.active) footer,
body:has(#page-match.active) #socialBar {
    display: none;
}

/* ========================================
   NAVBAR - Navigation principale
   ======================================== */

/* Masquer la navbar pendant les matchs */
body:has(#page-match.active) .navbar {
    display: none !important;
}

/* Container principal de la navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    padding: 0 clamp(16px, 4vw, 40px);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    transition:
        background var(--transition),
        border-color var(--transition);
}

/* Logo */
.navbar-logo {
    font-family: "DM Sans", sans-serif;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ink);
    text-decoration: none;
    transition: opacity var(--transition);
    flex-shrink: 0;
}

.navbar-logo:hover {
    opacity: 0.7;
}

/* Menu hamburger (masqué par défaut sur desktop) */
.navbar-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: opacity var(--transition);
}

.navbar-hamburger:hover {
    opacity: 0.7;
}

.hamburger-line {
    width: 20px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Menu principal (desktop) */
.navbar-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Conteneur des boutons auth */
.navbar-auth {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Conteneur des boutons utilisateur */
.navbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Boutons de la navbar */
.navbar-btn {
    padding: 8px 18px;
    border: 1px solid var(--ink);
    background: transparent;
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.03em;
    cursor: pointer;
    color: var(--ink);
    border-radius: var(--radius);
    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.1s ease;
    white-space: nowrap;
}

.navbar-btn:hover {
    background: var(--ink);
    color: var(--bg);
}

.navbar-btn:active {
    transform: scale(0.98);
}

/* Bouton primaire */
.navbar-btn-primary {
    background: var(--ink);
    color: var(--bg);
}

.navbar-btn-primary:hover {
    opacity: 0.9;
    background: var(--ink);
}

.btn-validate {
    display: block;
    margin: 0 auto;
    max-width: 15rem;
}

/* Boutons avec icône */
.navbar-btn-icon {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
}

.navbar-btn-icon img {
    transition: filter 0.2s ease;
}

.navbar-btn:hover img[src$=".svg"] {
    filter: brightness(0) invert(1);
}

[data-theme="dark"] .navbar-btn:hover img[src$=".svg"] {
    filter: brightness(0);
}

/* Masquer le texte complet sur mobile, afficher seulement l'icône */
.navbar-btn-icon-only {
    display: none;
}

/* Lien utilisateur */
.navbar-link {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.03em;
    color: var(--ink);
    text-decoration: none;
    padding: 8px 12px;
    transition: opacity var(--transition);
}

.navbar-link:hover {
    opacity: 0.7;
}

/* ========================================
   NAVBAR MOBILE - Menu overlay
   ======================================== */

/* Overlay sombre */
.navbar-mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 198;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.navbar-mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* Menu mobile */
.navbar-mobile {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    background: var(--bg);
    border-left: 1px solid var(--border);
    z-index: 199;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.navbar-mobile.active {
    display: flex;
    transform: translateX(0);
}

/* Header du menu mobile */
.navbar-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.navbar-mobile-title {
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink);
}

.navbar-mobile-close {
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--ink);
    transition:
        background var(--transition),
        color var(--transition);
}

.navbar-mobile-close:hover {
    background: var(--ink);
    color: var(--bg);
}

/* Contenu du menu mobile */
.navbar-mobile-content {
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Section de navigation mobile */
.navbar-mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Séparateur dans le menu mobile */
.navbar-mobile-separator {
    height: 1px;
    background: var(--border);
    margin: 12px 0;
}

/* Conteneurs des boutons mobile */
.navbar-mobile-auth,
.navbar-mobile-user {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Boutons du menu mobile */
.navbar-mobile-btn {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--ink);
    background: transparent;
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.03em;
    cursor: pointer;
    color: var(--ink);
    border-radius: var(--radius);
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.navbar-mobile-btn:hover {
    background: var(--ink);
    color: var(--bg);
}

.navbar-mobile-btn img {
    transition: filter 0.2s ease;
}

.navbar-mobile-btn:hover img[src$=".svg"] {
    filter: brightness(0) invert(1);
}

[data-theme="dark"] .navbar-mobile-btn:hover img[src$=".svg"] {
    filter: brightness(0);
}

/* Bouton primaire mobile */
.navbar-mobile-btn-primary {
    background: var(--ink);
    color: var(--bg);
}

.navbar-mobile-btn-primary:hover {
    opacity: 0.9;
}

/* Lien mobile */
.navbar-mobile-link {
    width: 100%;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.03em;
    color: var(--ink);
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: left;
    transition:
        background 0.2s ease,
        border-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-mobile-link:hover {
    background: var(--hover-bg);
    border-color: var(--ink);
}

/* Compatibilité avec l'ancien code */
#navUsername {
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] img[src$=".svg"] {
    filter: invert(1);
}

/* Ajustement pour les icônes SVG dans les boutons */
[data-theme="dark"] .navbar-btn img[src$=".svg"],
[data-theme="dark"] .navbar-mobile-btn img[src$=".svg"] {
    filter: invert(1);
}

#app {
    display: grid;
    grid-template-columns: 200px 1fr;
    grid-template-rows: 1fr;
    min-height: 100vh;
}

#app,
.page.active,
#page-home.active {
    flex: 1;
}

.nav-vertical {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 2rem 1.25rem;
    border-right: 1px solid var(--border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: var(--bg);
}

.nav-logo {
    font-size: 1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    font-weight: normal;
    color: var(--fg);
    margin-bottom: 1.5rem;
    padding-left: 0.25rem;
}

.nav-vertical .nav-logo {
    font-size: 1rem;
    text-align: center;
    margin-bottom: 2rem;
}

.nav-links-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
    margin-bottom: 0;
}

.nav-links-vertical a {
    display: block;
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    color: var(--fg2);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all var(--transition);
}

.nav-links-vertical a:hover,
.nav-links-vertical a.active {
    color: var(--fg);
    background: var(--bg2);
    border-color: var(--border);
}

.nav-social-links {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
    margin-top: auto;
    padding-top: 1rem;
}

.nav-social-links a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 1rem;
    font-size: 0.82rem;
    color: var(--fg3);
    text-decoration: none;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: all var(--transition);
}

.nav-social-links a:hover {
    color: var(--fg);
    background: var(--bg2);
    border-color: var(--border);
}

.nav-divider {
    width: 100%;
    border: none;
    border-top: 1px solid var(--border);
    margin: 0.75rem 0;
}

.nav-right-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

#mobileNav {
    display: none !important;
}

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--fg);
    font-size: 1.5rem;
    line-height: 1;
    z-index: 101;
    transition: opacity var(--transition);
}

.hamburger-btn:hover {
    opacity: 0.7;
}

.nav-mobile {
    display: none;
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    border-right: 1px solid var(--border);
    padding: 1.5rem 1rem;
    overflow-y: auto;
    flex-direction: column;
    justify-content: flex-start;
    z-index: 99;
    width: 100%;
    max-width: 280px;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    animation: slideInLeft 0.3s ease-out;
}

.nav-mobile.open {
    display: flex;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.nav-mobile::after {
    content: "";
    position: fixed;
    top: 52px;
    left: 280px;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 98;
}

.nav-mobile.open::after {
    display: block;
}

.nav-mobile .nav-logo {
    font-size: 1rem;
    margin-bottom: 1rem;
    text-decoration: none;
}

.nav-mobile .nav-links-vertical {
    margin-bottom: 2rem;
}

.nav-mobile .nav-right-vertical {
    width: 100%;
}

.nav-mobile .flex.flex-col {
    width: 100%;
}

.nav-mobile .btn {
    width: 50%;
    justify-content: center;
    text-align: center;
}

.nav-social {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.nav-icon-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.35rem 0.45rem;
    border-radius: 8px;
    font-size: 1.1rem;
    color: var(--fg2);
    transition:
        background 0.15s,
        color 0.15s;
    line-height: 1;
}

.nav-icon-btn:hover {
    background: var(--bg2);
    color: var(--fg2);
}

.main-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
}

.main-layout>main {
    padding: 2rem 2.5rem;
    overflow-y: auto;
}

.right-panel {
    border-left: 1px solid var(--border);
    padding: 2rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.right-panel-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--fg3);
    margin-bottom: 0.25rem;
}

.right-panel .btn {
    border-radius: 999px;
    width: 100%;
    justify-content: center;
}

main {
    flex: 1;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 0;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    padding: 40px 40px;
    align-items: flex-start;
}

.left-col {
    padding-right: 50px;
}

.section-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.section-label h2 {
    font-family: "DM Sans", sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fg2);
}

.streak-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--tag-bg);
    border: 1px solid var(--border);
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    color: var(--fg);
    border-radius: 2px;
    margin-left: auto;
}

.streak-badge .flame {
    font-size: 13px;
}

.streak-label {
    font-size: 10px;
    color: var(--fg3);
    letter-spacing: 0.05em;
}

.problem-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 24px 24px 20px;
    position: relative;
    animation: slideUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
    border-radius: 12px;
    overflow-wrap: anywhere;
}

.problem-card-empty {
    text-align: center;
    padding: 36px 24px;
    background: var(--bg2);
}

.problem-card-empty p {
    font-size: 13px;
    color: var(--fg3);
    margin-bottom: 12px;
}

.problem-card-empty .btn {
    display: inline-flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.problem-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.problem-date {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--ink);
}

.problem-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tag {
    font-size: 0.72rem;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    background: color-mix(in srgb, var(--accent) 12%, var(--bg));
    color: var(--accent);
    font-weight: 500;
}

.difficulty {
    display: flex;
    gap: 3px;
    align-items: center;
}

.dot,
.diff-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--border);
    display: inline-block;
}

.dot.filled,
.diff-dot.filled {
    background: var(--ink);
    opacity: 1;
}

.problem-divider {
    height: 1px;
    background: var(--border);
    margin-bottom: 20px;
}

.problem-text {
    font-size: 14.5px;
    font-weight: 300;
    line-height: 1.75;
    color: var(--ink);
    margin-bottom: 6px;
}

.problem-text strong {
    font-weight: 500;
}

.problem-ask {
    font-size: 14.5px;
    font-weight: 400;
    color: var(--ink);
    line-height: 1.7;
    margin-bottom: 24px;
}

.answer-section {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    margin-top: 1rem;
}

.format-label {
    font-size: 0.78rem;
    color: var(--fg3);
    margin-bottom: 0.4rem;
}

.format-label span {
    color: var(--fg2);
    font-weight: 500;
}

.btn-validate {
    padding: 0.55rem 1.1rem;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition:
        opacity 0.15s,
        transform 0.1s;
    white-space: nowrap;
    min-height: 44px;
    touch-action: manipulation;
}

.btn-validate:hover {
    opacity: 0.88;
}

.btn-validate:active {
    transform: scale(0.97);
}

.btn-validate:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-validate.btn-outline {
    background: transparent;
    color: var(--ink);
    border: 1.5px solid var(--ink);
}

.btn-validate.btn-outline:hover {
    background: var(--ink);
    color: var(--bg);
}

.right-col {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    padding-left: 50px;
    border-left: 1px solid var(--border);
    animation: fadeIn 0.7s ease both 0.1s;
}

.home-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.home-stat-card {
    border: 1px solid var(--border);
    padding: 12px;
    text-align: center;
}

.home-stat-val {
    display: block;
    font-size: 20px;
    font-weight: 600;
    color: var(--fg);
    line-height: 1.2;
}

.home-stat-lbl {
    display: block;
    font-size: 10px;
    color: var(--fg3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 2px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.hero-title {
    font-family: "Playfair Display", serif;
    font-size: 52px;
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.02em;
    text-align: left;
    color: var(--ink);
    margin-bottom: 0.5rem;
}

.hero-sub {
    font-size: 14px;
    font-weight: 300;
    color: var(--muted);
    text-align: left;
    letter-spacing: 0.01em;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.hero {
    padding: 4rem 0 2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.action-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 400px;
}

.action-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 16px 22px;
    cursor: pointer;
    transition:
        border-color 0.18s,
        box-shadow 0.18s,
        transform 0.18s;
    text-decoration: none;
    color: var(--ink);
    display: block;
    touch-action: manipulation;
}

.action-card:hover {
    border-color: var(--ink);
    box-shadow: 4px 4px 0 var(--ink);
    transform: translate(-2px, -2px);
}

.action-card h3 {
    font-family: "DM Sans", sans-serif;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

.action-card p {
    font-size: 12px;
    font-weight: 300;
    color: var(--muted);
    line-height: 1.5;
}

.action-card-play {
    background: var(--play-bg);
    border-color: var(--play-bg);
    color: var(--play-text);
    padding: 20px 26px;
    margin-bottom: 4px;
}

.action-card-play h3 {
    font-family: "DM Sans", sans-serif;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.action-card-play p {
    color: var(--play-text);
    opacity: 0.7;
    font-size: 13px;
}

.action-card-play:hover {
    background: var(--play-hover);
    border-color: var(--play-hover);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.play-arrow {
    display: inline-block;
    transition: transform 0.2s ease;
    font-size: 24px;
    line-height: 1;
    margin-left: 4px;
    vertical-align: middle;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    touch-action: manipulation;
}

.btn:hover {
    background: var(--bg3);
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-inv);
    border-color: var(--accent);
}

.btn-primary:hover {
    opacity: 0.85;
}

.btn-sm {
    padding: 0.3rem 0.8rem;
    font-size: 0.82rem;
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.05rem;
}

.btn-danger {
    border-color: var(--danger);
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

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

.btn-full {
    width: 100%;
}

.btn-play-friend {
    background: transparent;
    border: 1.5px solid var(--accent);
    color: var(--accent);
}

.btn-play-friend:hover {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.btn-cta {
    padding: 0.55rem 1.25rem;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
    color: var(--fg2);
    font-weight: 600;
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color var(--transition);
    outline: none;
    min-width: 0;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--fg);
}

.form-input::placeholder {
    color: var(--fg3);
}

.answer-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1rem;
}

.answer-input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    background: var(--bg);
    font-family: "DM Sans", sans-serif;
    font-size: 13.5px;
    font-weight: 300;
    color: var(--ink);
    outline: none;
    transition: border-color 0.18s;
    min-width: 0;
    border-radius: 8px;
}

.answer-input::placeholder {
    color: #bbbbb5;
}

.answer-input:focus {
    border-color: var(--accent);
}

.answer-input.correct {
    border-color: var(--success);
    animation: correct-pop 0.4s ease;
}

.answer-input.wrong {
    border-color: var(--danger);
    animation: shake 0.45s ease;
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    12% {
        transform: translateX(-8px) rotate(-0.4deg);
    }

    25% {
        transform: translateX(8px) rotate(0.4deg);
    }

    40% {
        transform: translateX(-6px);
    }

    55% {
        transform: translateX(6px);
    }

    70% {
        transform: translateX(-3px);
    }

    85% {
        transform: translateX(3px);
    }

    100% {
        transform: translateX(0);
    }
}

@keyframes correct-pop {
    0% {
        transform: scale(1);
    }

    30% {
        transform: scale(1.05);
    }

    65% {
        transform: scale(0.98);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes life-pop {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    40% {
        transform: scale(1.8);
        background: var(--danger);
    }

    100% {
        transform: scale(0);
        opacity: 0;
        background: var(--danger);
    }
}

@keyframes result-slide-in {
    0% {
        opacity: 0;
        transform: translateY(28px) scale(0.97);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes countdown-zoom {
    0% {
        transform: scale(0.35);
        opacity: 0;
    }

    25% {
        transform: scale(1.2);
        opacity: 1;
    }

    65% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(0.7);
        opacity: 0;
    }
}

@keyframes timer-heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    12% {
        transform: scale(1.12);
    }

    25% {
        transform: scale(1);
    }

    38% {
        transform: scale(1.06);
    }
}

@keyframes screen-flash-in {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

@keyframes combo-pop {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(-10deg);
    }

    55% {
        transform: scale(1.15) rotate(3deg);
        opacity: 1;
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes particle-fly {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(var(--px), var(--py)) scale(0.1);
        opacity: 0;
    }
}

@keyframes elo-count-in {
    0% {
        opacity: 0;
        transform: scale(0.4);
    }

    60% {
        transform: scale(1.18);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.msg-error {
    color: var(--danger);
    font-size: 0.88rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-left: 2px solid var(--danger);
    min-height: 1.1em;
}

.msg-error:empty {
    display: none;
}

.msg-success {
    color: var(--success);
    font-size: 0.88rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-left: 2px solid var(--success);
}

.msg-success:empty {
    display: none;
}

.feedback-success {
    color: var(--success, #22c55e);
    font-size: 0.85rem;
    font-weight: 500;
}

.feedback-error {
    color: var(--danger, #ef4444);
    font-size: 0.85rem;
    font-weight: 500;
}

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    background: var(--bg);
    box-shadow: var(--card-shadow);
    margin-bottom: 1rem;
    overflow-wrap: anywhere;
}

.card-sm {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    background: var(--bg2);
    margin-bottom: 0.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th,
thead th {
    text-align: left;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg3);
    border-bottom: 1.5px solid var(--border);
    padding: 0.5rem 0.75rem;
}

td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

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

tr:hover td,
tbody tr:hover {
    background: var(--hover-bg);
}

tbody a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

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

.leaderboard-main {
    display: block;
    padding: 2rem;
}

.leaderboard-title {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    text-align: relative;
}

.leaderboard-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.leaderboard-loading {
    padding: 1rem;
}

.elo-placement {
    color: var(--accent);
    font-size: 0.8rem;
}

.sidebar h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--fg3);
    margin-bottom: 1rem;
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    border-radius: 5px;
}

.leaderboard-entry:last-child {
    border-bottom: none;
}

.lb-rank {
    color: var(--fg3);
    width: 18px;
    font-size: 0.78rem;
    text-align: right;
    flex-shrink: 0;
}

.lb-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.lb-elo {
    color: var(--fg3);
    font-size: 0.78rem;
    flex-shrink: 0;
}

.lb-me {
    font-weight: bold;
    color: var(--fg);
}

.league-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid currentColor;
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-muted);
}

.league-Bronze {
    color: #a0522d;
    border-color: #a0522d;
}

.league-Argent {
    color: var(--fg3);
    border-color: var(--fg3);
}

.league-Or {
    color: #b8860b;
    border-color: #b8860b;
}

.league-Platine {
    color: #5f9ea0;
    border-color: #5f9ea0;
}

.league-Diamant {
    color: #4169e1;
    border-color: #4169e1;
}

.league-Maître {
    color: #8b0000;
    border-color: #8b0000;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    margin: 1.5rem 0;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
}

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

.stat-label {
    font-size: 0.78rem;
    color: var(--fg3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-wins {
    color: #22c55e;
}

.stat-losses {
    color: #ef4444;
}

.stat-draws {
    color: var(--fg3);
}

.stat-problems {
    color: var(--accent);
}

.match-arena {
    display: grid;
    grid-template-columns: 1fr 200px 1fr;
    gap: 0;
    min-height: 100vh;
}

.match-panel {
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.match-center {
    padding: 1rem;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.match-arena-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
}

.match-timer-center {
    text-align: center;
}

.match-progress-bar {
    width: 180px;
    margin: 4px auto 0;
}

.match-opp-info {
    text-align: right;
}

.match-grid {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.match-sidebar-label {
    color: var(--fg3);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.25rem;
}

.match-sidebar-divider {
    margin: 0.75rem 0;
    border: none;
    border-top: 1px solid var(--border);
}

.my-solved-count {
    font-size: 1.5rem;
}

.match-forfeit-btn {
    margin-top: 1rem;
    width: 100%;
}

.problem-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.prob-btn {
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    background: var(--card-bg);
    cursor: pointer;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--fg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all var(--transition);
    margin-bottom: 0.35rem;
}

.prob-btn:hover:not(:disabled) {
    border-color: var(--text-muted);
    background: var(--bg3);
}

.prob-btn.active {
    border-color: var(--fg);
}

.prob-btn.solved {
    border-color: var(--success);
    color: var(--success);
}

.prob-btn.failed {
    border-color: var(--danger);
    color: var(--danger);
    opacity: 0.5;
}

.prob-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.lives-display {
    display: flex;
    gap: 3px;
}

.life {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
}

.life.alive {
    background: var(--accent);
}

.problem-format-hint {
    margin-top: 1rem;
    padding: 0.55rem 0.85rem;
    background: var(--bg2);
    border-left: 3px solid var(--accent);
    border-radius: 0 4px 4px 0;
    font-size: 0.85rem;
    color: var(--fg2);
}

.timer {
    font-size: 1.6rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
}

.timer.warning {
    color: var(--warning);
}

.timer.danger {
    color: var(--danger);
    animation:
        blink 0.8s steps(1) infinite,
        timer-heartbeat 1.2s ease-in-out infinite;
}

@keyframes blink {
    50% {
        opacity: 0.4;
    }
}

.problem-display {
    padding: 2rem;
    border: 1px solid var(--border);
    background: var(--bg2);
    border-radius: var(--radius);
    margin: 0.9rem 0 0.6rem;
    line-height: 1.7;
    font-family: "KaTeX_Main", serif;
    font-size: 1.1rem;
    color: var(--fg);
    overflow-wrap: anywhere;
}

.katex {
    font-size: 1.05em;
}

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

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 1s linear;
}

.progress-fill.warning {
    background: var(--warning);
}

.progress-fill.danger {
    background: var(--danger);
}

.diff-dots {
    display: inline-flex;
    gap: 3px;
}

.prematch-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 1.5rem;
    text-align: center;
    padding: 2rem;
}

.prematch-players {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.prematch-player-name {
    font-weight: 700;
}

.prematch-vs {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--fg3);
}

.prematch-countdown {
    font-size: 3rem;
    font-weight: 900;
    color: var(--accent);
}

.matchmaking-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 2rem;
    text-align: center;
    padding: 2rem;
}

.pulse-ring {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid var(--accent);
    position: relative;
    animation: pulse 1.4s ease-in-out infinite;
}

.pulse-ring::before {
    content: "";
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 1px solid var(--fg);
    opacity: 0;
    animation: pulse-out 1.5s ease-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.25);
        opacity: 0.35;
    }
}

@keyframes pulse-out {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

.result-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    gap: 1.5rem;
    text-align: center;
    padding: 2rem;
    animation: result-slide-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.result-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.elo-delta {
    font-size: 1.8rem;
    font-weight: 800;
}

.elo-delta.positive {
    color: var(--success);
}

.elo-delta.negative {
    color: var(--danger);
}

.result-stats-grid {
    width: 280px;
    margin-top: 1rem;
}

.result-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    width: 100%;
    max-width: 440px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--fg3);
    font-size: 1.2rem;
    line-height: 1;
}

.modal-box {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2rem;
    width: 100%;
    max-width: 460px;
    position: relative;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
    max-height: 90vh;
    overflow-y: auto;
    overflow-wrap: anywhere;
}

.modal-box h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.modal-box-md {
    max-width: 500px;
}

.modal-box-sm {
    max-width: 420px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.modal-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 500;
}

/* Bouton de fermeture du modal */
.modal-close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--fg);
    transition:
        background var(--transition),
        color var(--transition),
        border-color var(--transition);
    padding: 0;
}

.modal-close-btn:hover {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
}

.auth-tabs-row {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.auth-tab {
    padding: 0.5rem 1.1rem;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition:
        color 0.15s,
        border-color 0.15s;
    min-height: 40px;
}

.auth-tab.active {
    color: var(--text);
    border-bottom-color: var(--text);
}

.auth-switch-text {
    margin-top: 0.75rem;
    font-size: 0.82rem;
    color: var(--fg3);
    text-align: center;
}

.auth-google-btn {
    display: flex;
    justify-content: center;
    min-height: 44px;
    margin-bottom: 0.25rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.pm-tabs-row {
    display: flex;
    gap: 0;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.pm-tab {
    opacity: 0.6;
}

.pm-tab.active {
    opacity: 1;
    border-color: var(--accent);
    color: var(--accent);
}

.pm-create-hint {
    font-size: 0.88rem;
    margin-bottom: 1rem;
}

.pm-create-btn-wrap {
    text-align: center;
}

.pm-code-input {
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.pm-waiting-wrap {
    text-align: center;
    padding: 0.75rem 0;
}

.pm-copy-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.pm-waiting-indicator {
    margin-top: 1.25rem;
}

.pm-pulse {
    width: 36px;
    height: 36px;
    margin: 0.25rem auto;
}

.pm-waiting-text {
    margin-top: 0.4rem;
}

.pm-cancel-btn {
    margin-top: 0.75rem;
    opacity: 0.55;
}

.pm-code {
    font-family: "Courier New", Courier, monospace;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--accent);
    background: var(--bg2);
    border: 2px var(--border);
    border-radius: 6px;
    padding: 0.75rem 1.5rem;
    display: inline-block;
    margin: 0.5rem 0;
    user-select: all;
    word-break: break-all;
}

.private-link-box {
    display: flex;
    gap: 0.5rem;
    margin: 0.75rem 0 1.25rem;
}

.pulse-ring-sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid var(--accent);
    animation: pulse-ring 1.4s ease-in-out infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.9);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(0.9);
        opacity: 0.7;
    }
}

footer {
    border-top: 1px solid var(--border);
    padding: 20px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    font-size: 12px;
    margin-top: auto;
}

footer a {
    color: var(--fg3);
    text-decoration: none;
    transition: color 0.15s;
}

footer a:hover {
    color: var(--fg);
}

.footer-social {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: auto;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    color: var(--muted);
    opacity: 0.5;
    transition: opacity 0.18s;
    text-decoration: none;
}

.footer-social a:hover {
    opacity: 1;
    color: var(--ink);
}

#toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    pointer-events: none;
}

.toast-item {
    padding: 0.5rem 1.25rem;
    background: var(--fg);
    color: var(--accent-inv);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    animation: toast-in 0.2s ease;
    max-width: 300px;
    pointer-events: auto;
}

@keyframes toast-in {
    from {
        transform: translateY(6px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.toast-invite {
    border-left: 3px solid var(--accent);
    padding: 0.85rem 1rem;
}

.notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger, #ef4444);
    color: var(--bg);
    font-size: 0.62rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    pointer-events: none;
}

.notif-badge.hidden {
    display: none;
}

.notif-badge-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--danger, #ef4444);
    color: var(--bg);
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    padding: 0 4px;
    margin-left: 0.35rem;
    vertical-align: middle;
}

.notif-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 300px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 200;
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
}

.notif-panel.open {
    display: block;
}

#notifPanel {
    display: none;
    padding: 0.6rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.notif-item {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item:hover {
    background: var(--bg3);
}

.notif-item.unread {
    background: color-mix(in srgb, var(--accent) 8%, var(--bg2));
}

.notif-item .notif-time {
    font-size: 0.7rem;
    margin-top: 0.2rem;
}

.notif-empty {
    padding: 0.75rem;
    text-align: center;
}

#notifListModal .notif-item-modal {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
    cursor: pointer;
    transition: background 0.1s;
}

#notifListModal .notif-item-modal:last-child {
    border-bottom: none;
}

#notifListModal .notif-item-modal:hover {
    background: var(--bg2);
}

#notifListModal .notif-item-modal.unread {
    background: var(--bg2);
    border-left: 3px solid var(--accent);
}

.notif-modal-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg2);
}

.theme-btn {
    background: none;
    border: 1px solid var(--border);
    cursor: pointer;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius);
    color: var(--fg);
    font-size: 0.9rem;
    transition: all var(--transition);
    line-height: 1;
}

.theme-btn:hover {
    background: var(--bg3);
}

.profile-wrap {
    max-width: 680px;
    margin: 0 auto;
    padding: 2.5rem 2rem 4rem;
    overflow-x: hidden;
    width: 100%;
}

.profile-back {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--fg3);
    padding: 0;
    margin-bottom: 2rem;
    display: inline-block;
    transition: color var(--transition);
    text-decoration: none;
}

.profile-back:hover {
    color: var(--fg);
}

.profile-hero {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.profile-avatar-lg {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: -0.02em;
}

.profile-hero-info {
    flex: 1;
}

.profile-name {
    font-family: "Playfair Display", serif;
    font-size: 1.9rem;
    font-weight: 400;
    margin: 0 0 0.5rem;
    letter-spacing: -0.01em;
}

.profile-badges-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}

.profile-elo-chip {
    background: var(--tag-bg);
    border: 1px solid var(--border);
    padding: 2px 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink);
    border-radius: 2px;
}

.profile-since {
    font-size: 0.8rem;
    color: var(--fg3);
    margin: 0;
}

.profile-own-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
    margin-left: auto;
}

.profile-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

.profile-stat-card {
    border: 1px solid var(--border);
    padding: 1.1rem 0.75rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    transition:
        border-color var(--transition),
        box-shadow var(--transition),
        transform var(--transition);
}

.profile-stat-card:hover {
    border-color: var(--ink);
    box-shadow: 3px 3px 0 var(--ink);
    transform: translate(-1px, -1px);
}

.profile-stat-val {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
}

.profile-stat-lbl {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg3);
}

.stat-win .profile-stat-val {
    color: var(--success);
}

.stat-loss .profile-stat-val {
    color: var(--danger);
}

.stat-draw .profile-stat-val {
    color: var(--fg3);
}

.stat-solved .profile-stat-val {
    color: var(--ink);
}

.profile-wr-bar-wrap {
    margin-bottom: 1.75rem;
}

.profile-wr-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--fg2);
    margin-bottom: 0.4rem;
}

.profile-wr-bar {
    height: 6px;
    background: var(--bg3);
    border-radius: 3px;
    overflow: hidden;
}

.profile-wr-fill {
    height: 100%;
    background: var(--success);
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.profile-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--fg3);
    margin: 0 0 0.75rem;
    font-weight: 600;
}

.profile-match-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.profile-match-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--border);
    font-size: 0.88rem;
    flex-wrap: wrap;
}

.pm-result-label {
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 60px;
}

.profile-match-item.win .pm-result-label {
    color: var(--success);
}

.profile-match-item.loss .pm-result-label {
    color: var(--danger);
}

.profile-match-item.draw .pm-result-label {
    color: var(--fg3);
}

.pm-opp {
    color: var(--fg2);
}

.pw-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.pw-input-wrap .form-input {
    padding-right: 2.5rem;
}

.pw-eye-btn {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0.25rem;
    color: var(--fg3);
    transition: opacity var(--transition);
}

.pw-eye-btn:hover {
    opacity: 0.8;
}

.forum-content {
    max-width: 860px;
}

.forum-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.forum-page-header h1 {
    margin-bottom: 0.15rem;
}

.forum-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--fg3);
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.forum-breadcrumb a {
    color: var(--fg2);
    text-decoration: none;
}

.forum-breadcrumb a:hover {
    color: var(--fg);
}

.forum-sep {
    color: var(--fg3);
    font-size: 0.8rem;
}

.forum-category-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.6rem;
    cursor: pointer;
    transition:
        background var(--transition),
        border-color var(--transition),
        transform var(--transition);
}

.forum-category-card:hover {
    background: var(--bg2);
    border-color: var(--fg3);
    transform: translateX(2px);
}

.forum-cat-body {
    flex: 1;
    min-width: 0;
}

.forum-cat-name {
    font-size: 1rem;
    margin-bottom: 0.12rem;
}

.forum-cat-desc {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.forum-cat-stats {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    flex-shrink: 0;
}

.forum-stat {
    text-align: center;
    min-width: 48px;
}

.forum-stat-value {
    display: block;
    font-size: 1.05rem;
}

.forum-stat-label {
    display: block;
    font-size: 0.68rem;
    color: var(--fg3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.forum-last-post {
    min-width: 110px;
    text-align: right;
}

.forum-cat-arrow {
    color: var(--fg3);
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: transform var(--transition);
}

.forum-category-card:hover .forum-cat-arrow {
    transform: translateX(3px);
}

.forum-thread-list {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.forum-thread-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--transition);
}

.forum-thread-item:last-child {
    border-bottom: none;
}

.forum-thread-item:hover {
    background: var(--bg2);
}

.forum-thread-item.forum-pinned {
    background: var(--bg2);
}

.forum-thread-item-main {
    flex: 1;
    min-width: 0;
}

.forum-thread-item-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
    flex-wrap: wrap;
}

.forum-thread-item-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.forum-thread-stat {
    text-align: center;
    min-width: 38px;
}

.forum-thread-stat-val {
    display: block;
    font-size: 1rem;
}

.forum-thread-stat-label {
    display: block;
    font-size: 0.68rem;
    color: var(--fg3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.forum-thread-last {
    min-width: 100px;
    text-align: right;
}

.forum-tag {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 2px;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid currentColor;
    flex-shrink: 0;
}

.forum-tag-pin {
    color: #b8860b;
    border-color: #b8860b;
}

.forum-tag-lock {
    color: var(--fg3);
    border-color: var(--fg3);
}

.forum-thread-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.forum-thread-header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.forum-thread-header-title h1 {
    font-size: 1.5rem;
}

.forum-mod-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.forum-post {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: box-shadow var(--transition);
}

.forum-post:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.forum-post-sidebar {
    width: 120px;
    min-width: 120px;
    padding: 1rem 0.75rem;
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.3rem;
}

.forum-post-author {
    font-size: 0.88rem;
    font-weight: normal;
    word-break: break-word;
}

.forum-role-badge {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    border-radius: 2px;
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid currentColor;
}

.forum-post-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    margin-top: 0.25rem;
}

.forum-post-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.forum-post-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.9rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg2);
    font-size: 0.78rem;
    flex-wrap: wrap;
}

.forum-post-actions {
    display: flex;
    gap: 0.35rem;
    margin-left: auto;
}

.forum-edited-badge {
    font-size: 0.7rem;
    color: var(--fg3);
    border: 1px solid var(--border);
    padding: 0.05rem 0.35rem;
    border-radius: 2px;
}

.forum-post-content {
    padding: 1rem;
    line-height: 1.75;
    word-break: break-word;
    font-size: 0.93rem;
}

.forum-post-content p {
    margin-bottom: 0.6rem;
}

.forum-post-content p:last-child {
    margin-bottom: 0;
}

.forum-post-content h1,
.forum-post-content h2,
.forum-post-content h3 {
    margin: 0.8rem 0 0.4rem;
    font-weight: normal;
}

.forum-post-content ul,
.forum-post-content ol {
    margin: 0.4rem 0 0.6rem 1.5rem;
}

.forum-post-content li {
    margin-bottom: 0.2rem;
}

.forum-post-content code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--bg3);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
}

.forum-post-content pre {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    overflow-x: auto;
    margin: 0.6rem 0;
}

.forum-post-content pre code {
    background: none;
    padding: 0;
    font-size: 0.88em;
}

.forum-post-content blockquote {
    border-left: 3px solid var(--border);
    margin: 0.6rem 0;
    padding: 0.4rem 0.9rem;
    color: var(--fg2);
    font-style: italic;
}

.forum-post-content a {
    color: var(--fg);
}

.forum-post-content table {
    font-size: 0.88rem;
    margin: 0.6rem 0;
}

.forum-post-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0.8rem 0;
}

.forum-spoiler {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 0.6rem 0;
    overflow: hidden;
}

.forum-spoiler-summary {
    padding: 0.55rem 0.9rem;
    background: var(--bg2);
    cursor: pointer;
    user-select: none;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    transition: background var(--transition);
}

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

.forum-spoiler-summary::before {
    content: "▸";
    font-size: 0.75rem;
    color: var(--fg3);
    transition: transform 0.2s ease;
}

.forum-spoiler[open] .forum-spoiler-summary::before {
    transform: rotate(90deg);
}

.forum-spoiler-summary:hover {
    background: var(--bg3);
}

.forum-spoiler-body {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.92rem;
    line-height: 1.7;
    animation: spoiler-in 0.2s ease;
}

@keyframes spoiler-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.forum-toolbar {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.35rem 0.5rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
    flex-wrap: wrap;
    -webkit-overflow-scrolling: touch;
}

.forum-toolbar+.form-input,
.forum-toolbar+textarea {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.forum-toolbar-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 3px;
    padding: 0.2rem 0.45rem;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.82rem;
    color: var(--fg2);
    transition: all var(--transition);
    line-height: 1.4;
}

.forum-toolbar-btn:hover {
    background: var(--bg3);
    border-color: var(--border);
    color: var(--fg);
}

.forum-toolbar-sep {
    width: 1px;
    height: 16px;
    background: var(--border);
    margin: 0 0.2rem;
    flex-shrink: 0;
}

.forum-preview-box {
    display: none;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 1rem;
    background: var(--bg2);
    min-height: 80px;
    line-height: 1.75;
    font-size: 0.93rem;
}

.forum-editor-hint {
    margin-bottom: 0.35rem;
    line-height: 1.5;
}

.forum-editor-hint code {
    font-family: var(--font-mono);
    font-size: 0.82em;
    background: var(--bg3);
    padding: 0.05rem 0.3rem;
    border-radius: 3px;
}

.forum-reply-box {
    margin-top: 2rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
}

.forum-reply-box h3 {
    font-size: 1rem;
    margin-bottom: 0.6rem;
}

.forum-reply-input {
    resize: vertical;
    min-height: 120px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.forum-pager {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.forum-locked-notice {
    margin-top: 1.5rem;
    padding: 0.85rem 1.25rem;
    border-left: 3px solid var(--fg3);
    background: var(--bg2);
    color: var(--fg2);
    font-size: 0.9rem;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.forum-empty {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--fg3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

a.forum-category-card,
a.forum-thread-item {
    display: block;
    text-decoration: none;
    color: inherit;
}

.admin-tab {
    cursor: pointer;
    color: var(--fg3);
    transition: all var(--transition);
    font-weight: normal;
    background: none !important;
}

.admin-tab:hover {
    color: var(--fg);
}

.admin-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent) !important;
}

.admin-tab-content {
    transition: opacity var(--transition);
}

.admin-tab-content.hidden {
    display: none;
}

.admin-actions {
    display: flex;
    gap: 0.5rem;
}

.admin-actions button {
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
}

td.admin-actions {
    white-space: nowrap;
}

td.admin-actions .btn {
    padding: 0.2rem 0.55rem;
    font-size: 0.8rem;
}

.admin-main-tab {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--fg3);
    padding: 0.65rem 1.5rem 0.65rem 0;
    margin-right: 0.5rem;
    border-bottom: 2px solid transparent;
    transition:
        color var(--transition),
        border-color var(--transition);
}

.admin-main-tab:hover {
    color: var(--fg);
}

.admin-main-tab.active {
    color: var(--fg);
    border-bottom-color: var(--fg);
}

.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
}

.status-dot.active {
    background: var(--success);
}

.status-dot.inactive {
    background: var(--danger);
}

tr.user-inactive td {
    opacity: 0.5;
}

.badge-admin {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border: 1px solid var(--accent);
    border-radius: 2px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    vertical-align: middle;
    margin-left: 0.35rem;
}

.role-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid currentColor;
}

.role-admin {
    color: #8b0000;
    border-color: #8b0000;
}

.role-moderator {
    color: #4169e1;
    border-color: #4169e1;
}

.role-creator {
    color: #b8860b;
    border-color: #b8860b;
}

.role-user {
    color: var(--fg3);
    border-color: var(--fg3);
}

td .form-select {
    display: inline-block;
    width: auto;
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
}

.format-suggestion {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.25rem 0.7rem;
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--fg2);
    cursor: pointer;
    transition: all var(--transition);
    min-height: 40px;
}

.format-suggestion:hover {
    background: var(--bg3);
    color: var(--fg);
}

.format-suggestion.selected {
    background: var(--accent);
    color: var(--accent-inv);
    border-color: var(--accent);
}

.announcements-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    margin: 0;
}

.announcement {
    padding: 1.5rem;
    border-radius: var(--radius);
    border-left: 4px solid;
    animation: slide-in 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.announcement-body {
    flex: 1;
}

.announcement-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
    padding: 0;
    opacity: 0.6;
    transition: opacity var(--transition);
}

.announcement-close:hover {
    opacity: 1;
}

.announcement.info {
    background: #e3f2fd;
    border-left-color: #1976d2;
    color: #0d47a1;
}

.announcement.success {
    background: #e8f5e9;
    border-left-color: #388e3c;
    color: #1b5e20;
}

.announcement.warning {
    background: #fff3e0;
    border-left-color: #f57c00;
    color: #e65100;
}

[data-theme="dark"] .announcement.info {
    background: #1a3a52;
    border-left-color: #64b5f6;
    color: #b3e5fc;
}

[data-theme="dark"] .announcement.success {
    background: #1b3a1b;
    border-left-color: #81c784;
    color: #c8e6c9;
}

[data-theme="dark"] .announcement.warning {
    background: #4a3a2a;
    border-left-color: #ffb74d;
    color: #ffe0b2;
}

.announcement.featured {
    padding: 2rem;
    font-size: 1.05rem;
    border: 2px solid;
    border-left-width: 6px;
    background-image: linear-gradient(135deg,
            rgba(0, 0, 0, 0.02) 0%,
            rgba(0, 0, 0, 0) 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .announcement.featured {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.announcement.featured.info {
    border-color: #1976d2;
    background-color: #e3f2fd;
}

.announcement.featured.success {
    border-color: #388e3c;
    background-color: #e8f5e9;
}

.announcement.featured.warning {
    border-color: #f57c00;
    background-color: var(--bg) 3;
}

[data-theme="dark"] .announcement.featured.info {
    background-color: #1a3a52;
}

[data-theme="dark"] .announcement.featured.success {
    background-color: #1b3a1b;
}

[data-theme="dark"] .announcement.featured.warning {
    background-color: #4a3a2a;
}

.announcement-title {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.announcement-text {
    line-height: 1.5;
    margin: 0;
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.daily-solved-msg {
    color: var(--success);
}

.daily-problem-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    overflow-wrap: anywhere;
}

.daily-problem-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.daily-badge {
    display: inline-block;
    background: var(--accent);
    color: var(--bg);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    margin-bottom: 0.4rem;
    letter-spacing: 0.04em;
}

.daily-problem-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0.25rem 0 0.2rem;
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

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

.text-sm {
    font-size: 0.85rem;
}

.text-center {
    text-align: center;
}

.mt-sm {
    margin-top: 0.75rem;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.flex-col {
    flex-direction: column;
}

.play-submenu {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition:
        max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.play-submenu.open {
    max-height: 500px;
    opacity: 1;
}

.action-subcard {
    border-left: 3px solid var(--accent);
    margin-left: 16px;
}

.action-subcard h3 {
    font-size: 17px;
}

.ranked-lock {
    font-size: 13px;
    opacity: 0.6;
}

#leaderboardCard {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

#leaderboardCard.pushed-down {
    transform: translateY(4px);
}

.submission-item {
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border);
    margin-bottom: 0.4rem;
    background: var(--bg);
}

.submission-title {
    font-weight: 500;
    font-size: 0.88rem;
}

.submission-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.status-pending {
    color: var(--warning, #f59e0b);
    font-size: 0.8rem;
}

.status-approved {
    color: var(--success);
    font-size: 0.8rem;
}

.status-rejected {
    color: var(--danger);
    font-size: 0.8rem;
}

.submission-note {
    color: var(--fg3);
    margin-top: 0.3rem;
    font-style: italic;
}

.dailies-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 4rem;
}

.dailies-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dailies-title {
    font-family: "Playfair Display", serif;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
}

.dailies-sub {
    color: var(--fg3);
    font-size: 0.88rem;
    margin: 0;
}

.streak-card {
    max-width: 240px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card);
    flex-shrink: 0;
    transition:
        box-shadow 0.2s,
        border-color 0.2s;
}

.streak-card.active {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

.streak-flame {
    font-size: 2rem;
    line-height: 1;
}

.streak-num {
    font-family: "Playfair Display", serif;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
    color: var(--fg);
}

.streak-lbl {
    font-size: 0.72rem;
    color: var(--fg3);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.cal-section-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--fg3);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.cal-grid {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    -webkit-overflow-scrolling: touch;
}

.cal-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.cal-day {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 500;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--fg2);
    cursor: pointer;
    transition:
        background 0.15s,
        border-color 0.15s,
        transform 0.1s;
    user-select: none;
}

.cal-day:hover:not(.no-problem) {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.cal-day.solved {
    background: var(--success, #22c55e);
    border-color: var(--success, #22c55e);
    color: var(--bg);
}

.cal-day.today {
    border-color: var(--accent);
    font-weight: 700;
}

.cal-day.selected {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

.cal-day.no-problem {
    opacity: 0.3;
    cursor: default;
}

.cal-day-lbl {
    font-size: 0.62rem;
    color: var(--fg3);
    white-space: nowrap;
}

.section-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.75rem 0 1.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--fg3);
    font-weight: 500;
}

.section-divider hr {
    flex: 1;
    border: none;
    border-top: 1px solid var(--border);
}

.archive-panel {
    margin-bottom: 1rem;
    animation: fadeSlideIn 0.18s ease;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.archive-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.archive-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--fg3);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0.2rem 0.4rem;
}

.archive-close:hover {
    color: var(--fg);
}

.biblio-wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

.biblio-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.biblio-title {
    font-family: "Playfair Display", serif;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.1;
    color: var(--fg);
    margin: 0;
}

.biblio-title span {
    color: var(--accent);
}

.biblio-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 2rem;
    -webkit-overflow-scrolling: touch;
}

.biblio-tab {
    padding: 0.55rem 1.1rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--fg3);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition:
        color 0.15s,
        border-color 0.15s;
    font-family: inherit;
    min-height: 40px;
}

.biblio-tab:hover {
    color: var(--fg);
}

.biblio-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.biblio-panel {
    display: none;
}

.biblio-panel.active {
    display: block;
}

.biblio-notes-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card);
}

.hist-section-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--fg3);
    font-weight: 600;
    margin: 1.5rem 0 0.6rem;
}

.hist-summary {
    font-size: 0.85rem;
    color: var(--fg3);
    margin-bottom: 1.25rem;
}

.hist-summary strong {
    color: var(--fg);
}

.hist-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card);
    margin-bottom: 0.6rem;
    overflow: hidden;
    transition: border-color 0.15s;
}

.hist-card:hover {
    border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
}

.hist-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.1rem;
    cursor: pointer;
    user-select: none;
}

.hist-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.hist-status-dot.solved {
    background: var(--success, #22c55e);
}

.hist-status-dot.failed {
    background: var(--danger, #ef4444);
}

.hist-card-info {
    flex: 1;
    min-width: 0;
}

.hist-card-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--fg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hist-card-meta {
    font-size: 0.73rem;
    color: var(--fg3);
    margin-top: 0.15rem;
}

.hist-card-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.hist-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.hist-badge.solved {
    background: color-mix(in srgb, var(--success, #22c55e) 15%, transparent);
    color: var(--success, #22c55e);
}

.hist-badge.failed {
    background: color-mix(in srgb, var(--danger, #ef4444) 12%, transparent);
    color: var(--danger, #ef4444);
}

.hist-expand-icon {
    font-size: 0.85rem;
    color: var(--fg3);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.hist-card.open .hist-expand-icon {
    transform: rotate(90deg);
}

.hist-card-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hist-card.open .hist-card-body {
    max-height: 1200px;
}

.hist-card-body-inner {
    padding: 0 1.1rem 1.1rem;
    border-top: 1px solid var(--border);
}

.hist-enonce {
    margin: 0.9rem 0 0.6rem;
    font-size: 0.93rem;
    line-height: 1.7;
    color: var(--fg);
}

.hist-answer-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 0 0.35rem;
    flex-wrap: wrap;
}

.hist-answer-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--fg3);
    font-weight: 600;
}

.hist-answer-value {
    font-family: "Playfair Display", serif;
    font-size: 0.95rem;
    color: var(--success, #22c55e);
    font-weight: 700;
}

.hist-correction-block {
    margin-top: 0.9rem;
    padding: 0.85rem 1.5rem;
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 6%, var(--bg));
    border-left: 3px solid var(--accent);
}

.hist-correction-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.hist-correction-text {
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--fg2);
}

.hist-no-correction {
    font-size: 0.8rem;
    color: var(--fg3);
    font-style: italic;
    margin-top: 0.75rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--fg3);
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.88rem;
    margin: 0;
}

.skeleton-line {
    height: 14px;
    border-radius: 4px;
    background: var(--border);
    margin-bottom: 0.5rem;
    animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.auth-prompt {
    text-align: center;
    padding: 2.5rem 1rem;
    border: 1px var(--border);
    border-radius: 12px;
}

.auth-prompt p {
    font-size: 0.9rem;
    color: var(--fg3);
    margin: 0 0 1rem;
}

.chat-widget {
    position: fixed;
    bottom: 15px;
    right: 18px;
    width: 260px;
    z-index: 50;
}

.chat-widget-inner {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.chat-widget-header {
    padding: 0.45rem 0.7rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg3);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--fg3);
}

.chat-toggle-btn:hover {
    color: var(--fg);
}

.chat-messages {
    height: 140px;
    overflow-y: auto;
    padding: 0.55rem;
    font-size: 0.78rem;
}

.chat-input-row {
    display: flex;
    gap: 0.35rem;
    padding: 0.45rem;
    border-top: 1px solid var(--border);
}

.chat-input {
    flex: 1;
    font-size: 0.78rem;
    padding: 0.35rem 0.55rem;
}

.chat-send-btn {
    padding: 0.35rem 0.55rem;
}

.chat-empty {
    font-size: 0.78rem;
}

.chat-msg {
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.chat-msg-author {
    font-weight: 600;
    color: var(--fg2);
}

.chat-msg-me {
    color: var(--accent);
}

.chat-msg-time {
    font-size: 0.72rem;
    margin-left: 0.3rem;
}

.chat-msg-text {
    color: var(--fg2);
    word-break: break-word;
}

.friends-search-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.friends-search-list {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.friends-section {
    margin-top: 1.25rem;
}

.friends-section-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--fg3);
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
}

.friend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg2);
    margin-bottom: 0.4rem;
    gap: 0.5rem;
}

.friend-item:last-child {
    margin-bottom: 0;
}

.friend-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.friend-actions {
    display: flex;
    gap: 0.4rem;
}

.friend-name-cell {
    cursor: pointer;
    flex: 1;
}

.friend-row-new {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.1s;
}

.friend-row-new:hover {
    background: var(--bg2);
}

.friend-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--fg2);
    flex-shrink: 0;
}

.online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
}

#friendsModal .modal-box {
    background: var(--bg);
}

#submitProblemModal .modal-box {
    max-width: 600px;
}

#submitProblemModal textarea.form-input {
    resize: vertical;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    line-height: 1.6;
    min-height: 90px;
}

#submitProblemModal .form-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--fg2);
    letter-spacing: 0.02em;
}

#submitProblemModal .form-label .text-muted {
    font-weight: 400;
    font-size: 0.75rem;
}

.sp-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.sp-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
}

#legalContent h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--fg);
    margin: 1rem 0 0.35rem;
}

#legalContent h3:first-child {
    margin-top: 0;
}

#legalContent p {
    font-size: 0.88rem;
    line-height: 1.75;
    color: var(--fg2);
}

#legalContent a {
    color: var(--fg);
}

.notes-page-body {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notes-page-body .notes-app--full {
    height: 100vh;
    max-height: 100dvh;
}

.notes-app--full {
    flex: 1 1 auto;
    height: 100vh;
    max-height: 100dvh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notes-app--embed {
    height: min(88vh, 920px);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
}

.notes-shell,
.wb-app {
    display: flex;
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: var(--bg);
}

.notes-sidebar {
    width: 260px;
    min-width: 220px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg2);
    border-right: 1px solid var(--border);
}

.wb-sidebar {
    width: 220px;
    min-width: 180px;
    max-width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    background: var(--bg-card, #f8f8f8);
    overflow: hidden;
    z-index: 10;
}

.notes-sidebar-head,
.wb-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.75rem 0.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.notes-sidebar-title {
    font-family: "Playfair Display", serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--fg);
}

.wb-sidebar-title {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg2, #888);
}

.notes-icon-btn,
.wb-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: none;
    color: var(--fg2);
    cursor: pointer;
    transition:
        background 0.12s,
        color 0.12s;
}

.notes-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-card);
}

.notes-icon-btn:hover,
.wb-icon-btn:hover {
    background: var(--bg3, #ececec);
    color: var(--fg);
}

.notes-icon-btn--danger:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.notes-icon-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.notes-search-wrap {
    padding: 0 0.75rem 0.5rem;
}

.notes-search,
.wb-search {
    width: 100%;
    padding: 0.35rem 0.6rem;
    font-size: 0.82rem;
    font-family: inherit;
    background: var(--bg, #fff);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--fg);
    outline: none;
    transition: border-color 0.15s;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.notes-search {
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    background: var(--bg);
}

.notes-search:focus,
.wb-search:focus {
    border-color: var(--accent, #6366f1);
}

.notes-list,
.wb-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.25rem 0.5rem 0.75rem;
    min-height: 0;
}

.wb-list {
    padding: 0.25rem 0.4rem;
}

.notes-list-item,
.wb-list-item {
    padding: 0.5rem 0.65rem;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.12s;
    margin-bottom: 2px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    user-select: none;
    width: 100%;
}

.notes-embed-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.notes-embed-select {
    background: var(--bg2);
    border: 1px solid var(--border);
    padding: 0.2rem 0.65rem;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.12s;
    margin-bottom: 2px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    user-select: none;
    text-align: center;
    color: var(--fg3);
}

.notes-list-item {
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.2rem;
    border: 1px solid transparent;
    background: none;
}

.notes-list-item:hover,
.wb-list-item:hover {
    background: var(--bg3, #ececec);
}

.notes-list-item.active {
    background: var(--bg-card);
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(var(--accent-rgb, 99, 102, 241), 0.15);
}

.wb-list-item.active {
    background: var(--bg3, #ececec);
    border-left: 2px solid var(--accent, #6366f1);
    padding-left: calc(0.65rem - 2px);
}

.notes-list-item-title,
.wb-list-item-title {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--fg);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.wb-list-item-title {
    font-size: 0.83rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notes-list-item-preview,
.wb-list-item-preview {
    font-size: 0.75rem;
    color: var(--fg3);
    margin-top: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.wb-list-item-preview {
    font-size: 0.74rem;
    color: var(--fg2, #888);
}

.notes-list-item-date {
    font-size: 0.68rem;
    color: var(--fg3);
    margin-top: 0.2rem;
}

.notes-match-badge {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent);
    font-weight: 600;
}

.notes-list-empty {
    font-size: 0.82rem;
    color: var(--fg3);
    text-align: center;
    padding: 1.5rem 0.5rem;
}

.notes-guest-hint,
.wb-guest-hint {
    font-size: 0.72rem;
    color: var(--muted, #aaa);
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--border);
    text-align: center;
    flex-shrink: 0;
}

.notes-guest-hint {
    padding: 0.5rem 1rem 0.75rem;
    margin: 0;
}

.notes-main,
.wb-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    padding: 1rem 0.75rem;
    height: 832px;
}

.notes-empty,
.wb-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    color: var(--fg2, #888);
    user-select: none;
    width: 100%;
}

.notes-empty {
    padding: 2rem;
    text-align: center;
}

.notes-empty h3,
.wb-empty h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--fg);
}

.notes-empty-icon {
    font-size: 2.5rem;
    opacity: 0.35;
    margin-bottom: 0.75rem;
}

.wb-empty p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--fg2);
}

.notes-editor,
.wb-editor {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.notes-editor-top,
.wb-editor-head {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    gap: 0.5rem;
    background: var(--bg-card, #f8f8f8);
}

.notes-editor-top {
    padding: 0.85rem 1.25rem 0.5rem;
}

.notes-title-input,
.wb-title-input,
.wb-editor-head input[type="text"] {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    background: transparent;
    border: none;
    outline: none;
    color: var(--fg);
    min-width: 0;
}

.notes-title-input {
    font-family: "Playfair Display", serif;
    font-size: 1.35rem;
    font-weight: 700;
}

.notes-title-input::placeholder,
.wb-title-input::placeholder,
.wb-editor-head input[type="text"]::placeholder {
    color: var(--fg3);
}

.notes-editor-actions,
.wb-editor-actions {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.notes-save-status {
    font-size: 0.72rem;
    color: var(--fg2, #aaa);
    transition: color 0.2s;
    white-space: nowrap;
    text-align: right;
}

.notes-save-status--saving {
    color: var(--accent);
}

.notes-save-status--dirty {
    color: #f59e0b;
}

.notes-save-status--error {
    color: #ef4444;
}

.wb-bottombar {
    flex-shrink: 0;
    border-top: 1px solid var(--border);
    background: var(--bg-card, #f8f8f8);
}

.wb-toolbar {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    flex-wrap: wrap;
    -webkit-overflow-scrolling: touch;
}

.wb-tool-group {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.wb-toolbar-sep {
    width: 1px;
    height: 22px;
    background: var(--border);
    margin: 0 0.15rem;
    flex-shrink: 0;
}

.wb-tbtn,
.wb-tool-btn,
.wb-size-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.45rem;
    border: 1px solid transparent;
    border-radius: 7px;
    background: none;
    color: var(--fg2, #888);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition:
        background 0.12s,
        border-color 0.12s,
        color 0.12s;
}

.wb-tbtn:hover,
.wb-tool-btn:hover,
.wb-size-btn:hover {
    background: var(--bg3, #ececec);
    border-color: var(--border);
    color: var(--fg);
}

.wb-tbtn.active,
.wb-tool-btn.active,
.wb-size-btn.active {
    background: var(--bg-card, #fff);
    border-color: var(--accent, #6366f1);
    color: var(--accent, #6366f1);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.12);
}

.wb-tool-btn--labeled {
    gap: 0.35rem;
    padding: 0 0.65rem;
    min-width: auto;
}

.wb-tool-btn--labeled span {
    font-size: 0.78rem;
    font-weight: 600;
}

.wb-toolbar-colors {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
}

.wb-color-swatch,
.wb-color-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition:
        transform 0.1s,
        border-color 0.1s;
    outline: none;
    flex-shrink: 0;
}

.wb-color-btn {
    width: 22px;
    height: 22px;
    background: var(--wb-color);
    border-color: var(--border);
}

.wb-color-swatch:hover,
.wb-color-btn:hover {
    transform: scale(1.1);
}

.wb-color-swatch.active {
    border-color: var(--fg, #1e1e1e);
    transform: scale(1.2);
}

.wb-color-btn.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.wb-toolbar-size {
    display: flex;
    align-items: center;
}

.wb-toolbar-size input[type="range"] {
    width: 80px;
    cursor: pointer;
    accent-color: var(--accent, #6366f1);
}

.wb-size-slider {
    width: 64px;
    accent-color: var(--accent);
    cursor: pointer;
}

.wb-zoom-controls {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.wb-zoom-label,
.wb-zoom-value {
    font-size: 0.74rem;
    color: var(--fg2);
    min-width: 40px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.wb-viewport {
    flex: 1 1 auto;
    overflow: hidden;
    position: relative;
    cursor: crosshair;
    background: var(--bg, #fff);
    touch-action: none;
}

.wb-viewport[data-tool="pen"],
.wb-viewport[data-tool="eraser"],
.wb-viewport[data-tool="arrow"] {
    cursor: crosshair;
}

.wb-viewport[data-tool="text"] {
    cursor: text;
}

.wb-viewport[data-tool="select"],
.wb-viewport[data-tool="connect"] {
    cursor: default;
}

.wb-viewport[data-tool="pan"] {
    cursor: grab;
}

.wb-viewport.wb-panning,
.wb-viewport.wb-panning[data-tool="pan"] {
    cursor: grabbing;
}

.wb-surface {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    background-color: var(--wb-surface);
    background-image: radial-gradient(circle,
            var(--wb-grid) 1px,
            transparent 1px);
    background-size: 24px 24px;
    box-shadow: 0 0 0 1px var(--border);
    will-change: transform;
}

.wb-canvas,
#wbCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
    display: block;
}

.wb-texts-layer {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.wb-texts-layer>* {
    pointer-events: auto;
}

.wb-svg-layer {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: visible;
}

.wb-connection-line {
    opacity: 0.85;
}

.wb-connection-active {
    stroke-width: 3;
    opacity: 1;
}

.wb-block {
    position: absolute;
    pointer-events: auto;
    padding: 0.15rem 0.35rem;
    background: transparent;
    border: 1px transparent;
    border-radius: 6px;
    box-sizing: border-box;
    min-width: 44px;
    min-height: 44px;
    max-width: 1000px;
}

.wb-block--paragraph {
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
}

.wb-block--paragraph.wb-block--filled {
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
}

.wb-block-draggable {
    cursor: grab;
}

.wb-block-draggable:active {
    cursor: grabbing;
}

.wb-block-editing {
    padding: 0;
    border-color: var(--accent);
    background: var(--bg-card);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.wb-block-selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.2);
}

.wb-block-connect-from {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.wb-block-content {
    line-height: 1.6;
    word-break: break-word;
    white-space: nowrap;
    text-align: center;
}

.wb-block-input {
    display: block;
    width: 280px;
    min-height: 2.5em;
    max-width: 480px;
    padding: 0.45rem 0.55rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font-family: inherit;
    line-height: 1.55;
    resize: none;
    overflow: hidden;
    text-align: left;
}

.wb-block-input:focus {
    outline: none;
}

.wb-text-block {
    position: absolute;
    min-width: 60px;
    min-height: 24px;
    cursor: move;
    user-select: none;
    outline: none;
    border-radius: 4px;
    transition: box-shadow 0.1s;
}

.wb-text-block.selected {
    box-shadow: 0 0 0 1.5px var(--accent, #6366f1);
}

.wb-text-block textarea {
    display: block;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    font-family: inherit;
    color: inherit;
    width: 100%;
    min-width: 120px;
    line-height: 1.5;
    padding: 2px 4px;
}

.wb-text-content {
    padding: 2px 6px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.wb-paragraphs-panel {
    width: 22%;
    min-width: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border-right: 1px solid var(--border);
    transition:
        width 0.25s ease,
        min-width 0.25s ease;
    overflow: hidden;
}

.wb-paragraphs-panel.collapsed {
    width: 40px;
    min-width: 40px;
    overflow: visible;
}

.wb-paragraphs-panel.collapsed .wb-paragraphs-body,
.wb-paragraphs-panel.collapsed .wb-paragraphs-head h3,
.wb-paragraphs-panel.collapsed .wb-paragraphs-help,
.wb-paragraphs-panel.collapsed .wb-paragraphs-clear-all {
    display: none;
}

.wb-paragraphs-panel.collapsed .wb-paragraphs-toggle {
    position: absolute;
    left: -28px;
    top: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px;
    z-index: 10;
    box-shadow: var(--shadow);
}

.wb-paragraphs-panel.collapsed .wb-paragraphs-head {
    padding: 0;
    justify-content: center;
    height: 40px;
}

.wb-paragraphs-panel.collapsed .wb-paragraphs-head-actions {
    width: 100%;
    justify-content: center;
}

.wb-paragraphs-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.75rem 0.35rem;
    flex-shrink: 0;
}

.wb-paragraphs-head h3 {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--fg2);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wb-paragraphs-head-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.wb-paragraphs-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--fg3);
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}

.wb-paragraphs-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.wb-paragraphs-panel.collapsed .wb-paragraphs-toggle svg {
    transform: rotate(180deg);
}

.wb-paragraphs-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.wb-block-editor {
    padding: 0.5rem 0;
}

.wb-block-row {
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding: 0.15rem 0.75rem 0.15rem 0;
    border-radius: 4px;
    transition: background 0.1s;
    min-height: 1.8em;
}

.wb-block-row--active {
    background: rgba(99, 102, 241, 0.04);
}

.wb-block-row:hover .wb-block-grip {
    opacity: 1;
}

.wb-block-grip {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    min-width: 24px;
    height: 28px;
    color: var(--fg3);
    cursor: grab;
    opacity: 0;
    transition:
        opacity 0.15s,
        color 0.15s;
    flex-shrink: 0;
    user-select: none;
}

.wb-block-grip:hover {
    color: var(--accent);
}

.wb-block-grip:active {
    cursor: grabbing;
}

.wb-block-text {
    flex: 1;
    min-height: 1.5em;
    padding: 0.15rem 0;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--fg);
    outline: none;
    word-break: break-word;
    white-space: pre-wrap;
}

.wb-block-text:empty::before {
    content: attr(placeholder);
    color: var(--fg3);
    pointer-events: none;
}

.wb-block-row--empty .wb-block-grip {
    opacity: 0;
}

.wb-block-row--empty:hover .wb-block-grip {
    opacity: 0.4;
}

.wb-draft-ghost {
    position: fixed;
    z-index: 9999;
    max-width: 220px;
    padding: 0.45rem 0.65rem;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    font-size: 0.75rem;
    color: var(--fg);
    pointer-events: none;
    opacity: 0.92;
}

body.wb-draft-dragging {
    cursor: grabbing;
}

body.wb-draft-dragging * {
    cursor: grabbing !important;
}

.notes-statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 1.25rem 0.45rem;
    font-size: 0.72rem;
    color: var(--fg3);
    border-top: 1px solid var(--border);
}

.notes-kbd-hint {
    opacity: 0.7;
}

.notes-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 8000;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.notes-drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.notes-drawer-root {
    position: relative;
    width: 100vw;
    max-width: 100vw;
    height: 100%;
    background: var(--bg);
    transform: translateX(100%);
    transition: transform 0.25s ease;
}

.notes-drawer-overlay.open .notes-drawer-root {
    transform: translateX(0);
}

.notes-drawer-close {
    position: absolute;
    left: 16px;
    top: 16px;
    z-index: 8100;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--fg2);
    cursor: pointer;
    transition: all 0.15s;
}

.notes-drawer-close:hover {
    border-color: var(--fg);
    color: var(--fg);
    background: var(--bg3);
}

.notes-drawer-close svg {
    transform: rotate(90deg);
}

.notes-shell--drawer {
    height: 100%;
}

body.notes-drawer-open {
    overflow: hidden;
}

.match-scratch-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.5rem 0.65rem;
    font-size: 0.82rem;
    font-family: inherit;
    font-weight: 500;
    color: var(--fg2);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    max-width: 10rem;
}

.match-scratch-btn:hover {
    border-color: var(--accent, #6366f1);
    color: var(--accent, #6366f1);
    background: var(--bg3);
}

.pa-bar-wrap {
    margin: 1.2rem 0;
}

.pa-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}

.pa-bar {
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    overflow: hidden;
}

.pa-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-text-info), #a78bfa);
    border-radius: 5px;
    transition: width 0.8s ease;
}

.pa-flash {
    position: fixed;
    top: 200px;
    right: 200px;
    font-size: 1.5rem;
    font-weight: 600;
    color: #a78bfa;
    animation: pa-float 1.8s ease forwards;
    pointer-events: none;
    z-index: 999;
}

@keyframes pa-float {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-40px);
    }
}

.pa-counter {
    font-size: 0.8rem;
    color: var(--fg3);
    margin-top: 0.3rem;
}

.pa-counter span {
    font-weight: 600;
    color: #a78bfa;
}

/* ── Game Feel Additions ── */

.screen-flash {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    animation: screen-flash-in 0.4s ease forwards;
}

.screen-flash.success {
    background: rgba(39, 174, 96, 0.22);
}

.screen-flash.danger {
    background: rgba(192, 57, 43, 0.22);
}

.combo-badge {
    position: fixed;
    top: 42%;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 2.4rem;
    font-weight: 900;
    color: #f59e0b;
    text-shadow: 0 2px 18px rgba(245, 158, 11, 0.6);
    pointer-events: none;
    z-index: 9998;
    animation: combo-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    white-space: nowrap;
}

.particle {
    position: fixed;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9997;
    animation: particle-fly 0.65s ease-out forwards;
}

.life.losing {
    animation: life-pop 0.38s ease forwards;
}

.prematch-countdown.animated {
    animation: countdown-zoom 0.9s ease forwards;
}

@media (min-width: 769px) {

    .left-col,
    .right-col,
    .main-layout,
    main {
        min-width: 0;
    }

    #page-home main {
        grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr);
        row-gap: 1.5rem;
    }

    #page-home .social-bar {
        grid-column: 1 / -1;
        width: 100%;
        margin: 0;
    }

    #page-home .left-col {
        grid-column: 1;
    }

    #page-home .right-col {
        grid-column: 2;
    }

    nav .nav-links {
        flex-wrap: nowrap;
    }

    nav .btn-create {
        white-space: nowrap;
    }

    .nav-links [data-show-auth],
    .nav-links [data-show-user] {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
    }

    .leaderboard-table-wrap,
    .biblio-panel,
    .archive-panel {
        overflow-x: visible;
    }
}

@media (max-width: 768px) {
    html {
        -webkit-text-size-adjust: 100%;
    }

    body {
        overflow-x: hidden;
        padding-bottom: 56px;
    }

    /* Navbar mobile */
    .navbar {
        height: 60px;
        padding: 0 16px;
    }

    /* Logo centré sur mobile */
    .navbar-logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        font-size: 13px;
    }

    /* Afficher le menu hamburger */
    .navbar-hamburger {
        display: flex;
        margin-left: auto;
    }

    /* Masquer le menu desktop */
    .navbar-menu {
        display: none;
    }

    #app {
        grid-template-columns: 1fr;
    }

    .nav-vertical {
        display: none;
    }

    #mobileNav {
        display: flex !important;
    }

    .modal-box {
        max-width: 100%;
    }

    .hamburger-btn {
        display: block;
    }

    .nav-mobile.open {
        display: flex !important;
    }

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

    .right-panel {
        display: none;
    }

    .main-layout>main {
        padding: 1rem;
    }

    .sidebar {
        display: none !important;
    }

    .content {
        padding: 1rem;
        flex: 1;
    }

    .streak-label {
        display: none;
    }

    main,
    .main-layout>main {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        max-width: 100%;
        padding: 1rem;
        gap: 1rem;
        align-items: stretch;
    }

    .left-col,
    .right-col {
        min-width: 0;
        padding: 0;
        border: 0;
    }

    .left-col {
        order: 1;
        margin-bottom: 3rem;
    }

    .right-col {
        order: 2;
        gap: 0.75rem;
        border-top: 1px solid var(--border);
        padding-top: 1rem;
        max-width: 420px;
        margin: 0 auto;
        width: 100%;
    }

    .hero .hero-title,
    .left-col .hero-title {
        display: none;
    }

    ro-sub,
    .hero-sub,
    .left-col .hero-sub {
        margin-top: 3rem;
        margin-bottom: 1rem;
        text-align: center;
    }

    .no-mobile-card {
        display: none;
    }

    .hero {
        padding: 0.5rem 0 0.75rem;
        text-align: center;
    }

    .match-arena-wrap {
        padding: 0.5rem 0.65rem 0;
        max-width: 100% !important;
    }

    .action-grid {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
    }

    .action-grid>.action-card p {
        display: none;
    }

    .home-stats {
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
    }
}

.action-subcard {
    margin-left: 0;
    text-align: center;
}

.action-subcard h3 {
    font-size: 0.9rem;
}

.action-subcard p {
    display: block !important;
    font-size: 0.72rem !important;
    line-height: 1.35;
    opacity: 0.85;
}

.action-card {
    padding: 0.85rem 1rem;
    text-align: center;
}

.action-card h3,
.action-card-play h3 {
    font-size: 0.95rem;
    line-height: 1.2;
    margin: 0;
}

.action-card-play {
    padding: 1rem;
    text-align: center;
}

.action-card-play p {
    display: block !important;
    font-size: 0.8rem !important;
    margin-top: 0.25rem;
}

.btn-lg {
    width: 100%;
    justify-content: center;
}

h1 {
    font-size: 1.4rem;
    text-align: center;
}

h2 {
    font-size: 1.05rem;
    text-align: center;
}

.social-bar {
    display: none !important;
}

.section-label {
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.section-label h2 {
    min-width: 0;
    font-size: 1.05rem;
    line-height: 1.2;
    text-align: center;
}

.streak-badge {
    margin-left: 0;
    flex-shrink: 0;
}

table {
    font-size: 0.8rem;
    min-width: 420px;
}

th,
td {
    padding: 0.4rem 0.5rem;
}

table th:nth-child(5),
table td:nth-child(5),
table th:nth-child(6),
table td:nth-child(6) {
    display: none;
}

.leaderboard-main {
    padding: 1rem;
    max-width: 540px;
    margin: 0 auto;
}

.leaderboard-table-wrap {
    margin: 0 -0.25rem;
    padding-bottom: 0.25rem;
}

.leaderboard-table-wrap table {
    min-width: 360px;
}

.stats-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 420px;
    margin: 0 auto;
}

.answer-row {
    flex-direction: column;
    align-items: stretch;
}

.answer-input {
    width: 100%;
    font-size: 16px;
}

.answer-row .btn-validate,
.answer-row .btn {
    width: 100%;
    justify-content: center;
}

.btn {
    font-size: 0.88rem;
    padding: 0.6rem 1.1rem;
}

#toast {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
}

.toast-item {
    max-width: none;
    border-radius: 8px;
}

.modal-overlay {
    padding: 0;
    align-items: flex-end;
    z-index: 210;
}

.modal-box,
.modal-box-md,
.modal-box-sm,
#friendsModal .modal-box,
#submitProblemModal .modal-box {
    width: 100%;
    max-width: 50%;
    max-height: min(88vh, 720px);
    margin: 0;
    padding: 1rem;
    border-radius: 12px 12px 0 0;
    overflow-y: auto;
}

.auth-tabs-row,
.pm-tabs-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sp-grid-2,
.sp-grid-3 {
    grid-template-columns: 1fr;
}

.match-arena {
    grid-template-columns: 1fr;
    min-height: auto;
}

.match-panel {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.match-center {
    border-left: none;
    border-right: none;
    padding: 1rem;
}

.match-arena-wrap {
    padding: 0.5rem 0.65rem 0;
    max-width: 50%;
}

.match-header {
    margin-bottom: 0.75rem;
}

.match-timer-center {
    text-align: center;
    order: 0;
}

.timer {
    font-size: 1.15rem;
    font-weight: 700;
}

.match-progress-bar {
    width: 80px;
    margin: 2px auto 0;
}

.match-opp-info {
    text-align: right;
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-opp-info strong {
    display: block;
    font-size: 0.8rem;
}

.match-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
}

.match-sidebar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.4rem;
    flex-wrap: nowrap;
    justify-content: space-between;
}

.match-sidebar-label {
    display: none;
}

#probSelector {
    display: flex;
    flex-direction: row;
    gap: 0.35rem;
    flex: 1;
}

.prob-btn {
    flex: 1;
    padding: 0.35rem 0.4rem;
    font-size: 0.75rem;
    margin-bottom: 0;
    justify-content: center;
    gap: 0.25rem;
}

.match-sidebar .match-sidebar-divider,
.match-sidebar>.text-muted,
.match-sidebar .my-solved-count {
    display: none;
}

.match-forfeit-btn {
    margin-top: 0;
    width: auto;
    padding: 0.3rem 0.65rem;
    font-size: 0.72rem;
    flex-shrink: 0;
}

#problemArea {
    min-height: 0;
}

.problem-display {
    padding: 0.85rem;
    font-size: 1rem;
    margin: 0 0 0.6rem;
}

#problemArea .btn-validate,
#problemArea button.btn-primary,
.match-arena-wrap .btn-validate {
    width: 50%;
    padding: 0.65rem;
    font-size: 0.9rem;
}

.match-arena-wrap~footer,
#page-match footer {
    display: none !important;
}

body:has(.match-arena-wrap) footer {
    display: none !important;
}

body:has(#page-match.active) {
    padding-bottom: 0;
}

.chat-widget {
    position: fixed !important;
    bottom: 0 !important;
    right: 0 !important;
    left: 0 !important;
    width: 100% !important;
    border-radius: 0 !important;
    z-index: 60;
    display: none !important;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.chat-widget.chat-mobile-open {
    display: block !important;
}

.chat-widget-inner {
    border-radius: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
}

.chat-widget-header {
    padding: 0.5rem 0.85rem;
    font-size: 0.75rem;
}

.chat-widget.chat-mobile-open #chatCollapsible {
    display: block !important;
}

.chat-messages {
    height: 140px;
}

.chat-input-row {
    padding-bottom: calc(0.45rem + env(safe-area-inset-bottom, 8px));
}

.chat-fab {
    position: fixed !important;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px)) !important;
    right: 1rem !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    background: var(--ink) !important;
    color: var(--bg) !important;
    border: none !important;
    font-size: 1.1rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 61 !important;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25) !important;
    transition: transform 0.15s !important;
}

.chat-fab:active {
    transform: scale(0.92) !important;
}

.chat-fab.hidden {
    display: none !important;
}

#page-match .match-arena-wrap {
    padding-bottom: 5rem;
}

.result-actions {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.result-actions .btn {
    width: 100%;
    justify-content: center;
}

.result-title {
    font-size: 1.8rem;
}

.elo-delta {
    font-size: 1.4rem;
}

.result-stats-grid {
    width: 100%;
}

.prematch-screen {
    min-height: 50vh;
    gap: 1.25rem;
}

.prematch-players {
    gap: 1rem;
}

.prematch-countdown {
    font-size: 2.5rem;
}

.matchmaking-screen {
    min-height: 50vh;
    gap: 1.25rem;
}

.leaderboard-main,
.biblio-wrap,
.dailies-wrap,
.profile-wrap,
.forum-content {
    width: 100%;
    max-width: 70%;
    padding: 1rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-bottom: calc(2.5rem + env(safe-area-inset-bottom));
}

.leaderboard-table-wrap,
.forum-post-content,
.archive-panel,
.biblio-panel {
    max-width: 100%;
    overflow-x: auto;
}

.biblio-hero,
.dailies-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.biblio-hero p,
.dailies-header p {
    display: none;
}

.biblio-title,
.dailies-title {
    font-size: 1.5rem;
    line-height: 1.1;
    text-align: center;
    margin: 0;
    font-weight: 600;
}

.biblio-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin-inline: -1rem;
    padding-inline: 1rem;
    justify-content: center;
}

.biblio-tabs::-webkit-scrollbar {
    display: none;
}

.biblio-tab {
    flex: 0 0 auto;
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
}

.biblio-notes-cta {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem;
}

.biblio-notes-cta p {
    display: none;
}

.biblio-notes-cta .btn-cta,
.biblio-notes-cta .btn {
    width: 100%;
    text-align: center;
}

.cal-grid {
    overflow-x: auto;
    padding-bottom: 0.4rem;
    justify-content: center;
}

.streak-card {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    justify-content: center;
}

.hist-section-title {
    text-align: center;
    margin-top: 1.25rem;
}

.hist-summary {
    text-align: center;
    font-size: 0.82rem;
}

.hist-card {
    border-radius: 10px;
}

.hist-card-header {
    padding: 0.75rem 0.85rem;
}

.hist-card-title {
    font-size: 0.88rem;
}

.hist-card-meta {
    font-size: 0.7rem;
}

.hist-badge {
    font-size: 0.68rem;
    padding: 0.15rem 0.45rem;
}

.cal-section-label {
    text-align: center;
    font-size: 0.7rem;
}

.section-divider {
    text-align: center;
}

.section-divider span {
    font-size: 0.85rem;
}

.profile-back {
    margin-bottom: 1.25rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.profile-hero {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.profile-hero-info {
    min-width: 0;
}

.profile-avatar-lg {
    width: 60px;
    height: 60px;
    font-size: 1.35rem;
}

.profile-name {
    font-size: 1.65rem;
    word-break: break-word;
}

.profile-own-actions {
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
    width: 100%;
    gap: 0.5rem;
}

.profile-own-actions .btn-validate,
.profile-own-actions .btn-create {
    width: 100%;
    text-align: center;
    min-height: 44px;
}

.profile-stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.profile-stat-card {
    padding: 0.85rem 0.5rem;
}

.profile-stat-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border);
}

.profile-stat-val {
    font-size: 1.65rem;
}

.pm-opp {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.forum-cat-stats {
    display: none;
}

.forum-thread-item-meta {
    display: none;
}

.forum-post {
    flex-direction: column;
}

.forum-post-sidebar {
    width: 100%;
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.75rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 1rem;
}

.forum-post-stats {
    flex-direction: row;
}

footer {
    min-height: 52px;
    height: auto;
    padding: 0.75rem max(1rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    justify-content: center;
    gap: 0.75rem;
    font-size: 0.7rem;
    flex-wrap: wrap;
}

footer a {
    font-size: 0.7rem;
    white-space: nowrap;
}

.notes-shell,
.wb-app {
    flex-direction: column;
}

.notes-sidebar {
    width: 100%;
    max-height: 32vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
}

.wb-sidebar {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0.25rem 0.5rem;
    gap: 0.4rem;
    overflow-x: auto;
    overflow-y: hidden;
    flex-shrink: 0;
}

.wb-sidebar-head {
    flex-shrink: 0;
    border-bottom: none;
    padding: 0;
}

.wb-sidebar-title {
    display: none;
}

.wb-search {
    margin: 0;
    flex: 1 1 auto;
    min-width: 80px;
}

.wb-list {
    display: flex;
    flex-direction: row;
    gap: 0.3rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
    flex: 1 1 auto;
    scrollbar-width: none;
}

.wb-list::-webkit-scrollbar {
    display: none;
}

.wb-list-item {
    flex-direction: row;
    align-items: center;
    padding: 0.3rem 0.6rem;
    margin-bottom: 0;
    white-space: nowrap;
    flex-shrink: 0;
    gap: 0.35rem;
    border-left: none;
    border-bottom: 2px solid transparent;
}

.wb-list-item.active {
    border-left: none;
    border-bottom: 2px solid var(--accent, #6366f1);
    padding-left: 0.6rem;
}

.wb-list-item-preview {
    display: none;
}

.wb-guest-hint {
    display: none;
}

.wb-paragraphs-panel {
    width: 100%;
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
    order: 3;
}

.wb-paragraphs-panel.collapsed {
    width: 100%;
    max-height: 40px;
}

.wb-paragraphs-panel.collapsed .wb-paragraphs-head {
    padding: 0.5rem 0.75rem;
}

.wb-paragraphs-panel.collapsed .wb-paragraphs-head h3 {
    display: block;
}

.wb-toolbar {
    padding: 0.3rem 0.5rem;
    gap: 0.2rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
}

.wb-toolbar::-webkit-scrollbar {
    display: none;
}

.wb-toolbar-sep {
    display: none;
}

.wb-toolbar-size input[type="range"] {
    width: 60px;
}

.wb-color-swatch {
    width: 18px;
    height: 18px;
}

.wb-tbtn,
.wb-tool-btn,
.wb-size-btn {
    min-width: 28px;
    height: 28px;
    padding: 0 0.3rem;
}

.notes-app--full,
.notes-app--embed {
    height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
}

.notes-page-body {
    height: 100dvh;
    padding-bottom: 0;
}

.notes-page-body nav {
    flex-shrink: 0;
}

.notes-page-body .notes-app--full {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
}

.notes-kbd-hint {
    display: none;
}

.notes-drawer-root {
    width: 100vw;
}

#page-profile {
    overflow-x: hidden;
    width: 100%;
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    /* Navbar encore plus compacte sur très petits écrans */
    .navbar {
        height: 56px;
        padding: 0 12px;
    }

    .navbar-logo {
        font-size: 12px;
        letter-spacing: 0.12em;
    }

    .navbar-hamburger {
        width: 36px;
        height: 36px;
    }

    .hamburger-line {
        width: 18px;
    }

    /* Menu mobile plus étroit */
    .navbar-mobile {
        width: 260px;
    }

    .navbar-mobile-header {
        padding: 16px;
    }

    .navbar-mobile-title {
        font-size: 14px;
    }

    .navbar-mobile-content {
        padding: 20px 16px;
    }

    .navbar-mobile-btn,
    .navbar-mobile-link {
        padding: 12px 14px;
        font-size: 13px;
    }

    main,
    .main-layout>main,
    .leaderboard-main,
    .biblio-wrap,
    .dailies-wrap,
    .profile-wrap,
    .forum-content {
        padding-inline: 0.85rem;
        max-width: 100%;
    }

    .hero-title,
    .left-col .hero-title {
        font-size: 1.5rem;
    }

    .dailies-title {
        font-size: 1.35rem;
    }

    .biblio-title {
        font-size: 1.35rem;
    }

    .home-stats,
    .profile-stats-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sp-grid-2,
    .sp-grid-3 {
        grid-template-columns: 1fr;
    }

    .problem-card,
    .daily-problem-card {
        padding: 0.85rem;
        margin-bottom: 1rem;
    }

    .modal-box,
    .modal-box-md,
    .modal-box-sm,
    #friendsModal .modal-box,
    #submitProblemModal .modal-box {
        padding: 0.9rem 0.85rem;
    }

    table {
        min-width: 360px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stat-box {
        padding: 0.75rem;
    }

    .card {
        padding: 0.85rem;
        margin-bottom: 0.65rem;
    }

    .card-sm {
        padding: 0.6rem 0.75rem;
    }

    .form-input,
    .form-select {
        font-size: 16px;
    }

    .cal-day {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    .cal-grid {
        gap: 0.3rem;
        justify-content: center;
    }

    .biblio-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-name {
        font-size: 1.4rem;
    }

    .profile-stat-val {
        font-size: 1.45rem;
    }

    .profile-stat-lbl {
        font-size: 0.62rem;
        letter-spacing: 0.05em;
    }

    .profile-badges-row {
        gap: 0.35rem;
    }

    .profile-elo-chip {
        font-size: 0.75rem;
        padding: 2px 8px;
    }

    .profile-since {
        font-size: 0.75rem;
    }

    .nav-mobile {
        max-width: none;
        width: 100%;
    }

    .nav-links-vertical a {
        padding: 0.5rem 0.5rem;
        font-size: 0.85rem;
    }

    .nav-mobile .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }

    .btn-sm {
        padding: 0.25rem 0.6rem;
        font-size: 0.75rem;
    }

    #toast {
        bottom: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
        gap: 0.3rem;
    }

    .toast-item {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 390px) {
    .profile-stat-lbl {
        font-size: 0.58rem;
    }

    .timer {
        font-size: 1rem;
    }

    .prob-btn {
        font-size: 0.7rem;
        padding: 0.3rem 0.35rem;
    }

    .problem-display {
        font-size: 0.93rem;
        padding: 0.65rem;
    }

    .match-arena-wrap {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .match-header>div:first-child,
    .match-opp-info {
        font-size: 0.72rem;
    }

    .leaderboard-table-wrap th:nth-child(5),
    .leaderboard-table-wrap td:nth-child(5) {
        display: none;
    }

    .leaderboard-main {
        padding: 1rem;
    }
}