
:root {
    --background: #edf0f1;
    --panel: #ffffff;
    --text: #243640;
    --muted: #75838a;
    --border: #cdd6da;
    --accent: #387f9c;

    --sea: #387f9c;
    --deep: #25516f;
    --coast: #65aeb5;
    --sand: #d9c58d;
    --land: #83965b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
}

h1, h2, p {
    margin: 0;
}

h2 {
    font-size: 16px;
    margin-bottom: 12px;
}

button {
    font: inherit;
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

/* En-tête */

/* Structure */

.container {
    max-width: 1000px;
    margin: auto;
    padding: 20px;
}

.menu {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.menu button {
    flex: 1;
    padding: 12px 6px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text);
}

.menu button.active {
    background: #193847;
    color: white;
    border-color: #193847;
}

/* Statistiques */

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.stat {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 14px;
}

.stat small {
    display: block;
    color: var(--muted);
    margin-bottom: 8px;
}

.stat strong {
    font-size: 20px;
}

.progress {
    height: 5px;
    background: #e0e6e8;
    margin-top: 10px;
}

#pa-bar {
    width: 100%;
    height: 100%;
    background: #58966e;
}

/* Bannière */

.banner {
    aspect-ratio: 8 / 3;
    background-color: #387f9c;
    background-image: linear-gradient(
        #a8d0dc 0%,
        #a8d0dc 48%,
        #387f9c 48%,
        #25516f 100%
    );
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    color: white;
    margin-bottom: 16px;
}

.banner span {
    font-size: 12px;
    opacity: 0.8;
}

.banner h2 {
    font-size: 24px;
    margin: 5px 0 0;
}

/* Panneaux */

.game-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 16px;
    align-items: start;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 16px;
}

.panel p {
    line-height: 1.6;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

#coordinates {
    color: var(--muted);
    font-size: 12px;
}

.sidebar {
    display: grid;
    gap: 12px;
}

.muted {
    color: var(--muted);
    font-size: 12px;
}

/* Carte */

.map {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    background: #193847;
    padding: 5px;
}

.tile {
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.sea {
    background: var(--sea);
}

.deep {
    background: var(--deep);
}

.coast {
    background: var(--coast);
}

.sand {
    background: var(--sand);
}

.land {
    background: var(--land);
}

.tile.player {
    outline: 2px solid white;
    outline-offset: -2px;
}

.boat {
    font-size: clamp(18px, 4vw, 32px);
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
    font-size: 11px;
}

.legend span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend i {
    width: 10px;
    height: 10px;
}

/* Actions */

.primary-button {
    width: 100%;
    background: var(--accent);
    border: none;
    color: white;
    padding: 14px;
    margin-top: 16px;
    font-weight: bold;
}

.primary-button:hover {
    background: #25516f;
}

#journal {
    font-size: 12px;
    line-height: 1.5;
    max-height: 180px;
    overflow-y: auto;
}

#journal p {
    border-bottom: 1px solid #edf0f1;
    padding: 6px 0;
}

footer {
    text-align: center;
    color: var(--muted);
    font-size: 11px;
    padding: 24px 0;
}

/* Mobile */

