/* ─── Julquiz – stilren julkväll ─────────────────────────────── */
:root {
  --ink: #0a1220;
  --ink-2: #111b2e;
  --cream: #f3ede2;
  --gold: #c8a96e;
  --gold-soft: rgba(200, 169, 110, .16);
  --muted: rgba(243, 237, 226, .62);
  --faint: rgba(243, 237, 226, .38);
  --line: rgba(243, 237, 226, .14);
  --line-2: rgba(243, 237, 226, .26);
  --panel: rgba(10, 18, 32, .72);
  --display: "Cormorant Garamond", "Cormorant", Georgia, serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--body);
  font-size: 16px;
  color: var(--cream);
  background: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  letter-spacing: .005em;
}

/* Bakgrund: dovt Göteborgsfoto */
.bgphoto {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 120% 90% at 50% 40%, rgba(10,18,32,.35) 0%, rgba(10,18,32,.82) 70%, rgba(10,18,32,.96) 100%),
    linear-gradient(180deg, rgba(10,18,32,.55), rgba(10,18,32,.7) 60%, rgba(10,18,32,.95)),
    url("bg-goteborg.jpg") center 42% / cover no-repeat;
  animation: drift 80s ease-in-out infinite alternate;
}
@media (max-width: 700px) {
  .bgphoto { background:
    linear-gradient(180deg, rgba(10,18,32,.72), rgba(10,18,32,.8) 55%, rgba(10,18,32,.97)),
    url("bg-goteborg-small.jpg") 32% 40% / cover no-repeat; }
}
@keyframes drift { from { transform: scale(1.03); } to { transform: scale(1.1); } }

#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }

/* ─── Layout ─── */
.stage {
  position: relative; z-index: 3; min-height: 100vh;
  display: grid; place-items: center;
  padding: 64px 20px 72px;
}
.screen { width: 100%; max-width: 620px; text-align: center; }
.hidden { display: none !important; }

/* logga (vit SVG) med kvistar som rör sig i vinden */
.brand { position: relative; width: min(270px, 60vw); margin: 34px auto 66px; }
.brand .logo {
  display: block; width: 100%; height: auto; position: relative; z-index: 1;
  filter: drop-shadow(0 6px 24px rgba(0,0,0,.45));
  animation: logoIn 1.6s var(--ease) both;
}
.twig { position: absolute; pointer-events: none; height: auto; filter: drop-shadow(0 8px 14px rgba(0,0,0,.4)); }
.twig.l { width: 50%; left: -30%; top: -46%; transform-origin: 72% 78%; animation: twigIn 1.8s var(--ease) .3s both, swayL 7s ease-in-out 2.1s infinite; }
.twig.r { width: 38%; right: -30%; bottom: -72%; transform-origin: 96% 2%; animation: twigIn 1.8s var(--ease) .5s both, swayR 8s ease-in-out 2.3s infinite; }
@keyframes logoIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes twigIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes swayL { 0%,100% { transform: rotate(0); } 50% { transform: rotate(-3deg); } }
@keyframes swayR { 0%,100% { transform: rotate(0); } 50% { transform: rotate(4deg); } }
.brand.sm { width: min(200px, 50vw); margin: 26px auto 46px; }
.logo-mini { width: 118px; height: auto; display: block; }
@media (max-width: 520px) { .brand { margin: 30px auto 62px; } }

.eyebrow {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  font-size: .72rem; letter-spacing: .34em; text-transform: uppercase; font-weight: 500;
  color: var(--gold); margin: 0 0 18px;
}
.eyebrow::before, .eyebrow::after { content: ""; width: 36px; height: 1px; background: currentColor; opacity: .6; }
.eyebrow.plain::before, .eyebrow.plain::after { display: none; }

