/* ============================================================
   VARIABLES
   ------------------------------------------------------------
   Variables globales du thème :
   - couleurs
   - panneaux
   - contrôles
   - focus
============================================================ */

:root {
    --gold-solid: #ffd700;
    --gold-strong: #ffea00;

    --border-gold: rgba(255, 215, 0, 0.45);
    --gold-shadow: rgba(255, 215, 0, 0.25);

    --text-main: #ffffff;
    --text-soft: #e0e0e0;
    --text-muted: #aaaaaa;
    --bg-page: #1a1a1a;

    --panel-bg: rgba(10, 10, 10, 0.28);
    --panel-border: 2px solid var(--border-gold);
    --panel-radius: 8px;
    --panel-shadow: 0 0 30px var(--gold-shadow);
    --panel-blur: blur(6px);

    --control-bg: rgba(20, 20, 20, 0.85);
    --control-border: rgba(255, 215, 0, 0.25);
    --control-radius: 7px;
    --control-shadow: 0 0 6px rgba(255, 215, 0, 0.10);
    --control-shadow-hover: 0 0 10px rgba(255, 215, 0, 0.20);
    --control-shadow-focus: 0 0 10px rgba(255, 215, 0, 0.24);

    --focus-ring: 2px solid var(--gold-solid);
    --focus-offset: 2px;

    --font-ui: 'Courier New', monospace;
}

/* ============================================================
   RESET & BASE
============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* outline: 1px solid red; */
}

img,
video {
    display: block;
    max-width: 100%;
    height: auto;
}

html {
    width: 100%;
    max-width: 100%;
    min-height: 100%;
    overflow-x: hidden;
}

body {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    position: relative;
    font-family: var(--font-ui);
    color: var(--text-main);
    background: var(--bg-page);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: url('images/background.jpg');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

a:not(.nav-link),
a:not(.nav-link):link,
a:not(.nav-link):visited,
a:not(.nav-link):hover,
a:not(.nav-link):active {
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

/* ============================================================
   FOCUS CLAVIER
   ------------------------------------------------------------
   On masque le focus standard au clic/touch
   et on garde un focus visible propre au clavier.
============================================================ */

a:focus,
button:focus,
input:focus {
    outline: 2px solid transparent;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
}

/* ============================================================
   UTILITAIRES COMMUNS
============================================================ */

.text-center {
    text-align: center;
    margin-top: 20px;
}

.btn-link {
    color: var(--gold-solid);
    font-size: 18px;
    font-weight: bold;
}

/* ============================================================
   HELPERS VISUELS COMMUNS
   ------------------------------------------------------------
   Ces classes regroupent les styles répétés :
   - panneaux vitrés
   - contrôles dorés
============================================================ */

.container,
.info-card,
.welcome-content,
.hideout-tech-tree-panel,
.trader-card {
    background: var(--panel-bg);
    border: var(--panel-border);
    border-radius: var(--panel-radius);
    box-shadow: var(--panel-shadow);
    backdrop-filter: var(--panel-blur);
    -webkit-backdrop-filter: var(--panel-blur);
}

.level-btn,
.tech-tree-zoom-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    background: var(--control-bg);
    color: var(--text-soft);
    border: 2px solid var(--control-border);
    border-radius: var(--control-radius);
    font-family: var(--font-ui);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--control-shadow);
}

.level-btn:hover,
.tech-tree-zoom-btn:hover {
    border-color: var(--gold-solid);
    color: var(--gold-solid);
    box-shadow: var(--control-shadow-hover);
    transform: translateY(-1px);
}

.level-btn:focus,
.tech-tree-zoom-btn:focus {
    outline: none;
}

.level-btn:focus-visible,
.tech-tree-zoom-btn:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
    border-color: var(--gold-solid);
    box-shadow: var(--control-shadow-focus);
}

.level-btn:active,
.tech-tree-zoom-btn:active {
    transform: scale(0.98);
}

/* ============================================================
   HEADER COMMUN
============================================================ */

.header-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 30px 0;
}

.header-content {
    position: relative;
    width: 95%;
    max-width: 1400px;
    height: 120px;
    padding: 0 40px;
}

/* ============================================================
   BORDURE DÉCORATIVE
============================================================ */

