















:root {
  --night: #101826;
  --night-2: #18243a;
  --night-3: #243350;
  --line: #3a4d70;
  --text: #eef2f8;
  --text-dim: #a9b6cc;
  --amber: #ffb547;
  --amber-ink: #3a2500;
  --cyan: #46d3e6;
  --cyan-ink: #04323a;
  --fuse: #6b3a44;
  --shut: #141d2d;
  --wall: #1a2438;
  --mg-scene-ground: #0b111d;
  --focus: #ffffff;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --cell: 32px;
  --gw: 60px;
  --gh: 60px;
  --clue: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; background: var(--night); color: var(--text); font-family: var(--font); font-size: 16px; }
body { display: flex; flex-direction: column; }
[hidden] { display: none !important; }

.studio-bar { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 48px; background: #0a101b; }
.studio-home { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; font-family: Georgia, 'Times New Roman', serif; font-weight: 700; font-size: 17px; }
.studio-home img { display: block; flex: 0 0 auto; width: 30px; height: 30px; }
.studio-home span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-back { margin-left: auto; color: var(--text-dim); text-decoration: none; font-size: 15px; padding: 10px 6px; white-space: nowrap; }
.studio-back:hover, .studio-back:focus-visible { color: var(--text); text-decoration: underline; }



@media (max-width: 560px) {
  .studio-back { font-size: 0; padding: 0; }
}

.ll { flex: 1 1 auto; width: 100%; padding: 16px; }

html[data-scene] main.ll { padding: 16px; }


html[data-scene] main.ll > .ll-setup, html[data-scene] main.ll > .ll-end { max-width: 640px; }


.ll-setup { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.ll-head h1 { margin: 0 0 8px; font-family: Georgia, 'Times New Roman', serif; font-size: 34px; }
.ll-head { background: rgba(16, 24, 38, 0.78); padding: 16px; border-radius: 20px; }
.ll-head p { margin: 0; color: var(--text); line-height: 1.4; }
.ll-card { border-image: url(../../shared/ui/kit/skins/glass/panel-default.svg) 20 20 24 20 fill / 20px 20px 24px 20px stretch; background: rgba(16, 24, 38, 0.55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ll-card h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--text-dim); }
.ll-card h2 ~ h2 { margin-top: 8px; }
.ll-card ul { margin: 0; padding-left: 20px; line-height: 1.5; display: flex; flex-direction: column; gap: 6px; }
.ll-chips { display: flex; flex-wrap: wrap; gap: 12px; }
.ll-chip, .ll-btn, .ll-tool, .ll-mini {
  font: inherit; font-weight: 700; min-height: 44px; cursor: pointer;
}

.skin-stone-button_primary, .skin-stone-toggle[aria-pressed="true"] { filter: saturate(0.18) brightness(1.12); font-weight: 700; }
.ll-chip[aria-disabled="true"] { opacity: 0.55; cursor: default; }
.ll-go { font: inherit; font-weight: 700; font-size: 18px; min-height: 52px; cursor: pointer; }
.ll-go:disabled { opacity: 0.5; cursor: default; }



.ll-launch { display: flex; flex-direction: column; gap: 12px; }
html[data-kit] main.ll button.ll-start { width: 100%; min-height: 104px; padding: 16px; font-family: Georgia, 'Times New Roman', serif; font-size: 32px; font-weight: 800; line-height: 1.1; }
.ll-picked { margin: 0; padding: 8px 16px; border-radius: 12px; background: rgba(16, 24, 38, 0.78); color: var(--text); text-align: center; font-weight: 600; line-height: 1.4; }

.ll-goal { margin: 0; padding: 8px 16px; border-radius: 12px; background: rgba(58, 37, 0, 0.72); border: 1px solid var(--amber); color: var(--text); text-align: center; font-weight: 600; line-height: 1.4; }
.ll-sky-rows { display: flex; flex-direction: column; gap: 12px; }

.ll-sky-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 12px; }
.ll-sky-row .ll-sky-tiles { grid-column: 1 / -1; }
.ll-sky-size { font-size: 13px; font-weight: 700; color: var(--text-dim); }
.ll-sky-count { font-size: 13px; color: var(--text-dim); white-space: nowrap; }
.ll-sky-tiles { display: flex; flex-wrap: wrap; gap: 6px; }
.ll-sky-tile { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--wall); cursor: pointer; }
.ll-sky-tile img { width: 26px; height: 26px; display: block; }
.ll-sky-tile.lit { border-color: var(--amber); box-shadow: 0 0 10px rgba(255, 181, 71, 0.35); }
.ll-sky-tile[aria-pressed="true"] { outline: 2px solid var(--text); outline-offset: 2px; }
.ll-prizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ll-prize { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--shut); color: var(--text-dim); font-size: 13px; font-weight: 600; line-height: 1.3; opacity: 0.75; }
.ll-prize img { width: 22px; height: 22px; flex: none; }
.ll-prize.won { border-color: var(--amber); color: var(--text); opacity: 1; }
.ll-more { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ll-more .ll-btn[aria-expanded="true"] { filter: brightness(1.25); }
@media (min-width: 900px) { html[data-kit] main.ll button.ll-start { min-height: 128px; font-size: 44px; } }
.ll-join { display: flex; gap: 12px; }
.ll-join input { flex: 1 1 auto; min-width: 0; font: inherit; min-height: 44px; text-transform: uppercase; }
.ll-row { display: flex; flex-wrap: wrap; gap: 12px; }
.ll-code { margin: 0; display: flex; align-items: center; gap: 12px; font-size: 26px; font-weight: 700; letter-spacing: 0.08em; }
.ll-pill { font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--text-dim); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.ll-status { margin: 0; color: var(--text-dim); line-height: 1.4; min-height: 1.4em; }

.ll-result .ll-status:empty { display: none; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }


.ll-match { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.ll-title { width: 100%; max-width: 1180px; display: flex; align-items: center; gap: 12px; min-height: 36px; font-weight: 600; }

html[data-kit] .ll-title .ll-mini { margin-left: auto; min-width: 0; min-height: 36px; padding: 4px 12px 6px; font-size: 14px; font-weight: 700; }
.ll-lastcall { color: var(--night); background: var(--text); border-radius: 6px; padding: 3px 10px; font-size: 14px; font-weight: 700; animation: ll-flicker 1.4s steps(2) 2; }

.ll-arena { width: 100%; display: grid; gap: 12px; grid-template-columns: 1fr 1fr; justify-items: stretch; }
.ll-arena .ll-boardwrap { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
.ll-arena.beside { grid-template-columns: 200px auto 200px; justify-content: center; gap: 24px; align-items: start; }
.ll-arena.beside .ll-boardwrap { grid-column: 2; grid-row: 1; }

.ll-crew { border-image: url(../../shared/ui/kit/skins/glass/panel-default.svg) 20 20 24 20 fill / 20px 20px 24px 20px stretch; background: rgba(16, 24, 38, 0.55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-radius: 20px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; position: relative; }

.ll-crew::before { content: ''; position: absolute; top: 3px; left: 10px; right: 10px; height: 3px; border-radius: 2px; background: var(--line); }
.ll-crew[data-seat="0"]::before { background: var(--amber); }
.ll-crew[data-seat="1"]::before { background: var(--cyan); }

.ll-crew .name { font-size: 13px; color: var(--text-dim); overflow-wrap: anywhere; }
.ll-crew .pts { font-size: 22px; font-weight: 700; line-height: 1.15; }
.ll-crew .sub { font-size: 12px; color: var(--text-dim); }
.ll-crew .frozen { font-size: 13px; font-weight: 700; color: var(--text); background: var(--fuse); border-radius: 4px; padding: 1px 6px; align-self: flex-start; }




.ll-arena:not(.beside) .ll-crew { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; align-items: center; height: 58px; }
.ll-arena:not(.beside) .ll-crew .win { display: none; }
.ll-arena:not(.beside) .ll-crew .name { grid-column: 1; grid-row: 1; line-height: 18px; }
.ll-arena:not(.beside) .ll-crew .pts { grid-column: 2; grid-row: 1 / span 2; font-size: 20px; white-space: nowrap; }
.ll-arena:not(.beside) .ll-crew .sub, .ll-arena:not(.beside) .ll-crew .frozen { grid-column: 1; grid-row: 2; line-height: 18px; justify-self: start; }
.ll-arena:not(.beside) .ll-crew .frozen { padding: 0 6px; }
.ll-arena.beside .ll-crew { padding: 16px; gap: 8px; }
.ll-arena.beside .ll-crew .pts { font-size: 36px; }
.ll-arena.beside .ll-crew .name { font-size: 15px; }
.ll-arena.beside .ll-crew .sub { font-size: 14px; }




.ll-boardwrap { position: relative; padding: 6px; background: rgba(10, 16, 27, 0.8); box-shadow: 0 10px 28px 6px rgba(0, 0, 0, 0.45); border-radius: 8px; }
.ll-board {
  display: grid; grid-template-columns: var(--gw) repeat(var(--cols), var(--cell));
  grid-template-rows: var(--gh) repeat(var(--rows), var(--cell));
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.ll-rowline { display: contents; }
.ll-clue { display: flex; color: var(--text); font-size: var(--clue); font-variant-numeric: tabular-nums; font-weight: 600; line-height: 1.2; }
.ll-clue.row { align-items: center; justify-content: flex-end; gap: 0.45em; padding-right: 6px; }
.ll-clue.col { flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 4px; }
.ll-clue.closed { color: #586a8a; font-weight: 400; }
.ll-clue.short { background: var(--night-3); color: #fff; border-radius: 4px; }
.ll-clue.crossed { background: rgba(255, 255, 255, 0.08); }
.ll-cell {
  appearance: none; border: 0; margin: 0; padding: 0; width: var(--cell); height: var(--cell);
  background: var(--wall) url(../assets/windows/dark_a.svg) center / 100% 100% no-repeat; background-origin: border-box;
  cursor: pointer; position: relative; color: transparent;
}


.ll-cell.edge-c { border-left: 2px solid #8496b8; }
.ll-cell.edge-r { border-top: 2px solid #8496b8; }


.ll-cell.vb { background-image: url(../assets/windows/dark_b.svg); }
.ll-cell.lit0.va { background-image: url(../assets/windows/lit0_a.svg); }
.ll-cell.lit0.vb { background-image: url(../assets/windows/lit0_b.svg); }
.ll-cell.lit0.vc { background-image: url(../assets/windows/lit0_c.svg); }
.ll-cell.lit1.va { background-image: url(../assets/windows/lit1_a.svg); }
.ll-cell.lit1.vb { background-image: url(../assets/windows/lit1_b.svg); }
.ll-cell.lit1.vc { background-image: url(../assets/windows/lit1_c.svg); }
.ll-cell.shut { background-image: url(../assets/windows/shut.svg); cursor: default; }
.ll-cell.fused { background-image: url(../assets/windows/fused.svg); cursor: default; }
.ll-cell.off { background-image: url(../assets/windows/off.svg); }
.ll-cell.marked { background-image: url(../assets/windows/mark.svg); }
.ll-cell.pending { box-shadow: inset 0 0 0 3px var(--text); animation: ll-pulse 0.6s infinite alternate; }
.ll-cell.aimed { box-shadow: inset 0 0 0 3px var(--text); z-index: 2; }
.ll-cell.axis { filter: brightness(1.35); }
.ll-cell:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; z-index: 3; }
.ll-cell.pop { animation: ll-pop 0.22s ease-out; }
.ll-cell.blow { animation: ll-shake 0.3s ease-out; }
.ll-board.frozen .ll-cell:not(.lit0):not(.lit1) { filter: saturate(0.4) brightness(0.8); }
.ll-board.veiled { filter: blur(7px); pointer-events: none; }
.ll-board.blackout .ll-cell { background-image: none; background-color: #000; box-shadow: none; }

.ll-boardwrap.block { padding: 0; box-shadow: none; background: radial-gradient(closest-side, rgba(6, 10, 18, 0.72), rgba(6, 10, 18, 0.45) 70%, rgba(6, 10, 18, 0)); }
.ll-block { position: relative; outline-offset: 2px; }
.ll-block.veiled { filter: blur(7px); pointer-events: none; }
.ll-canvas { display: block; touch-action: none; cursor: grab; }
.ll-canvas:active { cursor: grabbing; }
.ll-cut { display: flex; flex-wrap: nowrap; align-items: center; justify-content: center; gap: 12px; min-height: 44px; width: 100%; max-width: 620px; }
.ll-cut .ll-toggle { display: flex; gap: 8px; flex: none; }
.ll-cut .ll-chip { min-height: 44px; min-width: 44px; padding: 0 10px; }

.ll-cut-range { flex: 1 1 auto; min-width: 80px; height: 44px; appearance: none; -webkit-appearance: none; cursor: pointer; }
.ll-cut-range::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: rgba(0, 0, 0, 0.55); }
.ll-cut-range::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(0, 0, 0, 0.55); }
.ll-cut-range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%; border: 2px solid #fff3d6; background: #ffb547; }
.ll-cut-range::-moz-range-thumb { width: 20px; height: 20px; box-sizing: border-box; border-radius: 50%; border: 2px solid #fff3d6; background: #ffb547; }
.ll-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.ll-reveal.block { display: block; padding: 0; border-image: none; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: 0; animation: none; }

.ll-reveal.block .ll-canvas { touch-action: pan-y; }
.ll-count { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 72px; font-weight: 800; color: #fff; text-shadow: 0 2px 12px #000; pointer-events: none; }

.ll-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; min-height: 44px; }
.ll-toggle { display: flex; gap: 0; }
.ll-commit { font-weight: 700; }


.ll-hint { font-size: 13px; color: var(--text); background: rgba(16, 24, 38, 0.78); padding: 2px 12px; border-radius: 12px; }
.ll-hint:empty { display: none; }


.ll-end { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.ll-reveal { display: grid; grid-template-columns: repeat(var(--cols), var(--px)); grid-auto-rows: var(--px); padding: 16px; border-image: url(../../shared/ui/kit/skins/glass/panel-default.svg) 20 20 24 20 fill / 20px 20px 24px 20px stretch; background: rgba(16, 24, 38, 0.55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-radius: 20px; animation: ll-on 0.5s ease-out; }
.ll-reveal i { display: block; background: var(--wall) url(../assets/windows/dark_a.svg) center / 100% 100% no-repeat; }

.ll-reveal i.on { background-image: url(../assets/windows/lit0_a.svg); filter: saturate(0.35) brightness(1.2) drop-shadow(0 0 3px rgba(255, 220, 140, 0.7)); }
.ll-result { width: 100%; }
.ll-result h2 { font-size: 24px; color: var(--text); font-weight: 700; }
.ll-result p { margin: 0; }
.ll-tally { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ll-tally > div { background: rgba(10, 16, 27, 0.6); border-top: 4px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.ll-tally > div:first-child { border-top-color: var(--amber); }
.ll-tally > div:last-child { border-top-color: var(--cyan); }
.ll-tally b { font-size: 26px; }
.ll-tally span { font-size: 13px; color: var(--text-dim); }

.ll-toast { position: fixed; left: 16px; right: 16px; bottom: 16px; margin: 0 auto; max-width: 420px; background: var(--text); color: var(--night); padding: 12px 16px; border-radius: 10px; text-align: center; font-weight: 600; z-index: 10; overflow-wrap: anywhere; }

@keyframes ll-pop { from { transform: scale(0.6); } to { transform: scale(1); } }
@keyframes ll-shake { 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
@keyframes ll-pulse { from { opacity: 1; } to { opacity: 0.6; } }
@keyframes ll-flicker { 50% { opacity: 0.45; } }
@keyframes ll-on { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .ll-cell.pop, .ll-cell.blow, .ll-cell.pending, .ll-lastcall, .ll-reveal { animation: none; }
}
