html, body { margin: 0; height: 100%; overflow: hidden; background: #000; font-family: system-ui, sans-serif; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#hud { position: fixed; inset: 0; pointer-events: none; color: #fff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
#hud[hidden] { display: none; }
.hud-top { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; gap: 16px; }
.hud-health { width: min(320px, 50vw); }
.hbar { height: 14px; background: rgba(0,0,0,.45); border-radius: 7px; overflow: hidden; border: 1px solid rgba(255,255,255,.4); }
.hfill { height: 100%; width: 100%; background: #3ddc84; transition: width .2s; }
.hfill.low { background: #ff4d4d; }
.htext { font-size: 13px; }
.hud-stats { text-align: right; font-size: 16px; }
.hud-stats .big { font-size: 30px; }
.hud-mid { position: absolute; top: 28%; left: 0; right: 0; text-align: center; }
.hint { font-size: 18px; color: #ffe066; min-height: 24px; }
.toast { font-size: 22px; opacity: 0; transition: opacity .3s; min-height: 30px; }
.toast.on { opacity: 1; }
.hud-bottom { position: absolute; bottom: 14px; left: 12px; right: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: rgba(0,0,0,.5); border-radius: 12px; padding: 4px 10px; font-size: 13px; }
.chip.slot { border: 1px solid #ffe066; }

#screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(10, 20, 30, .55); overflow-y: auto; color: #fff; }
#screen[hidden] { display: none; }
.panel { background: rgba(20, 28, 38, .95); border: 1px solid rgba(255,255,255,.2); border-radius: 14px; padding: 20px 24px; width: min(460px, 92vw); max-height: 92vh; overflow-y: auto; margin: 16px; }
.panel.wide { width: min(980px, 96vw); }
h1 { margin: 0 0 4px; letter-spacing: 4px; }
h2, h3 { margin: 8px 0; }
.sub { color: #ffe066; margin: 4px 0 12px; }
.notice { background: rgba(255, 120, 60, .2); border: 1px solid #ff8a50; border-radius: 8px; padding: 8px 10px; }
.help { font-size: 12px; opacity: .8; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 8px 0; }
.buttons { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.buttons.end { justify-content: flex-end; }
button { background: #33414f; color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 8px; padding: 8px 14px; font-size: 14px; cursor: pointer; }
button.primary { background: #2e86de; border-color: #5aa7f0; }
button:hover:not(:disabled) { filter: brightness(1.15); }
button:disabled { opacity: .45; cursor: default; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.card { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.15); border-radius: 10px; padding: 10px 12px; }
.card.selected { border-color: #ffe066; }
.card.broken { border-color: #ff4d4d; }
.card.locked { opacity: .85; }
.card-head { display: flex; justify-content: space-between; align-items: center; }
.tag { font-size: 11px; background: rgba(255,255,255,.15); border-radius: 8px; padding: 2px 8px; }
.flavor { font-size: 12px; opacity: .8; margin: 4px 0 8px; min-height: 30px; }
.stats { display: grid; gap: 3px; margin-bottom: 8px; }
.stat { display: flex; justify-content: space-between; font-size: 12px; align-items: center; }
.pips { display: flex; gap: 3px; }
.pips i { width: 14px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.2); }
.pips i.on { background: #ffe066; }
.hbar.small { height: 8px; margin: 4px 0; }
.list { display: grid; gap: 6px; }
.power { background: rgba(255,255,255,.06); border-radius: 8px; padding: 6px 10px; margin: 0; }
small { opacity: .85; }

/* Login and account forms */
.account-form { display: grid; gap: 8px; margin: 8px 0; }
.account-form label { display: grid; gap: 4px; font-size: 13px; }
input[type=text], input[type=password] { background: rgba(0,0,0,.35); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; padding: 8px 10px; font-size: 15px; }
input:focus { outline: 2px solid #5aa7f0; outline-offset: 1px; }
.form-error { color: #ffb199; background: rgba(255, 80, 60, .15); border: 1px solid #ff6b50; border-radius: 8px; padding: 6px 10px; margin: 0; font-size: 13px; }
.form-error[hidden] { display: none; }
button.guest { width: 100%; padding: 14px; font-size: 18px; margin: 8px 0 4px; }
.divider { text-align: center; font-size: 13px; opacity: .75; margin: 12px 0 0; }
button.small { padding: 4px 10px; font-size: 12px; }
.block { display: block; }
.note { font-size: 12px; color: #ffb199; margin: 4px 0; }

/* Main screen: a transparent layer over the 3D scene */
#screen.layer { background: linear-gradient(rgba(10,20,30,.35), rgba(10,20,30,.1) 40%, rgba(10,20,30,.35)); }
.main-screen { position: absolute; inset: 0; }
.corner { position: absolute; z-index: 1; background: rgba(20, 28, 38, .82); border: 1px solid rgba(255,255,255,.18); border-radius: 12px; padding: 10px 14px; max-width: min(300px, 44vw); }
.corner.tl { top: 14px; left: 14px; }
.corner.tr { top: 14px; right: 14px; text-align: right; }
.corner.bl { bottom: 14px; left: 14px; width: 220px; }
.corner.br { bottom: 14px; right: 14px; text-align: right; }
.corner .big { font-size: 26px; }
.corner .buttons { margin: 6px 0 0; }
.corner .stats { margin: 6px 0 0; }
.main-centre { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -55%); width: min(440px, 90vw); text-align: center; text-shadow: 0 2px 6px rgba(0,0,0,.6); }
.main-centre .title { font-size: 56px; letter-spacing: 8px; }
.main-centre .help { text-shadow: 0 1px 3px rgba(0,0,0,.9); opacity: .9; }
button.play { font-size: 26px; padding: 14px 64px; margin: 10px 0; border-radius: 12px; }
.buttons.centre { justify-content: center; }
.buttons.centre button { min-width: 130px; }
@media (max-height: 640px), (max-width: 700px) {
  .corner.bl .stats { display: none; }
  .main-centre .title { font-size: 36px; }
  .main-centre .help { display: none; }
}
