@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;600;700&family=Share+Tech+Mono&display=swap');

/* Socle commun (variables, boutons, overlays) + styles du menu.
   Chargé par index.html ET game.html (équivalent de style.css de punch-reflex). */

:root {
    --bg: #0a0a0b;
    --bg2: #111113;
    --surface: #18181c;
    --surface2: #1e1e24;
    --border: rgba(255, 255, 255, 0.07);

    --text: #e8e8f0;
    --dim: #5a5a6a;
    --accent: #ff1e00;
    --gold: #ffd700;

    --success: #00d4aa;

    --font-display: 'Rajdhani', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

html,
body {
    overscroll-behavior: none;
}

body {
    font-family: var(--font-display);
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    width: 100vw;
    overflow-x: hidden;
}

/* ─── BACK BUTTON ─── */
.pause-btn {
    position: fixed;
    top: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--dim);
    width: 38px;
    height: 38px;
    border-radius: 8px;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    text-decoration: none;
}

.pause-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

/* ─── BUTTONS ─── */
.btn-primary {
    width: 100%;
    padding: 14px;
    margin: 8px 0 0;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 6px 20px rgba(255, 30, 0, 0.3);
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-secondary {
    width: 100%;
    padding: 11px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
    background: transparent;
    color: var(--dim);
    flex-shrink: 0;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-link {
    display: block;
    text-align: center;
    text-decoration: none;
}

/* ─── OVERLAYS ─── */
.game-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 6, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    backdrop-filter: blur(8px);
}

.game-overlay[style*="flex"] {
    display: flex !important;
}

.overlay-content {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px 28px;
    text-align: center;
    max-width: 360px;
    width: 92%;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
    animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

@keyframes popIn {
    from {
        transform: scale(0.85);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.overlay-content h2 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: 1px;
}

.overlay-text {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--dim);
    line-height: 1.5;
    margin-bottom: 8px;
}

/* ─── MENU PAGE ─── */
.menu-body {
    position: fixed;
    width: 100%;
    height: 100%;
    touch-action: none;
    overflow: hidden;
}

.menu-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 60px 20px 20px;
    gap: 20px;
}

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

.menu-icon {
    font-size: 48px;
    margin-bottom: 8px;
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

.menu-title {
    font-size: clamp(28px, 7vw, 44px);
    font-weight: 700;
    letter-spacing: 3px;
}

.menu-title-pro {
    color: var(--accent);
}

.menu-subtitle {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--dim);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 6px;
}

.menu-note {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--dim);
    opacity: 0.7;
}

.diff-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 420px;
}

.diff-card {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "name best" "desc best";
    align-items: center;
    column-gap: 12px;
    text-align: left;
    width: 100%;
    padding: 16px 20px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.diff-card:hover,
.diff-card:focus-visible {
    border-color: var(--accent);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
    outline: none;
}

.diff-name {
    grid-area: name;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
}

.diff-desc {
    grid-area: desc;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--dim);
}

.diff-best {
    grid-area: best;
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    color: var(--success);
}

.diff-resume {
    display: block;
    margin-top: 3px;
    color: var(--gold);
    font-size: 10px;
    letter-spacing: 1px;
}

/* ─── RÉGLAGES ─── */
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    max-width: 420px;
    padding: 14px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
}

.setting-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.setting-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
}

.setting-sub {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--dim);
}

.switch {
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
    position: relative;
    width: 46px;
    height: 26px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}

.switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s;
}

.switch:checked {
    background: var(--success);
}

.switch:checked::after {
    transform: translateX(20px);
}

.switch:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}
