.g-treasure-hunt{--th-gap:3px;--th-max:46px;--th-open:color-mix(in srgb, var(--c-border) 42%, var(--c-surface));--th-cover:var(--c-surface-2);--th-n1:#2563eb;--th-n2:#157a3d;--th-n3:#c2410c;--th-n4:#6d28d9;--th-n5:#9a3412;--th-n6:#0e7490;--th-n7:#8a5a08;--th-n8:#475569;width:100%}@media (prefers-color-scheme:dark){:root:not([data-theme=light]) .g-treasure-hunt{--th-open:color-mix(in srgb, var(--c-bg) 62%, var(--c-surface));--th-cover:color-mix(in srgb, var(--c-surface-2) 78%, var(--c-brand));--th-n1:#86aeff;--th-n2:#55d98a;--th-n3:#fb9a5c;--th-n4:#c3b0fb;--th-n5:#f0a684;--th-n6:#67d9ea;--th-n7:#f2c661;--th-n8:#b9c2d4}}:root[data-theme=dark] .g-treasure-hunt{--th-open:color-mix(in srgb, var(--c-bg) 62%, var(--c-surface));--th-cover:color-mix(in srgb, var(--c-surface-2) 78%, var(--c-brand));--th-n1:#86aeff;--th-n2:#55d98a;--th-n3:#fb9a5c;--th-n4:#c3b0fb;--th-n5:#f0a684;--th-n6:#67d9ea;--th-n7:#f2c661;--th-n8:#b9c2d4}.g-treasure-hunt .th-bar{justify-content:center;align-items:center;gap:var(--sp-2);flex-wrap:wrap;width:100%;display:flex}.g-treasure-hunt .th-mode{align-items:center;gap:var(--sp-2);min-height:var(--tap);padding-inline:var(--sp-4);border:1px solid var(--c-border);border-radius:var(--r-full);background:var(--c-surface);color:var(--c-text-dim);font:inherit;cursor:pointer;transition:background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);font-weight:600;display:inline-flex}.g-treasure-hunt .th-mode:hover{border-color:var(--c-brand)}.g-treasure-hunt .th-mode.is-on{background:var(--c-brand);border-color:var(--c-brand);color:var(--c-brand-text)}.g-treasure-hunt .th-mode__icon{place-items:center;display:grid}.g-treasure-hunt .th-mode__icon>svg{width:20px;height:20px}.g-treasure-hunt .th-count{align-items:center;gap:var(--sp-1);min-height:34px;padding-inline:var(--sp-3);border-radius:var(--r-full);background:var(--c-surface-2);color:var(--c-text-dim);font-size:var(--fs-sm);font-weight:700;display:inline-flex}.g-treasure-hunt .th-count>svg{width:16px;height:16px;color:var(--c-accent)}.g-treasure-hunt .th-count__num{font-family:var(--font-num);font-variant-numeric:tabular-nums;text-align:center;min-width:2ch}.g-treasure-hunt .th-viewport{overscroll-behavior-x:contain;scrollbar-width:thin;direction:rtl;width:100%;padding-block:5px;overflow:auto hidden}.g-treasure-hunt .th-grid{grid-template-columns:repeat(var(--th-size,8), 1fr);gap:var(--th-gap);width:max(calc(var(--th-size,8) * var(--tap) + (var(--th-size,8) - 1) * var(--th-gap)), min(100%, calc(var(--th-size,8) * var(--th-max) + (var(--th-size,8) - 1) * var(--th-gap))));-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;touch-action:manipulation;direction:rtl;margin-inline:auto;display:grid}.g-treasure-hunt[data-size="8"]{--th-max:54px}.g-treasure-hunt[data-size="12"],.g-treasure-hunt[data-size="16"]{--th-max:46px}.g-treasure-hunt .th-cell{aspect-ratio:1;min-width:var(--tap);min-height:var(--tap);border:1px solid var(--c-border);background:var(--th-cover);color:var(--c-text);font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);border-radius:min(22%,10px);place-items:center;padding:0;font-weight:800;line-height:1;display:grid;position:relative}.g-treasure-hunt .th-cell:focus-visible{outline:3px solid var(--c-focus);outline-offset:1px;z-index:2}.g-treasure-hunt .th-face{place-items:center;width:100%;height:100%;display:grid}.g-treasure-hunt .th-face>svg{width:68%;height:68%}.g-treasure-hunt .th-cell.is-hidden{background:linear-gradient(160deg, color-mix(in srgb, var(--c-surface) 70%, var(--th-cover)), var(--th-cover));box-shadow:var(--shadow-sm)}.g-treasure-hunt:not(.is-over) .th-cell.is-hidden:hover{border-color:var(--c-brand)}.g-treasure-hunt .th-cell.is-zero,.g-treasure-hunt .th-cell.is-number,.g-treasure-hunt .th-cell.is-peek{background:var(--th-open);border-color:color-mix(in srgb, var(--c-border) 70%, transparent);box-shadow:none;cursor:default}.g-treasure-hunt .th-cell[data-n="1"]{color:var(--th-n1)}.g-treasure-hunt .th-cell[data-n="2"]{color:var(--th-n2)}.g-treasure-hunt .th-cell[data-n="3"]{color:var(--th-n3)}.g-treasure-hunt .th-cell[data-n="4"]{color:var(--th-n4)}.g-treasure-hunt .th-cell[data-n="5"]{color:var(--th-n5)}.g-treasure-hunt .th-cell[data-n="6"]{color:var(--th-n6)}.g-treasure-hunt .th-cell[data-n="7"]{color:var(--th-n7)}.g-treasure-hunt .th-cell[data-n="8"]{color:var(--th-n8)}.g-treasure-hunt .th-cell.is-flag{background:color-mix(in srgb, var(--c-accent) 16%, var(--th-cover));border-color:color-mix(in srgb, var(--c-accent) 55%, var(--c-border));color:color-mix(in srgb, var(--c-accent) 70%, var(--c-text))}.g-treasure-hunt .th-cell.is-chest{background:color-mix(in srgb, var(--c-accent) 30%, var(--c-surface));border-color:var(--c-accent);color:color-mix(in srgb, var(--c-accent) 80%, var(--c-text))}.g-treasure-hunt .th-cell.is-peek{color:var(--c-text-faint)}.g-treasure-hunt .th-cell.is-peek>.th-face>svg{opacity:.6}.g-treasure-hunt .th-cell.is-found{background:var(--c-good-soft);border-color:var(--c-good);color:var(--c-good)}.g-treasure-hunt.is-over .th-cell{cursor:default}.g-treasure-hunt .th-msg{min-height:1.5em;padding-inline:var(--sp-3);text-align:center;color:var(--c-text-dim);margin:0;font-weight:600}.g-treasure-hunt.is-over .th-msg{color:var(--c-brand)}.g-treasure-hunt .th-end{justify-content:center;display:flex}.g-treasure-hunt .th-end[hidden]{display:none}.g-treasure-hunt .th-again{padding-inline:var(--sp-3);text-align:center;color:var(--c-text-dim);margin:0;font-weight:600}.g-treasure-hunt .th-tip{max-width:46ch;padding-inline:var(--sp-3);text-align:center;font-size:var(--fs-xs);color:var(--c-text-faint);margin:0;line-height:1.5}@media (max-width:460px){.g-treasure-hunt{--th-gap:2px}.g-treasure-hunt .th-tip{font-size:.7rem}}.g-treasure-hunt[data-size="8"] .th-cell{font-size:clamp(1rem,3.6vw,1.2rem)}.g-treasure-hunt[data-size="12"] .th-cell{font-size:clamp(.95rem,2.5vw,1.1rem)}.g-treasure-hunt[data-size="16"] .th-cell{font-size:clamp(.9rem,1.9vw,1.05rem)}.g-treasure-hunt.is-still .th-cell,.g-treasure-hunt.is-still .th-mode{transition:none}.g-treasure-hunt.is-still .bg-hint-flash{animation:none}@media (prefers-reduced-motion:reduce){.g-treasure-hunt .th-cell,.g-treasure-hunt .th-mode{transition:none}.g-treasure-hunt .bg-hint-flash{animation:none}}
