/* =====================================================
   TALENTIADE 2027 – HVB
   Main Stylesheet
   ===================================================== */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;700;900&family=Barlow:wght@400;600;700&display=swap');

/* --- CSS Custom Properties (HVB Branding) --- */
:root {
  --hvb-red:       #C8102E;
  --hvb-red-dark:  #a00d25;
  --hvb-black:     #1a1a1a;
  --hvb-white:     #ffffff;
  --hvb-gray-light:#f5f5f5;
  --hvb-gray:      #e0e0e0;
  --hvb-gray-text: #666666;

  --star-filled:   #C8102E;
  --star-empty:    #d0d0d0;

  /* Screen card: Breite fix, Höhe automatisch */
  --card-width: min(95vw, 1100px);

  --radius:        8px;
  --shadow:        0 4px 24px rgba(0,0,0,0.13);

  --font-main:     'Barlow', 'Arial', sans-serif;
  --font-condensed:'Barlow Condensed', 'Arial Narrow', sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-main);
  background: var(--hvb-gray-light);
  color: var(--hvb-black);
  min-height: 100vh;
}

/* --- Header --- */
.site-header {
  background: var(--hvb-red);
  color: var(--hvb-white);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.header-logo img { display: block; }
.site-talentiade { flex: 1; }
.site-talentiade-img { height: 40px; filter: brightness(0) invert(1); }
.site-hvb-logo { height: 40px; filter: brightness(0) invert(1); display: block; }
/* alte Header-Title Stile nicht mehr gebraucht */
.header-title, .talentiade-label, .talentiade-year { display: none; }
.header-nav {
  margin-left: auto;
  display: flex;
  gap: 1.2rem;
}
.header-nav a {
  color: var(--hvb-white);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0.9;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition: opacity 0.2s, border-color 0.2s;
}
.header-nav a:hover { opacity: 1; border-bottom-color: var(--hvb-white); }

/* --- Main Content --- */
.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* --- Station Index --- */
.page-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--hvb-red);
  margin-bottom: 1rem;
  font-family: var(--font-condensed);
  text-transform: uppercase;
}
.index-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.index-hero-img {
  width: min(25vw, 120px);
  height: auto;
  flex-shrink: 0;
}
.index-hero .page-title { margin-bottom: 0; }
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.filter-btn {
  padding: 0.3rem 0.9rem;
  border: 2px solid var(--hvb-red);
  background: transparent;
  color: var(--hvb-red);
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.filter-btn.active, .filter-btn:hover {
  background: var(--hvb-red);
  color: var(--hvb-white);
}
.stations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}
.station-card-link { text-decoration: none; color: inherit; }
.station-card-thumb {
  background: var(--hvb-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  aspect-ratio: 3/4;
  display: flex;
  flex-direction: column;
}
.station-card-link:hover .station-card-thumb {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(200,16,46,0.2);
}
.station-number {
  position: absolute;
  top: 0; left: 0;
  background: var(--hvb-red);
  color: var(--hvb-white);
  font-size: 0.75rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 0 0 var(--radius) 0;
  font-family: var(--font-condensed);
  letter-spacing: 0.05em;
}
.station-thumb-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--hvb-gray);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--hvb-gray-text);
  font-family: var(--font-condensed);
}
.station-card-thumb img {
  width: 100%;
  flex: 1;
  object-fit: contain;
  background: var(--hvb-gray-light);
  padding: 0.2rem;
}
.station-card-thumb-title {
  padding: 0.4rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  background: var(--hvb-white);
  color: var(--hvb-black);
  line-height: 1.2;
}
.station-category-badge {
  position: absolute;
  bottom: 2rem; right: 0;
  background: var(--hvb-red);
  color: var(--hvb-white);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius) 0 0 var(--radius);
}
.empty-state {
  grid-column: 1 / -1;
  color: var(--hvb-gray-text);
  font-size: 0.95rem;
  padding: 2rem;
  text-align: center;
}
.empty-state code {
  display: block;
  margin-top: 0.5rem;
  font-family: monospace;
  background: var(--hvb-gray);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
}

