/* Adventskalender: a German Christmas market at night. Deep red, gold, candlelight and paper stars. */

:root {
  --wall: #4c1114;
  --wall-light: #7a2225;
  --wall-dark: #2a080a;

  --gold: #d9b45a;
  --gold-light: #f2d78e;
  --gold-dark: #9c7a2c;

  --parchment: #f5ead2;
  --parchment-light: #fcf6e8;
  --parchment-edge: #dcc79c;
  --ink: #3a2414;
  --ink-soft: #6e5640;

  --red: #b3202a;
  --red-dark: #7a1219;
  --green: #1f4a35;
  --night: #0f1c36;

  --fraktur: 'UnifrakturMaguntia', 'Old English Text MT', serif;
  --serif: 'EB Garamond', Garamond, Georgia, serif;
  --hand: 'Caveat', 'Segoe Print', cursive;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--wall); }

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--parchment);
  font-family: var(--serif);
  font-size: 1.05rem;
  background:
    url('/strohstern.svg') 0 0 / 240px 240px,
    radial-gradient(ellipse 90% 55% at 50% 0%, var(--wall-light), transparent 70%),
    radial-gradient(ellipse 120% 60% at 50% 110%, var(--wall-dark), transparent 70%),
    var(--wall);
}

body:has(dialog[open]) { overflow: hidden; }

a { color: var(--gold-light); }

/* ---------- Snow ---------- */

