/* Tilt - the HUD over the canvas. The page frame (full window, font, back link) is the site's frame.css. */
:root { --gold: #ffc94a; --ink: rgb(18 22 30 / 0.62); --line: rgb(255 255 255 / 0.16); }
body { user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
[hidden] { display: none !important; }

.attract { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; pointer-events: none; text-align: center; transition: opacity 0.5s; padding: 0 16px; }
.attract h1 { margin: 5vh 0 0; font-size: clamp(64px, 13vh, 132px); line-height: 1; font-weight: 750; letter-spacing: -0.03em; text-shadow: 0 4px 30px rgb(10 14 22 / 0.55); }
.attract .sub { margin: 10px 0 0; font-size: clamp(14px, 2.2vh, 19px); color: rgb(255 255 255 / 0.82); text-shadow: 0 1px 12px rgb(10 14 22 / 0.7); }
.attract .go { margin: auto 0 6vh; padding: 12px 22px; border-radius: 9999px; background: var(--ink); border: 1px solid var(--line); font-size: clamp(14px, 2.2vh, 17px); font-weight: 600; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.6; } }
.playing .attract { opacity: 0; }

.hud { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.4s; }
.playing .hud { opacity: 1; }
.selecting .hud .info, .selecting .hint.show { opacity: 0; }
.info { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); text-align: center; text-shadow: 0 1px 10px rgb(10 14 22 / 0.6); white-space: nowrap; }
.info .name { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: rgb(255 255 255 / 0.78); }
.info .line { display: flex; align-items: center; justify-content: center; gap: 10px; }
.info .time { font-size: 26px; line-height: 30px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 2.6em; text-align: right; }
.stars { display: inline-flex; gap: 2px; font-size: 15px; }
.stars i, .goals i { font-style: normal; color: rgb(255 255 255 / 0.28); }
.stars i.lit, .goals li.lit i { color: var(--gold); text-shadow: 0 0 10px rgb(255 190 60 / 0.55); }
.tools { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; pointer-events: none; }
.playing .tools { pointer-events: auto; }
.round, .pill { height: 32px; border-radius: 9999px; background: var(--ink); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: inline-flex; align-items: center; justify-content: center; }
.round { width: 32px; } .pill { padding: 0 12px; font-size: 12px; font-weight: 600; }
.round:hover, .pill:hover { background: rgb(18 22 30 / 0.85); }
.round svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.touch-only { display: none; } .touch .touch-only { display: inline-flex; }
.hint { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); padding: 8px 14px; border-radius: 9999px; background: var(--ink); border: 1px solid var(--line); font-size: 13px; pointer-events: none; opacity: 0; transition: opacity 0.6s; max-width: calc(100vw - 32px); text-align: center; }
.hint.show { opacity: 1; }

.stick { position: fixed; width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: 50%; border: 2px solid rgb(255 255 255 / 0.35); background: rgb(18 22 30 / 0.25); pointer-events: none; opacity: 0; transition: opacity 0.15s; }
.stick.show { opacity: 1; }
.knob { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: rgb(255 255 255 / 0.75); }

.card { position: fixed; left: 50%; top: 50%; width: min(320px, calc(100vw - 32px)); box-sizing: border-box; padding: 20px 22px 18px; border-radius: 18px; background: rgb(20 24 32 / 0.82); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 20px 60px rgb(0 0 0 / 0.4); text-align: center; opacity: 0; pointer-events: none; transform: translate(-50%, -46%) scale(0.96); transition: opacity 0.3s, transform 0.3s; }
.card.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%); transition-delay: 0.35s; }
.card h2 { margin: 0 0 12px; font-size: 20px; line-height: 26px; font-weight: 700; }
.row { display: flex; justify-content: space-between; align-items: baseline; padding: 5px 0; font-size: 14px; color: rgb(255 255 255 / 0.7); border-bottom: 1px solid rgb(255 255 255 / 0.08); }
.row b { font-size: 17px; color: #fff; font-variant-numeric: tabular-nums; }
.goals { list-style: none; margin: 12px 0 14px; padding: 0; display: grid; gap: 4px; text-align: left; font-size: 14px; color: rgb(255 255 255 / 0.5); }
.goals li { display: flex; gap: 8px; align-items: center; } .goals li.lit { color: #fff; } .goals i { font-size: 17px; }
.next, .ghost { height: 38px; padding: 0 18px; border-radius: 9999px; font-size: 14px; font-weight: 650; }
.next { background: #fff; color: #14181f; } .next:hover { background: #ffe9bd; }
.ghost { border: 1px solid var(--line); background: rgb(255 255 255 / 0.06); } .ghost:hover { background: rgb(255 255 255 / 0.14); }
.final .big { margin: 0; font-size: 34px; font-weight: 750; color: var(--gold); }
.final .small { margin: 6px 0 0; min-height: 18px; font-size: 13px; color: rgb(255 255 255 / 0.7); }
.btns { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }

.select { position: fixed; inset: 0; display: none; flex-direction: column; padding: 56px max(16px, 4vw) 20px; box-sizing: border-box; overflow-y: auto; touch-action: pan-y; }
.selecting .select { display: flex; }
.head { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; }
.head h2 { margin: 0; font-size: 24px; line-height: 38px; font-weight: 700; }
.head .total { margin-right: auto; font-size: 15px; font-weight: 600; color: var(--gold); }
.grid { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(150px, 1fr); gap: 14px; min-height: 0; }
.level { display: flex; flex-direction: column; border-radius: 14px; border: 1px solid var(--line); background: rgb(18 22 30 / 0.28); overflow: hidden; text-align: left; transition: border-color 0.15s, background 0.15s; }
.level:hover { border-color: rgb(255 255 255 / 0.6); background: rgb(255 255 255 / 0.07); }
.win { flex: 1; min-height: 90px; }
.meta { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 9px 12px 10px; background: rgb(18 22 30 / 0.6); font-size: 13px; }
.meta .n { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta .best { grid-column: 1 / -1; font-size: 12px; color: rgb(255 255 255 / 0.6); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .info { top: 52px; } }