/* --- Card Actions --- */
.card-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}
.btn {
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  display: inline-block;
  transition: background 0.2s, color 0.2s;
}
.btn-secondary {
  border-color: var(--hvb-gray);
  background: var(--hvb-white);
  color: var(--hvb-black);
}
.btn-secondary:hover { border-color: var(--hvb-red); color: var(--hvb-red); }
.btn-print {
  border-color: var(--hvb-red);
  background: var(--hvb-white);
  color: var(--hvb-red);
}
.btn-print:hover { background: var(--hvb-red); color: var(--hvb-white); }

/* =====================================================
   SCREEN CARD (auto-höhe, kein A5-Zwang)
   ===================================================== */
.card-page {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.flip-container {
  width: var(--card-width);
  cursor: pointer;
}
.flip-card { width: 100%; }

.flip-face {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: opacity 0.25s ease;
}
.flip-back { display: none; }
.flip-card.flipped .flip-front { display: none; }
.flip-card.flipped .flip-back  { display: flex; flex-direction: column; }

/* =====================================================
   CARD A5 LAYOUT (shared by screen + print)
   ===================================================== */
.card-a5 {
  width: 100%;
  height: auto;
  background: var(--hvb-white);
  display: flex;
  flex-direction: column;
  font-size: clamp(15px, 1.65vw, 20px);
}

/* Card Header */
.card-header {
  background: var(--hvb-red);
  color: var(--hvb-white);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.7rem;
  min-height: 48px;
  flex-shrink: 0;
}
.card-header-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  max-width: 42%;
  min-width: 0;
}
.station-badge {
  background: var(--hvb-white);
  color: var(--hvb-red);
  border-radius: 4px;
  padding: 0.15rem 0.35rem;
  text-align: center;
  min-width: 38px;
  flex-shrink: 0;
}
.station-label {
  font-size: 0.5em;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
}
.station-num {
  font-size: 1.4em;
  font-weight: 900;
  font-family: var(--font-condensed);
  line-height: 1;
}
.card-title-block { min-width: 0; }
.card-title {
  font-size: 1.5em;
  font-weight: 700;
  font-family: var(--font-condensed);
  text-transform: uppercase;
  line-height: 1.1;
}
.card-subtitle {
  font-size: 0.9em;
  opacity: 0.85;
  margin-top: 0.1em;
}
.card-branding {
  text-align: right;
  flex-shrink: 0;
}
.branding-logo { height: 28px; filter: brightness(0) invert(1); }
.branding-claim { display: none; }

/* Talentiade Logo – zentriert im verbleibenden Platz */
.header-talentiade {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.talentiade-logo { height: 30px; filter: brightness(0) invert(1); max-width: 200px; object-fit: contain; }

/* Card Front Body */
.card-body-front {
  display: flex;
  gap: 0;
  min-height: 340px;
}
.card-diagram-section {
  flex: 1;
  border-right: 2px solid var(--hvb-gray);
  padding: 0.4rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
  overflow: hidden;
}
/* Rechte Spalte Vorderseite: nur Schritte */
.card-right-col {
  flex: 1.1;
  padding: 0.5rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}
/* Vollständige Steps-Liste (Vorderseite) */
.front-steps-full { gap: 0.3rem; }
/* Kompakte Ratings unter So geht's */
.front-ratings-mini { flex-shrink: 0; padding-top: 0.4rem; border-top: 1px solid var(--hvb-gray); margin-top: 0.1rem; }
.front-ratings-mini .rating-row  { gap: 0.4rem; }
.front-ratings-mini .rating-icon { width: 1.4em; height: 1.4em; }
.front-ratings-mini .rating-label{ min-width: 6em; font-size: 0.75em; }
.front-ratings-mini .star        { font-size: 1.05em; }
.front-steps-mini {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.front-steps-mini .steps-list { gap: 0.15rem; }
.front-steps-mini .step-title { font-size: 0.75em; }
.front-steps-mini .step-text  { font-size: 0.68em; line-height: 1.25; }
.front-steps-mini .step-icon-img { height: 2em; width: 2em; }

/* Ziel-Leiste (Front) */
.card-ziel-strip {
  background: var(--hvb-gray-light);
  border-top: 2px solid var(--hvb-red);
  padding: 0.2rem 0.6rem;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-shrink: 0;
}
.ziel-label { font-size: 0.72em; font-weight: 900; color: var(--hvb-red); font-family: var(--font-condensed); text-transform: uppercase; flex-shrink: 0; }
.ziel-text  { font-size: 0.72em; line-height: 1.3; }
.section-label {
  font-size: 0.8em;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hvb-red);
  border-bottom: 2px solid var(--hvb-red);
  padding-bottom: 0.15em;
  margin-bottom: 0.25em;
}
.diagram-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  flex: 1;
}
.diagram-placeholder {
  flex: 1;
  background: var(--hvb-gray-light);
  border: 2px dashed var(--hvb-gray);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hvb-gray-text);
  font-size: 0.8em;
}