.snow {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.snow::before,
.snow::after {
  content: '';
  position: absolute;
  inset: calc(var(--fall) * -1) 0 0 0;
  background-image:
    radial-gradient(circle at 8% 12%, #fff 1.6px, transparent 2.4px),
    radial-gradient(circle at 38% 52%, #fff 1.2px, transparent 2px),
    radial-gradient(circle at 68% 28%, #fff 2px, transparent 2.8px),
    radial-gradient(circle at 86% 78%, #fff 1.3px, transparent 2px),
    radial-gradient(circle at 22% 88%, #fff 1.6px, transparent 2.4px);
  background-size: var(--fall) var(--fall);
  animation: snowfall var(--duration) linear infinite;
}

.snow::before { --fall: 320px; --duration: 30s; opacity: .7; }
.snow::after { --fall: 210px; --duration: 46s; opacity: .35; }

@keyframes snowfall {
  to { transform: translateY(var(--fall)); }
}

/* ---------- Hanging Herrnhut stars ---------- */

.hanging-star {
  position: absolute;
  top: 0;
  z-index: 0;
  width: clamp(64px, 10vw, 118px);
  pointer-events: none;
  transform-origin: 50% 0;
  animation: sway 7s ease-in-out infinite alternate;
  filter: drop-shadow(0 6px 14px rgb(255 200 110 / .25));
}

.hanging-star-left { left: 3%; }
.hanging-star-right { right: 4%; width: clamp(52px, 8vw, 92px); animation-delay: -3s; }

@keyframes sway {
  from { rotate: -3deg; }
  to { rotate: 3deg; }
}

/* ---------- Top bar ---------- */

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 20px;
  padding: 10px 16px;
  background: rgb(30 6 8 / .6);
  border-bottom: 1px solid rgb(217 180 90 / .35);
  backdrop-filter: blur(4px);
}

.brand {
  font-family: var(--fraktur);
  font-size: 1.6rem;
  color: var(--gold-light);
  text-decoration: none;
}

.topbar-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 18px;
}

.topbar-links a {
  color: var(--parchment);
  font-weight: 500;
  text-decoration: none;
  text-underline-offset: 5px;
}

.topbar-links a:hover { text-decoration: underline; }
.topbar-links a[aria-current='page'] { color: var(--gold-light); text-decoration: underline; text-decoration-color: var(--gold); }

.topbar-user {
  padding: 2px 12px;
  border: 1px solid rgb(217 180 90 / .5);
  border-radius: 999px;
  font-size: .95rem;
  color: var(--gold-light);
}

.topbar-user:empty { display: none; }
.topbar .link-button { color: var(--parchment); opacity: .8; }

/* ---------- Page and headings ---------- */

.page {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 44px) 16px 48px;
}

.page-narrow { max-width: 660px; }

.hero { text-align: center; }

h1 {
  margin: 0;
  font-family: var(--fraktur);
  font-weight: 400;
  font-size: clamp(2.8rem, 10vw, 5.2rem);
  line-height: 1.05;
  color: var(--gold-light);
  text-shadow: 0 3px 0 var(--red-dark), 0 0 28px rgb(242 215 142 / .35);
}

.hero-sub {
  margin: .6rem auto 0;
  max-width: 34rem;
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.4;
  color: var(--parchment);
  opacity: .9;
}

.status {
  margin: 1rem auto 0;
  max-width: 38rem;
  text-align: center;
  font-size: 1.15rem;
  line-height: 1.45;
}

/* ---------- Advent wreath ---------- */

.wreath-wrap {
  margin: 18px auto 0;
  width: min(300px, 78vw);
  text-align: center;
}

.wreath { display: block; width: 100%; height: auto; overflow: visible; }

.wreath-ring {
  fill: none;
  stroke: #1d4a33;
  stroke-width: 24;
  stroke-linecap: round;
}

.wreath-needles {
  fill: none;
  stroke: #2f6e4b;
  stroke-width: 16;
  stroke-dasharray: 2 4;
  stroke-linecap: round;
}

.candle .flame,
.candle .halo {
  opacity: 0;
  transition: opacity .5s ease;
}

.candle.lit .flame,
.candle.lit .halo { opacity: 1; }

.candle.lit .flame {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: flicker 1.9s ease-in-out infinite;
}

@keyframes flicker {
  0%, 100% { transform: scale(1, 1) rotate(0deg); }
  30% { transform: scale(.9, 1.08) rotate(-3deg); }
  65% { transform: scale(1.06, .94) rotate(2deg); }
}

.wreath-caption {
  margin-top: 4px;
  font-style: italic;
  font-size: 1rem;
  color: var(--gold-light);
}

/* ---------- The calendar board and its doors ---------- */

.board {
  margin: 26px auto 0;
  padding: clamp(12px, 3vw, 28px);
  border: 3px solid var(--gold);
  border-radius: 10px;
  background: url('/village.svg') center bottom / cover no-repeat, var(--night);
  box-shadow:
    0 0 0 6px var(--wall-dark),
    0 0 0 8px var(--gold-dark),
    0 30px 60px rgb(0 0 0 / .45),
    inset 0 0 40px rgb(0 0 0 / .45);
}

.doors {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(8px, 2vw, 16px);
}

@media (min-width: 720px) { .doors { grid-template-columns: repeat(6, 1fr); } }

.door-cell { aspect-ratio: 1; perspective: 700px; }

.door {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.door:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 3px; border-radius: 6px; }

/* what's behind the door */
.door-inside {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2px;
  border-radius: 4px;
  background: var(--parchment);
  color: var(--ink);
  box-shadow: inset 0 3px 12px rgb(0 0 0 / .4);
}

/* hidden until the door swings open, otherwise it shows through the see-through door front */
.door:not(.is-opened) .door-inside { visibility: hidden; }

.inside-icon { font-size: clamp(1.5rem, 4.5vw, 2.2rem); line-height: 1; color: var(--red); }
.door:not(.has-mail) .inside-icon { color: var(--gold-dark); }
.inside-label { font-size: clamp(.7rem, 1.8vw, .85rem); font-style: italic; color: var(--ink-soft); }

/* the door itself, hinged on the left */
.door-flap {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform .7s cubic-bezier(.3, .7, .3, 1);
}

.door-front,
.door-back {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  backface-visibility: hidden;
}

/* printed onto the picture, with a perforated edge */
.door-front {
  display: grid;
  place-items: center;
  background: rgb(10 18 38 / .38);
  border: 2px dashed rgb(255 240 210 / .8);
}

.door-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, #efe2c4, #dccaa3);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / .08);
}

.door-number {
  font-weight: 700;
  font-size: clamp(1.4rem, 4.4vw, 2.4rem);
  line-height: 1;
  color: var(--parchment-light);
  text-shadow: 0 2px 4px rgb(0 0 0 / .85), 0 0 14px rgb(0 0 0 / .55);
}

/* door 24: the big golden one */
.door[data-day='24'] .door-front {
  background: radial-gradient(circle, rgb(242 215 142 / .45), rgb(156 122 44 / .45));
  border-color: var(--gold-light);
}
.door[data-day='24'] .door-number { font-family: var(--fraktur); font-weight: 400; font-size: clamp(1.8rem, 5.4vw, 3rem); color: #fff6d8; }

/* a red wax seal: a letter is waiting */
.door.has-mail .door-front::after {
  content: '';
  position: absolute;
  right: 9%;
  bottom: 9%;
  width: 22%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e0505a, var(--red) 55%, var(--red-dark));
  box-shadow: 0 2px 3px rgb(0 0 0 / .45);
}

.door.is-locked { cursor: default; }
.door.is-locked .door-front { border-color: rgb(255 240 210 / .5); }
.door.is-locked .door-number { opacity: .78; }

.door:not(.is-locked):not(.is-opened):hover .door-flap { transform: rotateY(-16deg); }
.door.is-opened .door-flap { transform: rotateY(-106deg); }

.door.is-today:not(.is-opened) .door-front {
  border-color: var(--gold-light);
  animation: glow 2.2s ease-in-out infinite;
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 10px rgb(242 215 142 / .4); }
  50% { box-shadow: 0 0 26px rgb(242 215 142 / .9), inset 0 0 14px rgb(242 215 142 / .35); }
}

.door.is-nudged .door-flap { animation: nudge .45s ease; }

@keyframes nudge {
  20% { translate: -5px 0; }
  40% { translate: 5px 0; }
  60% { translate: -3px 0; }
  80% { translate: 2px 0; }
}

.board-note {
  margin: 22px auto 0;
  max-width: 36rem;
  text-align: center;
  font-style: italic;
  font-size: .95rem;
  opacity: .75;
}

/* ---------- Letters behind a door ---------- */

.letters { display: grid; gap: 2rem; padding-top: 20px; }

.letter {
  position: relative;
  color: var(--ink);
  padding: 2.2rem clamp(16px, 4vw, 28px) 1.4rem;
  border: 1px solid var(--parchment-edge);
  border-radius: 6px;
  background:
    repeating-linear-gradient(to bottom, transparent 0 37px, rgb(110 86 64 / .13) 37px 38px) 0 14px,
    #fffaf0;
  box-shadow: 0 4px 12px rgb(0 0 0 / .12);
}

.letter-seal {
  position: absolute;
  top: -21px;
  left: 50%;
  translate: -50% 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e0505a, var(--red) 55%, var(--red-dark));
  box-shadow: 0 3px 6px rgb(0 0 0 / .35), inset 0 0 0 4px rgb(0 0 0 / .12);
  color: var(--gold-light);
  font-family: var(--fraktur);
  font-size: 1.45rem;
}

