:root {
  font-family: 'Trebuchet MS', Arial, sans-serif;
  color: #241c19;
  background: #ede0c9;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --cream: #fff5e3;
  --paper: #f8ecd8;
  --ink: #241c19;
  --red: #ed1923;
  --display: Impact, 'Arial Narrow', 'Liberation Sans Narrow', sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible { outline: 3px solid #156bc0; outline-offset: 5px; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
h1:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.app-shell {
  position: relative; isolation: isolate; width: min(100%, 480px); margin: 0 auto;
  min-height: 100vh; min-height: 100svh;
  padding: max(12px, env(safe-area-inset-top)) 22px max(16px, env(safe-area-inset-bottom));
  background: var(--paper); display: flex; flex-direction: column;
  overflow: clip; box-shadow: 0 0 50px #241c1910;
}
.app-shell::after { content: ''; position: absolute; width: 210px; height: 210px; border: 22px solid #d5a73c20; border-radius: 50%; top: -90px; left: -140px; z-index: -1; }
.app-header { display: flex; align-items: center; justify-content: center; position: relative; flex: 0 0 auto; min-height: 147px; margin-bottom: 10px; }
.brand { width: 176px; text-align: center; line-height: 1; }
#custom-logo { display: block; margin: 0 auto; max-width: 100%; height: 148px; width: auto; object-fit: contain; }
.placeholder-logo { position: relative; padding-top: 15px; transform: rotate(-5deg); }
.brand-main { display: block; font-family: var(--display); font-weight: 1000; font-size: 49px; line-height: .83; letter-spacing: -2px; font-style: italic; color: var(--cream); -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; text-shadow: 3px 6px 0 var(--ink); }
.brand-ribbon { display: inline-block; background: var(--red); color: var(--cream); border: 4px solid var(--ink); box-shadow: 0 4px 0 #241c1966; border-radius: 5px; font-weight: 1000; font-size: 20px; letter-spacing: 1px; padding: 6px 13px 4px; transform: rotate(-2deg); margin-top: 5px; }
.holly { width: 70px; height: 28px; position: absolute; top: -3px; left: 65px; }
.holly i { position: absolute; width: 36px; height: 20px; border-radius: 2px 15px; background: #178343; border: 3px solid var(--ink); transform: rotate(23deg); left: 0; }
.holly i:nth-child(2) { left: 29px; transform: rotate(-52deg); }
.holly b { position: absolute; width: 13px; height: 13px; background: #ed1923; border: 2px solid var(--ink); border-radius: 50%; left: 26px; top: 0; }
.holly b:nth-last-child(2) { top: 11px; left: 20px; }
.holly b:last-child { top: 11px; left: 32px; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; border: 2px solid var(--ink); border-radius: 50%; color: var(--ink); background: #fff5e3bb; }
.sound-button { position: absolute; right: 0; top: 12px; }
.sound-button svg { width: 21px; height: 21px; }
main { flex: 1; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; }
.screen-heading { text-align: center; }
.eyebrow { font-size: 10px; letter-spacing: 2px; font-weight: 900; line-height: 1.3; margin-bottom: 5px; }
h1 { font-family: var(--display); font-weight: 900; font-style: italic; font-size: clamp(26px, 7.8vw, 35px); line-height: 1.1; letter-spacing: -.5px; }
.screen-heading > p:last-child { font-size: 13px; margin-top: 7px; line-height: 1.5; }
#setup-form { display: flex; flex-direction: column; flex: 1; margin-top: 18px; }
.timing-cards { display: grid; gap: 11px; }
.timing-card { padding: 8px 15px 5px; border: 2px solid var(--ink); border-radius: 15px; background: var(--card-main); box-shadow: 0 4px 0 var(--card-dark); color: var(--card-ink); }
.timing-card[data-game='noise2'] { background: linear-gradient(110deg, #DF0076, #8b115c); }
.timing-card[data-game='action'] { background: linear-gradient(110deg, #2794D8, #236eac); }
.timing-card[data-game='doodle'] { background: linear-gradient(110deg, #3BA933, #268739); }
.timing-top { display: flex; align-items: center; gap: 11px; min-height: 44px; }
.card-logo-slot { display: flex; align-items: center; justify-content: center; width: 52px; height: 44px; flex: 0 0 52px; }
.card-logo { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.card-icon { width: 29px; height: 30px; flex: 0 0 29px; }
.card-icon svg { width: 100%; height: 100%; }
.game-label { font-weight: 900; font-size: 17px; flex: 1; line-height: 1.1; letter-spacing: -.4px; }
.game-label span { display: block; font-size: 10px; letter-spacing: .8px; margin-bottom: 2px; }
.time-badge { background: var(--cream); border: 2px solid var(--ink); color: var(--ink); border-radius: 9px; padding: 5px 8px; min-width: 65px; text-align: center; font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.1; }
.timing-card input[type='range'] { display: block; width: 100%; height: 29px; margin: 5px 0 0; padding: 0; -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; }
.timing-card input[type='range']::-webkit-slider-runnable-track { height: 7px; border-radius: 100px; background: linear-gradient(to right, var(--cream) 0%, var(--cream) var(--range-progress), #1c142655 var(--range-progress), #1c142655 100%); }
.timing-card input[type='range']::-moz-range-track { height: 7px; border-radius: 100px; background: #1c142655; }
.timing-card input[type='range']::-moz-range-progress { height: 7px; border-radius: 100px; background: var(--cream); }
.timing-card input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 25px; height: 25px; border: 2px solid var(--ink); background: var(--cream); border-radius: 50%; margin-top: -9px; box-shadow: 0 2px 0 #241c1955; }
.timing-card input[type='range']::-moz-range-thumb { width: 22px; height: 22px; border: 2px solid var(--ink); background: var(--cream); border-radius: 50%; box-shadow: 0 2px 0 #241c1955; }
.timing-note { font-size: 11px; text-align: center; margin-top: 13px; color: #655746; }
.setup-footer { margin-top: auto; padding-top: 20px; }
.big-button { min-height: 62px; width: 100%; border: 3px solid var(--ink); border-radius: 15px; box-shadow: 0 5px 0 var(--ink); font-family: var(--display); font-weight: 900; font-size: 27px; font-style: italic; letter-spacing: .5px; display: flex; justify-content: center; align-items: center; gap: 14px; padding: 12px 15px; transition: transform 100ms, box-shadow 100ms; }
.big-button:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.big-button > span { font-family: Arial, sans-serif; font-size: 25px; font-style: normal; }
.red-button { color: var(--cream); background: var(--red); }
.cream-button { background: var(--cream); color: var(--ink); }
.footer-note { font-size: 9px; font-weight: 900; letter-spacing: 1.25px; text-align: center; margin-top: 16px; line-height: 1.5; color: #766047; }
.party-confetti { position: absolute; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; }
.party-confetti i { position: absolute; width: 7px; height: 18px; background: #e6b33d; border-radius: 2px; left: 35px; top: 72px; transform: rotate(-30deg); }
.party-confetti i:nth-child(2) { background: #DC3421; left: auto; right: 70px; top: 130px; width: 5px; height: 12px; transform: rotate(32deg); }
.party-confetti i:nth-child(3) { background: #165D2C; left: 70px; top: 23px; width: 5px; height: 10px; transform: rotate(28deg); }
.party-confetti i:nth-child(4) { left: auto; right: -16px; top: 260px; border: 6px solid #dfb13a55; background: transparent; width: 42px; height: 42px; border-radius: 50%; }
.party-confetti i:nth-child(5) { left: -18px; top: auto; bottom: 75px; width: 45px; height: 45px; border: 6px solid #165D2C25; background: transparent; border-radius: 50%; }
.party-confetti i:nth-child(6) { left: auto; right: 30px; top: 28px; height: 4px; width: 4px; border-radius: 50%; }
.app-shell[data-screen='spinner'] .app-header, .app-shell[data-screen='round'] .app-header { min-height: 95px; margin-bottom: 13px; }
.app-shell:not([data-screen='setup']) .brand { width: 120px; }
.app-shell:not([data-screen='setup']) #custom-logo { height: 95px; }
.app-shell:not([data-screen='setup']) .brand-main { font-size: 33px; -webkit-text-stroke-width: 4px; text-shadow: 2px 4px 0 var(--ink); letter-spacing: -1px; }
.app-shell:not([data-screen='setup']) .brand-ribbon { font-size: 13px; padding: 4px 8px 3px; border-width: 3px; margin-top: 4px; }
.app-shell:not([data-screen='setup']) .holly { transform: scale(.75); transform-origin: left top; left: 42px; top: -1px; }
.round-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 17px; }
.round-label { border: 2px solid currentColor; border-radius: 100px; font-size: 10px; letter-spacing: 1.5px; font-weight: 900; padding: 7px 10px; white-space: nowrap; }
.text-button { color: inherit; background: transparent; border: 0; padding: 10px 3px; font-size: 13px; font-weight: 800; min-height: 44px; }
.text-button:disabled { opacity: .4; }
.wheel-stage { width: 100%; max-width: 370px; aspect-ratio: 1; margin: 29px auto 0; position: relative; flex: 0 0 auto; }
.wheel { width: 100%; height: 100%; border: 7px solid var(--ink); border-radius: 50%; box-shadow: 0 8px 0 #241c1933; position: relative; overflow: hidden; background: conic-gradient(#FAB00F 0deg 90deg, #DF0076 90deg 180deg, #2794D8 180deg 270deg, #3BA933 270deg 360deg); }
.wheel.will-spin { transition: transform 3.7s cubic-bezier(.12,.75,.14,1); }
.wheel-cross::before, .wheel-cross::after { content: ''; position: absolute; background: var(--ink); z-index: 1; }
.wheel-cross::before { height: 3px; width: 100%; top: calc(50% - 1.5px); }
.wheel-cross::after { width: 3px; height: 100%; left: calc(50% - 1.5px); }
.wheel-pointer { width: 39px; height: 48px; position: absolute; left: 50%; top: -20px; transform: translateX(-50%); z-index: 3; filter: drop-shadow(0 3px 0 #241c1944); }
.wheel-label { width: 25%; aspect-ratio: 1; max-width: 80px; position: absolute; transform: translate(-50%,-50%); color: var(--cream); display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1; }
.wheel-label small { font-size: 9px; font-weight: 900; letter-spacing: .2px; margin-bottom: 3px; }
.wheel-label strong { font-family: var(--display); font-weight: 900; font-style: italic; font-size: clamp(21px, 6.7vw, 29px); text-shadow: 1px 2px 0 var(--ink); -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; }
.label-noise { left: 74%; top: 26%; color: var(--ink); }
.label-noise strong { text-shadow: none; -webkit-text-stroke: 0; }
.label-noise2 { left: 74%; top: 74%; }
.label-action { left: 26%; top: 74%; }
.label-doodle { left: 26%; top: 26%; }
.wheel-logo { display: block; width: 100%; height: 100%; object-fit: contain; }
.wheel-icon { width: 31px; height: 31px; margin-bottom: 6px; }
.wheel-icon svg { width: 100%; height: 100%; }
.spin-button { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 108px; height: 108px; border: 5px solid var(--cream); border-radius: 50%; box-shadow: 0 0 0 3px var(--ink), 0 5px 0 #241c1966; background: var(--ink); color: var(--cream); font-family: var(--display); font-weight: 900; font-style: italic; font-size: 23px; line-height: .98; z-index: 2; }
.spin-button .spin-arrow { display: block; font-size: 21px; line-height: 1; margin-top: 4px; font-family: Arial, sans-serif; font-style: normal; }
.spin-button:disabled { font-size: 17px; }
.spin-button:active:not(:disabled) { transform: translate(-50%,-48%); }
.spin-result { text-align: center; font-size: 14px; font-weight: 900; min-height: 22px; margin: 22px 0 16px; }
.instruction-card { background: #fff9ee; border: 2px solid #e4d3ba; border-radius: 15px; display: grid; grid-template-columns: 27px 1fr; gap: 12px 10px; padding: 16px; margin-top: auto; }
.instruction-number { width: 26px; height: 26px; display: grid; place-items: center; background: var(--red); color: white; font-weight: 900; font-style: italic; border-radius: 50%; }
.instruction-number:nth-of-type(2) { background: #178343; }
.instruction-card p { font-size: 12px; line-height: 1.5; }
.instruction-card strong { font-size: 13px; }
.spinner-footer { margin-top: 14px; }
.app-shell[data-screen='round'] { background: var(--round-primary); color: var(--round-ink); background-image: radial-gradient(ellipse at 95% 55%, transparent 45%, #ffffff0a 45%, #ffffff0a 52%, transparent 52%), linear-gradient(160deg, var(--round-primary) 12%, var(--round-dark) 100%); }
.app-shell[data-screen='round']::after { display: none; }
.app-shell[data-screen='round'] .party-confetti { opacity: .3; }
.app-shell[data-screen='round'] .round-toolbar { margin-bottom: 10px; }
.round-back { color: inherit; }
.round-heading { text-align: center; }
.round-heading .eyebrow { margin-bottom: 8px; opacity: .85; }
.round-logo { display: block; height: 96px; max-width: 160px; width: auto; object-fit: contain; margin: 0 auto; }
.round-heading h1 { color: var(--cream); -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 2px 4px 0 var(--ink); }
.round-heading h1 span { display: block; font-size: 26px; line-height: .95; letter-spacing: .3px; }
.round-heading h1 strong { display: block; font-size: 55px; line-height: 1.08; font-weight: 1000; }
.status-pill { align-self: center; text-align: center; border-radius: 100px; font-size: 10px; letter-spacing: 1px; font-weight: 900; background: var(--cream); color: var(--ink); border: 2px solid var(--ink); padding: 7px 14px; margin: 15px 0 5px; }
.timer-face { width: min(100%, 265px); aspect-ratio: 1; position: relative; margin: 0 auto; flex: 0 0 auto; }
.timer-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-ring circle { fill: none; stroke-width: 9; }
.ring-track { stroke: #fff5e333; }
.ring-progress { stroke: var(--cream); stroke-linecap: round; stroke-dasharray: 735.13268; stroke-dashoffset: 0; }
.timer-centre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--cream); }
.timer-value { font-family: Arial, sans-serif; font-size: 86px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -5px; line-height: 1.1; text-shadow: 3px 4px 0 #241c1955; }
.timer-caption { font-size: 9px; font-weight: 900; letter-spacing: 2px; margin-top: 6px; }
.round-instructions { text-align: center; padding: 0 10px; color: var(--cream); }
.round-instructions strong { font-size: 18px; font-weight: 900; }
.round-instructions p { font-size: 12px; line-height: 1.5; margin: 6px auto 0; max-width: 310px; }
.round-bottom { padding-top: 22px; margin-top: auto; }
.round-message { text-align: center; font-weight: 800; font-size: 12px; line-height: 1.5; margin: 0 5px 13px; color: var(--cream); }
.timer-help { font-size: 10px; line-height: 1.5; text-align: center; color: var(--cream); margin-top: 17px; }
.restart-button { width: 100%; min-height: 44px; padding: 10px; border: 0; background: transparent; color: var(--cream); font-weight: 900; font-size: 14px; margin-top: 11px; }
.app-shell[data-game='noise'] .round-instructions, .app-shell[data-game='noise'] .round-message, .app-shell[data-game='noise'] .timer-help, .app-shell[data-game='noise'] .restart-button { color: var(--ink); }
.app-shell[data-game='noise'] .timer-value { color: var(--cream); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }
.app-shell[data-game='noise'] .timer-caption { color: var(--ink); }
.app-shell[data-game='doodle'] .ring-progress { stroke: #6BB95C; }
.app-shell[data-status='finished'] .status-pill { background: var(--ink); color: var(--cream); }
.app-shell[data-status='finished'] .timer-face { animation: time-up .4s ease-out 1; }
@keyframes time-up { 0% { transform: scale(.97); } 55% { transform: scale(1.04); } 100% { transform: scale(1); } }
@media (max-width: 360px) {
  .app-shell { padding-left: 16px; padding-right: 16px; }
  .timing-card { padding-left: 11px; padding-right: 11px; }
  .game-label { font-size: 16px; }
  .wheel-label small { font-size: 8px; }
  .wheel-icon { width: 25px; height: 25px; margin-bottom: 4px; }
  .spin-button { width: 95px; height: 95px; font-size: 21px; }
}
@media (min-height: 860px) {
  .app-header { margin-top: 12px; margin-bottom: 20px; }
  .timing-cards { gap: 15px; }
  .timing-card { padding-top: 10px; padding-bottom: 7px; }
  .timer-face { width: 280px; margin: 8px auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
