/* CozySquare — interface. Palette inspirée du logo : jaune miel, bleu ciel, crème, terre cuite. */
:root {
  --cream: #fff8ec;
  --cream-2: #f6ead4;
  --ink: #3b2a20;
  --ink-soft: #7a6454;
  --honey: #f7b733;
  --honey-dark: #e08e1b;
  --sky: #3fa4f0;
  --sky-dark: #1f6fc1;
  --leaf: #5aa469;
  --rose: #e2574c;
  --panel: rgba(255, 248, 236, 0.96);
  --shadow: 0 10px 30px rgba(59, 42, 32, 0.22), 0 2px 0 rgba(255, 255, 255, 0.6) inset;
  --radius: 22px;
  --font-title: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font: 'Nunito', system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--ink); background: #bfe3ff; overflow: hidden; -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--ink-soft); margin: 0.2rem 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
h1, h2, h3 { font-family: var(--font-title); margin: 0 0 0.4rem; }

/* Cartes & boutons */
.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); border: 3px solid #fff; padding: 22px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; border: 0; cursor: pointer; text-decoration: none;
  font-family: var(--font-title); font-weight: 600; font-size: 1.02rem;
  background: #fff; color: var(--ink); box-shadow: 0 4px 0 #e2cfae, 0 6px 14px rgba(59,42,32,.12);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.03); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #e2cfae; }
