@font-face { font-family: Poppins; font-weight: 500; src: url(../assets/fonts/Poppins-Medium.woff2); font-display: swap; }
@font-face { font-family: Poppins; font-weight: 600; src: url(../assets/fonts/Poppins-SemiBold.woff2); font-display: swap; }
@font-face { font-family: Poppins; font-weight: 700; src: url(../assets/fonts/Poppins-Bold.woff2); font-display: swap; }
@font-face { font-family: Inter; font-weight: 100 900; src: url(../assets/fonts/Inter.woff2); font-display: swap; }
:root { --bg: #F2F3F8; --card: #FFFFFF; --cell: #E4E6EF; --ink: #1C1E2B; --mute: #5C6075; --line: #D9DCE7; --dark: #1C1E2B; --danger: #C93A3A; --off: #767B90; --thumb: #B9BDCE; --key: #DDE0EB; --c: #FFC23D; --shadow: 0 2px 10px #1c1e2b10; color-scheme: light; }
[data-theme=dark] { --bg: #14151F; --card: #252838; --cell: #353950; --ink: #F1F2F8; --mute: #A4A8BC; --line: #383C4F; --danger: #FF8585; --off: #50556D; --thumb: #555B76; --key: #6E748F; --shadow: none; color-scheme: dark; }
* { box-sizing: border-box; margin: 0; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { font: 400 16px/1.5 Inter, system-ui, sans-serif; color: var(--ink); min-height: 100dvh; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, .btn, .tname, dd, .timer, .status { font-family: Poppins, system-ui, sans-serif; }
h1, h2, h3 { line-height: 1.2; font-weight: 600; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--thumb); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; min-height: 40px; }
::-webkit-scrollbar-thumb:hover { background-color: var(--mute); }
::-webkit-scrollbar-button, ::-webkit-scrollbar-corner { display: none; background: transparent; }
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: var(--thumb) transparent; } }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
#app { min-height: 100dvh; display: flex; flex-direction: column; padding: 0 max(16px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(16px, env(safe-area-inset-left)); }
.btn { font-size: 15px; font-weight: 500; min-height: 46px; padding: 8px 18px; border: 0; border-radius: 14px; background: none; color: inherit; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; line-height: 1.25; transition: background .16s, transform .16s, opacity .16s; touch-action: manipulation; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary { background: var(--ink); color: var(--bg); }
.game .btn.primary { background: var(--c); color: var(--dark); }
.btn.ghost { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.btn.danger { color: var(--danger); }
.btn.icon { width: 46px; padding: 0; border-radius: 50%; flex: none; }
.btn.big { min-height: 56px; font-size: 18px; width: 100%; }
@media (hover: hover) { .btn.icon:hover, .btn.ghost:hover:not(:disabled) { background: var(--cell); } .btn.primary:hover:not(:disabled) { opacity: .88; } }
.ic { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn .ic { width: 22px; height: 22px; }
.glyph { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.glyph .dot { fill: currentColor; stroke: none; }
.glyph circle.dot { stroke: currentColor; stroke-width: 1; }
.stars { display: inline-flex; gap: 2px; }
.star { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; opacity: .5; }
.star.on { fill: currentColor; opacity: 1; }

.top { display: flex; align-items: center; justify-content: space-between; height: 68px; width: 100%; max-width: 1080px; margin: 0 auto; flex: none; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { font-size: 22px; font-weight: 700; }
.logo { width: 34px; height: 34px; flex: none; }
.top nav { display: flex; margin-right: -10px; }
.hub main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; display: grid; gap: 28px; align-content: start; justify-items: center; }
.boardwrap { width: 100%; max-width: 620px; }
.dayline { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.dayline h2 { font-size: clamp(18px, 5vw, 24px); }
.dayline p { color: var(--mute); font-size: 15px; }
.nine { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(8px, 2vw, 14px); container-type: inline-size; }
.tile { aspect-ratio: 1; border-radius: clamp(16px, 5cqw, 26px); background: color-mix(in srgb, var(--c) 20%, var(--card)); color: var(--ink); text-decoration: none; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 4px; transition: transform .16s, background .16s; }
.tile .glyph { width: clamp(30px, 13cqw, 68px); height: clamp(30px, 13cqw, 68px); }
.tname { font-weight: 600; font-size: clamp(13px, 4cqw, 21px); line-height: 1.3; margin-top: 4px; }
.tsub { min-height: 20px; font-size: 13px; line-height: 20px; display: flex; justify-content: center; }
.tsub em { font-style: normal; color: var(--mute); line-height: 1.35; }
[data-theme=dark] .tsub em { color: #C3C6D6; }
.tile.done { background: var(--c); color: var(--dark); }
.tile .star { width: clamp(15px, 4cqw, 22px); height: clamp(15px, 4cqw, 22px); }
@media (hover: hover) { .tile:hover { transform: translateY(-3px); } .tile:not(.done):hover { background: color-mix(in srgb, var(--c) 38%, var(--card)); } }
@media (max-width: 560px) { .tsub em { display: none; } .tile:not(.done) .tsub:has(em) { display: none; } }
.today { width: 100%; max-width: 620px; display: grid; gap: 22px; }
.figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 16px; }
.figs dt { font-size: 13px; color: var(--mute); }
.figs dd { font-weight: 600; font-size: clamp(17px, 5vw, 22px); font-variant-numeric: tabular-nums; white-space: nowrap; }
.figs dd small { font-size: .65em; color: var(--mute); font-weight: 500; }
h3 { font-size: 15px; margin-bottom: 10px; }
.weekrow, .cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px clamp(8px, 3vw, 18px); }
.weekrow div, .cal div { display: grid; justify-items: center; gap: 5px; }
.weekrow small, .cal small { font-size: 12px; color: var(--mute); }
.now small { color: var(--ink); font-weight: 700; }
.mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; width: 100%; max-width: 42px; }
.mini i { aspect-ratio: 1; border-radius: 3px; background: var(--cell); }
.sign { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; color: var(--mute); padding: 26px 0 18px; }
.sign a { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; min-height: 32px; }
.sign img { border-radius: 5px; }
@media (min-width: 900px) {
  .hub main { grid-template-columns: minmax(0, auto) 300px; gap: 56px; justify-content: center; align-items: center; align-content: center; }
  .boardwrap { width: clamp(440px, calc(100dvh - 230px), 660px); max-width: none; }
  .today { gap: 34px; }
  .today .figs { grid-template-columns: 1fr; gap: 18px; }
  .today .figs dd { font-size: 30px; line-height: 1.25; }
  .weekrow { gap: 10px; }
}

.gtop { display: flex; align-items: center; gap: 4px; height: 64px; width: 100%; max-width: 1000px; margin: 0 auto; flex: none; }
.gtop h1 { font-size: 20px; display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.gtop .btn:first-child { margin-left: -10px; }
.gtop .btn:last-child { margin-right: -10px; }
.chip { width: 34px; height: 34px; border-radius: 10px; background: var(--c); color: var(--dark); display: grid; place-items: center; flex: none; }
.chip .glyph { width: 24px; height: 24px; }
.timer { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 18px; padding: 0 6px; }
.game main { flex: 1; width: 100%; max-width: 1000px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 12px; padding-bottom: 20px; }
.intro { width: 100%; max-width: 440px; margin: auto; text-align: center; display: grid; gap: 18px; justify-items: center; }
.badge { width: 104px; height: 104px; border-radius: 28px; background: var(--c); color: var(--dark); display: grid; place-items: center; }
.badge .glyph { width: 68px; height: 68px; }
.intro h2 { font-size: 26px; }
.rules { list-style: none; padding: 0; display: grid; gap: 10px; text-align: left; width: 100%; }
.rules li { padding-left: 22px; position: relative; text-wrap: pretty; }
.rules li::before { content: ""; position: absolute; left: 0; top: 8px; width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.goal { display: flex; gap: 8px; align-items: center; color: var(--mute); font-size: 14px; text-align: left; width: 100%; }
.goal .star { flex: none; }
.once { color: var(--mute); font-size: 14px; margin-top: -8px; }
.stage { width: 100%; max-width: min(560px, max(280px, 100dvh - 236px)); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.stage:has(.tall) { max-width: min(430px, max(220px, (100dvh - 226px) * .78)); }
.stage:has(.wgrid) { max-width: min(340px, max(170px, (100dvh - 318px) * .84)); }
.side { width: 100%; max-width: 480px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.siderules { display: none; }
.status { font-weight: 600; font-size: 17px; min-height: 26px; font-variant-numeric: tabular-nums; text-align: center; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; width: 100%; }
.tools:empty, .result:empty { display: none; }
.result { display: grid; gap: 10px; justify-items: center; width: 100%; max-width: 340px; text-align: center; }
.result > .btn { width: 100%; }
.result > b { font: 600 20px Poppins, sans-serif; }
.result .star { width: 40px; height: 40px; }
.result .star.on { fill: var(--c); stroke: var(--c); }
.over .status:not(:empty) { font-size: 14px; color: var(--mute); }
.pop { animation: pop .35s ease-out; }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } }
@media (min-width: 860px) {
  .game main { flex-direction: row; justify-content: center; align-items: center; gap: 48px; padding-bottom: 48px; }
  .stage { flex: 1; max-width: min(620px, max(320px, 100dvh - 130px)); }
  .stage:has(.tall) { max-width: min(520px, max(280px, (100dvh - 130px) * .78)); }
  .stage:has(.wgrid) { max-width: min(420px, max(260px, (100dvh - 130px) * .82)); }
  .game main:has(.wgrid) .side { width: 400px; }
  .side { width: 300px; flex: none; gap: 20px; }
  .side .status { font-size: 22px; }
  .siderules { display: grid; gap: 14px; order: -1; font-size: 15px; }
  .over .siderules { display: none; }
}

.board { width: 100%; height: auto; display: block; touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; border-radius: 12px; }
.board:focus { outline: none; }
.board:focus-visible { outline: 3px solid var(--c); outline-offset: 3px; }
.board text { font-family: Poppins, sans-serif; font-weight: 600; text-anchor: middle; pointer-events: none; }
.over .board { cursor: default; }
.cell { fill: var(--card); }
.cell.on { fill: color-mix(in srgb, var(--c) 28%, var(--card)); }
.cursor { fill: none; stroke: var(--ink); stroke-width: 6; }
.thin { stroke: #1c1e2b30; stroke-width: 2; fill: none; }
.thick { stroke: #1C1E2B; stroke-width: 6; stroke-linecap: round; fill: none; }
.frame { fill: none; stroke: #1C1E2B; stroke-width: 6; }
[data-theme=dark] .frame { stroke: #F1F2F8; }
.mark { stroke: #1c1e2b90; stroke-width: 6; stroke-linecap: round; }
.lamp path { fill: #1C1E2B; stroke: #1C1E2B; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.lamp path:first-child { fill: #FFE27A; }
.lamp.bad path { stroke: #C41E1E; }
.lamp.bad path:first-child { fill: #FF6B6B; }
.line { fill: none; stroke: var(--c); stroke-width: 42; stroke-linecap: round; stroke-linejoin: round; }
.tip { fill: var(--c); }
.wall { stroke: var(--ink); stroke-width: 12; stroke-linecap: round; }
.num { fill: var(--ink); }
.numt { fill: var(--bg); font-size: 32px; }
.patch { stroke: none; }
.patch.off { fill: var(--cell); stroke: var(--mute); stroke-width: 4; stroke-dasharray: 10 10; }
.clue { fill: var(--ink); font-size: 44px; }
.clue.on { fill: #1C1E2B; }
.ghostbox { fill: color-mix(in srgb, var(--c) 30%, transparent); stroke: var(--c); stroke-width: 7; }
.cipher { width: 100%; max-width: 360px; display: grid; gap: 5px; }
.crow { display: grid; grid-template-columns: repeat(4, 1fr) 70px; gap: 6px; align-items: center; padding: 3px 6px; border-radius: 14px; }
.crow.cur { background: color-mix(in srgb, var(--c) 30%, transparent); }
.peg { height: clamp(29px, 5.4dvh, 48px); border-radius: 12px; background: var(--card); display: grid; place-items: center; }
.peg svg { width: 28px; height: 28px; }
.crow:not(.past):not(.cur):not(.answer) { opacity: .55; }
.marks { display: grid; grid-template-columns: 14px 14px; gap: 6px; justify-content: center; }
.marks i { width: 14px; height: 14px; border-radius: 50%; background: var(--cell); }
.marks .hit { background: var(--ink); }
.marks .near { background: none; border: 3.5px solid var(--ink); }
.marks.ans { display: block; font-size: 12px; text-align: center; line-height: 1.2; color: var(--mute); }
.crow.answer { margin-top: 8px; }
.keys { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; width: 100%; max-width: 360px; }
.symkey { padding: 0; background: var(--card); box-shadow: var(--shadow); min-height: 50px; }
.symkey svg { width: 32px; height: 32px; }

.wgrid { width: 100%; display: grid; gap: 6px; }
.wrow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.wcell { aspect-ratio: 1; min-width: 0; border-radius: 12px; background: var(--card); display: grid; place-items: center; font: 700 clamp(18px, 4.4dvh, 34px)/1 Poppins, sans-serif; text-transform: uppercase; }
.wcell.typed { box-shadow: inset 0 0 0 2.5px var(--mute); }
.wcell.m0, .wkey.m0 { background: var(--off); color: #fff; }
.wcell.m1, .wkey.m1 { background: #FFC23D; color: var(--dark); }
.wcell.m2, .wkey.m2 { background: #4CC38A; color: var(--dark); }
.fresh .wcell { animation: turn .4s ease-out backwards; animation-delay: calc(var(--i) * 90ms); }
@keyframes turn { from { transform: scaleY(0); background: var(--card); } }
.shake { animation: shake .3s; }
@keyframes shake { 25%, 75% { transform: translateX(-6px); } 50% { transform: translateX(6px); } }
.wkeys { display: grid; gap: 6px; width: 100%; max-width: 480px; }
.wkrow { display: flex; gap: clamp(3px, 1vw, 6px); justify-content: center; }
.wkey { flex: 1 1 0; min-width: 0; max-width: 46px; min-height: 46px; padding: 0; border-radius: 9px; background: var(--key); text-transform: uppercase; font-weight: 600; font-size: 15px; }
.wkey.wide { flex: 1.5 1 0; max-width: 66px; }

.stopw { width: 100%; max-width: 420px; display: grid; gap: 18px; justify-items: center; }
.dial { width: min(100%, clamp(170px, 38dvh, 320px)); aspect-ratio: 1; border-radius: 50%; border: 12px solid var(--c); background: var(--card); display: grid; place-content: center; justify-items: center; text-align: center; gap: 4px; }
.dial.run { border-style: dashed; }
.dial small { font-size: 15px; color: var(--mute); }
.dial b { font: 700 clamp(30px, 7dvh, 54px)/1.1 Poppins, sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rounds { list-style: none; padding: 0; width: 100%; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.rounds li { background: var(--card); border-radius: 12px; padding: 8px 2px; text-align: center; font-size: 13px; min-height: 60px; display: grid; align-content: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rounds li.cur { box-shadow: inset 0 0 0 2.5px var(--c); }
.rounds span { color: var(--mute); }
.rounds b { font: 600 13px/1.5 Poppins, sans-serif; min-height: 20px; }

.board.tall { border-radius: 18px; background: var(--card); }
.board .big { fill: var(--ink); font-size: 34px; font-weight: 700; }
.board .hintt { fill: var(--mute); font: 500 11px Inter, sans-serif; }
.scrap { animation: scrap .6s ease-in forwards; }
@keyframes scrap { to { transform: translateY(90px); opacity: 0; } }
.flash { fill: none; stroke: var(--ink); stroke-width: 2.5; animation: flash .5s forwards; }
@keyframes flash { to { opacity: 0; } }
.turf { fill: #7CCB8B; }
.cup { fill: #17301F; }
.pole { stroke: #17301F; stroke-width: 2; }
.flag { fill: #E9503F; }
.block { fill: #2E6B45; }
.ball { fill: #fff; stroke: #17301F; stroke-width: 1.4; }
.aim { fill: #fff; }
.pwbg { fill: #17301f50; }
.pw { fill: #fff; }
.turf ~ .hintt { fill: #17301F; }

.hue { width: 100%; max-width: 440px; display: grid; gap: 18px; }
.swatch { height: clamp(150px, 34dvh, 320px); border-radius: 26px; position: relative; display: grid; place-items: end center; padding-bottom: 18px; overflow: hidden; }
.swatch > span { background: #fffffff0; color: #1C1E2B; border-radius: 12px; padding: 4px 14px; font: 500 14px/1.6 Poppins, sans-serif; }
.swatch.blank { background: var(--card); place-items: center; padding: 0; }
.swatch.blank .glyph { width: 90px; height: 90px; opacity: .35; }
.swatch.two { grid-template-columns: 1fr 1fr; padding: 0; place-items: stretch; }
.swatch.two > span { border-radius: 0; display: grid; place-items: end center; padding-bottom: 14px; color: #1C1E2B; }
.fuse { position: absolute; left: 0; top: 0; height: 8px; width: 100%; background: #1c1e2ba0; transform-origin: left; animation: fuse 3s linear forwards; }
@keyframes fuse { to { transform: scaleX(0); } }
.score { text-align: center; font: 700 40px Poppins, sans-serif; }
.sliders { display: grid; gap: 14px; }
.sliders label span { font-size: 14px; color: var(--mute); display: block; margin-bottom: 4px; }
.sliders input { -webkit-appearance: none; appearance: none; width: 100%; height: 32px; border-radius: 16px; margin: 0; display: block; touch-action: pan-y; }
.sliders input::-webkit-slider-thumb { -webkit-appearance: none; width: 32px; height: 32px; border-radius: 50%; background: #fff; border: 5px solid #1C1E2B; cursor: grab; }
.sliders input::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 5px solid #1C1E2B; cursor: grab; }
.pairs { display: grid; gap: 10px; }
.pair, .pairhead { display: grid; grid-template-columns: 1fr 1fr 64px; align-items: center; }
.pairhead { text-align: center; color: var(--mute); font-size: 14px; }
.pair span { height: clamp(44px, 9dvh, 72px); }
.pair span:first-child { border-radius: 16px 0 0 16px; }
.pair span:nth-child(2) { border-radius: 0 16px 16px 0; }
.pair b { text-align: right; font: 600 18px Poppins, sans-serif; font-variant-numeric: tabular-nums; }

dialog { border: 0; padding: 0; margin: auto; background: var(--card); color: var(--ink); border-radius: 24px; width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: hidden; box-shadow: 0 20px 60px #0005; }
dialog[open] { display: flex; flex-direction: column; }
dialog.shotdlg { width: min(440px, calc(100vw - 24px)); }
.shot img { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100dvh - 210px); margin: 0 auto; border-radius: 18px; box-shadow: 0 0 0 1px var(--line); }
.acts { display: flex; gap: 8px; }
.acts .btn { flex: 1; }
dialog.wide { width: min(540px, calc(100vw - 24px)); }
dialog::backdrop { background: #0d0e16a0; }
.dhead { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 6px 24px; flex: none; }
.dhead h2 { font-size: 20px; }
.dbody { padding: 8px 18px 26px 24px; margin: 0 6px 10px 0; display: grid; gap: 18px; align-content: start; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.dbody h3 { margin: 6px 0 -6px; }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.seg { display: flex; background: var(--cell); border-radius: 14px; padding: 4px; }
.seg .btn { min-height: 40px; padding: 4px 14px; border-radius: 11px; font-size: 14px; }
.seg .on { background: var(--ink); color: var(--card); }
.erase { display: grid; gap: 10px; justify-items: start; }
.two { display: flex; gap: 8px; }
.about { display: flex; align-items: center; gap: 16px; border-top: 1px solid var(--line); padding-top: 18px; }
.about .logo { width: 52px; height: 52px; }
.about div { display: grid; font-size: 14px; color: var(--mute); }
.about b { font: 600 17px Poppins, sans-serif; color: var(--ink); }
.tbl { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
.tbl th { font-weight: 500; color: var(--mute); font-size: 13px; padding: 4px; }
.tbl td { padding: 7px 4px; text-align: center; border-top: 1px solid var(--line); }
.tbl td:first-child { text-align: left; white-space: nowrap; }
.tbl i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 10px; vertical-align: -1px; }
#toast { position: fixed; left: 50%; top: max(12px, env(safe-area-inset-top)); transform: translate(-50%, -20px); background: var(--ink); color: var(--bg); border-radius: 14px; padding: 11px 20px; font-size: 15px; opacity: 0; pointer-events: none; transition: .2s; z-index: 20; width: max-content; max-width: calc(100vw - 32px); text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { *, ::before { animation-duration: .01s !important; transition: none !important; } .fuse { animation-duration: 3s !important; } }
@media (max-height: 600px) { .cipher { gap: 1px; } .crow { padding: 1px 6px; } }