h1.title {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(3.4rem, 11vw, 6rem); line-height: .95; letter-spacing: -.01em;
  margin: 0 0 18px; color: var(--cream);
}
h1.title em { font-style: italic; color: var(--gold); font-weight: 400; }
h1.title.sm { font-size: clamp(2.6rem, 8vw, 4rem); }
.lead { color: var(--muted); font-size: 1.02rem; font-weight: 300; margin: 0 0 44px; }
.fine { color: var(--faint); font-size: .8rem; letter-spacing: .04em; margin-top: 22px; line-height: 1.7; }

/* ─── Panel ─── */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 32px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 40px 90px -40px rgba(0,0,0,.9);
  text-align: left;
}

label.field {
  display: block; font-size: .7rem; letter-spacing: .24em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 6px; font-weight: 500;
}
input[type=text], input[type=password] {
  width: 100%; font: inherit; font-family: var(--display); font-size: 1.7rem; color: var(--cream);
  padding: 8px 0 10px; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0;
  background: transparent; outline: none; transition: border-color .3s;
}
input::placeholder { color: var(--faint); font-style: italic; }
input:focus { border-color: var(--gold); }

/* ─── Knappar ─── */
.btn {
  appearance: none; cursor: pointer; font: inherit; font-size: .74rem; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase;
  padding: 15px 26px; border-radius: 2px; color: var(--cream);
  background: transparent; border: 1px solid var(--line-2);
  transition: background .3s var(--ease), color .3s, border-color .3s, opacity .3s;
  display: inline-flex; align-items: center; justify-content: center; gap: .7em;
}
.btn:hover { border-color: var(--cream); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.primary { background: var(--cream); color: var(--ink); border-color: var(--cream); }
.btn.primary:hover { background: #fff; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn.gold:hover { background: #d6ba84; }
.btn.on { border-color: var(--gold); color: var(--gold); }
.btn.ghost { border-color: transparent; color: var(--muted); padding-left: 0; padding-right: 0; }
.btn.ghost:hover { color: var(--cream); }
.btn.block { width: 100%; margin-top: 30px; padding: 18px; }
.btn.small { padding: 10px 16px; font-size: .66rem; }
.arrow { font-family: var(--display); font-size: 1.2em; letter-spacing: 0; line-height: 0; }

/* ─── Frågevy ─── */
.qhead { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.chip { font-size: .7rem; font-weight: 500; letter-spacing: .28em; text-transform: uppercase; color: var(--gold); }
.qcount { font-family: var(--display); font-size: 1.1rem; color: var(--faint); font-variant-numeric: lining-nums; }
.qcount b { color: var(--cream); font-weight: 500; font-size: 1.5rem; }

.ornaments { display: flex; gap: 4px; margin: 0 0 28px; }
.orn {
  flex: 1; height: 2px; padding: 0; border: 0; cursor: pointer; border-radius: 0;
  background: var(--line); transition: background .4s var(--ease);
  position: relative;
}
.orn::after { content: ""; position: absolute; inset: -8px 0; }
.orn.done { background: rgba(243,237,226,.55); }
.orn.current { background: var(--gold); }

.qcard { padding: 40px 36px 32px; }
.qtext {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(1.8rem, 5.4vw, 2.5rem); line-height: 1.15; letter-spacing: -.005em;
  margin: 0 0 32px; text-wrap: balance;
}
.options { display: grid; gap: 0; border-top: 1px solid var(--line); }
.option {
  --i: 0;
  appearance: none; font: inherit; color: var(--cream); text-align: left; cursor: pointer;
  display: flex; align-items: center; gap: 20px;
  padding: 20px 6px; background: transparent; border: 0; border-bottom: 1px solid var(--line);
  font-size: 1.06rem; font-weight: 400;
  transition: background .3s var(--ease), padding .3s var(--ease), color .3s;
  animation: fadeUp .6s var(--ease) both; animation-delay: calc(var(--i) * 70ms + 120ms);
  position: relative;
}
.option::before {
  content: ""; position: absolute; left: 0; top: -1px; bottom: -1px; width: 0;
  background: linear-gradient(90deg, var(--gold-soft), transparent); transition: width .45s var(--ease);
}
.option:hover { padding-left: 14px; }
.option:hover::before { width: 100%; }
.option > * { position: relative; }
.option .letter {
  flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--display); font-style: italic; font-size: 1.25rem;
  border: 1px solid var(--line-2); color: var(--muted);
  transition: all .35s var(--ease);
}
.option .check { margin-left: auto; width: 18px; height: 18px; opacity: 0; transform: translateX(-6px); transition: all .4s var(--ease); color: var(--gold); }
.option.selected { padding-left: 14px; }
.option.selected::before { width: 100%; background: linear-gradient(90deg, rgba(200,169,110,.24), rgba(200,169,110,.04)); }
.option.selected .letter { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.option.selected .check { opacity: 1; transform: none; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.sparkle { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--gold); pointer-events: none; animation: spark .9s var(--ease) forwards; }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)); opacity: 0; } }