.letter-from {
  margin: 0 0 1rem;
  text-align: center;
  font-style: italic;
  color: var(--ink-soft);
}

.letter-from strong { font-style: normal; color: var(--ink); }

.letter-photo {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 1.2rem;
  padding: 8px 8px 28px;
  background: #fff;
  box-shadow: 0 4px 14px rgb(0 0 0 / .2);
  rotate: -1.5deg;
}

.letter-photo img { display: block; max-width: 100%; max-height: 360px; }

.letter-text {
  margin: 0;
  font-family: var(--hand);
  font-weight: 500;
  font-size: clamp(1.5rem, 4.6vw, 1.9rem);
  line-height: 1.27;
  color: #2b1d12;
  white-space: pre-line;
  overflow-wrap: break-word;
}

.letter-music {
  margin-top: 1.2rem;
  padding: .7rem;
  border: 1px solid rgb(31 74 53 / .25);
  border-radius: 10px;
  background: rgb(31 74 53 / .07);
}

.letter-music-label {
  display: block;
  margin-bottom: .4rem;
  font-weight: 600;
  color: var(--green);
  overflow-wrap: anywhere;
}

.letter-music audio { display: block; width: 100%; }

/* ---------- Cards and forms ---------- */

.card {
  margin-top: clamp(24px, 5vw, 40px);
  padding: clamp(22px, 5vw, 36px);
  border: 2px solid var(--gold);
  border-radius: 10px;
  background: linear-gradient(180deg, var(--parchment-light), var(--parchment));
  color: var(--ink);
  box-shadow: 0 0 0 5px rgb(42 8 10 / .6), 0 24px 60px rgb(0 0 0 / .4);
}