.btn-primary { background: linear-gradient(#ffcf4a, var(--honey)); color: #5a3508; box-shadow: 0 4px 0 var(--honey-dark), 0 8px 18px rgba(224,142,27,.35); }
.btn-primary:active { box-shadow: 0 1px 0 var(--honey-dark); }
.btn-blue { background: linear-gradient(#6cc0ff, var(--sky)); color: #fff; box-shadow: 0 4px 0 var(--sky-dark); }
.btn-ghost { background: transparent; box-shadow: none; color: var(--ink-soft); }
.btn-xl { padding: 14px 28px; font-size: 1.2rem; }
.btn-sm { padding: 6px 12px; font-size: .88rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.tag { font-size: .62rem; background: var(--sky); color: #fff; padding: 2px 7px; border-radius: 99px; letter-spacing: .04em; }
.link { color: var(--sky-dark); font-weight: 700; font-size: .9rem; text-align: center; }
.tabs { display: flex; gap: 6px; background: var(--cream-2); padding: 5px; border-radius: 999px; margin: 10px 0 14px; flex-wrap: wrap; }
.tab { flex: 1; border: 0; background: transparent; padding: 8px 12px; border-radius: 999px; cursor: pointer; font-family: var(--font-title); font-weight: 600; white-space: nowrap; }
.tab.active { background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
input:not([type=checkbox]):not([type=range]), select {
  width: 100%; padding: 11px 14px; border-radius: 14px; border: 2px solid #eadbc2; background: #fff; outline: none; margin-top: 4px;
}
input:focus, select:focus { border-color: var(--sky); }
label { display: block; font-weight: 700; font-size: .92rem; }
label small { font-weight: 400; color: var(--ink-soft); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.form-msg { min-height: 1.2em; margin: 8px 0 0; font-weight: 700; color: var(--rose); text-align: center; }
.form-msg.ok { color: var(--leaf); }

/* ------------------------------------------------ Menu principal */
.page-menu canvas#bg3d { position: fixed; inset: 0; width: 100%; height: 100%; }
.menu-vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 40%, transparent 45%, rgba(20,30,60,.35)); }
.menu-wrap { position: relative; z-index: 2; height: 100%; overflow-y: auto; display: flex; flex-direction: column; align-items: center; padding: 16px 16px 40px; }
.menu-logo { width: min(400px, 78vw); filter: drop-shadow(0 12px 22px rgba(0,0,0,.25)); animation: float 5s ease-in-out infinite; margin-bottom: -10px; }
@keyframes float { 50% { transform: translateY(-8px) rotate(-.6deg); } }
.menu-card, .auth-card { width: min(420px, 100%); }
.welcome { font-family: var(--font-title); font-size: 1.35rem; font-weight: 600; margin: 0; text-align: center; }
.menu-card .muted { text-align: center; }
.menu-buttons { display: grid; gap: 10px; margin-top: 14px; }
.tagline { text-align: center; font-family: var(--font-title); font-size: 1.1rem; margin: 0; color: var(--ink-soft); }
.auth-form { display: grid; gap: 12px; }
.lang-switch { margin-top: 14px; display: flex; gap: 6px; }
.lang-switch button { border: 0; background: rgba(255,255,255,.75); border-radius: 99px; padding: 6px 12px; cursor: pointer; font-weight: 700; }
.lang-switch .active { background: var(--honey); }

/* ------------------------------------------------ Modales & panneaux */
.modal-back { position: fixed; inset: 0; background: rgba(30, 25, 40, .35); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.panel { width: min(560px, 100%); max-height: min(82vh, 760px); display: flex; flex-direction: column; padding: 0; overflow: hidden; animation: pop .18s ease-out; }
.panel.wide { width: min(760px, 100%); }
@keyframes pop { from { transform: scale(.94) translateY(8px); opacity: 0; } }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 10px; background: linear-gradient(#fff, var(--cream)); }
.panel-head h2 { font-size: 1.35rem; margin: 0; }
.panel-close { border: 0; background: var(--cream-2); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1.1rem; }
.panel-body { padding: 4px 20px 20px; overflow-y: auto; }

/* ------------------------------------------------ Créateur */
.page-creator { background: linear-gradient(#bfe3ff, #fff3dd); }
.page-creator #preview3d { position: fixed; inset: 0; width: 100%; height: 100%; }
.creator-panel { position: fixed; right: 16px; top: 16px; bottom: 16px; width: min(420px, calc(100% - 32px)); display: flex; flex-direction: column; overflow: hidden; }
.creator-options { overflow-y: auto; flex: 1; padding-right: 4px; }
.opt-group { margin-bottom: 14px; }
.opt-group h3 { font-size: .95rem; color: var(--ink-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 2px solid #eadbc2; background: #fff; border-radius: 99px; padding: 6px 12px; cursor: pointer; font-weight: 700; font-size: .88rem; }
.chip.active { border-color: var(--honey); background: #fff2cc; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px #eadbc2; cursor: pointer; }
.swatch.active { box-shadow: 0 0 0 3px var(--honey); transform: scale(1.1); }
@media (max-width: 760px) {
  .creator-panel { top: auto; height: 55vh; right: 8px; left: 8px; bottom: 8px; width: auto; }
}

/* ------------------------------------------------ Jeu */
.page-game #game3d { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; }
.loading { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(circle at 50% 35%, #fff6df, #bfe3ff 70%); transition: opacity .6s; }
.loading img { width: min(340px, 70vw); animation: float 4s ease-in-out infinite; }
.loading .bar { width: min(360px, 70vw); height: 14px; background: #fff; border-radius: 99px; overflow: hidden; box-shadow: inset 0 2px 4px rgba(0,0,0,.1); }
.loading .bar span { display: block; height: 100%; width: 5%; background: linear-gradient(90deg, var(--honey), #ffd86b); transition: width .3s; border-radius: 99px; }
.loading p { margin: 0; font-family: var(--font-title); font-weight: 600; }
.loading .tip { color: var(--ink-soft); font-family: var(--font); font-weight: 600; max-width: 480px; text-align: center; padding: 0 16px; }
.loading.done { opacity: 0; pointer-events: none; }

.hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; transition: opacity .3s; }
.hud > * { pointer-events: auto; }
.hud.hidden-ui > *:not(.prompt) { opacity: 0; pointer-events: none; }
.card-mini { background: var(--panel); border-radius: 18px; box-shadow: 0 6px 18px rgba(59,42,32,.18); border: 2px solid #fff; padding: 8px 12px; }
.hud-top-left { position: absolute; left: 12px; top: 12px; display: flex; gap: 10px; align-items: center; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(var(--sky), var(--sky-dark)); color: #fff; display: grid; place-items: center; font-family: var(--font-title); font-weight: 700; font-size: 1.2rem; }
.hud-name { font-family: var(--font-title); font-weight: 600; }
.hud-level { display: flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; color: var(--ink-soft); }
.xpbar { width: 110px; height: 8px; background: #eadbc2; border-radius: 99px; overflow: hidden; }
.xpbar span { display: block; height: 100%; background: linear-gradient(90deg, #7fd36b, var(--leaf)); width: 0; transition: width .6s ease; }
.hud-top-right { position: absolute; right: 12px; top: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; max-width: 60vw; }
.coins { font-family: var(--font-title); font-weight: 700; font-size: 1.05rem; }
.coins.bump { animation: bump .5s; }
@keyframes bump { 40% { transform: scale(1.2); background: #fff2b0; } }
.clock { font-size: .85rem; font-weight: 700; }
.admin-bar { display: flex; gap: 6px; }
.admin-btn { height: 42px; padding: 0 14px; border-radius: 21px; border: 2px solid #fff; background: linear-gradient(135deg, #e0483e, #b8322a); color: #fff; font: 800 .82rem/1 inherit; font-family: inherit; box-shadow: 0 4px 12px rgba(120,30,20,.3); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap; }
.admin-btn:hover { filter: brightness(1.08); }
.admin-btn.active { background: linear-gradient(135deg, #2f9e5b, #1f7a43); }
@media (max-width: 1100px) { .admin-btn span { display: none; } .admin-btn { padding: 0 10px; } }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 2px solid #fff; background: var(--panel); box-shadow: 0 4px 12px rgba(59,42,32,.18); cursor: pointer; font-size: 1.15rem; display: grid; place-items: center; text-decoration: none; }
.icon-btn:hover { transform: translateY(-2px); }
.hud-zone { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); font-family: var(--font-title); font-weight: 600; font-size: .9rem; }
.prompt { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); background: rgba(59,42,32,.85); color: #fff; padding: 8px 16px; border-radius: 99px; font-weight: 700; font-family: var(--font-title); opacity: 0; transition: opacity .2s; pointer-events: none; white-space: nowrap; }
.prompt.show { opacity: 1; }
.hud-bottom { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 8px; }
.action-btn { width: 66px; height: 66px; border-radius: 20px; border: 3px solid #fff; background: var(--panel); box-shadow: 0 6px 16px rgba(59,42,32,.2); cursor: pointer; font-size: 1.5rem; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.action-btn small { font-size: .62rem; font-weight: 800; margin-top: 4px; color: var(--ink-soft); }
.action-btn:hover { transform: translateY(-3px); }
.action-btn.active { background: #fff2cc; border-color: var(--honey); }
.chat { position: absolute; left: 12px; bottom: 14px; width: min(340px, 40vw); }
.chat-log { max-height: 190px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; margin-bottom: 6px; mask-image: linear-gradient(transparent, #000 25%); padding-top: 20px; }
.chat-line { background: rgba(255,248,236,.88); border-radius: 12px; padding: 4px 10px; font-size: .86rem; width: fit-content; max-width: 100%; word-wrap: break-word; }
.chat-line b { color: var(--sky-dark); }
.chat-line.sys { background: rgba(247,183,51,.9); color: #5a3508; font-weight: 700; }
#chat-input { background: rgba(255,255,255,.92); border-radius: 99px; }
.hint { position: absolute; right: 12px; bottom: 14px; font-size: .75rem; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); max-width: 260px; text-align: right; pointer-events: none; }
.joystick { display: none; position: absolute; left: 24px; bottom: 110px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.35); border: 3px solid rgba(255,255,255,.7); touch-action: none; }
.joystick span { position: absolute; left: 35px; top: 35px; width: 50px; height: 50px; border-radius: 50%; background: rgba(255,255,255,.9); }
@media (pointer: coarse) {
  .joystick { display: block; }
  .hint { display: none; }
  .chat { bottom: auto; top: 70px; width: 60vw; }
  .chat-log { max-height: 90px; }
}
@media (max-width: 640px) {
  .hud-zone { top: 64px; }
  .action-btn { width: 56px; height: 56px; }
  .xpbar { width: 70px; }
  .hud-top-right .clock { display: none; }
}
.toasts { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--panel); border: 2px solid #fff; border-radius: 16px; padding: 10px 16px; box-shadow: var(--shadow); font-weight: 700; animation: toastIn .3s ease-out; display: flex; align-items: center; gap: 10px; max-width: 90vw; }
.toast.error { background: #ffe3df; color: #9b2c22; }
.toast.big { font-size: 1.1rem; padding: 14px 22px; font-family: var(--font-title); }
.toast .ticon { font-size: 1.8rem; }
.toast.out { opacity: 0; transform: translateY(-10px); transition: .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) scale(.95); } }
.offline { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%); background: var(--rose); color: #fff; padding: 8px 16px; border-radius: 99px; font-weight: 700; z-index: 70; }

/* Inventaire */
.inv-tools { display: flex; gap: 8px; margin-bottom: 10px; }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; }
.slot { aspect-ratio: 1; border-radius: 14px; background: var(--cream-2); border: 2px solid #eadbc2; position: relative; display: grid; place-items: center; font-size: 1.8rem; cursor: pointer; user-select: none; }
.slot.filled { background: #fff; }
.slot.selected { border-color: var(--honey); box-shadow: 0 0 0 3px #ffe29a; }
.slot.drag-over { border-color: var(--sky); }
.slot .qty { position: absolute; right: 5px; bottom: 2px; font-size: .75rem; font-weight: 800; }
.slot .fav { position: absolute; left: 4px; top: 1px; font-size: .7rem; }
.slot.r-uncommon { border-color: #7fd36b; } .slot.r-rare { border-color: #5ab0ff; } .slot.r-epic { border-color: #b884ff; } .slot.r-legendary { border-color: #ffb938; box-shadow: 0 0 10px #ffd86b; }
.item-detail { margin-top: 12px; background: #fff; border-radius: 16px; padding: 12px; display: flex; gap: 12px; align-items: flex-start; }
.item-detail .big { font-size: 2.6rem; }
.item-detail h3 { margin: 0; }
.rarity { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.rarity.common { color: #8a7a6a; } .rarity.uncommon { color: #3f9a4f; } .rarity.rare { color: #2d7fd6; } .rarity.epic { color: #8a4fe0; } .rarity.legendary { color: #d9870f; }

/* Listes (magasin, amis, journal) */
.list { display: grid; gap: 8px; }
.list-item { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 16px; padding: 10px 12px; }
.list-item .ico { font-size: 1.9rem; width: 44px; text-align: center; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .name { font-weight: 800; }
.list-item .sub { font-size: .82rem; color: var(--ink-soft); }
.price { font-family: var(--font-title); font-weight: 700; white-space: nowrap; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #c8b8a8; margin-right: 4px; }
.dot.on { background: #4cc864; }
.section-title { font-family: var(--font-title); font-weight: 600; color: var(--ink-soft); margin: 14px 0 6px; }
.journal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.journal-card { background: #fff; border-radius: 14px; padding: 10px; text-align: center; }
.journal-card .ico { font-size: 2rem; }
.journal-card.unknown { opacity: .55; }
.dialog { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); width: min(620px, 94vw); z-index: 40; cursor: pointer; }
.dialog .who { position: absolute; top: -16px; left: 22px; background: var(--honey); color: #5a3508; font-family: var(--font-title); font-weight: 700; padding: 4px 14px; border-radius: 99px; }
.dialog p { margin: 6px 0 0; font-size: 1.08rem; line-height: 1.45; }
.dialog .next { text-align: right; color: var(--ink-soft); font-size: .8rem; }
.emote-bar { position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; z-index: 30; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px dashed #eadbc2; }
.settings-row input[type=range] { width: 170px; }
.map-canvas { width: 100%; border-radius: 16px; background: #8ccf62; }

/* Mini-jeu de pêche */
.fish-game { position: fixed; left: 50%; bottom: 130px; transform: translateX(-50%); width: min(460px, 90vw); z-index: 45; background: var(--panel); border-radius: 22px; padding: 16px; box-shadow: var(--shadow); text-align: center; }
.fg-track { position: relative; height: 46px; background: linear-gradient(#5fc2ea, #2f8fc9); border-radius: 99px; overflow: hidden; }
.fg-zone { position: absolute; top: 4px; bottom: 4px; width: 24%; background: rgba(120, 230, 120, .55); border: 3px solid #d8ffd0; border-radius: 99px; }
.fg-fish { position: absolute; top: 50%; transform: translate(-50%, -50%); font-size: 1.7rem; }
.fg-progress { height: 10px; margin-top: 10px; background: #eadbc2; border-radius: 99px; overflow: hidden; }
.fg-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--honey), #7fd36b); width: 30%; }
.fish-game p { margin: 8px 0 0; font-weight: 700; }

/* Icônes 3D rendues hors écran (poissons) */
.item-ico { display: inline-grid; place-items: center; width: 1.3em; height: 1.3em; line-height: 1; }
.item-ico-3d { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(60, 40, 20, .25)); }
.slot .item-ico { width: 78%; height: 78%; font-size: 1.8rem; }
.item-detail .big .item-ico, .list-item .ico .item-ico, .journal-card .ico .item-ico { width: 1.5em; height: 1.5em; }

/* Compagnons */
.pets-panel { display: grid; gap: 10px; }
.pet-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: #fff; border-radius: 14px; border: 2px solid #eadbc2; flex-wrap: wrap; }
.pet-name { font-weight: 800; font-family: var(--font-title); }
.pet-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pet-actions .tag { background: #e7f6d8; color: #3e7a2a; border-radius: 999px; padding: 4px 10px; font-weight: 700; font-size: .8rem; }
.btn.small { padding: 6px 10px; font-size: .85rem; }
.btn.danger { background: #f6d6d0; color: #9b3322; }

/* Arcade */
.arcade-canvas { width: 100%; max-width: 520px; aspect-ratio: 520 / 360; display: block; margin: 8px auto; border-radius: 16px; box-shadow: 0 6px 18px rgba(40, 20, 60, .35); touch-action: none; }
.arcade-hud { text-align: center; font-family: var(--font-title); font-size: 1.3rem; font-weight: 800; }
.arcade-top ol { margin: 4px 0 12px 18px; }
.arcade-result { text-align: center; padding: 10px; }

/* Cabine d'essayage */
.wardrobe-row { margin: 10px 0; }
.wardrobe-row h4 { margin: 0 0 6px; }
.wardrobe-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.wopt { min-width: 44px; height: 40px; border-radius: 12px; border: 2px solid #eadbc2; background: #fff; font-weight: 800; cursor: pointer; display: grid; place-items: center; padding: 0 8px; }
.wopt.on { border-color: var(--honey); box-shadow: 0 0 0 3px #ffe29a; }
.wopt .swatch { width: 24px; height: 24px; border-radius: 50%; display: block; border: 2px solid rgba(0, 0, 0, .1); }
.wardrobe-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* Quêtes */
.quest { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 8px 0; background: #fff; border-radius: 14px; border: 2px solid #eadbc2; }
.quest.claimed { opacity: .6; }
.quest-main { flex: 1; }
.quest-name { font-weight: 800; }
.quest-bar { height: 8px; border-radius: 99px; background: #f1e6d3; overflow: hidden; margin: 6px 0 4px; }
.quest-bar span { display: block; height: 100%; background: linear-gradient(90deg, #7fd36b, #f7b733); }

/* ============================== Administration ============================== */
.page-admin { background: #f4efe6; }
.admin { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.admin-nav { background: #3b2a20; color: #fff4dc; padding: 18px 12px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.admin-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-title); font-size: 1.3rem; margin-bottom: 14px; }
.admin-brand img { width: 36px; height: 36px; }
.a-tab { text-align: left; padding: 10px 12px; border-radius: 12px; border: 0; background: transparent; color: inherit; font-weight: 700; cursor: pointer; font-size: .95rem; }
.a-tab:hover { background: rgba(255, 255, 255, .08); }
.a-tab.on { background: var(--honey, #f7b733); color: #3b2a20; }
.admin-back { margin-top: auto; color: #f2c66d; text-decoration: none; font-weight: 700; }
.admin-main { padding: 22px 28px; min-width: 0; }
.admin-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.admin-head h1 { font-family: var(--font-title); margin: 0; }
.a-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.a-card { background: #fff; border-radius: 16px; padding: 14px 16px; box-shadow: 0 2px 8px rgba(60, 40, 20, .08); }
.a-card-label { font-size: .8rem; color: #8a7462; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.a-card-value { font-family: var(--font-title); font-size: 1.6rem; margin-top: 4px; }
.a-card-sub { font-size: .8rem; color: #8a7462; }
.a-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 14px; margin-bottom: 14px; }
.a-panel { background: #fff; border-radius: 16px; padding: 14px 16px; box-shadow: 0 2px 8px rgba(60, 40, 20, .08); overflow: auto; margin-bottom: 14px; }
.a-panel h3 { margin: 0 0 10px; font-family: var(--font-title); }
.a-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.a-table th { text-align: left; color: #8a7462; font-size: .75rem; text-transform: uppercase; padding: 6px; border-bottom: 2px solid #f1e6d3; position: sticky; top: 0; background: #fff; }
.a-table td { padding: 6px; border-bottom: 1px solid #f5ede0; vertical-align: middle; }
.a-table a { color: #b8621b; font-weight: 700; }
.a-toolbar, .a-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.a-input { padding: 7px 10px; border-radius: 10px; border: 2px solid #eadbc2; background: #fffdf8; font: inherit; min-width: 0; }
.a-toolbar .a-input { flex: 1; min-width: 220px; }
.a-tag { padding: 2px 8px; border-radius: 99px; background: #eee; font-size: .78rem; font-weight: 700; }
.a-tag.on { background: #dff3d2; color: #2f6a1f; }
.a-plus { color: #2f8a2f; font-weight: 800; } .a-minus { color: #c0392b; font-weight: 800; }
.a-big { font-family: var(--font-title); font-size: 2rem; margin: 4px 0 8px; }
.a-warn { color: #b03a2e; font-weight: 700; }
.a-bars { display: flex; gap: 8px; align-items: flex-end; height: 140px; }
.a-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.a-bar span { width: 100%; background: linear-gradient(#f7b733, #e58e26); border-radius: 8px 8px 0 0; min-height: 3px; }
.a-inv { display: flex; flex-wrap: wrap; gap: 6px; }
.a-chip { background: #f6efe3; border-radius: 10px; padding: 4px 8px; font-size: .82rem; }
.a-log { background: #2a211b; color: #f3e6cf; padding: 12px; border-radius: 12px; font-size: .75rem; overflow: auto; max-height: 420px; white-space: pre-wrap; }
.a-setting label { flex: 1; min-width: 260px; font-weight: 700; }
@media (max-width: 800px) { .admin { grid-template-columns: 1fr; } .admin-nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; } .admin-main { padding: 14px; } }

/* Tour Horizon */
.elevator-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; max-height: 60vh; overflow: auto; padding: 4px; }
.floor-btn { border: 2px solid #c9a45c; background: linear-gradient(#2b2622, #3d342d); color: #f3e2b8; border-radius: 12px; padding: 8px 4px; cursor: pointer; display: grid; gap: 2px; font-family: var(--font-title); }
.floor-btn b { font-size: 1.15rem; } .floor-btn small { font-size: .68rem; color: #d8c79a; font-family: inherit; }
.floor-btn.lobby { grid-column: 1 / -1; background: linear-gradient(#6b4a35, #4a3326); }
.floor-btn.mine { border-color: #7fd36b; box-shadow: 0 0 0 2px #7fd36b inset; }
.floor-btn.here { outline: 3px solid #f7b733; }
.floor-btn:hover { filter: brightness(1.15); }
.apt-sale { display: grid; gap: 8px; }
.apt-price { font-family: var(--font-title); font-size: 2.1rem; color: #b8862b; }
.tower-mine { display: grid; gap: 8px; margin-top: 8px; }
/* Salle de sport */
.gym-bar { position: relative; height: 34px; border-radius: 99px; background: #2e3136; margin: 14px 0; overflow: hidden; cursor: pointer; touch-action: none; transition: box-shadow .1s; }
.gym-bar.hit { box-shadow: 0 0 0 4px #7fd36b; }
.gym-zone { position: absolute; top: 0; bottom: 0; background: linear-gradient(90deg, #4cd07a, #7fe39c); opacity: .85; }
.gym-cursor { position: absolute; top: -4px; bottom: -4px; width: 8px; margin-left: -4px; background: #fff; border-radius: 6px; box-shadow: 0 0 8px rgba(255, 255, 255, .8); }
.skill-ico { font-size: 1.8rem; width: 42px; text-align: center; }

/* Casino */
.slot-window { display: flex; gap: 8px; justify-content: center; background: linear-gradient(#8c1c2f, #5e1020); padding: 14px; border-radius: 18px; border: 4px solid #d6b25e; }
.slot-reel { width: 84px; height: 96px; display: grid; place-items: center; font-size: 3rem; background: #fffaf0; border-radius: 12px; box-shadow: inset 0 6px 12px rgba(0, 0, 0, .25); }
.slot-reel.spinning { filter: blur(1.5px); }
.slot-msg { text-align: center; font-family: var(--font-title); font-size: 1.2rem; min-height: 1.6em; }
.slot-msg.win { color: #2f8a2f; } .slot-msg.jackpot { color: #d4a017; font-size: 1.6rem; animation: pulse .5s infinite alternate; }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.08); } }
.roulette-grid { display: grid; grid-template-columns: repeat(13, 1fr); gap: 3px; margin: 10px 0; }
.rnum { border: 0; border-radius: 6px; color: #fff; font-weight: 800; padding: 8px 0; cursor: pointer; font-size: .85rem; }
.rnum.red { background: #c62828; } .rnum.black { background: #1b1b1b; } .rnum.green { background: #1f9a4a; grid-row: span 3; }
.rnum:hover { filter: brightness(1.25); }
.wopt.chip { border-radius: 50%; width: 46px; height: 46px; background: radial-gradient(#fff 40%, #f7b733 42%); }
.bet-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
.roulette-result { text-align: center; font-family: var(--font-title); font-size: 1.4rem; min-height: 1.6em; }
.roulette-result.win { color: #2f8a2f; }

/* HUD : la barre d'actions se place à droite du chat quand l'écran est étroit (plus de chevauchement) */
@media (max-width: 1280px) {
  .hud-bottom { left: auto; right: 12px; transform: none; bottom: 40px; flex-wrap: wrap; justify-content: flex-end; max-width: calc(100vw - min(340px, 40vw) - 40px); }
  .action-btn { width: 56px; height: 56px; font-size: 1.25rem; border-radius: 16px; }
  .action-btn small { font-size: .55rem; }
}

/* Compagnons : vie & éducation */
.pet-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.pet-stat small { font-weight: 700; color: #8a7462; }
.quest-bar.happy span { background: linear-gradient(90deg, #ff8fb1, #ff5d7a); }
.quest-bar.food span { background: linear-gradient(90deg, #f7b733, #e58e26); }
.pet-tricks { display: flex; flex-wrap: wrap; gap: 5px; width: 100%; }
.a-chip.learned { background: #dff3d2; color: #2f6a1f; font-weight: 700; }
.pet-row { flex-direction: column; align-items: stretch; }
.pet-cmds { display: inline-flex; gap: 4px; }
.simon { display: flex; justify-content: center; gap: 8px; min-height: 64px; margin: 14px 0; flex-wrap: wrap; }
.simon-key { font-size: 2.2rem; background: #fff; border-radius: 14px; padding: 6px 10px; border: 3px solid #eadbc2; transition: transform .1s; }
.simon-key.ok { border-color: #7fd36b; transform: scale(.9); opacity: .6; }
.simon-key.ko { border-color: #e2574c; animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* Éditeur de monde en jeu (admin, F2) */
.admin-editor { position: fixed; right: 12px; top: 70px; width: 300px; max-height: calc(100vh - 180px); overflow: auto; background: rgba(43, 38, 34, .94); color: #f3e2b8; border-radius: 16px; padding: 12px; z-index: 40; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); font-size: .85rem; }
.admin-editor .muted { color: #cdbd98; }
.ae-head { display: flex; align-items: center; gap: 6px; } .ae-head b { flex: 1; font-family: var(--font-title); font-size: 1rem; }
.ae-list { display: grid; gap: 4px; margin: 8px 0; }
.ae-item { text-align: left; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); color: inherit; border-radius: 10px; padding: 6px 8px; cursor: pointer; }
.ae-item.on { background: #f7b733; color: #2b2622; }
.ae-ctl { display: grid; gap: 6px; } .ae-pad { display: flex; gap: 4px; flex-wrap: wrap; } .ae-vals { font-family: monospace; }

/* Concession */
.car-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.car-card { background: #fff; border: 2px solid #eadbc2; border-radius: 16px; padding: 12px; display: grid; gap: 6px; justify-items: center; text-align: center; }
.car-card.owned { border-color: #7fd36b; }
.car-ico { font-size: 2.6rem; }
