@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Manrope:wght@400;500;600;700;800&display=swap');

:root{
  color-scheme:dark;
  --bg:#070b0e;
  --bg-2:#0a1115;
  --surface:#0f181d;
  --surface-2:#131f25;
  --line:rgba(255,255,255,.08);
  --line-strong:rgba(255,255,255,.15);
  --text:#eef4ec;
  --muted:#9daea7;
  --dim:#72837d;
  --lux:#8bf0b1;
  --lux-2:#c8ffdd;
  --lux-deep:#2b8f5d;
  --ember:#ff8a4d;
  --ember-2:#ffb36e;
  --aqua:#63d8e7;
  --gold:#d7b477;
  --violet:#b5a7ff;
  --radius:20px;
  --radius-sm:14px;
  --display:'Bricolage Grotesque',Manrope,system-ui,sans-serif;
  --body:'Manrope',system-ui,-apple-system,Segoe UI,sans-serif;
  --shadow:0 24px 60px rgba(0,0,0,.34);
  --safe-b:env(safe-area-inset-bottom,0px);
}

*,*::before,*::after{box-sizing:border-box}
html{height:100%;overflow:hidden}
body{
  margin:0;
  height:100%;
  overflow:hidden;
  background:#071318;
  color:var(--text);
  font-family:var(--body);
  font-size:16px;
  -webkit-font-smoothing:antialiased;
  overscroll-behavior:none;
}
::selection{background:rgba(139,240,177,.28);color:#fff}
a{color:inherit;text-decoration:none}
button,input,select,textarea{font:inherit}
button{
  color:inherit;
  cursor:pointer;
  border:1px solid var(--line);
  background:rgba(255,255,255,.04);
  border-radius:12px;
  min-height:44px;
  padding:10px 16px;
  transition:background .15s,border-color .15s,transform .15s,color .15s,filter .15s;
}
button:hover{background:rgba(255,255,255,.08);border-color:var(--line-strong)}
button:active{transform:translateY(1px)}
button:disabled{opacity:.45;cursor:not-allowed}
button:focus-visible,a:focus-visible,textarea:focus-visible{outline:3px solid var(--lux);outline-offset:3px}
button[hidden],[hidden]{display:none!important}
h1,h2,h3,p{margin-top:0}
img,svg{max-width:100%}
.eyebrow{display:block;font-size:9px;font-weight:800;letter-spacing:.2em;color:var(--lux);text-transform:uppercase}
.panel{
  background:linear-gradient(180deg,rgba(15,24,29,.94),rgba(10,17,21,.9));
  border:1px solid var(--line-strong);
  border-radius:18px;
  box-shadow:var(--shadow);
  backdrop-filter:blur(18px);
}

#world{
  position:fixed;
  inset:0;
  z-index:1;
  display:block;
  width:100vw;
  height:100vh;
  height:100dvh;
  touch-action:none;
}
.vignette{
  position:fixed;
  inset:0;
  z-index:4;
  pointer-events:none;
  background:radial-gradient(120% 92% at 50% 36%,transparent 52%,rgba(2,5,7,.52) 100%);
  box-shadow:inset 0 0 150px rgba(2,6,8,.48);
}