.card[hidden] { display: none; }

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 1.4rem;
  padding: 4px;
  border-radius: 999px;
  background: rgb(122 18 25 / .08);
}

.tab {
  flex: 1;
  padding: .5rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
}

.tab[aria-selected='true'] { background: var(--red); color: #fff; box-shadow: 0 2px 0 var(--red-dark); }
.tab:focus-visible { outline: 2px solid var(--gold-dark); outline-offset: 2px; }

.field {
  display: grid;
  align-content: start;
  gap: .4rem;
  min-width: 0;
  margin-bottom: 1.3rem;
}

.field-label {
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--red-dark);
}

.field-label em,
.field-help {
  font-style: italic;
  font-weight: 400;
  font-size: .9rem;
  color: var(--ink-soft);
}

.field-help[hidden] { display: none; }

.field input[type='text'],
.field input[type='password'],
.field select,
.field textarea {
  width: 100%;
  padding: .6rem .8rem;
  border: 1.5px solid var(--parchment-edge);
  border-radius: 8px;
  background: #fffdf7;
  color: var(--ink);
  font: inherit;
  font-size: 1.1rem;
}

.field textarea {
  min-height: 150px;
  resize: vertical;
  font-family: var(--hand);
  font-size: 1.55rem;
  line-height: 1.3;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px rgb(217 180 90 / .35);
}

.field input[type='file'] {
  max-width: 100%;
  font: inherit;
  font-size: .95rem;
  color: var(--ink-soft);
}

.field input[type='file']::file-selector-button {
  margin-right: .75rem;
  padding: .45rem 1rem;
  border: 1px solid var(--gold-dark);
  border-radius: 999px;
  background: linear-gradient(var(--gold-light), var(--gold));
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.field-row { display: grid; gap: 0 1.4rem; }
@media (min-width: 600px) { .field-row { grid-template-columns: 1fr 1fr; } }

.image-preview {
  justify-self: start;
  max-width: 100%;
  max-height: 170px;
  border: 6px solid #fff;
  box-shadow: 0 3px 10px rgb(0 0 0 / .18);
  rotate: -2deg;
}

.music-preview { width: 100%; }

.image-preview[hidden],
.music-preview[hidden],
.link-button[hidden],
.form-error[hidden] { display: none; }

.link-button {
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--red-dark);
  font: inherit;
  font-size: .95rem;
  text-decoration: underline;
  cursor: pointer;
}

.form-error {
  margin: 0 0 1rem;
  padding: .65rem .9rem;
  border-left: 4px solid var(--red);
  border-radius: 6px;
  background: #f9dfdc;
  color: var(--red-dark);
  font-weight: 500;
}

.btn {
  --btn-bg: linear-gradient(var(--gold-light), var(--gold));
  --btn-fg: var(--ink);
  --btn-edge: var(--gold-dark);
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  padding: .6rem 1.4rem;
  border: 1px solid var(--btn-edge);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  box-shadow: 0 3px 0 var(--btn-edge);
  font: inherit;
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
  cursor: pointer;
  transition: translate .1s ease, box-shadow .1s ease;
}

.btn:hover { translate: 0 -1px; box-shadow: 0 4px 0 var(--btn-edge); }
.btn:active { translate: 0 2px; box-shadow: 0 1px 0 var(--btn-edge); }
.btn:focus-visible { outline: 3px solid var(--gold-dark); outline-offset: 3px; }
.btn:disabled { opacity: .65; cursor: progress; translate: none; }