.header-border {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.header-border svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* ============================================================
   NAVIGATION PRINCIPALE
============================================================ */

.header-nav {
    position: absolute;
    inset: 0;
    z-index: 10;
}

.nav-link {
    position: absolute;
    top: 46px;
    white-space: nowrap;
    text-decoration: none;
    color: var(--text-soft);
    font-family: var(--font-ui);
    font-weight: bold;
    text-shadow:
        3px 3px 8px rgba(0, 0, 0, 0.95),
        0 0 15px rgba(0, 0, 0, 0.85);
    transition: color 0.15s ease, text-shadow 0.15s ease;
    outline: none;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
}

.nav-link:link,
.nav-link:visited,
.nav-link:hover,
.nav-link:focus {
    color: var(--text-soft);
    text-decoration: none;
}

.nav-link:focus {
    outline: none;
    box-shadow: none;
}

.nav-link:focus-visible {
    outline: var(--focus-ring);
    outline-offset: 3px;
}

.nav-link:active {
    color: var(--gold-solid);
    text-decoration: none;
    text-shadow:
        3px 3px 10px rgba(0, 0, 0, 0.95),
        0 0 10px rgba(255, 215, 0, 1),
        0 0 18px rgba(255, 215, 0, 0.95),
        0 0 30px rgba(255, 215, 0, 0.90),
        0 0 45px rgba(255, 215, 0, 0.80),
        0 0 65px rgba(255, 215, 0, 0.65);
}

/* ============================================================
   POSITIONNEMENT DU MENU
============================================================ */

.nav-left {
    left: 65px;
    font-size: 26px;
}

.nav-center {
    left: 0;
    right: 0;
    width: fit-content;
    margin: 0 auto;
    font-size: 30px;
    text-align: center;
}

.title-line {
    display: inline;
}

.nav-right {
    right: 65px;
    font-size: 26px;
}

/* ============================================================
   INFOS UTILISATEUR / PROFIL
============================================================ */

.user-info {
    position: absolute;
    top: 8px;
    right: 20px;
    z-index: 15;
    font-size: 12px;
    color: var(--text-muted);
}

.user-info a,
.profile-link {
    color: var(--gold-solid);
    margin-left: 10px;
}

.header-left {
    position: absolute;
    top: 8px;
    left: 10px;
    z-index: 15;
    font-size: 12px;
    color: var(--text-muted);
}

.logout-form {
    display: inline;
    margin: 0;
    padding: 0;
}

.logout-button {
    display: inline;
    width: auto;
    margin: 0 0 0 10px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    color: var(--gold-solid);
    font: inherit;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.logout-button:hover {
    background: none;
    border: none;
    box-shadow: none;
    color: var(--gold-solid);
    text-decoration: underline;
    transform: none;
}

.logout-button:active {
    color: var(--gold-solid);
    transform: none;
}

.logout-button:focus {
    outline: none;
}

.logout-button:focus-visible {
    outline: var(--focus-ring);
    outline-offset: 2px;
}

/* ============================================================
   AUTHENTIFICATION
============================================================ */

.container {
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    overflow: hidden;
}

.container h1 {
    margin-bottom: 20px;
    color: var(--gold-solid);
    text-align: center;
    font-size: 28px;
}

.container p {
    margin-top: 20px;
    color: var(--text-muted);
    text-align: center;
}

.container a {
    color: var(--gold-solid);
}

.form-group {
    margin-bottom: 15px;
}

.form-hint {
    margin-bottom: 20px;
    color: var(--text-muted);
    text-align: center;
    font-size: 14px;
}

.error,
.success {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.error {
    background: rgba(90, 26, 26, 0.25);
    color: #ff6666;
    border: 1px solid #ff6666;
}

.success {
    background: rgba(26, 90, 26, 0.25);
    color: #66ff66;
    border: 1px solid #66ff66;
}

form label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-soft);
    font-weight: bold;
}

form input {
    width: 100%;
    padding: 12px;
    background: #0a0a0a;
    border: 2px solid #444;
    border-radius: 4px;
    color: var(--text-soft);
    font-size: 1em;
    font-family: var(--font-ui);
}

form input:focus {
    outline: none;
    border-color: var(--gold-solid);
    box-shadow: 0 0 10px var(--gold-shadow);
}

form button {
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    background: var(--gold-solid);
    color: #0a0a0a;
    border: 2px solid var(--border-gold);
    border-radius: 4px;
    box-shadow: 0 0 12px var(--gold-shadow);
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    font-family: var(--font-ui);
    transition: all 0.3s;
}

form button:hover {
    background: #ffa500;
    border-color: var(--gold-solid);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    transform: translateY(-2px);
}

/* ============================================================
   PROFIL
============================================================ */

.container--profile {
    max-width: 600px;
    margin: 20px auto 30px;
}

.info-card {
    padding: 20px;
    margin-bottom: 30px;
}

/* ============================================================
   ACCUEIL
============================================================ */

.welcome-content {
    max-width: 700px;
    margin: 150px auto 0;
    padding: 40px;
    text-align: center;
}

.welcome-content h1 {
    margin-bottom: 20px;
    color: var(--gold-solid);
    font-size: 48px;
    text-shadow:
        3px 3px 8px rgba(0, 0, 0, 0.9),
        0 0 20px rgba(255, 215, 0, 0.4);
}

.welcome-content p {
    color: var(--text-soft);
    font-size: 24px;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8);
}