@media (max-width: 650px) {
    .container {
        padding: 12px;
    }

    .game-layout {
        grid-template-columns: 1fr;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .panel {
        padding: 12px;
    }
}

/* ==============================
   NAVIGATION — VERSION 0.2
   ============================== */

.edge {
    background: #142733;
}

.tile {
    user-select: none;
}

.tile.adjacent {
    outline: 1px solid rgba(255, 255, 255, 0.5);
    outline-offset: -1px;
}

.tile.reachable {
    cursor: pointer;
}

.tile.reachable:hover {
    filter: brightness(1.2);
    outline: 2px solid white;
    outline-offset: -2px;
}

.tile.blocked {
    cursor: not-allowed;
}

.tile.player {
    outline: 2px solid white;
    outline-offset: -2px;
}

.direction {
    color: rgba(255, 255, 255, 0.8);
    font-size: 20px;
    pointer-events: none;
}

.boat {
    pointer-events: none;
    z-index: 2;
}

@media (max-width: 650px) {

    .direction {
        font-size: 16px;
    }
}

/* ==============================
   BANNIÈRES — VERSION 0.3
   ============================== */

.banner {
    position: relative;
    aspect-ratio: 8 / 3;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 0;
    overflow: hidden;
}

.banner-caption {
    width: 100%;
    padding: 18px 20px;
    background: rgba(25, 56, 71, 0.45);
    color: white;
}

.banner-caption h2 {
    font-size: 24px;
    margin: 5px 0 0;
}

.banner-caption span {
    font-size: 12px;
    opacity: 0.85;
}

@media (max-width: 650px) {

    .banner-caption {
        padding: 10px 12px;
    }

    .banner-caption h2 {
        font-size: 18px;
    }

    .banner-caption span {
        font-size: 10px;
    }
}

/* Points d'action — V0.4 */
#pa-timer { font-size: 11px; color: var(--muted); margin-top: 7px; font-variant-numeric: tabular-nums; }
#pa-bar { transition: width .2s ease; }
.primary-button:disabled { background: #a5b1b7; color: #243640; cursor: not-allowed; }
.tile.no-energy { cursor: not-allowed; }
.tile.no-energy .direction { opacity: .2; }
.tile.no-energy:hover { filter: none; }

#hold-bar {height:100%;background:var(--accent);width:0;}
#hold-list {margin-top:10px;max-height:160px;overflow:auto;}
.catch-row {padding:5px 0;border-bottom:1px solid var(--border);}
.release-button {margin-top:10px;background:white;border:1px solid var(--border);padding:6px 10px;color:var(--text);}
/* V0.6 */
.game-layout {grid-template-areas:"map energy" "map sidebar";grid-template-rows:auto 1fr;}
.map-panel{grid-area:map}.energy-panel{grid-area:energy}.sidebar{grid-area:sidebar}
.energy-panel .stat,.progression .stat{border:0;padding:5px 0;display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:5px}.energy-panel .stat .progress,.energy-panel #pa-timer{width:100%}.progression .stat strong{font-size:16px}.progression .stat small{margin:0}
#equipment-slots{display:grid;gap:12px;margin:16px 0}#equipment-slots label{display:grid;gap:5px}#equipment-slots select{font:inherit;padding:8px;max-width:100%}.item-row{border-bottom:1px solid var(--border);padding:8px 0}.catch-row{display:flex;align-items:center;justify-content:space-between;gap:6px;flex-wrap:wrap}.catch-row button{margin:0;font-size:11px}
@media(max-width:650px){.game-layout{grid-template-areas:"energy" "map" "sidebar";grid-template-rows:auto;}}
.collection-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr)); gap:12px; margin-top:16px; }
.species-card { border:1px solid #cdd6da; padding:14px; border-radius:6px; }
.species-card h3 { margin:0 0 8px; }
.species-card p { margin:6px 0; font-size:.9rem; }
.species-card.undiscovered { background:#edf0f1; color:#52636b; }
#collection-bar { height:100%; background:#58966e; }

/* V0.8 */
.port {background:#b28e64;} .tile.port{position:relative;} .port-mark{position:absolute;top:3px;left:4px;font-size:12px;color:#fff;pointer-events:none;} #commerce h3{font-size:14px;margin:14px 0 8px;} #commerce .primary-button{margin-top:8px;} .shop-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 0;border-bottom:1px solid var(--border);} .shop-row button{margin:0;flex-shrink:0;} button:disabled{cursor:not-allowed;opacity:.6;}

.gear-detail {display:block;font-size:.78rem;color:inherit;opacity:.8;margin-top:4px;}

#xp-bar {height:100%;background:#58966e;width:0;}
#skill-list,#trophy-list {margin-bottom:20px;}

/* Terrains réservés aux futures extensions. */
.tile.reef { background: #408b80; }
.tile.estuary { background: #749b93; }
.tile.mangrove { background: #526e50; }
.tile.lake { background: #528ca4; }
.tile.river { background: #78b6c6; }
.tile.stream { background: #638f9b; }
.tile.marsh { background: #687b49; }
.tile.pond { background: #8ba58a; }
.tile.mountain_lake { background: #8dbecb; }

.auth-card{max-width:420px;margin:35px auto}.auth-card form,.auth-card label{display:grid;gap:8px}.auth-card form{gap:16px;margin-top:18px}.auth-card input{font:inherit;padding:10px;border:1px solid var(--border);border-radius:4px;width:100%}.account-bar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px;flex-wrap:wrap}
#world-dialog{width:min(94vw,740px);max-height:92vh;overflow:auto;border:1px solid #b9c7cb;border-radius:10px;padding:16px;background:#fff;color:#20333b}#world-dialog::backdrop{background:#17252e99}#world-canvas{display:block;width:100%;max-width:600px;height:auto;margin:10px auto;touch-action:none;cursor:grab;image-rendering:pixelated}.world-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.world-tools button{padding:7px 12px;cursor:pointer}#world-legend{display:flex;flex-wrap:wrap;gap:8px}#world-open{margin-bottom:10px}

.tile.rock { background:#929b9c; }

/* V0.12.6 G */
.banner-brand{position:absolute;top:0;left:0;padding:18px 20px;color:white;text-shadow:0 1px 4px #193847;background:linear-gradient(120deg,rgba(25,56,71,.55),transparent);}
.banner-brand h1{font-size:clamp(22px,4vw,36px);letter-spacing:3px;margin:0;}
.banner-brand span{opacity:1;}
.banner{margin-bottom:8px;}
#profile .account-bar{margin-top:16px;}
@media(max-width:650px){.banner-brand{padding:8px 12px}.banner-brand h1{letter-spacing:2px}.banner-brand span{font-size:11px}.banner{min-height:130px}}

.other-boat{position:absolute;right:2px;bottom:2px;background:#fff;color:#193447;border:1px solid #193447;border-radius:4px;padding:1px 3px;font-size:clamp(9px,1.6vw,14px);line-height:1.2;z-index:2;pointer-events:none;}
#presence-count{font-size:12px;margin:6px 0;}
.other-boat{pointer-events:auto;cursor:pointer;min-height:20px;}
#nearby-profile-dialog{width:min(440px,90vw);max-height:80vh;overflow:auto;border:1px solid #b6c6cc;border-radius:8px;padding:16px;}
#nearby-profile-dialog::backdrop{background:rgba(0,0,0,.45)}
.nearby-profile-card{border:1px solid #b6c6cc;border-radius:6px;padding:12px;margin:8px 0;}
.nearby-profile-card h3,.nearby-profile-card p{margin:4px 0;overflow-wrap:anywhere;}
#social-dialog{width:min(620px,94vw);max-height:85vh;overflow:auto;border:1px solid #b7c7cc;border-radius:8px;padding:18px}#social-dialog::backdrop{background:#19344788}.social-row,.social-actions{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:8px 0}.social-row{padding:8px 0;border-bottom:1px solid #dce4e6}.social-row span{flex:1;min-width:120px}.social-actions button,.social-row button{font-size:.85rem}#social-status,#nearby-social-status{font-size:.85rem;color:#387f9c}
#chat-dialog{width:min(620px,90vw);max-height:85vh;overflow:auto;border:1px solid #b7c7cc;border-radius:8px;padding:18px;color:#20333b}#chat-dialog::backdrop{background:#19344788}#chat-messages{height: min(38vh,320px);overflow:auto;background:#eef3f4;padding:10px;margin:10px 0;border-radius:6px}.chat-message{padding:8px;margin:6px 0;background:white;border-radius:5px;overflow-wrap:anywhere}.chat-mine{background:#d6e8ed}.chat-message p{white-space:pre-wrap;margin:5px 0}.chat-message small{color:#526b75}.chat-message button{font-size:.75rem}#chat-form{display:grid;gap:6px}#chat-body{width:100%;box-sizing:border-box;font:inherit;padding:8px}#chat-status{font-size:.85rem;color:#387f9c}
#trade-dialog{width:min(600px,95vw);max-height:85vh;overflow:auto}#trade-list{display:flex;flex-wrap:wrap;gap:6px}#trade-detail form{display:grid;gap:8px;margin:12px 0}#trade-detail label{display:flex;align-items:center;justify-content:space-between;gap:8px}#trade-detail input[type=number]{width:90px}

#trade-dialog{width:min(720px,94vw);box-sizing:border-box;padding:20px;color:#203743}#trade-detail{display:grid;gap:12px}#trade-detail>p{margin:0} .trade-offers{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.trade-offer{border:1px solid #c4d2d7;background:#f5f8f9;padding:14px;min-width:0;overflow-wrap:anywhere}.trade-offer h3{margin:0 0 12px;padding-bottom:10px;border-bottom:1px solid #c4d2d7}.trade-offer p{margin:6px 0}.trade-confirmed{color:#34734c;font-weight:bold}.trade-editor{border:1px solid #c4d2d7;padding:12px}.trade-editor summary{cursor:pointer;font-weight:bold}.trade-editor form{max-height:42vh;overflow:auto;padding:4px}.trade-editor label:has(input[type=checkbox]){justify-content:flex-start!important}.trade-editor input[type=checkbox]{width:auto;flex:none}.trade-confirm{width:100%}.trade-confirm:disabled{opacity:.55;cursor:not-allowed}@media(max-width:480px){.trade-offers{grid-template-columns:1fr}#trade-dialog{padding:12px}}
