/* Lantern Lines: the game box (#ll) and everything drawn over the 3D raft. */
.ll {
  --ink: #fff7ea; --ink2: #c9c3e6; --gold: #ffc94d; --gold2: #ff9f2e; --coral: #ff6f61; --night: #1a1b46; --night2: #2a2563;
  --card: rgba(24, 22, 64, 0.9); --line: rgba(255, 236, 200, 0.14);
  position: relative; width: 100%; height: 100%; overflow: hidden; user-select: none; -webkit-user-select: none;
  touch-action: none; -webkit-tap-highlight-color: transparent; background: #1d2452; outline: none;
  font-family: 'Fredoka', 'Nunito', 'Segoe UI', system-ui, sans-serif; color: var(--ink); contain: layout paint; container-type: size;
}
.ll-canvas { position: absolute; inset: 0; display: block; z-index: 0; cursor: grab; }
.ll.dragging .ll-canvas { cursor: grabbing; }
.ll button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ll svg { width: 1em; height: 1em; fill: currentColor; display: block; }

/* ---------------------------------------------------------------- loading */
.ll-loading { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: radial-gradient(120% 90% at 50% 15%, #4a3d8f 0%, #1f2459 55%, #0e1130 100%); transition: opacity .6s; color: #fff; }
.ll-loading.gone { opacity: 0; pointer-events: none; }
.ll-loading p { margin: 0; font-weight: 600; font-size: 15px; opacity: .85; max-width: 80%; text-align: center; }
.ll-loadbar { width: 160px; height: 8px; border-radius: 6px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.ll-loadbar i { display: block; height: 100%; width: 40%; border-radius: 6px; background: linear-gradient(90deg, var(--gold), var(--coral)); animation: llLoad 1.1s ease-in-out infinite; }
@keyframes llLoad { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

/* ---------------------------------------------------------------- the logo */
.ll-logo { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: .2em; font-weight: 700; font-size: 44px; line-height: .95; letter-spacing: .01em; }
.ll-logo span { color: #fff6df; -webkit-text-stroke: .08em #3a1f6e; paint-order: stroke fill;
  text-shadow: 0 .08em 0 #24124a, 0 0 .5em rgba(255, 190, 90, .55), 0 .18em .3em rgba(0, 0, 0, .35); }
.ll-logo .b { color: var(--gold); -webkit-text-stroke-color: #7a2a12; text-shadow: 0 .08em 0 #561c0a, 0 0 .6em rgba(255, 150, 60, .7), 0 .18em .3em rgba(0, 0, 0, .35); }
.ll-logo.big { font-size: clamp(42px, 11cqw, 84px); transform: rotate(-2deg); }

/* ---------------------------------------------------------------- HUD */
.ll-hud { position: absolute; left: 0; right: 0; top: 0; z-index: 8; display: none; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 10px 12px 6px; pointer-events: none; }
.ll-hud.on { display: flex; }
.ll-hud > * { pointer-events: auto; }
.ll-mode { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 12px; border-radius: 22px; background: rgba(20, 18, 56, .62) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 230, 190, .18), 0 4px 14px rgba(0, 0, 0, .25); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); min-width: 0; }
.ll-mode svg { font-size: 20px; flex: none; }
.ll-mode b { font-weight: 600; font-size: 16px; white-space: nowrap; }
.ll-mode small { font-size: 12px; opacity: .7; white-space: nowrap; margin-left: -2px; }
.ll-mid { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none !important; min-width: 0; }
.ll-score { font-weight: 700; font-size: clamp(34px, 6.4cqw, 52px); line-height: 1; color: #fff8e8; -webkit-text-stroke: 5px #2a1758; paint-order: stroke fill;
  text-shadow: 0 3px 0 #2a1758, 0 0 18px rgba(255, 190, 90, .55); font-variant-numeric: tabular-nums; }
.ll-score.pop { animation: llPop .24s ease-out; }
@keyframes llPop { 0% { transform: scale(1.16); } 100% { transform: scale(1); } }
.ll-sub { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.ll-best { display: flex; align-items: center; gap: 5px; font-weight: 600; font-size: 14px; color: #ffe4a8; text-shadow: 0 2px 0 rgba(20, 10, 50, .7); }
.ll-best i svg { font-size: 15px; color: var(--gold); }
.ll-goal { display: flex; align-items: center; gap: 5px; padding: 3px 10px 3px 7px; border-radius: 14px; background: rgba(20, 18, 56, .62);
  box-shadow: inset 0 0 0 1px rgba(255, 230, 190, .16); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ll-goal i svg { font-size: 16px; }
.ll-goal.done { background: rgba(70, 150, 90, .75); }
.ll-goal.done::after { content: '✓'; font-weight: 700; margin-left: 2px; }
.ll-combo { position: absolute; top: 100%; left: 50%; translate: -50% 0; display: flex; align-items: center; gap: 7px; margin-top: 4px; white-space: nowrap; padding: 3px 12px; border-radius: 14px; background: linear-gradient(90deg, #ff9f2e, #ff5f8a);
  font-weight: 700; font-size: 14px; color: #fff; box-shadow: 0 3px 12px rgba(255, 110, 90, .45); opacity: 0; transform: scale(.7); transition: opacity .2s, transform .2s; }
.ll-combo.on { opacity: 1; transform: scale(1); }
.ll-combo .pips { display: flex; gap: 3px; }
.ll-combo .pips i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .3); }
.ll-combo .pips i.on { background: #fff; box-shadow: 0 0 6px #fff; }
.ll-tr { display: flex; gap: 8px; }
.ll-round { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 21px; background: rgba(20, 18, 56, .62) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 230, 190, .18), 0 4px 14px rgba(0, 0, 0, .25); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: transform .12s; }
.ll-round:hover, .ll-mode:hover { transform: translateY(-1px); }
.ll-round.off { color: #8a86b0; }
.ll[data-small] .ll-mode small { display: none; }
.ll[data-small] .ll-hud { padding: 8px 8px 4px; gap: 6px; }
.ll[data-small] .ll-round { width: 40px; height: 40px; font-size: 19px; }
.ll[data-small] .ll-mode { height: 40px; padding: 0 11px; }
.ll[data-danger] .ll-score { text-shadow: 0 3px 0 #2a1758, 0 0 18px rgba(255, 90, 90, .7); }

/* ---------------------------------------------------------------- floating words */
.ll-floats { position: absolute; inset: 0; z-index: 7; pointer-events: none; overflow: hidden; }
.ll-float { position: absolute; transform: translate(-50%, -50%); font-weight: 700; font-size: 26px; color: #fff; white-space: nowrap; -webkit-text-stroke: 4px #2a1758; paint-order: stroke fill;
  text-shadow: 0 3px 0 #2a1758; animation: llFloat 1.4s ease-out forwards; }
.ll-float.word { font-size: 30px; color: var(--gold); }
.ll-float.combo { font-size: 22px; color: #ffb0c8; }
.ll-float.big { font-size: clamp(30px, 6cqw, 46px); color: #fff3c4; text-shadow: 0 3px 0 #2a1758, 0 0 24px rgba(255, 200, 100, .8); }
.ll-float.gold { color: var(--gold); }
.ll-float.jar { font-size: 20px; color: #fff2a0; }
@keyframes llFloat { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  30% { transform: translate(-50%, -55%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -150%) scale(1); } }

/* ---------------------------------------------------------------- toast */
.ll-toast { position: absolute; left: 50%; bottom: 18px; transform: translate(-50%, 10px); z-index: 9; max-width: calc(100% - 32px); padding: 9px 18px; border-radius: 20px;
  background: rgba(20, 18, 56, .88); box-shadow: inset 0 0 0 1px rgba(255, 230, 190, .2), 0 6px 20px rgba(0, 0, 0, .3); font-weight: 600; font-size: 16px; text-align: center;
  opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; }
.ll-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- screens and cards */
.ll-screen { position: absolute; inset: 0; z-index: 20; display: none; align-items: center; justify-content: center; padding: 14px;
  background: radial-gradient(90% 80% at 50% 50%, rgba(12, 10, 40, .35), rgba(8, 6, 30, .62)); }
.ll-screen.on { display: flex; animation: llFade .25s ease-out; }
.ll-screen[data-name="title"] { background: linear-gradient(180deg, rgba(10, 8, 34, .05) 0%, rgba(10, 8, 34, .2) 45%, rgba(10, 8, 34, .55) 100%); }
@keyframes llFade { from { opacity: 0; } to { opacity: 1; } }
.ll-card { position: relative; width: min(440px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 14px; padding: 22px 22px 20px; border-radius: 22px;
  background: var(--card); box-shadow: inset 0 0 0 1px rgba(255, 230, 190, .2), 0 18px 50px rgba(0, 0, 0, .45); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: llCard .3s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes llCard { from { transform: translateY(14px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.ll-card h2 { margin: 0; font-weight: 700; font-size: 26px; text-align: center; color: #fff3d6; text-shadow: 0 0 16px rgba(255, 190, 90, .45); }
.ll-card p { margin: 0; text-align: center; line-height: 1.4; }
.ll-x { position: absolute; right: 10px; top: 10px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; opacity: .7; }
.ll-x:hover { opacity: 1; background: rgba(255, 255, 255, .08) !important; }
.ll-subtitle { color: var(--ink2); font-size: 15px; margin-top: -6px !important; }
.ll-small { color: var(--ink2); font-size: 14px; }
.ll-small.gold { color: var(--gold); font-weight: 600; }
.ll-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.ll-row.small .ll-btn { padding: 8px 12px; font-size: 14px; }
.ll-col { display: flex; flex-direction: column; gap: 10px; }
.ll-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 16px; font-weight: 600; font-size: 16px;
  background: rgba(255, 255, 255, .1) !important; box-shadow: inset 0 0 0 1px rgba(255, 230, 190, .16); transition: transform .12s, background .15s; }
.ll-btn:hover { background: rgba(255, 255, 255, .17) !important; transform: translateY(-1px); }
.ll-btn:active { transform: translateY(1px) scale(.98); }
.ll-btn.go { background: linear-gradient(180deg, #ffcf5a, #ff9a2e) !important; color: #3a1a06; box-shadow: 0 4px 0 #b55f12, 0 8px 20px rgba(255, 150, 50, .35); }
.ll-btn.go:hover { background: linear-gradient(180deg, #ffd96e, #ffa63e) !important; }
.ll-btn.big { padding: 14px 20px; font-size: 19px; }
.ll-btn.ghost { background: transparent !important; box-shadow: inset 0 0 0 1px rgba(255, 230, 190, .22); }
.il { display: inline-flex; align-items: center; gap: 7px; }
.il i svg { font-size: 18px; }
.il small { display: block; font-size: 12px; opacity: .7; font-weight: 500; }
.ll-scroll { overflow: auto; max-height: min(56cqh, 520px); margin: 0 -6px; padding: 0 6px; scrollbar-width: thin; scrollbar-color: rgba(255, 230, 190, .35) transparent; }

/* ---------------------------------------------------------------- the title */
.ll-title { display: flex; flex-direction: column; align-items: center; gap: 16px; width: min(560px, 100%); text-align: center; animation: llCard .45s cubic-bezier(.2, 1.2, .4, 1); }
.ll-tag { margin: -4px 0 4px; font-size: 16px; font-weight: 500; color: #fff1d8; text-shadow: 0 2px 6px rgba(0, 0, 0, .5); max-width: 420px; }
.ll-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.ll-modebtn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 10px 12px; border-radius: 20px; background: rgba(22, 18, 62, .82) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 230, 190, .2), 0 10px 28px rgba(0, 0, 0, .35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: transform .15s; }
.ll-modebtn:hover { transform: translateY(-3px); }
.ll-modebtn i { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; margin-bottom: 2px; color: #3a1a06;
  background: linear-gradient(180deg, #ffd56a, #ff9a2e); box-shadow: 0 0 18px rgba(255, 170, 70, .55); }
.ll-modebtn.daily i { background: linear-gradient(180deg, #8fe0ff, #4da3ff); box-shadow: 0 0 18px rgba(80, 170, 255, .5); color: #082a55; }
.ll-modebtn.trail i { background: linear-gradient(180deg, #b9f59a, #4fc46b); box-shadow: 0 0 18px rgba(90, 220, 120, .45); color: #0c3a1a; }
.ll-modebtn b { font-size: 19px; font-weight: 700; }
.ll-modebtn small { font-size: 12.5px; color: var(--ink2); line-height: 1.25; }
.ll-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ll-links .ll-btn { background: rgba(22, 18, 62, .7) !important; padding: 9px 14px; font-size: 14px; }
.ll[data-tall] .ll-modes { grid-template-columns: 1fr; max-width: 340px; }
.ll[data-tall] .ll-modebtn { flex-direction: row; text-align: left; gap: 12px; padding: 10px 14px; }
.ll[data-tall] .ll-modebtn i { margin: 0; flex: none; }
.ll[data-tall] .ll-modebtn b { flex: none; }
.ll[data-tall] .ll-modebtn small { flex: 1; text-align: right; }

/* ---------------------------------------------------------------- results, stars, badges */
.ll-results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ll-results div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 14px; background: rgba(255, 255, 255, .07); }
.ll-results b { font-size: 24px; font-weight: 700; color: #fff3d6; font-variant-numeric: tabular-nums; }
.ll-results span { font-size: 13px; color: var(--ink2); }
.ll-badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.ll-badges span { padding: 5px 12px; border-radius: 14px; font-size: 14px; font-weight: 600; background: linear-gradient(90deg, rgba(255, 190, 70, .25), rgba(255, 110, 140, .25)); box-shadow: inset 0 0 0 1px rgba(255, 200, 120, .35); }
.ll-stars { display: flex; justify-content: center; gap: 10px; font-size: 46px; }
.ll-stars i { color: rgba(255, 255, 255, .15); }
.ll-stars i.on { color: var(--gold); filter: drop-shadow(0 0 10px rgba(255, 190, 70, .7)); animation: llStar .5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes llStar { from { transform: scale(0) rotate(-40deg); } to { transform: none; } }
.ll-goals { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.ll-goals li { padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, .07); font-size: 15px; }
.ll-goals li.done { background: rgba(70, 150, 90, .4); }
.ll-goals li.done::before { content: '✓ '; font-weight: 700; }

/* ---------------------------------------------------------------- the level map */
.ll-place { margin-bottom: 14px; padding: 10px 12px 12px; border-radius: 16px; background: rgba(255, 255, 255, .05); }
.ll-place h3 { margin: 0 0 8px; font-size: 16px; font-weight: 600; color: #ffe4a8; }
.ll-place.t1 h3 { color: #ffb8a0; } .ll-place.t2 h3 { color: #a8c4ff; } .ll-place.t3 h3 { color: #9ff0dc; }
.ll-levels { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.ll-lv { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 14px;
  background: rgba(255, 255, 255, .1) !important; box-shadow: inset 0 0 0 1px rgba(255, 230, 190, .16); transition: transform .12s; }
.ll-lv:hover:not([disabled]) { transform: translateY(-2px); background: rgba(255, 255, 255, .18) !important; }
.ll-lv b { font-size: 19px; font-weight: 700; line-height: 1; }
.ll-lv.done { background: linear-gradient(180deg, rgba(255, 200, 80, .3), rgba(255, 140, 60, .2)) !important; }
.ll-lv.locked { opacity: .45; cursor: default; }
.ll-lv.locked i svg { font-size: 18px; }
.ll-lv .st { display: flex; gap: 1px; font-size: 10px; }
.ll-lv .st i { color: rgba(255, 255, 255, .22); }
.ll-lv .st i.on { color: var(--gold); }
.ll[data-small] .ll-levels { grid-template-columns: repeat(6, 1fr); gap: 5px; }
.ll[data-small] .ll-lv b { font-size: 16px; }

/* ---------------------------------------------------------------- settings, stats, help */
.ll-settings { display: flex; flex-direction: column; gap: 4px; }
.ll-tog, .ll-slide { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: 15px; cursor: pointer; }
.ll-tog input { width: 22px; height: 22px; accent-color: var(--gold2); cursor: pointer; }
.ll-slide input { width: 46%; accent-color: var(--gold2); }
.ll-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.ll-table th { text-align: left; font-weight: 500; color: var(--ink2); padding: 8px 4px; border-bottom: 1px solid var(--line); }
.ll-table td { text-align: right; font-weight: 600; padding: 8px 4px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.ll-help { scrollbar-width: thin; scrollbar-color: rgba(255, 230, 190, .35) transparent; margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.4; max-height: min(56cqh, 480px); overflow: auto; }
.ll-help b { color: #ffe4a8; }

/* a phone held sideways fills the screen (the page adds the rest) */
html.ll-immersive .ll-hud { padding-top: max(8px, env(safe-area-inset-top)); }
@media (prefers-reduced-motion: reduce) { .ll-float, .ll-card, .ll-title { animation-duration: .01s !important; } }