/* ============================================================
   PLANQUE / STRUCTURE GENERALE
============================================================ */

.hideout-page {
    width: 100%;
    padding: 12px 10px 24px;
}

.hideout-panel {
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
}

/* ============================================================
   PLANQUE / MARCHANDS
============================================================ */

.traders-grid {
    display: grid;
    grid-template-columns: repeat(7, 110px);
    justify-content: center;
    align-items: stretch;
    gap: 6px;
}

.trader-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    width: 100%;
    max-width: 110px;
    margin: 0 auto;
    padding: 8px 4px;
    text-align: center;
}

.trader-image {
    width: 58px;
    height: 58px;
    flex-shrink: 0;
    object-fit: cover;
    border: 2px solid var(--border-gold);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--gold-shadow);
}

.trader-card h2 {
    margin: 0;
    color: var(--gold-solid);
    font-size: 14px;
    line-height: 1.1;
    text-shadow:
        1px 1px 4px rgba(0, 0, 0, 0.85),
        0 0 8px rgba(255, 215, 0, 0.18);
}

.trader-level-form {
    width: 100%;
}

.trader-level-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    align-content: start;
    justify-items: stretch;
    gap: 4px;
    width: 100%;
    max-width: 64px;
    margin: 0 auto;
}

.level-btn {
    width: 100%;
    min-height: 0;
    aspect-ratio: 1 / 1;
    padding: 0;
    line-height: 1;
    font-size: 14px;
}

.level-btn.is-active {
    background: var(--gold-solid);
    color: #0a0a0a;
    border-color: var(--gold-strong);
    box-shadow:
        0 0 10px rgba(255, 215, 0, 0.28),
        inset 0 0 5px rgba(255, 255, 255, 0.10);
}

/* ============================================================
   PLANQUE / TECH TREE
============================================================ */

.tech-tree-stage {
    cursor: grab;
    user-select: none;
}

.tech-tree-stage.is-panning {
    cursor: grabbing;
}

.hideout-tech-tree-panel {
    max-width: 1800px;
    margin: 18px auto 22px;
    padding: 16px;
    border-radius: 10px;
    box-shadow: 0 0 18px var(--gold-shadow);
}

.tech-tree-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-bottom: 10px;
}

.tech-tree-toolbar-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.tech-tree-zoom-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    line-height: 1;
    font-size: 14px;
}

.tech-tree-zoom-btn.js-tech-tree-zoom-reset {
    min-width: 54px;
    padding: 0 12px;
}

.tech-tree-scroll {
    position: relative;
    max-height: 2000px;
    overflow: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 215, 0, 0.45) rgba(20, 20, 20, 0.35);
}

.tech-tree-scroll::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.tech-tree-scroll::-webkit-scrollbar-track {
    background: rgba(20, 20, 20, 0.35);
    border-radius: 999px;
}

.tech-tree-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.40);
    border-radius: 999px;
}

.tech-tree-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.60);
}

.tech-tree-stage {
    position: relative;
    width: max-content;
    height: max-content;
}

.tech-tree-zoom-layer {
    position: relative;
    width: max-content;
    height: max-content;
    transform-origin: 0 0;
    will-change: transform;
}