.game-header{
  position:fixed;
  top:0;
  left:0;
  right:0;
  z-index:30;
  display:flex;
  align-items:center;
  gap:16px;
  padding:18px clamp(14px,3vw,32px);
  background:linear-gradient(180deg,rgba(7,11,14,.94),rgba(7,11,14,.55) 62%,transparent);
  pointer-events:none;
}
.game-header>*{pointer-events:auto}
.brand{display:flex;align-items:center;gap:11px;min-width:0}
.gem{
  display:grid;
  place-items:center;
  width:38px;
  height:38px;
  flex:0 0 auto;
  border-radius:12px;
  background:linear-gradient(145deg,rgba(139,240,177,.2),rgba(139,240,177,.04));
  border:1px solid rgba(139,240,177,.28);
  color:var(--lux);
  font-size:20px;
  box-shadow:0 0 28px rgba(139,240,177,.12);
}
.brand-text{
  font-family:var(--display);
  font-size:21px;
  font-weight:800;
  letter-spacing:.14em;
  line-height:1;
  white-space:nowrap;
}
.brand-text>span{color:var(--lux)}
.brand-text small{
  display:block;
  margin-top:6px;
  font-family:var(--body);
  font-size:8px;
  font-weight:700;
  letter-spacing:.22em;
  color:var(--muted);
}
.resources{display:flex;gap:8px;margin-left:auto;min-width:0}
.resource{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:88px;
  padding:7px 12px;
  border-radius:12px;
  background:rgba(7,11,14,.72);
  border:1px solid var(--line);
  backdrop-filter:blur(14px);
}
.resource-icon{font-size:18px;line-height:1;color:#d2dec7}
.resource-copper .resource-icon{color:var(--ember-2)}
.resource-crystal .resource-icon{color:#9be9e7}
.resource-credits .resource-icon{color:var(--gold)}
.resource-value{font-size:14px;font-weight:800;line-height:1;white-space:nowrap}
.resource-value small{
  display:block;
  margin-top:4px;
  font-size:8px;
  font-weight:700;
  letter-spacing:.08em;
  color:var(--dim);
  text-transform:uppercase;
}
.icon-button{
  display:grid;
  place-items:center;
  min-width:44px;
  min-height:44px;
  padding:0 12px;
  border-radius:12px;
  background:rgba(7,11,14,.72);
  border:1px solid var(--line-strong);
  font-size:20px;
  backdrop-filter:blur(14px);
}
.icon-button:hover{background:rgba(255,255,255,.1)}

.quest{
  position:fixed;
  top:104px;
  left:clamp(14px,3vw,32px);
  z-index:20;
  width:300px;
  padding:18px 19px;
}
.quest::before{
  content:"";
  position:absolute;
  top:18px;
  bottom:18px;
  left:0;
  width:3px;
  border-radius:0 3px 3px 0;
  background:linear-gradient(180deg,var(--lux),rgba(139,240,177,0));
}
.quest-top{display:flex;align-items:center;justify-content:space-between;gap:10px}
.quest-count{
  padding:3px 7px;
  border:1px solid var(--line);
  border-radius:999px;
  color:var(--muted);
  font-size:10px;
  font-weight:800;
}
.quest h2{
  margin:9px 0 6px;
  font-family:var(--display);
  font-size:18px;
  line-height:1.12;
  letter-spacing:-.01em;
}
.quest p{margin:0 0 11px;color:var(--muted);font-size:12px;line-height:1.5}
.quest-progress{height:6px;overflow:hidden;border-radius:99px;background:rgba(255,255,255,.08)}
.quest-progress i{
  display:block;
  width:0;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg,var(--lux-deep),var(--lux));
  transition:width .4s ease;
}
.quest-foot{display:flex;align-items:flex-end;justify-content:space-between;gap:8px;margin-top:9px}
.quest-foot small{max-width:160px;color:var(--dim);font-size:10px;line-height:1.35}
.text-button{
  min-height:0;
  padding:0;
  border:0;
  background:none;
  color:var(--lux);
  font-size:10px;
  font-weight:800;
  text-decoration:underline;
  text-underline-offset:3px;
  white-space:nowrap;
}
.text-button:hover{background:none;border-color:transparent;color:var(--lux-2)}

.zone{
  position:fixed;
  top:112px;
  right:clamp(14px,3vw,32px);
  z-index:20;
  display:grid;
  gap:2px;
  padding:9px 13px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(7,11,14,.62);
  backdrop-filter:blur(12px);
  text-align:right;
}
.zone span{color:var(--lux);font-size:9px;font-weight:800;letter-spacing:.16em}
.zone small{color:var(--muted);font-size:10px}
.legend{
  position:fixed;
  left:clamp(14px,3vw,32px);
  bottom:108px;
  z-index:20;
  display:grid;
  gap:7px;
  padding:12px 14px;
  border-radius:14px;
  color:var(--muted);
  font-size:10px;
}
.legend span{display:flex;align-items:center;gap:8px}
.legend i{width:14px;color:var(--lux);font-style:normal;text-align:center}

.dock{
  position:fixed;
  left:clamp(14px,3vw,32px);
  right:clamp(14px,3vw,32px);
  bottom:calc(18px + var(--safe-b));
  z-index:25;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  pointer-events:none;
}
.dock>*{pointer-events:auto}
.player-card{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:250px;
  padding:11px 14px;
  border-radius:16px;
}
.avatar-icon{
  display:grid;
  place-items:center;
  width:44px;
  height:44px;
  flex:0 0 auto;
  border-radius:13px;
  border:1px solid var(--line-strong);
  background:radial-gradient(circle at 35% 28%,rgba(255,255,255,.2),transparent 55%),rgba(255,255,255,.05);
  font-size:23px;
}
.player-info{min-width:0}
.player-line{display:flex;align-items:center;gap:8px}
.player-line strong{
  font-family:var(--display);
  font-size:13px;
  letter-spacing:-.01em;
  white-space:nowrap;
}
.element-tag{
  padding:2px 5px;
  border:1px solid rgba(255,138,77,.3);
  border-radius:5px;
  background:rgba(255,138,77,.1);
  color:var(--ember-2);
  font-size:8px;
  font-weight:800;
  letter-spacing:.12em;
}
.element-tag.water{
  border-color:rgba(99,216,231,.3);
  background:rgba(99,216,231,.1);
  color:var(--aqua);
}
.player-info>small{
  display:block;
  margin-top:2px;
  overflow:hidden;
  color:var(--muted);
  font-size:10px;
  white-space:nowrap;
  text-overflow:ellipsis;
}
.energy-row{display:flex;align-items:center;gap:6px;margin-top:7px}
.energy-bolt{font-size:10px}
.energy-track{width:92px;height:5px;overflow:hidden;border-radius:99px;background:rgba(255,255,255,.09)}
.energy-track i{
  display:block;
  width:100%;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg,var(--gold),var(--lux));
  transition:width .3s ease;
}
.energy-track i.low{background:linear-gradient(90deg,#ff6b5f,var(--ember))}
.energy-row small{color:var(--dim);font-size:9px;white-space:nowrap}
.actions{display:flex;gap:8px}
.action{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  min-width:78px;
  min-height:58px;
  padding:8px 12px;
  border-radius:14px;
  background:linear-gradient(180deg,rgba(19,31,37,.96),rgba(10,17,21,.94));
  border:1px solid var(--line-strong);
  box-shadow:0 10px 24px rgba(0,0,0,.24);
}
.action:hover{background:linear-gradient(180deg,rgba(28,44,52,.98),rgba(13,23,28,.96));transform:translateY(-1px)}
.action-icon{font-size:19px;line-height:1}
.action-label{color:var(--muted);font-size:9px;font-weight:800;letter-spacing:.04em}
.action-label small{display:block;color:var(--dim);font-size:7px;font-weight:600}
.action.primary{
  min-width:120px;
  border-color:transparent;
  background:linear-gradient(135deg,var(--lux),#4fcb86);
  color:#062014;
  box-shadow:0 12px 30px rgba(80,203,134,.28);
}
.action.primary:hover{background:linear-gradient(135deg,var(--lux-2),#5ddb93);filter:brightness(1.02)}
.action.primary .action-label{color:#062014}
.action.primary .action-label small{color:rgba(6,32,20,.6)}

#toast{
  position:fixed;
  left:50%;
  bottom:104px;
  z-index:45;
  max-width:min(520px,calc(100vw - 28px));
  padding:11px 16px;
  border:1px solid rgba(139,240,177,.25);
  border-radius:12px;
  background:rgba(7,11,14,.94);
  box-shadow:var(--shadow);
  color:var(--text);
  font-size:12px;
  font-weight:600;
  line-height:1.4;
  text-align:center;
  opacity:0;
  pointer-events:none;
  transform:translate(-50%,12px);
  transition:opacity .2s,transform .2s;
}
#toast.visible{opacity:1;transform:translate(-50%,0)}
#saveLabel{
  position:fixed;
  right:clamp(14px,3vw,32px);
  bottom:calc(84px + var(--safe-b));
  z-index:20;
  padding:5px 9px;
  border:1px solid var(--line);
  border-radius:999px;
  background:rgba(7,11,14,.62);
  color:var(--dim);
  font-size:9px;
  backdrop-filter:blur(8px);
}

.overlay{
  position:fixed;
  inset:0;
  z-index:60;
  overflow:auto;
  overscroll-behavior:contain;
  background:
    radial-gradient(900px 620px at 82% 8%,rgba(255,112,54,.12),transparent 64%),
    radial-gradient(820px 660px at 10% 82%,rgba(57,157,185,.13),transparent 62%),
    radial-gradient(760px 600px at 50% 50%,rgba(31,110,82,.2),transparent 70%),
    linear-gradient(180deg,#070b0e 0%,#081116 52%,#070b0e 100%);
}
.welcome{display:grid;place-items:center;min-height:100vh;min-height:100dvh;padding:clamp(24px,5vw,60px) clamp(16px,4vw,40px)}
.welcome-glow{position:fixed;inset:0;z-index:0;pointer-events:none}
.welcome-glow::before{
  content:"";
  position:absolute;
  inset:auto -10% -24% -10%;
  height:58%;
  background:repeating-linear-gradient(180deg,rgba(139,240,177,.07) 0 1px,transparent 1px 30px);
  mask-image:linear-gradient(transparent,#000 32%,transparent 92%);
  transform:perspective(620px) rotateX(62deg);
  transform-origin:bottom;
  opacity:.55;
}
.welcome-glow::after{
  content:"";
  position:absolute;
  inset:0;
  background-image:
    radial-gradient(circle,rgba(255,179,110,.55) 0 1px,transparent 1.5px),
    radial-gradient(circle,rgba(139,240,177,.4) 0 1px,transparent 1.5px);
  background-size:190px 190px,250px 250px;
  background-position:22px 44px,90px 130px;
  mask-image:linear-gradient(180deg,#000,transparent 72%);
  opacity:.34;
}
.intro{position:relative;z-index:1;width:min(760px,100%);text-align:center}
.intro>.eyebrow{font-size:10px;letter-spacing:.24em}
.intro h1{
  margin:16px 0 18px;
  font-family:var(--display);
  font-size:clamp(34px,6vw,62px);
  line-height:.96;
  letter-spacing:-.045em;
  text-wrap:balance;
}
.intro h1 em{color:var(--lux);font-style:normal}
.intro>p{margin-bottom:28px;color:var(--muted);font-size:clamp(13px,1.6vw,16px);line-height:1.6}
.characters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;max-width:620px;margin:0 auto 22px}
.character{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:16px 18px 18px;
  border:1px solid var(--line-strong);
  border-radius:20px;
  background:linear-gradient(180deg,rgba(19,31,37,.94),rgba(10,17,21,.92));
  text-align:center;
  transition:transform .18s,border-color .18s,box-shadow .18s,background .18s;
}
.character:hover{transform:translateY(-2px);border-color:rgba(255,255,255,.24);background:linear-gradient(180deg,rgba(24,38,45,.96),rgba(10,17,21,.92))}
.character.selected{
  border-color:rgba(139,240,177,.55);
  background:linear-gradient(180deg,rgba(28,49,43,.96),rgba(10,17,21,.92));
  box-shadow:0 0 0 1px rgba(139,240,177,.22),0 18px 40px rgba(0,0,0,.35);
}
.character.water.selected{
  border-color:rgba(99,216,231,.55);
  background:linear-gradient(180deg,rgba(20,43,52,.96),rgba(10,17,21,.92));
  box-shadow:0 0 0 1px rgba(99,216,231,.22),0 18px 40px rgba(0,0,0,.35);
}
.char-badge{
  margin-bottom:6px;
  padding:4px 8px;
  border:1px solid var(--line);
  border-radius:999px;
  color:var(--muted);
  font-size:8px;
  font-weight:800;
  letter-spacing:.14em;
}
.character.fire .char-badge{border-color:rgba(255,138,77,.25);color:var(--ember-2)}
.character.water .char-badge{border-color:rgba(99,216,231,.25);color:var(--aqua)}
.char-art{width:min(160px,100%);height:124px;margin:0 auto}
.character strong{font-family:var(--display);font-size:24px;line-height:1;margin-top:2px}
.char-bonus{margin-top:5px;color:var(--lux);font-size:10px;font-weight:800}
.character p{margin:8px 0 0;color:var(--muted);font-size:11px;line-height:1.45}
.char-check{
  position:absolute;
  top:12px;
  right:12px;
  display:none;
  place-items:center;
  width:20px;
  height:20px;
  border-radius:50%;
  background:var(--lux);
  color:#062014;
  font-size:12px;
  font-weight:900;
}
.character.selected .char-check{display:grid}
.primary{
  border-color:transparent;
  background:linear-gradient(135deg,var(--lux),#4fcb86);
  color:#062014;
  font-weight:800;
}
.primary:hover{background:linear-gradient(135deg,var(--lux-2),#5ddb93);border-color:transparent;filter:brightness(1.02)}
.secondary{border-color:var(--line-strong);background:rgba(255,255,255,.04);font-weight:700}
.start{display:block;width:min(360px,100%);margin:0 auto;padding:15px 22px;border-radius:14px;font-size:14px}
#continueButton{display:block;width:min(360px,100%);margin:10px auto 0}
.disclaimer{display:block;max-width:430px;margin:18px auto 0;color:var(--dim);font-size:10px;line-height:1.6}

dialog#modal{
  width:min(620px,calc(100vw - 28px));
  max-height:min(86vh,760px);
  max-height:min(86dvh,760px);
  padding:0;
  overflow:hidden;
  border:1px solid var(--line-strong);
  border-radius:22px;
  background:linear-gradient(180deg,#101a20,#0a1115);
  color:var(--text);
  box-shadow:0 30px 90px rgba(0,0,0,.6);
}
dialog#modal[open]{display:flex;flex-direction:column;animation:modalIn .18s ease-out}
dialog#modal::backdrop{background:rgba(3,6,8,.72);backdrop-filter:blur(6px)}
@keyframes modalIn{from{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:none}}
.modal-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:20px 20px 14px;
  border-bottom:1px solid var(--line);
  background:linear-gradient(180deg,rgba(255,255,255,.03),transparent);
}
.modal-head h2{
  margin:4px 0 0;
  font-family:var(--display);
  font-size:24px;
  line-height:1.05;
  letter-spacing:-.03em;
}
.modal-head .icon-button{min-width:38px;min-height:38px;padding:0;font-size:16px}
#modalBody{padding:16px 20px 4px;overflow:auto;overscroll-behavior:contain}
#modalBody p{margin:0 0 14px;color:var(--muted);font-size:12px;line-height:1.6}
#modalBody strong{color:var(--text)}
#modalBody .note{
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:rgba(255,255,255,.03);
  color:var(--dim);
  font-size:10px;
  line-height:1.55;
}
#modalStatus{
  min-height:16px;
  margin:0;
  padding:0 20px 16px;
  color:var(--lux);
  font-size:11px;
}
#modalStatus:empty{display:none}
.recipe{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid var(--line)}
.recipe:last-of-type{border-bottom:0}
.recipe>div{min-width:0}
.recipe strong{display:block;font-size:13px;font-weight:800;line-height:1.3}
.recipe small{display:block;margin-top:3px;color:var(--muted);font-size:10px}
.recipe button{
  min-height:38px;
  padding:8px 13px;
  border-color:rgba(139,240,177,.24);
  background:rgba(139,240,177,.08);
  color:var(--lux);
  font-size:11px;
  font-weight:800;
  white-space:nowrap;
}
.recipe button:hover{background:rgba(139,240,177,.16);border-color:rgba(139,240,177,.4)}
.recipe button:disabled{border-color:var(--line);background:rgba(255,255,255,.03);color:var(--dim)}
.farm-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:6px;margin:14px 0}
.farm-grid button{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  min-height:0;
  aspect-ratio:1;
  padding:4px;
  border:1px solid var(--line);
  border-radius:9px;
  background:rgba(255,255,255,.035);
  font-size:16px;
}
.farm-grid button small{color:var(--muted);font-size:7px;font-weight:800}
.farm-grid button:hover{background:rgba(255,255,255,.08)}
.farm-grid button.ready{border-color:rgba(139,240,177,.35);background:rgba(139,240,177,.12);color:var(--lux)}
.farm-grid button.ready small{color:var(--lux)}
#farmInfo{color:var(--muted);font-size:10px}
.row-actions{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}
.row-actions button{
  flex:1 1 140px;
  min-height:40px;
  padding:9px 12px;
  border-color:var(--line-strong);
  background:rgba(255,255,255,.04);
  font-size:11px;
  font-weight:700;
}
.row-actions button:hover{background:rgba(255,255,255,.08)}
.row-actions .primary{border-color:transparent;background:linear-gradient(135deg,var(--lux),#4fcb86);color:#062014}
.row-actions .primary:hover{background:linear-gradient(135deg,var(--lux-2),#5ddb93)}
.danger{color:#ff9a8d!important;border-color:rgba(255,120,100,.25)!important;background:rgba(255,120,100,.06)!important}
.danger:hover{background:rgba(255,120,100,.12)!important}
.bag-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 0;border-bottom:1px solid var(--line);font-size:12px}
.bag-row:last-of-type{border-bottom:0}
.bag-row strong{font-size:15px}
.journal-row{display:flex;gap:11px;padding:11px 0;border-bottom:1px solid var(--line)}
.journal-row:last-of-type{border-bottom:0}
.journal-row>span{
  display:grid;
  place-items:center;
  width:24px;
  height:24px;
  flex:0 0 auto;
  border:1px solid var(--line);
  border-radius:50%;
  background:rgba(255,255,255,.05);
  color:var(--muted);
  font-size:11px;
}
.journal-row strong{display:block;font-size:12px;line-height:1.3}
.journal-row small{display:block;margin-top:3px;color:var(--muted);font-size:10px;line-height:1.4}
.rating{display:flex;gap:7px;margin:12px 0}
.rating button{
  flex:1;
  min-height:42px;
  border-color:var(--line-strong);
  background:rgba(255,255,255,.04);
  font-size:14px;
  font-weight:800;
}
.rating button.active{border-color:rgba(139,240,177,.45);background:rgba(139,240,177,.16);color:var(--lux)}
#modalBody textarea{
  width:100%;
  min-height:96px;
  margin:4px 0 2px;
  padding:11px 12px;
  resize:vertical;
  border:1px solid var(--line-strong);
  border-radius:10px;
  background:rgba(0,0,0,.22);
  color:var(--text);
  font:12px/1.5 var(--body);
}
#modalBody textarea::placeholder{color:var(--dim)}
#modalBody .row-actions:last-child{margin-bottom:0}

@media(max-width:760px){
  .game-header{padding:10px 12px 8px;gap:8px;flex-wrap:wrap}
  .gem{width:32px;height:32px;font-size:17px;border-radius:10px}
  .brand-text{font-size:17px;letter-spacing:.1em}
  .brand-text small{font-size:7px;letter-spacing:.14em;margin-top:5px}
  .resources{order:3;width:100%;gap:5px;margin:0;padding-top:2px}
  .resource{flex:1;min-width:0;padding:6px 8px;gap:6px;border-radius:10px}
  .resource-icon{font-size:15px}
  .resource-value{font-size:12px}
  .resource-value small{font-size:7px;margin-top:3px}
  .game-header>.icon-button{margin-left:auto;min-width:38px;min-height:38px;font-size:18px;padding:0 10px}
  .quest{top:118px;left:12px;width:214px;max-width:calc(100vw - 24px);padding:12px 13px;border-radius:14px}
  .quest::before{top:12px;bottom:12px}
  .quest h2{font-size:15px;margin:6px 0 4px}
  .quest p{display:none}
  .quest-foot{margin-top:7px}
  .quest-foot small{max-width:120px;font-size:9px}
  .quest .text-button{font-size:9px}
  .zone{top:118px;right:12px;max-width:130px;padding:7px 9px}
  .zone span{font-size:8px}
  .zone small{font-size:8px}
  .legend{display:none}
  .dock{left:10px;right:10px;bottom:calc(10px + var(--safe-b));display:block}
  .player-card{width:100%;min-width:0;margin-bottom:8px;padding:8px 10px;border-radius:13px;gap:9px}
  .avatar-icon{width:36px;height:36px;border-radius:10px;font-size:19px}
  .player-line strong{font-size:12px}
  .player-info>small{font-size:9px}
  .energy-track{width:min(140px,38vw)}
  .energy-row small{font-size:8px}
  .actions{gap:5px}
  .action{flex:1;min-width:0;min-height:52px;padding:6px 4px;border-radius:11px}
  .action-icon{font-size:17px}
  .action-label{font-size:8px}
  .action-label small{font-size:6px}
  .action.primary{flex:1.55;min-width:0}
  #toast{bottom:calc(148px + var(--safe-b));padding:9px 12px;font-size:11px}
  #saveLabel{display:none}
  .welcome{padding:26px 14px calc(20px + var(--safe-b));align-items:center}
  .intro{padding-top:8px}
  .intro>.eyebrow{font-size:9px}
  .intro h1{font-size:clamp(31px,9vw,42px);margin:12px 0 14px}
  .intro>p{font-size:12px;margin-bottom:20px}
  .characters{gap:9px;margin-bottom:18px}
  .character{padding:12px 10px 14px;border-radius:16px}
  .char-art{height:96px}
  .character strong{font-size:20px}
  .char-bonus{font-size:9px}
  .character p{font-size:10px}
  .char-badge{padding:3px 6px;font-size:7px}
  .start{padding:13px;font-size:13px}
  dialog#modal{width:calc(100vw - 20px);max-height:88vh;max-height:88dvh;border-radius:18px}
  .modal-head{padding:16px 15px 12px}
  .modal-head h2{font-size:20px}
  #modalBody{padding:13px 15px 2px}
  #modalStatus{padding:0 15px 13px}
  .recipe button{padding:8px 10px}
}

@media(max-width:374px){
  .zone{display:none}
  .quest{width:calc(100vw - 24px)}
}

@media(max-height:700px){
  .welcome{align-items:start;padding-top:20px}
  .intro h1{font-size:clamp(30px,5vw,48px);margin:10px 0 12px}
  .intro>p{margin-bottom:18px}
  .characters{margin-bottom:16px}
  .char-art{height:96px}
  .character p{display:none}
  .quest p{display:none}
  .legend{display:none}
}

@media(max-height:600px){
  .quest{top:92px;padding:11px 13px}
  .zone{top:98px}
  .dock{bottom:calc(8px + var(--safe-b))}
  .player-card{padding:7px 10px}
  .action{min-height:50px}
  .modal-head{padding:14px 16px 10px}
  #modalBody{padding-top:12px}
}

@media(max-height:600px) and (min-width:701px){
  #toast{bottom:calc(88px + var(--safe-b))}
}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}
}
.showroom-link{position:fixed;right:24px;bottom:120px;z-index:10;padding:10px 15px;border:1px solid rgba(139,240,177,.55);border-radius:12px;background:#0d211fde;color:#c8ffdd;font-weight:800;font-size:14px;box-shadow:0 10px 30px #0008}
.showroom-link:hover{background:#214735}
.account-link{padding:8px 12px;border:1px solid var(--line-strong);border-radius:10px;background:#10211ee6;color:var(--lux);font-size:13px;font-weight:800}
@media(max-width:700px){.showroom-link{right:12px;bottom:calc(156px + var(--safe-b));padding:7px 10px;font-size:12px}}
@media(max-width:700px){.account-link{padding:6px 8px;font-size:11px}}