.btn-primary {
  --btn-bg: linear-gradient(#c62c36, var(--red));
  --btn-fg: #fff8e7;
  --btn-edge: var(--red-dark);
}

.btn-block { width: 100%; padding: .85rem; font-size: 1.25rem; }

.sent { text-align: center; }

.sent-seal {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e0505a, var(--red) 55%, var(--red-dark));
  box-shadow: 0 3px 6px rgb(0 0 0 / .3), inset 0 0 0 4px rgb(0 0 0 / .12);
  color: var(--gold-light);
  font-size: 1.6rem;
}

.sent h2 {
  margin: .5rem 0 .4rem;
  font-family: var(--fraktur);
  font-weight: 400;
  font-size: 2.6rem;
  color: var(--red-dark);
}

.sent p { margin: 0 auto; max-width: 30rem; font-size: 1.15rem; line-height: 1.45; }

.sent-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem 1.5rem;
  margin-top: 1.5rem;
}

/* ---------- Door themes in the calendar ---------- */

.door.is-done .door-front::before {
  content: '✓';
  position: absolute;
  top: 6%;
  left: 8%;
  font-size: clamp(.8rem, 2vw, 1rem);
  font-weight: 700;
  color: var(--gold-light);
  text-shadow: 0 1px 3px rgb(0 0 0 / .8);
}

.door.is-done .inside-label { color: var(--green); font-weight: 600; }

/* ---------- A day's page ---------- */

.hero-kicker {
  margin: 0 0 .2rem;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-light);
}

.theme-card { text-align: center; }

.theme-icon { display: block; font-size: 2.8rem; line-height: 1; }

.theme-title {
  margin: .5rem 0 .4rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.6rem, 5.5vw, 2.1rem);
  line-height: 1.15;
  color: var(--red-dark);
}

.theme-prompt {
  margin: 0 auto;
  max-width: 32rem;
  font-size: 1.2rem;
  line-height: 1.45;
}

.theme-extra:not(:empty) { margin-top: 1.4rem; }
.theme-extra > * + * { margin-top: 1.2rem; }

.theme-pending { margin: 0; font-style: italic; color: var(--ink-soft); }

.riddle {
  padding: 1rem 1.2rem;
  border: 1px dashed var(--gold-dark);
  border-radius: 8px;
  background: #fffaf0;
}

.riddle-text {
  margin: 0;
  font-family: var(--hand);
  font-size: clamp(1.5rem, 4.8vw, 1.85rem);
  line-height: 1.25;
}

.solution { margin: .6rem 0 0; font-weight: 600; color: var(--green); }
.solution-label { font-weight: 400; font-style: italic; }
.field .solution { margin: 0; font-size: .95rem; }

.section-title {
  margin: 0 0 .3rem;
  font-family: var(--fraktur);
  font-weight: 400;
  font-size: 2rem;
  color: var(--red-dark);
}

.section-title:not(:first-child) { margin-top: 1.8rem; }

.team-note { margin: 0 0 1.2rem; color: var(--ink-soft); line-height: 1.4; }
.team-note a { color: var(--red-dark); font-weight: 600; }

#mine .entry { margin-top: 26px; }
.mine-edit { display: flex; margin: 1.2rem auto 0; }
.form-cancel { display: block; margin: .9rem auto 0; }

.board-section { margin-top: clamp(32px, 6vw, 48px); }

.section-heading {
  margin: 0;
  text-align: center;
  font-family: var(--fraktur);
  font-weight: 400;
  font-size: clamp(2rem, 6vw, 2.6rem);
  color: var(--gold-light);
  text-shadow: 0 2px 0 var(--red-dark);
}

.section-note {
  margin: .3rem auto 0;
  max-width: 30rem;
  text-align: center;
  font-style: italic;
  opacity: .85;
}

.board-section .letters { padding-top: 34px; }
.board-section .letters:empty { display: none; }

.day-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .8rem 1.4rem;
  margin-top: clamp(32px, 6vw, 48px);
  padding-top: 1rem;
  border-top: 1px solid rgb(217 180 90 / .35);
}

.day-nav a { font-weight: 600; text-underline-offset: 4px; }
.day-nav a[hidden] { display: none; }
.day-nav a:nth-child(2) { margin: 0 auto; }

/* ---------- Entries ---------- */

.entry-members { font-size: .9rem; }