.qnav { display: flex; justify-content: space-between; margin-top: 22px; }

/* ─── Översikt ─── */
.review { display: grid; margin: 22px 0 0; max-height: 50vh; overflow: auto; border-top: 1px solid var(--line); }
.review-item {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 10px; row-gap: 2px;
  padding: 14px 4px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .3s;
  animation: fadeUp .5s var(--ease) both; animation-delay: calc(var(--i) * 30ms);
}
.review-item:hover { background: rgba(243,237,226,.04); }
.review-item .n { font-family: var(--display); color: var(--gold); font-size: 1.15rem; grid-row: span 2; }
.review-item .q { font-size: .86rem; color: var(--muted); font-weight: 300; }
.review-item .a { font-family: var(--display); font-size: 1.2rem; grid-column: 2; }
.review-item.missing .a { color: #d9a3a3; font-style: italic; }

/* ─── Klart ─── */
.starline { width: 64px; height: 64px; margin: 0 auto 28px; display: block; }
.starline path { fill: none; stroke: var(--gold); stroke-width: 1.2; stroke-dasharray: 300; stroke-dashoffset: 300; animation: draw 2.4s var(--ease) .2s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.waiting { display: flex; align-items: center; gap: 14px; color: var(--muted); font-weight: 300; }
.pulse-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); animation: pd 2.4s ease-in-out infinite; }
@keyframes pd { 0%,100% { opacity: .25; } 50% { opacity: 1; box-shadow: 0 0 0 6px rgba(200,169,110,.12); } }

.result-big { font-family: var(--display); font-size: clamp(3rem, 10vw, 4.4rem); font-weight: 500; line-height: 1; margin: 10px 0 6px; }
.result-big small { font-size: .45em; color: var(--muted); font-style: italic; }
.podium-list { list-style: none; padding: 0; margin: 26px 0 0; border-top: 1px solid var(--line); }
.podium-list li { display: flex; align-items: baseline; gap: 16px; padding: 14px 2px; border-bottom: 1px solid var(--line); animation: fadeUp .6s var(--ease) both; }
.podium-list .pl { font-family: var(--display); font-style: italic; color: var(--gold); width: 22px; font-size: 1.2rem; }
.podium-list .nm { font-family: var(--display); font-size: 1.35rem; }
.podium-list .pts { margin-left: auto; color: var(--muted); font-size: .85rem; }

/* ─── Toast ─── */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); opacity: 0; z-index: 50;
  padding: 14px 22px; border-radius: 2px; max-width: 92vw; font-size: .9rem;
  background: rgba(10,18,32,.95); border: 1px solid var(--line-2); color: var(--cream);
  transition: all .5s var(--ease); pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.err { border-color: rgba(217,163,163,.6); }

.screen.enter { animation: screenIn .9s var(--ease) both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.shake { animation: shake .4s; }
@keyframes shake { 25%,75% { transform: translateX(-5px) } 50% { transform: translateX(5px) } }

@media (max-width: 520px) {
  .card { padding: 26px 22px; }
  .qcard { padding: 30px 22px 22px; }
  .option { gap: 16px; padding: 17px 4px; font-size: 1rem; }
  .logo-card { margin-bottom: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
