/* ============================================================
   Thömus Jackpot — Oberfläche über der 3D-Szene
   Farben, Schrift und Parallelogramm-Motiv aus dem Thömus Design System
   (tokens.css von herbstsale2026 / roadshow2026.thoemus.ch).
   Die Maschine und ihre Welt werden in WebGL gezeichnet (js/world.js,
   machine.js, fx.js); hier liegen Kopfzeile, Taste, Dialoge und Admin.
   ============================================================ */

@font-face { font-family: 'Galano Grotesque'; src: url('../assets/fonts/GalanoGrotesque-Regular.otf')  format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Galano Grotesque'; src: url('../assets/fonts/GalanoGrotesque-SemiBold.otf') format('opentype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Galano Grotesque'; src: url('../assets/fonts/GalanoGrotesque-Bold.otf')     format('opentype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Galano Grotesque'; src: url('../assets/fonts/GalanoGrotesque-Heavy.otf')    format('opentype'); font-weight: 900; font-display: swap; }

:root {
  --tho-red: #E30613;
  --tho-red-dark: #B5040F;
  --tho-red-light: #FF1A27;
  --tho-black: #0D0D0D;
  --tho-gray-900: #1A1A1A;
  --tho-gray-700: #444;
  --tho-gray-600: #666;
  --tho-gray-400: #999;
  --tho-gray-300: #CCC;
  --tho-gray-200: #E5E5E5;
  --tho-gray-100: #F5F5F5;
  --gold: #FFC83D;
  --skew: -12deg;
  --font: 'Galano Grotesque', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --s: clamp(14px, calc(0.85vw + 0.85vh), 34px);      /* Grundgrösse der Oberfläche, wächst mit dem Bildschirm */
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: #000; color: #fff; font-family: var(--font); font-weight: 400; font-size: var(--s);
  overflow: hidden; overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  -webkit-user-select: none; user-select: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
body.no-gl #gl { display: none; }
body.no-gl { background: radial-gradient(ellipse at 50% 40%, rgba(227, 6, 19, .5), #420101 40%, #000 78%); }

/* ── Ladebild ──────────────────────────────────────────── */
.loader { position: fixed; inset: 0; z-index: 30; display: grid; place-content: center; justify-items: center; gap: 1.2em;
  background: #000; transition: opacity .7s ease .1s, visibility 0s linear .9s; }
.loader img { width: min(60vw, 16em); height: auto; }
.loader__bar { width: 9em; height: 3px; background: #2a2a2a; overflow: hidden; transform: skewX(var(--skew)); }
.loader__bar i { display: block; width: 40%; height: 100%; background: var(--tho-red); animation: load 1s ease-in-out infinite alternate; }
body.is-ready .loader { opacity: 0; visibility: hidden; }

/* ── Kopfzeile ─────────────────────────────────────────── */
.top { position: fixed; z-index: 5; top: 0; left: 0; right: 0; padding: .4em 1.2em 0; padding-top: max(.4em, env(safe-area-inset-top));
  display: flex; align-items: center; justify-content: space-between;
  transition: opacity 1.2s ease, transform 1.2s var(--ease-out); }
.top__logo img { display: block; height: 3.5em; width: auto; filter: drop-shadow(0 0 .8em rgba(0, 0, 0, .9)); }
.lang { display: flex; align-items: center; gap: .45em; font-weight: 700; letter-spacing: .12em; text-shadow: 0 0 .6em #000; }
.lang__btn { color: var(--tho-gray-400); padding: .5em .3em; }
.lang__btn.is-active { color: #fff; box-shadow: inset 0 -.18em 0 var(--tho-red); }
.lang__sep { color: var(--tho-gray-700); }

/* ── Taste und Laufschrift ─────────────────────────────── */
.hud { position: fixed; z-index: 5; left: 0; right: 0; bottom: max(3.2vh, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: .75em; pointer-events: none;
  transition: opacity 1.2s ease, transform 1.2s var(--ease-out); }
.hud > * { pointer-events: auto; }
body:not(.is-live) .top { opacity: 0; transform: translateY(-1em); pointer-events: none; }
body:not(.is-live) .hud { opacity: 0; transform: translateY(1.5em); }
body:not(.is-live) .hud > * { pointer-events: none; }

.ticker { max-width: 94vw; overflow: hidden; white-space: nowrap; text-align: center; transition: opacity .5s; }
.ticker span { display: inline-block; font-size: 1.05em; font-weight: 900; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold); text-shadow: 0 0 .4em rgba(255, 200, 61, .9), 0 0 1.2em rgba(255, 120, 0, .7), 0 .1em .3em #000; }
.ticker span.in { animation: tickin .5s var(--ease-out); }

.spin { position: relative; width: min(84vw, 19em); height: 3.5em; transform: skewX(var(--skew)); border-radius: .2em;
  background: linear-gradient(180deg, #ff4a54 0%, var(--tho-red) 45%, var(--tho-red-dark) 100%);
  box-shadow: inset 0 .14em .1em rgba(255, 255, 255, .5), 0 .32em 0 #6d0208, 0 .6em 1.2em rgba(0, 0, 0, .8), 0 0 1.6em rgba(227, 6, 19, .7);
  transition: transform .08s, box-shadow .08s, opacity .45s, filter .2s; }
.spin span { display: block; transform: skewX(12deg); font-size: 1.5em; font-weight: 900; letter-spacing: .16em; text-transform: uppercase;
  text-shadow: 0 .06em 0 rgba(0, 0, 0, .35); }
.spin::after { content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%) -150% 0 / 250% 100% no-repeat; }
.spin.is-pulse { animation: pulse 1.2s ease-in-out infinite; }
.spin.is-pulse::after { animation: sheen 2.4s ease-in-out infinite; }
.spin:active:not(:disabled) { transform: skewX(var(--skew)) translateY(.24em);
  box-shadow: inset 0 .14em .1em rgba(255, 255, 255, .3), 0 .08em 0 #6d0208, 0 .3em .6em rgba(0, 0, 0, .8); }
.spin:disabled { cursor: default; }
.hud__hint { margin: 0; font-size: .68em; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--tho-gray-300);
  text-shadow: 0 0 .6em #000, 0 0 .3em #000; transition: opacity .45s; }
body[data-phase="attract"] .hud__hint { opacity: 0; }
body[data-phase="spinning"] .spin, body[data-phase="won"] .spin,
body[data-phase="spinning"] .hud__hint, body[data-phase="won"] .hud__hint { opacity: 0; pointer-events: none; }
body[data-phase="won"] .ticker, body[data-phase="spinning"] .ticker { opacity: 0; }
body.is-soldout .spin { opacity: .35; filter: grayscale(.8); }

/* ── Dialoge ───────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 40; display: none; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 16px;
  overflow-y: auto; background: rgba(0, 0, 0, .5); font-size: clamp(15px, calc(var(--s) * 1.05), 32px); }
.modal.is-open { display: grid; animation: fadein .35s ease; }
.modal--admin { z-index: 70; font-size: 15px; background: rgba(0, 0, 0, .8); }

.card { position: relative; width: min(100%, 30em); padding: 2.2em 2em 1.6em; color: #fff;
  background: linear-gradient(160deg, rgba(40, 6, 9, .82), rgba(10, 10, 10, .88));
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 6px;
  box-shadow: 0 1.5em 4em rgba(0, 0, 0, .7), 0 0 5em rgba(227, 6, 19, .45), inset 0 1px 0 rgba(255, 255, 255, .18);
  animation: cardin .5s var(--ease-out); -webkit-user-select: text; user-select: text; overflow: hidden; }
.card--form::before { content: ""; position: absolute; top: 0; left: -2em; width: 46%; height: .5em; background: var(--tho-red);
  transform: skewX(var(--skew)); box-shadow: 0 0 1.4em var(--tho-red-light); }
.card__close { position: absolute; top: .3em; right: .5em; width: 1.6em; height: 1.6em; font-size: 1.6em; line-height: 1; color: var(--tho-gray-300); }
.card__kicker { color: var(--tho-red-light); font-size: .72em; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.card__title { margin: .25em 0 .3em; font-size: 2.1em; font-weight: 900; line-height: 1.02; letter-spacing: -.02em; text-transform: uppercase; }
.card__title--sm { font-size: 1.5em; margin-bottom: .8em; }
.card__sub { margin: 0 0 1.2em; color: var(--tho-gray-300); line-height: 1.45; font-size: .92em; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8em; }
.field { display: block; margin-bottom: .9em; }
.field > span { display: block; margin-bottom: .35em; font-size: .68em; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--tho-gray-300); }
.field input { width: 100%; padding: .7em .8em; font: inherit; font-size: max(16px, 1em); font-weight: 600; color: #fff;
  background: rgba(255, 255, 255, .07); border: 2px solid rgba(255, 255, 255, .24); border-radius: 4px; -webkit-user-select: text; user-select: text; }
.field input:focus { outline: none; border-color: var(--tho-red-light); box-shadow: 0 0 0 4px rgba(227, 6, 19, .3), 0 0 1.5em rgba(227, 6, 19, .5); }
.form__error { min-height: 1.3em; margin: 0 0 .6em; color: #ff7b84; font-size: .82em; font-weight: 600; }
.form__note { margin: 1em 0 0; text-align: center; color: var(--tho-gray-400); font-size: .72em; }

.btn { display: inline-flex; align-items: center; justify-content: center; border-radius: 2px;
  font-weight: 900; letter-spacing: .14em; text-transform: uppercase; transition: background .15s, color .15s, transform .08s; }
.btn:active { transform: translateY(2px); }
.btn--primary { width: 100%; padding: 1.05em 1.5em; background: var(--tho-red); color: #fff; box-shadow: 0 0 1.6em rgba(227, 6, 19, .55); }
.btn--primary:hover { background: var(--tho-red-light); }
.btn--light { padding: .9em 2.6em; background: #fff; color: var(--tho-black); }
.btn--light:hover { background: var(--tho-gray-200); }
.btn--sm { width: auto; padding: .7em 1.2em; font-size: .8em; letter-spacing: .1em; box-shadow: none; }
.btn--outline { border: 2px solid var(--tho-gray-900); color: var(--tho-gray-900); }
.btn--outline:hover { background: var(--tho-gray-100); }
.btn--danger { background: var(--tho-black); color: #fff; }
.btn--danger:disabled { background: var(--tho-gray-300); cursor: default; }

/* ── Gewinn-Dialog ─────────────────────────────────────── */
.modal--win { background: radial-gradient(ellipse at center, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, .15) 70%); }
.win { position: relative; width: min(100%, 29em); min-width: 0; padding: 1.5em 1.5em 1.6em; text-align: center;
  display: flex; flex-direction: column; align-items: center;
  background: linear-gradient(160deg, rgba(46, 6, 9, .78), rgba(8, 8, 8, .86));
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 8px;
  box-shadow: 0 2em 5em rgba(0, 0, 0, .7), 0 0 6em rgba(227, 6, 19, .5), inset 0 1px 0 rgba(255, 255, 255, .2);
  animation: winin .8s var(--ease-out); }
.tier-3 .win, .tier-4 .win { border-color: rgba(255, 200, 61, .55); box-shadow: 0 2em 5em rgba(0, 0, 0, .7), 0 0 7em rgba(255, 170, 0, .55), inset 0 1px 0 rgba(255, 240, 200, .35); }
.win__title { font-size: min(3.3em, 10.5vw); font-weight: 900; line-height: 1; letter-spacing: .01em; text-transform: uppercase; white-space: nowrap;
  transform: skewX(var(--skew)); color: #fff;
  text-shadow: 0 0 .1em #fff, 0 0 .3em var(--tho-red-light), 0 0 .8em var(--tho-red), 0 .06em 0 var(--tho-red-dark);
  animation: titlepop .6s ease-in-out infinite alternate; }
.tier-4 .win__title, .tier-3 .win__title { color: var(--gold); text-shadow: 0 0 .1em #fff3c4, 0 0 .35em var(--gold), 0 0 .9em #ff8a00, 0 .06em 0 #C98A00; }
.tier-4 .win__title { font-size: min(4.4em, 15vw); }
.win__congrats { margin: .5em 0 0; font-size: 1.05em; font-weight: 600; color: var(--tho-gray-200); }
.win__symbol { width: 9.6em; height: 8em; margin: .7em 0 .5em; padding: .5em .6em; border-radius: .6em;
  background: radial-gradient(circle at 50% 35%, #fff, #e4e4e4); box-shadow: 0 0 0 .2em var(--gold), 0 0 3em .5em rgba(255, 200, 61, .7);
  animation: pop .7s ease-in-out infinite alternate; }
.win__symbol img { display: block; width: 100%; height: 100%; object-fit: contain; }
.win__label { margin: .2em 0 0; font-size: .72em; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--tho-gray-300); }
.win__prize { margin: .1em 0 .6em; font-size: min(2em, 7.2vw); font-weight: 900; line-height: 1.1; text-transform: uppercase; letter-spacing: -.01em; }
.ticket { position: relative; display: flex; align-items: center; gap: 1em; width: 100%; padding: .8em .8em .8em 1.2em; background: #fff; color: var(--tho-black);
  border-radius: 4px; text-align: left; box-shadow: 0 0 0 3px var(--tho-red), 0 1em 2.5em rgba(0, 0, 0, .6); overflow: hidden;
  -webkit-user-select: text; user-select: text; }
.ticket::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 40%, rgba(255, 200, 61, .35) 50%, transparent 60%) -150% 0 / 250% 100% no-repeat; animation: sheen 3.2s ease-in-out infinite; }
.ticket__text { flex: 1; min-width: 0; }
.ticket__label { display: block; font-size: .64em; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--tho-gray-600); }
.ticket__code { display: block; margin-top: .15em; font-size: min(1.5em, 5.6vw); font-weight: 900; letter-spacing: .06em; white-space: nowrap; color: var(--tho-red); }
.ticket__qr { flex: none; width: 6.2em; height: 6.2em; position: relative; z-index: 1; }
.ticket__qr svg { display: block; width: 100%; height: 100%; }
.win__redeem { margin: .9em 0 1.1em; font-size: .8em; line-height: 1.45; color: var(--tho-gray-300); }
@media (max-width: 480px) {
  .win { padding-left: .9em; padding-right: .9em; }
  .ticket { flex-direction: column; gap: .6em; padding: .9em; text-align: center; }
  .ticket__code { font-size: min(1.5em, 7vw); }
  .ticket__qr { width: 8.5em; height: 8.5em; }
}

/* ── Admin (hell, sachlich) ────────────────────────────── */
.card--light { background: #fff; color: var(--tho-gray-900); border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 1.5em 4em rgba(0, 0, 0, .6); }
.card--light .card__close { color: var(--tho-gray-600); }
.card--light .field > span { color: var(--tho-gray-700); }
.card--light .field input { color: var(--tho-gray-900); background: #fff; border-color: var(--tho-gray-300); }
.card--light .form__error { color: var(--tho-red); }
.card--pin { width: min(100%, 22em); }
.card--admin { width: min(100%, 64em); align-self: start; overflow: visible; }
.card--admin h3 { margin: 1.6em 0 .5em; font-size: 1em; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.admin__hint { margin: 0 0 .8em; color: var(--tho-gray-600); font-size: .9em; line-height: 1.45; }
.admin__row { display: flex; flex-wrap: wrap; align-items: center; gap: .8em; margin: .8em 0; }
.admin__msg { color: var(--tho-gray-600); font-size: .9em; }
.admin__search { flex: 1; min-width: 12em; padding: .6em .8em; font: inherit; font-size: 16px; border: 2px solid var(--tho-gray-300); border-radius: 4px; }
.admin__search--sm { flex: none; width: 9em; min-width: 0; }
.check { display: flex; gap: .6em; align-items: flex-start; line-height: 1.4; cursor: pointer; }
.check input { width: 1.2em; height: 1.2em; margin-top: .1em; accent-color: var(--tho-red); }
.tablewrap { overflow: auto; border: 1px solid var(--tho-gray-200); border-radius: 4px; }
.tablewrap--tall { max-height: 22em; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9em; }
.tbl th, .tbl td { padding: .5em .7em; text-align: left; border-bottom: 1px solid var(--tho-gray-200); white-space: nowrap; }
.tbl th { position: sticky; top: 0; background: var(--tho-gray-100); font-size: .78em; letter-spacing: .08em; text-transform: uppercase; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl input[type="number"] { width: 5.5em; padding: .3em .4em; font: inherit; text-align: right; border: 2px solid var(--tho-gray-300); border-radius: 4px; }
.tbl tr.is-redeemed td { color: var(--tho-gray-400); }
.tbl .empty { color: var(--tho-gray-600); text-align: center; padding: 1.4em; }

/* ── Animationen ───────────────────────────────────────── */
@keyframes load { from { transform: translateX(-20%); } to { transform: translateX(170%); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes tickin { from { opacity: 0; letter-spacing: .5em; } to { opacity: 1; } }
@keyframes sheen { 0%, 55% { background-position: -150% 0; } 100% { background-position: 250% 0; } }
@keyframes pulse {
  0%, 100% { box-shadow: inset 0 .14em .1em rgba(255, 255, 255, .5), 0 .32em 0 #6d0208, 0 .6em 1.2em rgba(0, 0, 0, .8), 0 0 1.2em rgba(227, 6, 19, .6); }
  50% { box-shadow: inset 0 .14em .1em rgba(255, 255, 255, .5), 0 .32em 0 #6d0208, 0 .6em 1.2em rgba(0, 0, 0, .8), 0 0 3.2em .5em rgba(255, 60, 70, 1); filter: brightness(1.16); }
}
@keyframes pop { from { transform: scale(.95) rotate(-2deg); } to { transform: scale(1.07) rotate(2deg); } }
@keyframes titlepop { from { transform: skewX(var(--skew)) scale(.96); } to { transform: skewX(var(--skew)) scale(1.06); } }
@keyframes cardin { from { opacity: 0; transform: translateY(1.5em) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes winin { 0% { opacity: 0; transform: scale(.4) rotate(-4deg); } 60% { opacity: 1; transform: scale(1.05) rotate(.6deg); } 100% { transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .win__title, .win__symbol, .spin.is-pulse, .spin.is-pulse::after, .ticket::after { animation: none; }
}

/* ── Gewinn-Tafel: Knopf oben rechts und Ansicht ───────── */
.top__right { display: flex; align-items: center; gap: 1em; }
.top__prizes { transform: skewX(var(--skew)); padding: .5em 1.1em; border: 2px solid rgba(255, 255, 255, .75); border-radius: 2px;
  background: rgba(0, 0, 0, .35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background .2s, border-color .2s, opacity .4s; }
.top__prizes span { display: block; transform: skewX(12deg); font-size: .78em; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.top__prizes:hover { background: rgba(227, 6, 19, .55); }
body[data-view="board"] .top__prizes { background: var(--tho-red); border-color: var(--tho-red); }
body[data-phase="spinning"] .top__prizes, body[data-phase="won"] .top__prizes { opacity: .3; pointer-events: none; }
body[data-view="board"] .spin, body[data-view="board"] .ticker, body[data-view="board"] .hud__hint { opacity: 0; pointer-events: none; }
@media (max-width: 420px) { .top__right { gap: .6em; } .top__prizes { padding: .45em .8em; } }

/* ── Ton-Taste ─────────────────────────────────────────── */
.top__sound { width: 2.3em; height: 2.3em; display: grid; place-items: center; border: 2px solid rgba(255, 255, 255, .75); border-radius: 50%;
  background: rgba(0, 0, 0, .35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background .2s, border-color .2s; }
.top__sound:hover { background: rgba(227, 6, 19, .55); }
.top__sound svg { width: 1.25em; height: 1.25em; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.top__sound .s-body { fill: #fff; }
.top__sound .s-off { display: none; }
.top__sound[aria-pressed="false"] .s-on { display: none; }
.top__sound[aria-pressed="false"] .s-off { display: inline; }
.top__sound[aria-pressed="false"] { border-color: rgba(255, 255, 255, .4); }

/* ── Formular: Einwilligungen ──────────────────────────── */
.check--dark { margin: .2em 0 .7em; font-size: .78em; color: var(--tho-gray-300); }
.check--dark a { color: #fff; text-decoration: underline; text-underline-offset: .15em; }
.check--dark a:hover { color: var(--tho-red-light); }
.btn--primary:disabled { opacity: .6; cursor: progress; }

/* ── Gewinn: Code kopieren, PDF, Test-Hinweis ──────────── */
.win__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .6em; margin: 0 0 1em; }
.btn--ghost { padding: .7em 1.2em; font-size: .72em; border: 2px solid rgba(255, 255, 255, .6); color: #fff; background: rgba(0, 0, 0, .25); }
.btn--ghost:hover { background: rgba(255, 255, 255, .14); }
.btn--ghost:disabled { opacity: .5; cursor: progress; }
.win__test { margin: -.4em 0 .9em; padding: .3em .8em; background: var(--tho-red); color: #fff; font-size: .75em; font-weight: 900; letter-spacing: .14em; }
body.is-kiosk #winPdf { display: none; }
.card--pin .admin__row .btn { text-decoration: none; }