.tech-tree-svg {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

/* ============================================================
   PLANQUE / GRILLE TECH TREE
   ------------------------------------------------------------
   La grille pilote seule le placement.
   Les tracks sont alignées sur la vraie taille des nodes.
   Les espacements restent gérés par les gaps.
============================================================ */

.tech-tree-manual {
    position: relative;
    display: grid;
    grid-template-columns: repeat(11, 260px);
    grid-template-rows: repeat(26, 110px);
    column-gap: 40px;
    row-gap: 40px;
    width: max-content;
    margin: 0;
    padding: 40px;
}

.tech-col-1  { grid-column: 1; }
.tech-col-2  { grid-column: 2; }
.tech-col-3  { grid-column: 3; }
.tech-col-4  { grid-column: 4; }
.tech-col-5  { grid-column: 5; }
.tech-col-6  { grid-column: 6; }
.tech-col-7  { grid-column: 7; }
.tech-col-8  { grid-column: 8; }
.tech-col-9  { grid-column: 9; }
.tech-col-10 { grid-column: 10; }
.tech-col-11 { grid-column: 11; }

.tech-row-1  { grid-row: 1; }
.tech-row-2  { grid-row: 2; }
.tech-row-3  { grid-row: 3; }
.tech-row-4  { grid-row: 4; }
.tech-row-5  { grid-row: 5; }
.tech-row-6  { grid-row: 6; }
.tech-row-7  { grid-row: 7; }
.tech-row-8  { grid-row: 8; }
.tech-row-9  { grid-row: 9; }
.tech-row-10 { grid-row: 10; }
.tech-row-11 { grid-row: 11; }
.tech-row-12 { grid-row: 12; }
.tech-row-13 { grid-row: 13; }
.tech-row-14 { grid-row: 14; }
.tech-row-15 { grid-row: 15; }
.tech-row-16 { grid-row: 16; }
.tech-row-17 { grid-row: 17; }
.tech-row-18 { grid-row: 18; }
.tech-row-19 { grid-row: 19; }
.tech-row-20 { grid-row: 20; }
.tech-row-21 { grid-row: 21; }
.tech-row-22 { grid-row: 22; }
.tech-row-23 { grid-row: 23; }
.tech-row-24 { grid-row: 24; }
.tech-row-25 { grid-row: 25; }
.tech-row-26 { grid-row: 26; }

.tech-edge {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.92;
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.55));
}

.tech-edge--default {
    stroke: #ffd54a;
}

/* ============================================================
   PLANQUE / NODES TECH TREE
============================================================ */

.tech-node {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    justify-self: start;
    align-self: start;
    width: 214px;
    height: 94px;
    padding: 8px 10px;
    text-align: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 6px 18px rgba(0, 0, 0, 0.22);
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease,
        background-color 0.18s ease;
}

.tech-node:hover {
    transform: translateY(-1px);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 10px 22px rgba(0, 0, 0, 0.28);
}

.tech-node--done {
    border-color: rgba(103, 190, 110, 0.88);
    box-shadow:
        0 0 0 1px rgba(103, 190, 110, 0.14),
        0 0 14px rgba(103, 190, 110, 0.14),
        0 6px 18px rgba(0, 0, 0, 0.22);
}

.tech-node--progress {
    border-color: rgba(214, 185, 84, 0.92);
    box-shadow:
        0 0 0 1px rgba(214, 185, 84, 0.14),
        0 0 14px rgba(214, 185, 84, 0.14),
        0 6px 18px rgba(0, 0, 0, 0.22);
}

.tech-node--blocked {
    border-color: rgba(191, 92, 92, 0.88);
    box-shadow:
        0 0 0 1px rgba(191, 92, 92, 0.12),
        0 0 14px rgba(191, 92, 92, 0.12),
        0 6px 18px rgba(0, 0, 0, 0.22);
}

.tech-node__name {
    display: -webkit-box;
    width: 100%;
    min-height: 38px;
    max-height: 38px;
    margin-bottom: 6px;
    overflow: hidden;
    color: rgba(255, 245, 230, 0.96);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.18;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    text-wrap: balance;
    overflow-wrap: break-word;
    word-break: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.tech-node__level {
    display: block;
    width: 100%;
    color: rgba(255, 245, 220, 0.90);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.06em;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.75);
}

/* ============================================================
   RESPONSIVE / GRAND ECRAN
============================================================ */

@media (min-width: 1400px) {
    .hideout-page {
        padding-left: 18px;
        padding-right: 18px;
    }

    .hideout-tech-tree-panel {
        max-width: 1800px;
    }
}

/* ============================================================
   RESPONSIVE / GLOBAL TABLET
============================================================ */

