/* Wand-Screen: dunkle Wirtshaus-Tafel im Look des Albrecht-Dürer-Hauses.
   Hausfarben: Gold-Braun #8B5C03 · Dunkelbraun #462E01 · Creme #E2CFAB.
   Aus 5 m lesbar, hoher Kontrast. Handgemacht statt SaaS-glatt. */
@import url('/static/css/fonts.css');

:root {
  --kreide: #f2e8d5;
  --kreide-dim: #c9b98f;
  --tafel-1: #2b2114;
  --tafel-2: #201810;
  --holz-1: #4a3317;
  --holz-2: #5d4520;
  --holz-3: #3a2a12;
  --gold: #d8ab5c;          /* helles Haus-Gold für dunklen Grund */
  --gold-tief: #8B5C03;     /* Original-Hausfarbe */
  --creme: #E2CFAB;
  /* Pro-Metrik-Themes (Deko-Farbe) */
  --theme-gold: #d8ab5c; --theme-kupfer: #c98a4b; --theme-rose: #d99a9a;
  --theme-tanne: #93b07c; --theme-feuer: #d76b45;
  --theme-himmel: #7faec9; --theme-geheim: #b09ad4;
}

* { box-sizing: border-box; margin: 0; }

body.screen {
  min-height: 100vh;
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: var(--kreide);
  background:
    repeating-linear-gradient(95deg,
      var(--holz-1) 0 14px, var(--holz-2) 14px 21px,
      var(--holz-3) 21px 27px, var(--holz-2) 27px 40px);
  padding: clamp(10px, 2vw, 26px);
}

