* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: #000;
  font-family: "Lucida Console", "DejaVu Sans Mono", Consolas, monospace; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; cursor: pointer; }
button { font: inherit; }
.panel { background: #fff; border: 4px double #000; border-radius: 6px; box-shadow: 0 0 0 2px #fff; }

#overlay { position: fixed; inset: 0; pointer-events: none; display: grid; place-items: center; }
#cs-pic { width: 240px; image-rendering: pixelated; background: #fff; border: 4px double #000; border-radius: 6px; padding: 8px; }
#credits { position: absolute; inset: 0; background: #000; color: #fff; overflow: hidden; font-size: 20px; text-align: center; }
#credits div { position: absolute; left: 0; right: 0; animation: credits 22s linear forwards; line-height: 2; }
@keyframes credits { from { transform: translateY(100vh); } to { transform: translateY(-100%); } }

#zone { position: fixed; top: 10px; left: 10px; padding: 5px 10px; font-size: 13px; font-weight: bold; text-transform: uppercase; display: flex; gap: 12px; align-items: baseline; }
#zone-time, #zone-count { font-weight: normal; text-transform: none; color: #555; }

#party { position: fixed; top: 10px; right: 10px; width: 220px; padding: 6px 8px; font-size: 12px; opacity: .93; }
.pm-row { padding: 3px 4px; border-radius: 3px; cursor: pointer; }
.pm-row:hover { background: #eee; }
.pm-row.ko { color: #999; }
.pm-row span { float: right; font-weight: normal; }
.pm-row b { font-weight: bold; }
#party-info { margin-top: 5px; padding-top: 4px; border-top: 2px solid #000; display: flex; justify-content: space-between; }
.hpbar, .expbar { height: 6px; border: 1px solid #000; border-radius: 3px; background: #fff; overflow: hidden; margin: 2px 0; }
.hpbar i, .expbar i { display: block; height: 100%; background: #333; transition: width .22s; }
.hpbar i.low { background: repeating-linear-gradient(90deg, #000 0 2px, #fff 2px 4px); }
.expbar { height: 3px; } .expbar i { background: #888; }

#menu { position: fixed; right: 10px; bottom: 10px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 60vw; }
#menu button, button.gb { font-size: 13px; padding: 6px 12px; background: #fff; border: 2px solid #000; border-radius: 4px; cursor: pointer; }
#menu button:hover, button.gb:hover:not(:disabled) { background: #000; color: #fff; }
button.gb:disabled { color: #999; border-color: #bbb; cursor: default; }
button.gb.sel { background: #000; color: #fff; }

#chat { position: fixed; left: 10px; bottom: 10px; width: min(420px, calc(100vw - 20px)); opacity: .93; }
#chat-log { height: 140px; overflow-y: auto; padding: 6px 8px; font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
#chat-log .who { font-weight: bold; cursor: pointer; } #chat-log .who:hover { text-decoration: underline; }
#chat-log .pm { color: #7a1fa2; } #chat-log .sys { color: #555; font-style: italic; }
#chat-input { width: 100%; border: 0; border-top: 2px solid #000; padding: 7px 8px; font: inherit; font-size: 12px; outline: none; background: transparent; }
#chat-input:focus { background: #f1f1f1; }

#toasts { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); display: grid; gap: 6px; pointer-events: none; z-index: 30; }
.toast { background: #000; color: #fff; padding: 8px 14px; border-radius: 4px; font-size: 14px; animation: toast 3.2s forwards; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-8px); } 10%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }

#dialog { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); width: min(660px, calc(100vw - 20px));
  min-height: 96px; padding: 14px 18px; font-size: 18px; line-height: 1.5; cursor: pointer; user-select: none; z-index: 20; }
#dialog p { margin: 0; white-space: pre-wrap; }
#dialog-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
#dialog-choices:empty { display: none; }
#dialog-next { position: absolute; right: 12px; bottom: 6px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

#modal { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.35); z-index: 15; }
#modal[hidden] { display: none; }
#modal-box { position: relative; width: min(720px, calc(100vw - 20px)); max-height: calc(100vh - 40px); overflow: auto; padding: 14px 18px; }
#modal-title { margin: 0 0 10px; font-size: 18px; }
#modal-close { position: absolute; top: 8px; right: 10px; border: 0; background: none; font-size: 18px; cursor: pointer; }
.list { display: grid; gap: 4px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 8px; border: 2px solid #000; border-radius: 4px; cursor: pointer; font-size: 13px; }
.row:hover { background: #eee; } .row.dim { color: #999; border-color: #ccc; cursor: default; } .row.sel { background: #000; color: #fff; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card { display: flex; gap: 10px; align-items: center; } .card img { width: 64px; image-rendering: pixelated; }
.dexgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 4px; font-size: 11px; }
.dexgrid div { border: 1px solid #000; padding: 3px 5px; border-radius: 3px; cursor: pointer; } .dexgrid .unk { color: #aaa; border-color: #ddd; cursor: default; }
.dexgrid .got::after { content: " ●"; }
.muted { color: #666; font-size: 12px; } .small { font-size: 12px; }
.clue { border-left: 4px solid #000; padding: 4px 10px; margin: 6px 0; } .clue b { display: block; }
.moves { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 6px; } .moves div { border: 1px solid #000; padding: 3px 6px; border-radius: 3px; font-size: 12px; }

#popup { position: fixed; z-index: 25; padding: 6px; display: grid; gap: 4px; }
#popup[hidden] { display: none; }

#battle { position: fixed; inset: 0; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 10; }
#battle[hidden] { display: none; }
#bt-scene { position: relative; width: min(640px, 100vw); height: 360px; }
#bt-scene img { position: absolute; image-rendering: pixelated; transition: opacity .15s, transform .2s; }
#bt-foe-pic { right: 32px; top: 4px; } #bt-me-pic { left: 32px; bottom: 0; }
#bt-scene img.out { opacity: 0; transform: translateY(30px); }
#bt-scene img.slide { transform: translateX(120%); }
.bt-info { position: absolute; width: 260px; font-size: 16px; padding: 6px 10px; border-left: 4px solid #000; border-bottom: 4px solid #000; }
.bt-info span { float: right; }
#bt-foe-info { left: 16px; top: 20px; } #bt-me-info { right: 16px; bottom: 16px; }
#bt-me-num { float: none !important; font-size: 13px; }
#bt-foe-balls { font-size: 11px; letter-spacing: 2px; margin-top: 2px; }
#bt-box { width: min(640px, calc(100vw - 16px)); min-height: 136px; padding: 14px 18px; font-size: 18px; line-height: 1.4; cursor: pointer; }
#bt-box p { margin: 0 0 10px; min-height: 1.4em; }
#bt-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#bt-menu small { font-size: 11px; opacity: .7; }
.shake { animation: shake .15s; } @keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.blink { animation: hit .25s steps(2) 2; } @keyframes hit { 50% { opacity: 0; } }

#login, #lost { position: fixed; inset: 0; display: grid; place-items: center; background: #fff; z-index: 40; }
#lost { background: rgba(0, 0, 0, .7); }
#login[hidden], #lost[hidden] { display: none; }
.box { padding: 22px 26px; width: min(380px, calc(100vw - 24px)); text-align: center; }
.box h1 { margin: 0 0 18px; font-size: 24px; line-height: 1.3; letter-spacing: 1px; }
.box label { display: block; margin: 10px 0 6px; font-size: 14px; }
.box input { width: 100%; padding: 8px; font: inherit; font-size: 18px; text-align: center; border: 2px solid #000; border-radius: 4px; }
.box button { margin-top: 14px; width: 100%; padding: 10px; font-size: 16px; font-weight: bold; color: #fff; background: #000; border: 0; border-radius: 4px; cursor: pointer; }
.box button:disabled { background: #888; cursor: wait; }
#login-error { min-height: 1.2em; margin: 10px 0 0; font-size: 13px; font-weight: bold; }
.hint { margin: 8px 0 0; font-size: 11px; color: #555; }

/* Parc Safari, Casino, Apparence, chat de groupe */
#safari { position: fixed; top: 52px; left: 50%; transform: translateX(-50%); padding: 6px 12px; font-size: 13px; z-index: 5; }
.slot-reels { display: flex; gap: 10px; justify-content: center; margin: 12px 0; }
.slot-reel { width: 74px; height: 74px; display: grid; place-items: center; background: #fff; border: 3px solid #222; border-radius: 6px; }
.slot-ico { display: inline-block; image-rendering: pixelated; vertical-align: middle; }
.slot-pay { margin-right: 10px; white-space: nowrap; }
.slot-bets { display: flex; gap: 8px; justify-content: center; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { display: flex; padding: 3px; border: 2px solid transparent; border-radius: 6px; background: none; cursor: pointer; }
.swatch.sel { border-color: #c03028; }
.swatch i { width: 18px; height: 26px; display: block; }
#chat-log .group .who { color: #2a7a3a; }

#login-create { margin-top: 8px; width: 100%; }
