/* Beursloterij — huisstijl 80e Huishoudbeurs (karmijnrood, goud, crème) */

@font-face { font-family: 'Anton'; src: url('fonts/anton-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Open Sans'; src: url('fonts/open-sans-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Open Sans'; src: url('fonts/open-sans-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --red: #8e1f2e;
  --red-deep: #5e1220;
  --red-ink: #7a1626;
  --gold: #bc9c55;
  --gold-light: #e3c77f;
  --cream: #fcf6e6;
  --panel: rgba(52, 8, 16, .42);
  --line: rgba(252, 246, 230, .18);
  --ok: #8fd19e;
  --font-display: 'Anton', 'Impact', 'Arial Narrow', sans-serif;
  --font-body: 'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--red);
  color: var(--cream);
  font: 400 17px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
/* Achtergrond uit de presentatie; via pseudo-element zodat 'fixed' ook op iOS werkt */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--red) url('bg.jpg') center / cover no-repeat;
}
img { max-width: 100%; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- typografie */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: .98;
  letter-spacing: .01em;
  color: var(--cream);
  margin: 0 0 .35em;
  font-size: clamp(2.6rem, 13vw, 3.6rem);
}
.display span { display: block; }
.display-xl { font-size: clamp(3.4rem, 18vw, 5rem); }
.display-xl span { color: var(--gold-light); }
.gold-sub { color: var(--gold-light); font-size: 1.15rem; margin: 0 0 1rem; }
.gold-sub strong { color: var(--cream); }
.lead { font-size: 1.05rem; margin: 0 0 1rem; opacity: .95; }
.note { font-size: .95rem; padding: .8rem 1rem; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.error { color: #ffd2c9; background: rgba(0,0,0,.25); padding: .5rem .8rem; border-radius: 10px; margin: .6rem 0 0; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: .08em; }
.small { font-size: .85rem; opacity: .85; }

/* ---------------------------------------------------------------- knoppen & velden */
.btn-gold, .btn-outline, .btn-danger {
  appearance: none;
  border: 0;
  border-radius: 999px;
  font: 700 1.05rem/1 var(--font-body);
  padding: 1rem 1.6rem;
  cursor: pointer;
  transition: transform .1s, filter .15s, opacity .15s;
}
.btn-gold { background: var(--gold); color: var(--red-deep); text-transform: uppercase; letter-spacing: .06em; }
.btn-gold:hover { filter: brightness(1.08); }
.btn-gold:active { transform: scale(.98); }
.btn-outline { background: transparent; color: var(--cream); border: 2px solid var(--gold); padding: .75rem 1.2rem; font-size: .95rem; }
.btn-danger { background: #c0392b; color: #fff; padding: .75rem 1.2rem; font-size: .95rem; }
button:disabled { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--gold-light); font: inherit; cursor: pointer; padding: .2rem .4rem; }
.link.danger { color: #ffb4a8; }

input[type=text], input[type=password], input[type=number], input[type=search], input:not([type]) {
  width: 100%;
  font: 400 1.15rem/1.3 var(--font-body);
  padding: .95rem 1.1rem;
  border-radius: 14px;
  border: 2px solid transparent;
  background: var(--cream);
  color: var(--red-deep);
  outline: none;
}
input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(188, 156, 85, .35); }
input::placeholder { color: #b08a8f; }
label { display: block; font-weight: 700; margin: 0 0 .4rem; color: var(--gold-light); }

/* ---------------------------------------------------------------- telefoon */
.phone-wrap {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(20px, env(safe-area-inset-top)) 22px max(28px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}
.brand { margin-bottom: 2rem; }
.brand-logo { width: 116px; display: block; }
.phone-card { flex: 1; display: flex; flex-direction: column; }
.join-form { margin-top: .5rem; }
.join-form .btn-gold { width: 100%; margin-top: 1rem; padding: 1.15rem; font-size: 1.15rem; }

#app .state { display: none; }
#app[data-view=waiting] .state-waiting,
#app[data-view=won] .state-won { display: block; animation: fade-in .4s ease both; }

.pulse-icon { margin: 1.6rem 0 1.8rem; }
.pulse-icon img { width: 110px; display: block; animation: beat 1.6s ease-in-out infinite; transform-origin: 70% 60%; }

.code-box {
  background: var(--cream);
  color: var(--red-ink);
  border-radius: 22px;
  padding: 1.1rem 1.4rem 1.3rem;
  margin: 1.2rem 0 1.4rem;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .3), 0 0 0 4px var(--gold);
  animation: pop .6s cubic-bezier(.2, 1.6, .4, 1) both .15s;
}
.code-label { display: block; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; color: var(--gold); }
.code { display: block; font: 400 4.2rem/1 var(--font-display); letter-spacing: .14em; margin-top: .25rem; }

.live { display: flex; align-items: center; gap: .5rem; font-size: .8rem; opacity: .8; margin-top: auto; padding-top: 1.5rem; }
.live .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }
.live[data-live=on] .dot { background: var(--ok); box-shadow: 0 0 0 0 rgba(143, 209, 158, .6); animation: ping 2s infinite; }
.live[data-live=off] .dot { background: #ff8a7a; animation: blink 1s infinite; }

.corner-icon { position: fixed; right: 16px; bottom: max(14px, env(safe-area-inset-bottom)); width: 38px; opacity: .85; pointer-events: none; }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; }

/* ---------------------------------------------------------------- groot scherm */
body.screen { overflow: hidden; }
#screen { height: 100vh; position: relative; }
.screen-idle, .screen-draw { position: absolute; inset: 0; padding: 5vh 5vw; }
.screen-idle { display: grid; place-items: center; text-align: center; }
#screen.drawing .screen-idle { visibility: hidden; }
.display-screen { font-size: 7.2vw; }
.screen-sub { font-size: 1.9vw; margin-bottom: 3vh; }
.qr-frame { background: var(--cream); padding: 1.6vw; border-radius: 1.6vw; display: inline-block; box-shadow: 0 1vw 3vw rgba(0, 0, 0, .35), 0 0 0 .4vw var(--gold); }
.qr-frame #qr { width: 22vw; height: 22vw; }
.qr-frame svg { width: 100%; height: 100%; display: block; }
.qr-frame svg rect, .qr-frame svg path { shape-rendering: crispEdges; }
.screen-url { font: 700 1.6vw/1.2 var(--font-body); color: var(--gold-light); margin: 2.2vh 0 0; letter-spacing: .02em; }

.screen-right { align-self: stretch; display: flex; flex-direction: column; padding-top: 14vh; min-width: 0; }
.counter { display: flex; align-items: baseline; gap: 1.2vw; }
.counter-num { font: 400 11vw/1 var(--font-display); color: var(--gold-light); }
.counter-label { font: 400 3vw/1 var(--font-display); text-transform: uppercase; }
.ticker { list-style: none; padding: 0; margin: 4vh 0 0; display: flex; flex-wrap: wrap; gap: .8vw; align-content: flex-start; overflow: hidden; max-height: 46vh; }
.ticker li { transition: background 1.2s, color 1.2s; font-size: 1.5vw; padding: .45vw 1.1vw; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ticker li.new { animation: slide-in .5s cubic-bezier(.2, 1.4, .4, 1) both; background: var(--gold); color: var(--red-deep); font-weight: 700; }
.closed-banner { font: 400 2.2vw/1 var(--font-display); text-transform: uppercase; color: var(--red-deep); background: var(--gold); padding: 1vw 1.6vw; border-radius: 999px; align-self: flex-start; margin-top: 3vh; }

.screen-logo { position: absolute; right: 3.5vw; top: 4vh; width: 11vw; }
.screen-live { position: absolute; right: 1.6vw; bottom: 1.6vw; margin: 0; padding: 0; }

.screen-draw { display: flex; flex-direction: column; animation: fade-in .5s ease both; }
.screen-draw .display-screen { font-size: 6vw; margin-bottom: .1em; }
.screen-draw .display span { display: inline; color: var(--gold-light); }
.winners { list-style: none; margin: 3vh 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6vh 2.4vw; counter-reset: none; }
.winners[data-count="1"], .winners[data-count="2"], .winners[data-count="3"] { grid-template-columns: minmax(0, 1fr); max-width: 60vw; }
.winners li { display: flex; align-items: center; gap: 1.4vw; padding: 1.1vh 1.6vw; border-radius: 999px; border: .25vw solid var(--gold); background: var(--panel); transition: background .3s, color .3s, transform .3s; min-width: 0; }
.winners .nr { font: 400 2.4vw/1 var(--font-display); color: var(--gold-light); width: 2.6vw; text-align: center; flex: none; }
.winners .nm { font: 700 2.5vw/1.25 var(--font-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.winners[data-count] li { font-size: 1em; }
.winners li.pending { opacity: .35; }
.winners li.spinning .nm { opacity: .6; filter: blur(.5px); }
.winners li.revealed { background: var(--cream); color: var(--red-ink); animation: pop .55s cubic-bezier(.2, 1.6, .4, 1) both; }
.winners li.revealed .nr { color: var(--gold); }

/* ---------------------------------------------------------------- beheer */
body.admin { font-size: 15px; }
.admin-login { max-width: 400px; margin: 0 auto; padding: 40px 20px; }
.admin-login .brand-logo { margin-bottom: 2rem; }
.admin-login .display { font-size: 2.6rem; }
.admin-login .btn-gold { width: 100%; margin-top: 1rem; }
.admin-wrap { max-width: 980px; margin: 0 auto; padding: 24px 16px 60px; }
.admin-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; margin-bottom: 1.2rem; }
.admin-head .display { font-size: 2.4rem; margin: 0; }
.admin-head .display span { display: inline; color: var(--gold-light); }
.admin-head nav { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; }
.admin-head nav a { color: var(--gold-light); text-decoration: none; font-weight: 700; }
.admin-head nav form { margin: 0; }

.flash { padding: .8rem 1rem; border-radius: 12px; font-weight: 700; margin: 0 0 1rem; }
.flash-ok { background: var(--cream); color: var(--red-ink); }
.flash-err { background: #ffd2c9; color: #6b0f12; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.stats div { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.stats strong { display: block; font: 400 2.4rem/1 var(--font-display); color: var(--gold-light); }
.stats span { font-size: .85rem; opacity: .85; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin-bottom: 14px; backdrop-filter: blur(4px); }
.panel h2 { font: 400 1.5rem/1.1 var(--font-display); text-transform: uppercase; margin: 0 0 .8rem; letter-spacing: .02em; }
.panel h2 small { font: 400 .9rem var(--font-body); text-transform: none; opacity: .75; margin-left: .4rem; }
.draw-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.draw-form label { margin: 0; }
.draw-form input { width: 110px; display: block; margin-top: .4rem; }
.btn-big { padding: 1.15rem 2.2rem; font-size: 1.2rem; flex: 1 1 220px; }
.row-buttons { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.row-buttons form { margin: 0; }
.badge { font-size: .8rem; font-weight: 700; padding: .35rem .8rem; border-radius: 999px; }
.badge-ok { background: rgba(143, 209, 158, .2); color: var(--ok); }
.badge-closed { background: rgba(255, 138, 122, .2); color: #ffb4a8; }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gold-light); padding: .4rem .5rem; border-bottom: 1px solid var(--line); }
.tbl td { padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }
.tbl td form { margin: 0; text-align: right; }
.tbl tr:last-child td { border-bottom: 0; }
.filter { margin-bottom: .6rem; padding: .6rem .9rem; font-size: 1rem; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.qr-small { padding: 12px; border-radius: 14px; box-shadow: 0 0 0 3px var(--gold); }
.qr-small #qr { width: 200px; height: 200px; }
.reset-form { display: flex; gap: 8px; }
.reset-form input { flex: 1; padding: .7rem .9rem; font-size: 1rem; }

@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------------------------------------------------------------- animaties */
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.1); } 30% { transform: scale(1); } 45% { transform: scale(1.06); } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(143, 209, 158, .6); } 70% { box-shadow: 0 0 0 8px rgba(143, 209, 158, 0); } 100% { box-shadow: 0 0 0 0 rgba(143, 209, 158, 0); } }
@keyframes blink { 50% { opacity: .3; } }
@keyframes slide-in { from { transform: translateY(-12px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