.entry-card {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin: 0 0 1rem;
  padding: .7rem .9rem;
  border: 1px solid var(--gold);
  border-radius: 8px;
  background: rgb(217 180 90 / .12);
  line-height: 1.35;
}

.entry-card-emoji { font-size: 2rem; }

.answers {
  margin: 0 0 .6rem;
  padding-left: 1.4rem;
  display: grid;
  gap: .55rem;
}

.answer-q {
  display: block;
  overflow: hidden;
  font-size: .9rem;
  font-style: italic;
  color: var(--ink-soft);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.answer-a { display: block; font-family: var(--hand); font-size: 1.5rem; line-height: 1.15; }
.answer-solution { display: block; font-size: .9rem; font-weight: 600; color: var(--green); }

.answer-single { margin: 0 0 .6rem; font-family: var(--hand); font-size: 1.7rem; line-height: 1.2; }
.answer-label { font-family: var(--serif); font-size: 1rem; font-style: italic; color: var(--ink-soft); }

.entry-bingo { margin: 0; text-align: center; font-weight: 700; font-size: 1.2rem; color: var(--red-dark); }

.entry-link {
  display: inline-block;
  margin-top: .9rem;
  padding: .35rem .9rem;
  border: 1px solid rgb(31 74 53 / .35);
  border-radius: 999px;
  background: rgb(31 74 53 / .07);
  color: var(--green);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.entry-link:hover { background: rgb(31 74 53 / .14); }

.secret {
  display: block;
  margin: 1rem 0 0;
  padding: .55rem .9rem;
  border: 1.5px dashed var(--red);
  border-radius: 8px;
  background: rgb(179 32 42 / .06);
  color: var(--red-dark);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button.secret { width: 100%; }
.secret.is-revealed { border-style: solid; cursor: default; font-family: var(--hand); font-size: 1.6rem; font-weight: 500; }
.secret-label { font-family: var(--serif); font-size: 1rem; font-style: italic; font-weight: 400; }

.vote-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-top: 1.1rem; }
.vote-btn { font-size: 1rem; padding: .4rem 1.1rem; }
.vote-count { font-weight: 600; color: var(--red-dark); }

/* ---------- Ranking ---------- */

.ranking { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }

.ranking-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .4rem .5rem .4rem .8rem;
  border: 1.5px solid var(--parchment-edge);
  border-radius: 8px;
  background: #fffdf7;
}

.ranking-pos { width: 1.4rem; font-weight: 700; color: var(--red); }
.ranking-name { flex: 1; font-size: 1.15rem; }

.ranking-move {
  width: 2.3rem;
  height: 2.3rem;
  border: 1px solid var(--gold-dark);
  border-radius: 50%;
  background: linear-gradient(var(--gold-light), var(--gold));
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.ranking-move:disabled { opacity: .3; cursor: default; }
.ranking-move:focus-visible { outline: 2px solid var(--red-dark); outline-offset: 2px; }

.ranking-result { margin: 0 0 .4rem; padding-left: 1.6rem; font-family: var(--hand); font-size: 1.5rem; line-height: 1.25; }
.combined { text-align: left; padding: 1rem 1.2rem; border-radius: 8px; background: rgb(217 180 90 / .14); }
.combined-title { margin: 0 0 .4rem; font-size: 1.1rem; color: var(--red-dark); }

/* ---------- Tarot ---------- */

.tarot-wrap { perspective: 900px; }

.tarot {
  display: block;
  width: min(230px, 70vw);
  aspect-ratio: 2 / 3.2;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.tarot.is-flipped { cursor: default; }
.tarot:focus-visible { outline: 3px solid var(--gold-dark); outline-offset: 4px; border-radius: 12px; }

.tarot-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .8s cubic-bezier(.3, .7, .3, 1);
}

.tarot.is-flipped .tarot-inner { transform: rotateY(180deg); }
.tarot:not(.is-flipped):hover .tarot-inner { transform: rotateY(-8deg) translateY(-4px); }

.tarot-back,
.tarot-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 1rem;
  border-radius: 12px;
  backface-visibility: hidden;
  box-shadow: 0 10px 24px rgb(0 0 0 / .3);
}

.tarot-back {
  border: 3px double var(--gold);
  background:
    repeating-linear-gradient(45deg, rgb(242 215 142 / .12) 0 2px, transparent 2px 14px),
    repeating-linear-gradient(-45deg, rgb(242 215 142 / .12) 0 2px, transparent 2px 14px),
    var(--night);
  color: var(--gold-light);
}

.tarot-back-star { font-size: 3.6rem; line-height: 1; }
.tarot-back-label { font-style: italic; font-size: 1.1rem; }

.tarot-face {
  transform: rotateY(180deg);
  border: 3px double var(--gold-dark);
  background: linear-gradient(180deg, #fffaf0, var(--parchment));
  color: var(--ink);
}

.tarot-numeral { font-family: var(--fraktur); font-size: 1.4rem; color: var(--red-dark); }
.tarot-emoji { font-size: 3.2rem; line-height: 1.1; }
.tarot-name { font-weight: 700; font-size: 1.2rem; color: var(--red-dark); }
.tarot-meaning { font-style: italic; font-size: 1rem; line-height: 1.3; }

/* ---------- Bingo ---------- */

.bingo {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 4px;
  border: 2px solid var(--red-dark);
  border-radius: 8px;
  background: var(--red-dark);
}

.bingo-square {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  aspect-ratio: 1;
  padding: 3px;
  border: 0;
  border-radius: 4px;
  background: #fffaf0;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  overflow: hidden;
}

.bingo-de { max-width: 100%; font-weight: 700; font-size: clamp(.6rem, 2.2vw, .88rem); line-height: 1.1; overflow-wrap: break-word; hyphens: auto; }
.bingo-en { font-size: clamp(.5rem, 1.6vw, .7rem); font-style: italic; line-height: 1.1; color: var(--ink-soft); }

.bingo-square.is-marked {
  background: radial-gradient(circle, rgb(179 32 42 / .2) 0 55%, transparent 56%), #fdf1d6;
}

.bingo-square.is-marked .bingo-de { color: var(--red-dark); }
.bingo-square.is-free { background: var(--gold); cursor: default; }
.bingo-square.is-free .bingo-de { font-family: var(--fraktur); font-weight: 400; font-size: clamp(.75rem, 2.6vw, 1.05rem); }
.bingo-square:focus-visible { outline: 3px solid var(--gold-dark); outline-offset: -3px; }

.bingo-summary { margin: .6rem 0 0; font-weight: 600; color: var(--red-dark); }

/* ---------- Teams ---------- */

.team-current {
  margin-bottom: .4rem;
  padding: .9rem 1.1rem;
  border: 1px solid var(--gold);
  border-radius: 8px;
  background: rgb(217 180 90 / .12);
}

.team-current-name { margin: 0; font-weight: 700; font-size: 1.4rem; color: var(--red-dark); }
.team-current .team-note { margin: .2rem 0 .5rem; }

.team-list { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .5rem; }

.team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .5rem .5rem .5rem 1rem;
  border: 1px solid var(--parchment-edge);
  border-radius: 8px;
  background: #fffdf7;
}

.team-row .btn { font-size: 1rem; padding: .35rem 1.1rem; }
.team-members { color: var(--ink-soft); font-size: .95rem; }
.new-team { margin-top: .6rem; }

/* ---------- Golden star burst ---------- */

.sparkle {
  position: fixed;
  z-index: 30;
  width: 14px;
  height: 14px;
  pointer-events: none;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.sparkle-snow {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  clip-path: none;
  background: #fff !important;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  max-width: calc(100% - 32px);
  padding: .75rem 1.2rem;
  border: 2px solid var(--gold);
  border-radius: 10px;
  background: var(--parchment-light);
  color: var(--ink);
  box-shadow: 0 12px 30px rgb(0 0 0 / .4);
  font-size: 1.05rem;
  text-align: center;
  opacity: 0;
  translate: -50% 16px;
  pointer-events: none;
  transition: opacity .25s ease, translate .3s ease;
}

.toast.is-visible { opacity: 1; translate: -50% 0; }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
  }
}