/* Ratings */
.ratings-grid { display: flex; flex-direction: column; gap: 0.3rem; }
.rating-row { display: flex; align-items: center; gap: 0.35rem; }
.rating-icon { width: 1.6em; height: 1.6em; object-fit: contain; flex-shrink: 0; }
.rating-label { font-size: 0.78em; font-weight: 700; min-width: 6.5em; text-transform: uppercase; font-family: var(--font-condensed); letter-spacing: 0.03em; }
.rating-stars { display: flex; gap: 1px; margin-left: auto; }
.star { font-size: 1.1em; color: var(--star-empty); }
.star-filled { color: var(--star-filled); }

/* Flip Hint */
.card-flip-hint {
  background: var(--hvb-gray-light);
  border-top: 1px solid var(--hvb-gray);
  text-align: center;
  padding: 0.15rem;
  font-size: 0.6em;
  color: var(--hvb-gray-text);
  cursor: pointer;
  flex-shrink: 0;
}

/* Slim header on back side */
.card-header-back { min-height: 36px; padding: 0.25rem 0.5rem; }
.card-header-back .station-num { font-size: 1.2em; }
.card-header-back .card-title { font-size: 1.1em; }

/* Card Back */
.card-back-body {
  display: flex;
  gap: 0;
  min-height: 280px;
}
.back-left  { flex: 1.1; padding: 0.8rem; border-right: 2px solid var(--hvb-gray); }
.back-right { flex: 1; padding: 0.8rem; display: flex; flex-direction: column; gap: 0.8rem; }
.steps-list {
  list-style: none;
  counter-reset: step-counter;
  margin-top: 0.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.step-item {
  counter-increment: step-counter;
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
}
.step-item::before {
  content: counter(step-counter);
  background: var(--hvb-red);
  color: var(--hvb-white);
  font-weight: 900;
  font-size: 0.7em;
  min-width: 1.4em;
  height: 1.4em;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.15em;
  font-family: var(--font-condensed);
}
.step-content { flex: 1; min-width: 0; }
.step-title { font-weight: 700; font-size: 0.9em; font-family: var(--font-condensed); text-transform: uppercase; letter-spacing: 0.03em; }
.step-text  { font-size: 0.85em; color: var(--hvb-gray-text); line-height: 1.35; margin-top: 0.1em; }

/* Step Icons – kompakte Variante für Vorderseite */
.step-icon-sm { height: 2.2em; width: 2.2em; }

/* Step Icons – horizontal row with arrows */
.step-icons {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
}
.step-icon-img {
  height: 2.8em;
  width: 2.8em;
  object-fit: contain;
  flex-shrink: 0;
}
.step-icon-arrow {
  color: var(--hvb-red);
  font-size: 0.8em;
  font-weight: 900;
  line-height: 1;
}

.rules-list { list-style: none; display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.2rem; }
.rule-item {
  font-size: 0.88em;
  padding-left: 0.9em;
  position: relative;
  line-height: 1.4;
}
.rule-item::before { content: "●"; position: absolute; left: 0; color: var(--hvb-red); font-size: 0.6em; top: 0.2em; }

.material-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.2rem; }
.material-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--hvb-gray-light);
  border-radius: 4px;
  padding: 0.3rem 0.5rem;
  min-width: 44px;
}
.material-icon { width: 2.5em; height: 2.5em; object-fit: contain; margin-bottom: 0.1em; }
.material-count { font-size: 1.1em; font-weight: 900; color: var(--hvb-red); font-family: var(--font-condensed); }
.material-name  { font-size: 0.72em; text-align: center; color: var(--hvb-gray-text); line-height: 1.2; }