@media (max-width: 1024px) {
    .header-content {
        height: 100px;
        padding: 0 20px;
    }

    .nav-link {
        top: 39px;
        font-size: 20px;
    }

    .nav-left {
        left: 48px;
    }

    .nav-center {
        left: 0;
        right: 0;
        width: fit-content;
        margin: 0 auto;
        font-size: 24px;
    }

    .nav-right {
        right: 48px;
    }

    .welcome-content {
        margin-top: 100px;
        padding: 30px;
    }

    .welcome-content h1 {
        font-size: 36px;
    }

    .welcome-content p {
        font-size: 18px;
    }

    .container {
        margin: 80px auto;
        padding: 25px;
    }
}

/* ============================================================
   RESPONSIVE / MOBILE
============================================================ */

@media (max-width: 768px) {
    .header-container {
        padding: 15px 0;
    }

    .header-content {
        height: 95px;
        padding: 0 10px;
    }

    .header-border svg {
        height: 82px;
    }

    .nav-link {
        top: 31px;
        font-size: 14px;
    }

    .nav-left {
        left: 18px;
    }

    .nav-center {
        left: 50%;
        width: 150px;
        margin: 0;
        font-size: 14px;
        line-height: 1.1;
        text-align: center;
        white-space: normal;
        transform: translateX(-50%) translateY(-6px);
    }

    .nav-center .title-line {
        display: block;
    }

    .nav-right {
        right: 18px;
    }

    .user-info {
        top: 5px;
        right: 8px;
        font-size: 9px;
    }

    .header-left {
        top: 5px;
        left: 8px;
        font-size: 9px;
    }

    .welcome-content {
        width: calc(100% - 30px);
        max-width: 700px;
        margin: 10px auto 0;
        padding: 10px;
    }

    .welcome-content h1 {
        font-size: 26px;
    }

    .welcome-content p {
        font-size: 16px;
    }

    .container {
        width: calc(100% - 30px);
        max-width: 400px;
        margin: 15px auto;
        padding: 15px;
        box-sizing: border-box;
    }

    .container h1 {
        font-size: 22px;
    }

    form input {
        font-size: 16px;
    }

    .hideout-page {
        padding: 10px 8px 20px;
    }

    .traders-grid {
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
        gap: 8px;
    }

    .trader-card {
        padding: 8px 6px;
        gap: 4px;
    }

    .trader-image {
        width: 52px;
        height: 52px;
    }

    .trader-card h2 {
        font-size: 11px;
    }

    .trader-level-buttons {
        max-width: 60px;
        gap: 4px;
    }

    .level-btn {
        font-size: 9px;
        border-radius: 6px;
    }

    .hideout-tech-tree-panel {
        margin-top: 14px;
        margin-bottom: 18px;
        padding: 12px;
    }

    .tech-tree-scroll {
        padding-bottom: 10px;
    }

    .tech-edge {
        stroke-width: 2.2;
    }
}

@media (max-width: 480px) {
    .header-content {
        height: 95px;
        padding: 0 10px;
    }

    .header-border svg {
        display: block;
        width: 100%;
        height: 80px;
    }

    .nav-link {
        top: 30px;
        font-size: 12px;
    }

    .nav-left {
        left: 12px;
    }

    .nav-center {
        left: 50%;
        width: 130px;
        margin: 0;
        font-size: 12px;
        line-height: 1.05;
        text-align: center;
        white-space: normal;
        transform: translateX(-50%);
    }

    .nav-center .title-line {
        display: block;
    }

    .nav-right {
        right: 12px;
    }

    .user-info {
        top: 5px;
        right: 8px;
        font-size: 8px;
    }

    .header-left {
        top: 5px;
        left: 8px;
        font-size: 8px;
    }

    .welcome-content {
        width: 100%;
        max-width: 100%;
        margin-top: 10px;
        padding: 10px;
        box-sizing: border-box;
    }

    .welcome-content h1 {
        font-size: 22px;
    }

    .container {
        margin: 30px auto;
        padding: 15px;
    }

    .hideout-page {
        padding: 8px 6px 16px;
    }

    .traders-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .trader-card {
        padding: 8px 6px;
        gap: 4px;
    }

    .trader-image {
        width: 50px;
        height: 50px;
    }

    .trader-card h2 {
        font-size: 11px;
    }

    .trader-level-buttons {
        max-width: 58px;
    }

    .level-btn {
        font-size: 9px;
        border-radius: 6px;
    }
}

/* ============================================================
   DEBUG
============================================================ */

#debug-viewport {
    position: fixed;
    left: 10px;
    bottom: 10px;
    z-index: 99999;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.25);
    color: #00ff99;
    border: 1px solid #00ff99;
    border-radius: 4px;
    pointer-events: none;
    font-size: 12px;
    font-family: monospace;
}