.screen-root {
  height: calc(100vh - 2 * clamp(10px, 2vw, 26px));
  overflow: hidden;
  border-radius: 10px;
  border: 4px solid #2e2008;
  box-shadow: inset 0 0 0 3px #00000055, 0 10px 40px #00000088;
  background:
    radial-gradient(ellipse at 50% -10%, #ffffff0e, transparent 60%),
    radial-gradient(ellipse at 85% 110%, #00000055, transparent 55%),
    repeating-radial-gradient(circle at 30% 40%, transparent 0 2px, #ffffff04 2px 3px),
    linear-gradient(160deg, var(--tafel-1), var(--tafel-2) 70%);
  padding: clamp(14px, 2.5vw, 40px);
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.6vh, 22px);
}

.loading { font-size: 2rem; text-align: center; padding-top: 20vh; opacity: .7; }

/* ---------- Kopf ---------- */
.kopf { text-align: center; position: relative; }
.kopf .marke {
  display: flex; align-items: center; justify-content: center; gap: .6em;
}
.kopf .marke img { height: clamp(34px, 6.5vh, 84px); opacity: .95; }
.kopf .challenge-name {
  font-family: 'Italiana', 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.9rem, 5vw, 4.4rem);
  letter-spacing: .05em;
  color: var(--gold);
  text-shadow: 1px 2px 0 #00000055;
}
.kopf .thema {
  font-family: 'Caveat', cursive;
  font-size: clamp(1.2rem, 2.8vw, 2.2rem);
  color: var(--theme, var(--creme));
  margin-top: .15em;
  transform: rotate(-.4deg);
}
.kopf .meta {
  display: flex; justify-content: center; gap: 1.6em; flex-wrap: wrap;
  margin-top: .4em;
  font-size: clamp(.95rem, 1.7vw, 1.3rem);
  color: var(--kreide-dim);
}
.kopf .meta .preis { color: var(--gold); }

/* Kreidestrich-Trenner */
.strich {
  height: 3px; border: 0;
  background: repeating-linear-gradient(90deg, var(--kreide-dim) 0 12px, transparent 12px 18px);
  opacity: .3; border-radius: 2px;
}

/* ---------- Podest ---------- */
.podest {
  display: flex; align-items: flex-end; justify-content: center;
  gap: clamp(8px, 2vw, 26px);
  padding: 0 clamp(4px, 3vw, 40px);
}
.sockel {
  flex: 1; max-width: 320px; text-align: center;
  border-radius: 8px 8px 0 0;
  padding: clamp(8px, 1.2vw, 18px) 8px;
  background: linear-gradient(180deg, #ffffff12, #ffffff05);
  border: 2px solid #ffffff1a; border-bottom: 6px solid var(--theme, var(--gold));
}
.sockel.platz1 { padding-bottom: clamp(30px, 5vh, 70px); transform: rotate(-.4deg); }
.sockel.platz2 { padding-bottom: clamp(14px, 2.6vh, 40px); transform: rotate(.5deg); }
.sockel.platz3 { padding-bottom: clamp(6px, 1.2vh, 22px); transform: rotate(-.3deg); }
.sockel .medaille { font-size: clamp(1.6rem, 3.4vw, 3rem); }
.sockel .name {
  font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 700;
  font-size: clamp(1.05rem, 2.4vw, 2rem);
  line-height: 1.12; word-break: break-word;
}
.sockel .wert {
  font-family: 'Caveat', cursive;
  font-size: clamp(1.1rem, 2.6vw, 2.1rem);
  color: var(--theme, var(--gold));
}

/* ---------- Reihen ---------- */
.reihen {
  display: flex; flex-direction: column; gap: .3em;
  flex: 1; min-height: 0; justify-content: flex-start; overflow: hidden;
  /* Schriftgröße liegt am Container: das JS skaliert sie bei Überlauf herunter,
     alles in den Reihen ist em-basiert und schrumpft mit. */
  font-size: clamp(1rem, 2.2vw, 1.6rem);
}
.reihe {
  display: grid;
  grid-template-columns: 3.2em 1fr auto;
  align-items: center; gap: 1em;
  flex-shrink: 0; /* nie zusammenquetschen — bei Überlauf verkleinert JS die Schrift */
  padding: .3em clamp(10px, 1.6vw, 22px);
  border-radius: 6px;
  background: #ffffff08;
  border-left: 5px solid transparent;
  transition: transform .6s ease, background .6s ease;
}
.reihe:nth-child(odd) { background: #ffffff0d; }
.reihe .rang {
  font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 700;
  color: var(--gold); text-align: center;
}
.reihe .rname {
  font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
/* Top 3 stehen auf dem Podest — Reihen dazu nur auf kleinen Screens
   oder im Kompakt-Modus (Fenster zu niedrig fürs Podest). */
.reihe.im-podest { display: none; }
.kompakt .podest { display: none; }
.kompakt .reihe.im-podest { display: grid; }
.kompakt .kopf .marke img { height: clamp(26px, 4.5vh, 48px); }
.kompakt .kopf .challenge-name { font-size: clamp(1.4rem, 3.2vw, 2.4rem); }
.kompakt .kopf .thema { font-size: clamp(1rem, 2vw, 1.6rem); }
.kompakt .kopf .meta { font-size: clamp(.8rem, 1.3vw, 1rem); margin-top: .2em; }
.reihe .details { display: flex; align-items: baseline; gap: .9em; }
.reihe .wert { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 700; color: var(--kreide); }
.reihe .badge {
  font-family: 'Caveat', cursive;
  font-size: .85em;
  padding: .05em .5em;
  border-radius: 999px;
  border: 1.5px dashed currentColor;
  transform: rotate(-1.2deg);
}
.badge.bonus { color: #ecc27a; }
.badge.abzug { color: #dda3a3; }
.badge.messwert { color: var(--kreide-dim); border-style: dotted; }
.reihe.unqualified { opacity: .55; }
.reihe.mystery .rname { letter-spacing: .2em; color: var(--kreide-dim); }

/* ---------- Ticker & Fuß ---------- */
.ticker {
  font-family: 'Caveat', cursive;
  font-size: clamp(1rem, 2vw, 1.5rem);
  color: #ecc27a;
  white-space: nowrap; overflow: hidden;
}
.ticker .lauf { display: inline-block; padding-left: 100%; animation: lauf 30s linear infinite; }
@keyframes lauf { to { transform: translateX(-100%); } }

.fuss {
  display: flex; justify-content: space-between; align-items: center;
  color: var(--kreide-dim);
  font-size: clamp(.8rem, 1.4vw, 1.05rem);
  margin-top: auto;
}
.fuss .wortmarke {
  font-family: 'Italiana', Georgia, serif;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--kreide-dim);
}
.fuss .frische::before { content: '🔄 '; }

/* ---------- Siegerehrung ---------- */
.zeremonie-hinweis {
  text-align: center;
  font-family: 'Caveat', cursive;
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  color: var(--gold);
}
.reihe.verdeckt .rname, .reihe.verdeckt .wert { color: var(--kreide-dim); letter-spacing: .25em; }
.reihe.frisch { animation: aufgedeckt .9s ease; background: #d8ab5c22; }
@keyframes aufgedeckt {
  0% { transform: scale(.96) translateY(8px); background: #d8ab5c55; }
  100% { transform: none; }
}

/* Konfetti */
.konfetti {
  position: fixed; top: -4vh; font-size: clamp(1rem, 2.4vw, 2rem);
  animation: fallen linear forwards;
  pointer-events: none; z-index: 99;
}
@keyframes fallen {
  to { transform: translateY(110vh) rotate(720deg); opacity: .9; }
}

/* Leerlauf */
.idle { text-align: center; padding-top: 14vh; }
.idle img { height: clamp(80px, 22vh, 220px); opacity: .95; }
.idle h1 {
  font-family: 'Italiana', Georgia, serif; letter-spacing: .08em;
  font-size: clamp(2rem, 5.5vw, 4rem); color: var(--gold); margin-top: .3em;
}
.idle p { font-family: 'Caveat', cursive; font-size: clamp(1.4rem, 3vw, 2.4rem); color: var(--kreide-dim); margin-top: .6em; }

/* Handy */
@media (max-width: 640px) {
  /* Handy scrollt, statt zu schrumpfen */
  .screen-root { height: auto; min-height: calc(100vh - 2 * clamp(10px, 2vw, 26px)); overflow: visible; }
  .reihen { overflow: visible; font-size: 1.05rem !important; }
  .podest { display: none; }
  .reihe.im-podest { display: grid; }
  .reihe { grid-template-columns: 2.4em 1fr auto; }
  .reihe .badge.messwert { display: none; } /* Platz für den Namen */
  .kopf .meta { gap: .8em; }
  .kopf .marke img { height: 34px; }
}
