:root{
  --app-height:100vh;
  --night-0:#061126;
  --night-1:#0b2040;
  --night-2:#15365b;
  --paper:#f7f1dd;
  --paper-ink:#17243a;
  --muted:#93a9c9;
  --line:rgba(190,226,255,.22);
  --panel:rgba(8,25,52,.72);
  --panel-strong:rgba(10,30,60,.9);
  --beacon:#40d9dc;
  --beacon-ink:#042f3b;
  --ember:#f3a844;
  --ember-ink:#3d2302;
  --dusk:#53657d;
  --dusk-ink:#f2f7ff;
  --focus:#fff5a8;
  --danger:#ff9bad;
  --success:#79f0d4;
  --shadow:0 28px 80px rgba(0,5,20,.48);
  --tile-size:clamp(38px,min(13.4vw,8.1dvh),64px);
  --reveal-duration:320ms;
  --reveal-stagger:50ms;
  --key-feedback-duration:130ms;
  --result-effect-duration:520ms;
}
@supports(height:100svh){:root{--app-height:100svh}}
@supports(height:100dvh){:root{--app-height:100dvh}}
*{box-sizing:border-box}
[hidden]{display:none!important}
html,body{width:100%;height:100%;min-height:0;overflow:hidden}
body{
  margin:0;
  color:#f7fbff;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:
    radial-gradient(circle at 18% 12%,rgba(55,204,226,.19),transparent 28%),
    radial-gradient(circle at 83% 77%,rgba(247,170,69,.13),transparent 30%),
    linear-gradient(145deg,var(--night-0),var(--night-1) 58%,#07172d);
  overscroll-behavior:none;
}
body:before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  opacity:.45;
  background-image:
    radial-gradient(circle at 13% 23%,#fff 0 1px,transparent 1.4px),
    radial-gradient(circle at 73% 18%,#fff 0 1px,transparent 1.4px),
    radial-gradient(circle at 31% 72%,#fff 0 1px,transparent 1.4px),
    radial-gradient(circle at 91% 62%,#fff 0 1px,transparent 1.4px),
    radial-gradient(circle at 58% 46%,#fff 0 1px,transparent 1.4px);
  background-size:210px 180px,260px 240px,240px 230px,300px 210px,280px 260px;
}
button,select,input,textarea{font:inherit}
button{border:0;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
button:disabled{cursor:not-allowed;opacity:.58}
button:focus-visible,select:focus-visible,input:focus-visible,textarea:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
.app{
  position:relative;
  isolation:isolate;
  width:min(100%,1080px);
  height:var(--app-height);
  min-height:0;
  margin:0 auto;
  padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
  display:grid;
  grid-template-rows:auto minmax(0,1fr);
  gap:10px;
  overflow:hidden;
}
.topbar{
  min-height:58px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:7px 10px 7px 14px;
  border:1px solid var(--line);
  border-radius:22px;
  background:linear-gradient(120deg,rgba(15,45,84,.9),rgba(7,25,53,.86));
  box-shadow:0 15px 44px rgba(0,5,20,.22),inset 0 1px 0 rgba(255,255,255,.09);
  backdrop-filter:blur(16px);
}
.brand-lockup{display:flex;align-items:center;gap:11px;min-width:0}
.brand-lantern{position:relative;width:38px;height:43px;flex:0 0 auto;border:2px solid rgba(174,244,249,.9);border-radius:13px 13px 17px 17px;background:linear-gradient(180deg,rgba(64,217,220,.35),rgba(64,217,220,.05));box-shadow:0 0 23px rgba(64,217,220,.36),inset 0 0 16px rgba(64,217,220,.2)}
.brand-lantern:before{content:"";position:absolute;width:17px;height:7px;left:50%;top:-8px;transform:translateX(-50%);border:2px solid rgba(174,244,249,.8);border-bottom:0;border-radius:9px 9px 0 0}
.brand-lantern span{position:absolute;width:13px;height:13px;left:50%;top:50%;transform:translate(-50%,-42%);border-radius:50%;background:var(--beacon);box-shadow:0 0 17px 7px rgba(64,217,220,.48)}
.brand-kicker,.camp-kicker,.dialog-kicker{display:block;font-size:9px;line-height:1.1;letter-spacing:.2em;text-transform:uppercase;font-weight:900;color:#8adce2}
h1,h2,p{margin:0}
h1{font-size:clamp(21px,4.2vw,31px);line-height:1;letter-spacing:-.045em}
.header-actions{display:flex;gap:6px}
.icon-button,.dialog-close{width:42px;min-width:42px;height:42px;border-radius:15px;color:#dff7ff;background:rgba(139,201,237,.11);box-shadow:inset 0 0 0 1px rgba(189,231,255,.16);font-weight:900;font-size:19px}
.icon-button:hover,.dialog-close:hover{background:rgba(139,201,237,.2)}
#muteButton[aria-pressed="true"]{color:#8195aa;background:rgba(139,201,237,.07)}
.game-layout{
  min-height:0;
  display:grid;
  grid-template-columns:minmax(320px,.88fr) minmax(390px,1.12fr);
  gap:10px;
}
.puzzle-panel,.control-panel{
  min-width:0;
  min-height:0;
  border:1px solid var(--line);
  border-radius:28px;
  background:linear-gradient(155deg,rgba(16,48,87,.82),rgba(5,20,44,.83));
  box-shadow:var(--shadow),inset 0 1px 0 rgba(255,255,255,.07);
  backdrop-filter:blur(14px);
  overflow:hidden;
}
.puzzle-panel{display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:8px;padding:12px}
.round-strip{min-height:34px;display:flex;align-items:center;justify-content:space-between;gap:8px;color:#c7d8ed;font-size:12px;font-weight:850}
.streak-label{white-space:nowrap}
.mode-picker{display:flex;align-items:center;gap:3px;padding:3px;border-radius:999px;background:rgba(1,11,28,.34);box-shadow:inset 0 0 0 1px rgba(189,231,255,.12)}
.mode-picker button{min-height:28px;padding:4px 9px;border-radius:999px;color:#aebfd4;background:transparent;font-size:10px;font-weight:950;letter-spacing:.04em;text-transform:uppercase}
.mode-picker button[aria-pressed="true"]{color:#062532;background:linear-gradient(180deg,#a7fff6,var(--beacon));box-shadow:0 0 13px rgba(64,217,220,.22)}
html[data-mode="crazy"] .mode-picker button[aria-pressed="true"]{color:#3d2302;background:linear-gradient(180deg,#ffd991,var(--ember));box-shadow:0 0 15px rgba(243,168,68,.28)}
.mode-chip{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:6px 9px;border-radius:999px;color:#ffe0a9;background:rgba(243,168,68,.14);box-shadow:inset 0 0 0 1px rgba(243,168,68,.22)}
.board{align-self:center;justify-self:center;display:grid;grid-template-rows:repeat(6,var(--tile-size));gap:5px;min-width:0;min-height:0;padding:6px;border-radius:25px;background:rgba(1,11,28,.3);box-shadow:inset 0 0 0 1px rgba(170,222,255,.08)}
.board-row{display:grid;grid-template-columns:repeat(5,var(--tile-size));gap:5px}
.tile{
  position:relative;
  display:grid;
  grid-template-areas:"letter";
  place-items:center;
  width:var(--tile-size);
  height:var(--tile-size);
  border:1px solid rgba(177,217,239,.28);
  border-radius:31% 31% 39% 39%/24% 24% 48% 48%;
  color:#cfe0ed;
  background:linear-gradient(180deg,rgba(28,61,96,.66),rgba(7,24,49,.78));
  box-shadow:inset 0 -4px 0 rgba(0,0,0,.12),0 5px 13px rgba(0,0,0,.13);
  overflow:hidden;
  font-size:clamp(18px,5vw,30px);
  font-weight:950;
  text-transform:uppercase;
}
.tile:before{content:"";position:absolute;left:50%;top:-3px;width:42%;height:7px;transform:translateX(-50%);border-radius:7px;background:rgba(170,216,239,.24)}
.tile.filled{color:var(--paper-ink);background:linear-gradient(180deg,#fff9e7,var(--paper));border-color:#fff7dc;transform:translateY(-1px);box-shadow:inset 0 -4px 0 rgba(62,45,11,.09),0 7px 18px rgba(0,0,0,.18)}
.tile.current{border-color:rgba(130,232,239,.68);box-shadow:0 0 0 2px rgba(64,217,220,.13),inset 0 -4px 0 rgba(0,0,0,.12)}
.tile-letter{grid-area:letter;position:relative;z-index:2}
.tile-glyph{position:absolute;right:4px;bottom:2px;z-index:3;font-size:clamp(10px,2.8vw,15px);line-height:1;font-weight:1000}
.tile[data-state="beacon"]{color:var(--beacon-ink);border-color:#90f7f1;background:radial-gradient(circle at 50% 40%,#bafff8 0 12%,transparent 13%),linear-gradient(180deg,#5fe9e2,var(--beacon));box-shadow:0 0 19px rgba(64,217,220,.28),inset 0 -5px 0 rgba(0,58,69,.12)}
.tile[data-state="beacon"]:after{content:"";position:absolute;inset:7px;border:2px solid rgba(1,69,80,.32);border-radius:50%}
.tile[data-state="ember"]{color:var(--ember-ink);border-color:#ffd28d;background:repeating-linear-gradient(135deg,rgba(255,255,255,.13) 0 5px,transparent 5px 10px),linear-gradient(180deg,#ffc76e,var(--ember));box-shadow:0 0 18px rgba(243,168,68,.23),inset 0 -5px 0 rgba(82,43,0,.13)}
.tile[data-state="dusk"]{color:var(--dusk-ink);border-color:#72849b;background:radial-gradient(circle at 25% 25%,rgba(255,255,255,.13) 0 2px,transparent 2.5px),linear-gradient(180deg,#65778e,var(--dusk));background-size:12px 12px,auto;box-shadow:inset 0 -5px 0 rgba(0,0,0,.14)}
.tile.reveal{animation:lanternReveal var(--reveal-duration) ease both;animation-delay:calc(var(--column)*var(--reveal-stagger))}
.feedback-zone{min-height:52px;display:grid;align-content:center;text-align:center;padding:4px 8px}
.chain-status{width:max-content;max-width:100%;margin:0 auto 3px;padding:4px 9px;border-radius:999px;color:#ffe2ae;background:rgba(243,168,68,.13);box-shadow:inset 0 0 0 1px rgba(243,168,68,.24);font-size:11px;font-weight:900;letter-spacing:.02em}
.chain-status strong{color:#fff;font-size:13px}
.prompt{font-size:13px;color:#bfd0e4}
.message{min-height:20px;margin-top:2px;color:#eef7ff;font-size:13px;font-weight:800}
.message.error{color:var(--danger)}
.message.success{color:var(--success)}
.control-panel{display:grid;grid-template-rows:auto minmax(0,1fr) auto auto;gap:12px;padding:14px}
.camp-card{position:relative;min-height:86px;display:grid;grid-template-columns:1fr auto;align-items:center;gap:12px;padding:14px 16px;border-radius:22px;overflow:hidden;background:linear-gradient(120deg,rgba(34,73,111,.68),rgba(18,45,78,.38));box-shadow:inset 0 0 0 1px rgba(191,229,250,.12)}
.camp-card>div:not(.camp-glow){position:relative;z-index:2}
.camp-card p{margin-top:6px;max-width:320px;color:#d4e0ee;font-size:13px;line-height:1.35}
.camp-glow{position:absolute;width:145px;height:145px;right:-50px;bottom:-82px;border-radius:50%;background:radial-gradient(circle,rgba(243,168,68,.45),rgba(243,168,68,0) 68%)}
.attempt-meter{width:60px;height:60px;display:grid;place-content:center;text-align:center;border-radius:50%;color:#08223a;background:linear-gradient(180deg,#fff1c9,#f5b75f);box-shadow:inset 0 -4px 0 rgba(96,52,0,.13),0 10px 23px rgba(0,0,0,.18)}
.attempt-meter strong{font-size:24px;line-height:.9}
.attempt-meter span{font-size:9px;font-weight:950;text-transform:uppercase;letter-spacing:.1em}
.keyboard{align-self:center;display:grid;gap:6px;width:100%;max-width:590px;margin:0 auto;user-select:none}
.keyboard-row{display:flex;justify-content:center;gap:5px;min-width:0}
.key{min-width:0;flex:1 1 0;height:clamp(44px,7.3dvh,62px);max-width:52px;border-radius:11px;color:#0d2037;background:linear-gradient(180deg,#e7f4fc,#b9cddd);box-shadow:inset 0 -4px 0 rgba(20,50,76,.13),0 5px 12px rgba(0,0,0,.13);font-weight:950;text-transform:uppercase}
.key.wide{flex:1.55 1 0;max-width:82px;font-size:11px}
.key[data-state="beacon"]{color:var(--beacon-ink);background:linear-gradient(180deg,#87f5ee,var(--beacon))}
.key[data-state="ember"]{color:var(--ember-ink);background:linear-gradient(180deg,#ffd491,var(--ember))}
.key[data-state="dusk"]{color:#f5f8fd;background:linear-gradient(180deg,#6c7e94,var(--dusk))}
.key:active{transform:translateY(2px);box-shadow:inset 0 -2px 0 rgba(20,50,76,.13)}
.key.input-pulse{animation:keyInputPulse var(--key-feedback-duration) ease both}
.round-actions{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:7px}
.primary-action,.secondary-action,.dialog-actions button{min-height:45px;border-radius:14px;padding:9px 12px;font-weight:900}
.primary-action,.dialog-actions .primary{color:#082a31;background:linear-gradient(180deg,#a7fff6,var(--beacon));box-shadow:inset 0 -4px 0 rgba(0,74,81,.12)}
.secondary-action,.dialog-actions button{color:#e8f5ff;background:rgba(145,197,227,.13);box-shadow:inset 0 0 0 1px rgba(189,231,255,.15)}
.state-legend{display:flex;justify-content:center;flex-wrap:wrap;gap:7px 13px;color:#aebfd4;font-size:11px;font-weight:750}
.state-legend span{display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
.legend-glyph{width:20px;height:20px;display:grid;place-items:center;border-radius:7px;font-style:normal;font-weight:1000}
.legend-glyph.beacon{color:var(--beacon-ink);background:var(--beacon)}
.legend-glyph.ember{color:var(--ember-ink);background:var(--ember)}
.legend-glyph.dusk{color:#fff;background:var(--dusk)}
.app-dialog{width:min(94vw,540px);max-height:calc(var(--app-height) - 24px);padding:0;border:0;border-radius:26px;color:#f4f9ff;background:transparent;box-shadow:var(--shadow);overflow:visible}
.app-dialog::backdrop{background:rgba(1,7,20,.75);backdrop-filter:blur(8px)}
.dialog-card{max-height:calc(var(--app-height) - 24px);display:grid;grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden;border:1px solid rgba(189,231,255,.2);border-radius:26px;background:linear-gradient(155deg,#14375e,#081a36 65%);box-shadow:inset 0 1px 0 rgba(255,255,255,.08)}
.dialog-header{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:18px 18px 12px}
.dialog-header h2{margin-top:4px;font-size:27px;letter-spacing:-.03em}
.dialog-close{font-size:27px}
.dialog-content{min-height:0;overflow:auto;padding:4px 18px 18px;color:#d7e4f2;line-height:1.45}
.dialog-content h3{margin:18px 0 7px;color:#fff;font-size:16px}
.dialog-content p{margin:0 0 10px}
.dialog-content ul{margin:8px 0 12px;padding-left:20px}
.dialog-content .legend-list{display:grid;gap:8px;margin:12px 0}
.legend-item{display:grid;grid-template-columns:38px 1fr;gap:10px;align-items:center;padding:9px;border-radius:14px;background:rgba(142,192,222,.09)}
.legend-item .sample{width:36px;height:36px;display:grid;place-items:center;border-radius:12px;font-weight:1000}
.legend-item .sample.beacon{color:var(--beacon-ink);background:var(--beacon)}
.legend-item .sample.ember{color:var(--ember-ink);background:var(--ember)}
.legend-item .sample.dusk{color:#fff;background:var(--dusk)}
.dialog-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px;padding:12px 18px 18px;border-top:1px solid rgba(189,231,255,.09)}
.setting-row{display:grid;grid-template-columns:1fr minmax(120px,190px);gap:16px;align-items:center;padding:13px 0;border-bottom:1px solid rgba(189,231,255,.1)}
.setting-row label,.setting-row strong{color:#fff;font-weight:850}
.setting-row small{display:block;margin-top:4px;color:#9fb3ca}
.setting-row select{min-height:42px;border:1px solid rgba(189,231,255,.18);border-radius:11px;padding:7px 10px;color:#eef8ff;background:#102c4d}
.toggle-label{display:flex;align-items:center;justify-content:flex-end;gap:8px}
.toggle-label input{width:22px;height:22px;accent-color:var(--beacon)}
.audio-status{margin:10px 0 0;color:#9fb3ca;font-size:11px;line-height:1.4}
.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:7px;margin:10px 0 18px}
.stat-card{padding:10px 5px;border-radius:14px;text-align:center;background:rgba(142,192,222,.1)}
.stat-card strong{display:block;color:#fff;font-size:25px}
.stat-card span{font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:#9fb3ca}
.distribution{display:grid;gap:6px}
.distribution-row{display:grid;grid-template-columns:20px 1fr 30px;gap:8px;align-items:center;font-size:12px}
.distribution-bar{height:22px;border-radius:8px;background:rgba(142,192,222,.1);overflow:hidden}
.distribution-fill{height:100%;min-width:3px;border-radius:8px;background:linear-gradient(90deg,#2dbbc1,var(--beacon))}
.summary-answer{margin:8px 0 14px;text-align:center}
.summary-answer span{display:block;color:#9fb3ca;font-size:10px;text-transform:uppercase;letter-spacing:.17em}
.summary-answer strong{display:block;margin-top:4px;color:#fff;font-size:36px;letter-spacing:.16em}
.share-fallback{width:100%;min-height:150px;padding:12px;border:1px solid rgba(189,231,255,.2);border-radius:12px;color:#071b33;background:#edf8ff;resize:vertical}
.danger-button{color:#ffdbe2!important;background:rgba(222,79,105,.15)!important;box-shadow:inset 0 0 0 1px rgba(255,155,173,.23)!important}
.shake{animation:shake .28s ease}
.app[data-outcome="won"] .puzzle-panel{animation:winLanternGlow var(--result-effect-duration) ease both}
.app[data-outcome="lost"] .puzzle-panel{animation:lossLanternFade var(--result-effect-duration) ease both}
.app[data-outcome="won"] + .app-dialog[open] .dialog-card{animation:resultDialogRise var(--result-effect-duration) cubic-bezier(.18,.82,.25,1.12) both}
html[data-motion-profile="cinematic"] .tile.reveal{box-shadow:0 0 28px rgba(64,217,220,.26),inset 0 -5px 0 rgba(0,0,0,.12)}
html[data-motion-profile="instant"] *,html[data-motion-profile="instant"] *:before,html[data-motion-profile="instant"] *:after{animation-duration:.001ms!important;animation-delay:0ms!important;transition-duration:.001ms!important;scroll-behavior:auto!important}
@keyframes lanternReveal{0%{transform:rotateX(0) scale(1)}45%{transform:rotateX(85deg) scale(.92)}55%{transform:rotateX(85deg) scale(.92)}100%{transform:rotateX(0) scale(1)}}
@keyframes shake{0%,100%{transform:translateX(0)}25%{transform:translateX(-5px)}50%{transform:translateX(5px)}75%{transform:translateX(-3px)}}
@keyframes keyInputPulse{0%,100%{transform:translateY(0) scale(1)}45%{transform:translateY(2px) scale(.94);filter:brightness(1.2)}}
@keyframes winLanternGlow{0%,100%{filter:none}45%{filter:drop-shadow(0 0 24px rgba(64,217,220,.8));transform:scale(1.008)}}
@keyframes lossLanternFade{0%,100%{filter:none}45%{filter:saturate(.55) brightness(.82);transform:scale(.995)}}
@keyframes resultDialogRise{0%{opacity:0;transform:translateY(14px) scale(.9)}55%{opacity:1;transform:translateY(0) scale(1.035)}100%{transform:scale(1)}}

html[data-theme="light"] body{--night-0:#e9f4f5;--night-1:#d7e8ee;--night-2:#c7dde8;--panel:rgba(242,250,252,.84);--panel-strong:rgba(235,247,250,.96);--line:rgba(24,65,91,.16);color:#10253a;background:radial-gradient(circle at 18% 12%,rgba(55,204,226,.22),transparent 28%),linear-gradient(145deg,#eef9f8,#dceaf1 58%,#ecf4f7)}
html[data-theme="light"] body:before{opacity:.12}
html[data-theme="light"] .topbar,html[data-theme="light"] .puzzle-panel,html[data-theme="light"] .control-panel{color:#10253a;background:linear-gradient(155deg,rgba(248,253,253,.92),rgba(226,239,244,.9));box-shadow:0 22px 60px rgba(32,70,93,.16),inset 0 1px 0 #fff}
html[data-theme="light"] .brand-kicker,html[data-theme="light"] .camp-kicker{color:#157d86}
html[data-theme="light"] .icon-button{color:#15324b;background:rgba(48,99,126,.14);box-shadow:inset 0 0 0 1px rgba(32,75,99,.18)}
html[data-theme="light"] .round-strip,html[data-theme="light"] .prompt,html[data-theme="light"] .state-legend{color:#536d82}
html[data-theme="light"] .mode-chip{color:#704100;background:rgba(211,132,24,.16);box-shadow:inset 0 0 0 1px rgba(151,88,5,.18)}
html[data-theme="light"] .message.success{color:#096f65}
html[data-theme="light"] .message.error{color:#a42d43}
html[data-theme="light"] .camp-card{background:linear-gradient(120deg,rgba(218,239,243,.9),rgba(229,239,244,.72))}
html[data-theme="light"] .camp-card p{color:#405c72}
html[data-contrast="high-contrast"]{--line:rgba(255,255,255,.65);--muted:#fff;--focus:#fff600;--beacon:#00ffff;--ember:#ffb000;--dusk:#303030}
html[data-contrast="high-contrast"] .tile,html[data-contrast="high-contrast"] .key{border-width:2px}
html[data-motion-profile="instant"] *,html[data-motion-profile="instant"] *:before,html[data-motion-profile="instant"] *:after,html[data-motion="reduced"] *,html[data-motion="reduced"] *:before,html[data-motion="reduced"] *:after{scroll-behavior:auto!important;animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}
@media(prefers-reduced-motion:reduce){html[data-motion="system"] *,html[data-motion="system"] *:before,html[data-motion="system"] *:after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}}
@media(prefers-color-scheme:light){html[data-theme="system"] body{--night-0:#e9f4f5;--night-1:#d7e8ee;--line:rgba(24,65,91,.16);color:#10253a;background:linear-gradient(145deg,#eef9f8,#dceaf1 58%,#ecf4f7)}html[data-theme="system"] .topbar,html[data-theme="system"] .puzzle-panel,html[data-theme="system"] .control-panel{color:#10253a;background:linear-gradient(155deg,rgba(248,253,253,.92),rgba(226,239,244,.9));box-shadow:0 22px 60px rgba(32,70,93,.16)}html[data-theme="system"] .round-strip,html[data-theme="system"] .prompt,html[data-theme="system"] .state-legend{color:#536d82}html[data-theme="system"] .icon-button{color:#15324b;background:rgba(48,99,126,.14);box-shadow:inset 0 0 0 1px rgba(32,75,99,.18)}html[data-theme="system"] .mode-chip{color:#704100;background:rgba(211,132,24,.16);box-shadow:inset 0 0 0 1px rgba(151,88,5,.18)}html[data-theme="system"] .message.success{color:#096f65}html[data-theme="system"] .message.error{color:#a42d43}}

.game-tip{position:absolute;left:50%;bottom:max(9px,env(safe-area-inset-bottom));z-index:12;width:max-content;max-width:min(calc(100% - 24px),520px);display:flex;align-items:center;gap:8px;padding:9px 13px;border:1px solid rgba(191,229,250,.22);border-radius:999px;color:#f4fbff;background:rgba(7,25,53,.92);box-shadow:0 12px 32px rgba(0,0,0,.3),inset 0 1px 0 rgba(255,255,255,.08);backdrop-filter:blur(14px);font-size:12px;font-weight:850;line-height:1.35;text-align:left;opacity:0;visibility:hidden;transform:translate(-50%,12px) scale(.98);transition:opacity .34s ease,transform .34s ease,visibility .34s ease;pointer-events:none;will-change:opacity,transform}
.game-tip.is-visible{opacity:1;visibility:visible;transform:translate(-50%,0) scale(1)}
.game-tip.is-fading{opacity:0;visibility:hidden;transform:translate(-50%,-6px) scale(.98)}
.game-tip-icon{flex:0 0 auto;color:var(--beacon);text-shadow:0 0 12px rgba(64,217,220,.72)}
.game-tip-text{min-width:0}
html[data-motion-profile="instant"] .game-tip{transition:none}
@media(max-width:520px){.game-tip{max-width:calc(100% - 18px);padding:8px 11px;font-size:11px}}
@media(max-width:859px){
  .game-tip{bottom:calc(max(9px,env(safe-area-inset-bottom)) + 168px)}
  .app{gap:6px;padding:max(5px,env(safe-area-inset-top)) max(5px,env(safe-area-inset-right)) max(5px,env(safe-area-inset-bottom)) max(5px,env(safe-area-inset-left))}
  .topbar{min-height:50px;border-radius:18px;padding:5px 7px 5px 10px}
  .brand-lantern{width:31px;height:35px;border-radius:10px 10px 14px 14px}
  .brand-lantern span{width:10px;height:10px}
  .brand-kicker{display:none}
  h1{font-size:22px}
  .icon-button{width:38px;min-width:38px;height:38px;border-radius:13px}
  .game-layout{grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) auto;gap:6px}
  .puzzle-panel,.control-panel{border-radius:20px}
  .puzzle-panel{gap:3px;padding:5px 7px 3px}
  .round-strip{min-height:26px;font-size:10px}
  .mode-chip{padding:4px 7px}
  .board{gap:4px;padding:4px;border-radius:18px}
  .board-row{gap:4px}
  .feedback-zone{min-height:38px;padding:1px 5px}
  .prompt{font-size:11px}
  .message{min-height:16px;margin-top:0;font-size:11px}
  .control-panel{grid-template-rows:minmax(0,1fr) auto auto;padding:7px;gap:6px;background:rgba(5,20,44,.72)}
  .camp-card{display:none}
  .keyboard{gap:4px;align-self:end}
  .keyboard-row{gap:4px}
  .key{height:44px;border-radius:8px;font-size:13px}
  .key.wide{font-size:9px}
  .round-actions{grid-template-columns:1fr 1fr 1fr;gap:4px}
  .primary-action,.secondary-action{min-height:40px;padding:6px;font-size:10px;border-radius:10px}
  .state-legend{display:none}
}
@media(max-width:350px){
  .header-actions{gap:3px}
  .icon-button{width:35px;min-width:35px;height:35px}
  .mode-label{display:none}
  .key{font-size:12px}
  .key.wide{font-size:8px}
}
@media(max-height:620px){
  :root{--tile-size:min(11.5vw,6.8dvh)}
  .topbar{min-height:44px}
  .brand-lantern{width:29px;height:32px}
  h1{font-size:20px}
  .icon-button{width:34px;min-width:34px;height:34px}
  .round-strip{min-height:23px}
  .feedback-zone{min-height:31px}
  .prompt{display:none}
  .key{height:42px}
}
@media(min-width:860px) and (max-height:700px){
  :root{--tile-size:min(7.1dvh,54px)}
  .app{gap:7px;padding:6px}
  .topbar{min-height:48px}
  .brand-lantern{width:31px;height:36px}
  h1{font-size:23px}
  .icon-button{width:38px;min-width:38px;height:38px}
  .game-layout{gap:7px}
  .puzzle-panel,.control-panel{border-radius:22px}
  .puzzle-panel{padding:7px;gap:4px}
  .round-strip{min-height:27px}
  .feedback-zone{min-height:37px}
  .control-panel{padding:9px;gap:7px}
  .camp-card{min-height:65px;padding:9px 12px}
  .camp-card p{margin-top:3px;font-size:11px}
  .attempt-meter{width:49px;height:49px}
  .attempt-meter strong{font-size:20px}
  .key{height:clamp(42px,8dvh,53px)}
  .state-legend{font-size:10px}
}
@media(max-width:420px) and (min-height:700px){:root{--tile-size:min(13.2vw,7.4dvh)}}