/* --- Schwerpunkte --- */
.schwerpunkte-block { margin-top: 0.4rem; border-top: 1px solid var(--hvb-gray); padding-top: 0.3rem; }
.sp-gruppe { margin-bottom: 0.25rem; }
.sp-kategorie { font-size: 0.72em; font-weight: 900; font-family: var(--font-condensed); text-transform: uppercase; color: var(--hvb-black); margin-bottom: 0.1em; }
.sp-list { list-style: none; display: flex; flex-direction: column; gap: 0.1rem; padding-left: 0.5rem; }
.sp-item { font-size: 0.78em; line-height: 1.35; }
.sp-title { font-weight: 700; color: var(--hvb-black); }
.sp-text  { color: var(--hvb-gray-text); }

/* --- Punkte-Tabelle (Scoring Strip) --- */
.scoring-strip {
  border-top: 2px solid var(--hvb-red);
  padding: 0.3rem 0.5rem 0.35rem;
  flex-shrink: 0;
  background: var(--hvb-white);
}
.scoring-strip-label {
  font-size: 0.7em;
  font-weight: 900;
  font-family: var(--font-condensed);
  text-transform: uppercase;
  color: var(--hvb-red);
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 0.3em;
  margin-bottom: 0.25em;
}
.scoring-trophy { width: 1.1em; height: 1.1em; }
.scoring-table-wrap { overflow-x: auto; }
.scoring-table {
  border-collapse: collapse;
  width: 100%;
  min-width: max-content;
  table-layout: auto;
}
.scoring-cell {
  font-family: var(--font-condensed);
  font-size: 0.72em;
  text-align: center;
  padding: 0.2em 0.35em;
  min-width: 1.6em;
  white-space: nowrap;
  line-height: 1.2;
}
.scoring-time {
  color: var(--hvb-gray-text);
  font-weight: 600;
  background: var(--hvb-gray-light);
  border-bottom: 1px solid var(--hvb-gray);
}
.scoring-pts       { font-weight: 900; color: white; background: var(--hvb-red); }
.pts-orange        { background: #EA580C; }
.pts-yellow        { background: #EAB308; color: #1a1a1a; }
.pts-lime          { background: #84CC16; color: #1a1a1a; }
.pts-green         { background: #16A34A; }
.pts-darkgreen     { background: #15803D; }

/* --- QR-Code --- */
.qr-block { margin-top: auto; padding-top: 0.4rem; }
.qr-wrap  { display: flex; align-items: center; gap: 0.7rem; margin-top: 0.3rem; }
.qr-dummy {
  width: 4.5em; height: 4.5em;
  flex-shrink: 0;
  border: 0.18em solid var(--hvb-black);
  border-radius: 3px;
  padding: 0.3em;
  display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(var(--hvb-black) 0 0) top    0.3em left  0.3em / 38% 38% no-repeat,
    linear-gradient(var(--hvb-black) 0 0) top    0.3em right 0.3em / 38% 38% no-repeat,
    linear-gradient(var(--hvb-black) 0 0) bottom 0.3em left  0.3em / 38% 38% no-repeat,
    linear-gradient(var(--hvb-black) 0 0) center              / 18% 18% no-repeat,
    white;
}
.qr-dummy-inner { display: none; }
.qr-hint  { font-size: 0.78em; color: var(--hvb-gray-text); font-style: italic; }

/* --- Contest --- */
.contest-page { max-width: 480px; margin: 2rem auto; }
.join-form { background: var(--hvb-white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem; }
.join-form h2 { color: var(--hvb-red); font-family: var(--font-condensed); text-transform: uppercase; font-size: 1.4rem; margin-bottom: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1rem; }
.form-group label { font-weight: 700; font-size: 0.85rem; }
.form-group input {
  padding: 0.6rem 0.8rem;
  border: 2px solid var(--hvb-gray);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color 0.2s;
}
.form-group input:focus { outline: none; border-color: var(--hvb-red); }
.btn-primary {
  background: var(--hvb-red);
  color: var(--hvb-white);
  border-color: var(--hvb-red);
  width: 100%;
  text-align: center;
  padding: 0.7rem;
  font-size: 1rem;
}
.btn-primary:hover { background: var(--hvb-red-dark); border-color: var(--hvb-red-dark); }
