/* Sommerspiele — 1:1-Port der Optik aus Sommerspiele.dc.html (Claude Design) */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 400 900;
  src: url('fonts/outfit.woff2') format('woff2');
}
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 700 800;
  src: url('fonts/baloo2.woff2') format('woff2');
}

:root {
  --bg: #F6F3EE;
  --ink: #171412;
  --coral: #FF7A6B;
  --gelb: #FFC93C;
  --gruen: #28C07E;
  --lila: #A99CF7;
  --blau: #4C86F0;
  --offwhite: #FFF8F0;
  --line: #EFEAE2;
  --dash: #D8D1C6;
  --m1: #8C857D;
  --m2: #6B6560;
  --m3: #59534D;
  --m4: #4A443E;
  --m5: #B9B2A8;
  --qualbg: #F3FBF6;
  --softbg: #FBF9F5;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  font-family: 'Outfit', system-ui, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; color: inherit; }
input { font-family: inherit; color: inherit; }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; }
a:hover { color: var(--coral); }

@keyframes pop { 0% { transform: scale(.5) rotate(-8deg); opacity: 0; } 65% { transform: scale(1.09) rotate(2deg); opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes fall { 0% { transform: translateY(-15vh) rotate(0deg); } 100% { transform: translateY(110vh) rotate(900deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes slidein { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.pop { animation: pop .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.blink { animation: blink 1s infinite; }

/* ---------- Shell / Sidebar (Prototyp: 264px, weiß, 3px Kante) ---------- */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: #FFFFFF;
  border-right: 3px solid var(--ink);
  padding: 26px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.logo { font-family: 'Baloo 2', cursive; font-weight: 800; font-size: 31px; line-height: .92; letter-spacing: -.5px; }
.logo-chip {
  display: inline-block;
  margin-top: 9px;
  background: var(--gelb);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 2px 11px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 1.2px;
}
.nav-col { display: flex; flex-direction: column; gap: 16px; flex: 1 1 auto; }
.navgroup { display: flex; flex-direction: column; gap: 4px; }
.navtitle { font-size: 11.5px; font-weight: 800; letter-spacing: 1.6px; color: var(--m1); padding: 0 13px 4px; }
.nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  background: transparent;
  border-radius: 14px;
  padding: 11px 13px;
  font-size: 17.5px;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}
.nav:hover { background: #EFEAE1; }
.nav .navbg {
  display: none;
  position: absolute;
  inset: 0;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  box-shadow: 3px 3px 0 var(--ink);
}
.nav.active .navbg { display: block; }
.nav .dot { position: relative; z-index: 1; width: 10px; height: 10px; border-radius: 10px; background: var(--ink); flex: 0 0 auto; }
.nav .navlabel { position: relative; z-index: 1; }
.side-foot { border-top: 2.5px dashed var(--dash); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.side-foot .l1 { font-size: 14.5px; font-weight: 700; color: var(--m2); line-height: 1.35; }
.side-foot .l2 { font-size: 13px; font-weight: 700; color: var(--m1); line-height: 1.35; }
.main { padding: 38px 44px 80px; max-width: 1560px; }
.screen { display: flex; flex-direction: column; gap: 26px; }

/* ---------- Typo ---------- */
.eyebrow { font-size: 15px; font-weight: 800; letter-spacing: 2px; color: var(--m1); }
h1.title { margin: 6px 0 0; font-family: 'Baloo 2', cursive; font-weight: 800; font-size: 56px; line-height: .95; letter-spacing: -1.5px; }
h1.title.xl { font-size: 60px; }
.lede { margin: 12px 0 0; font-size: 22px; font-weight: 600; color: var(--m3); max-width: 640px; text-wrap: pretty; }
.headrow { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* ---------- Karten ---------- */
.card {
  background: #FFFFFF;
  border: 3px solid var(--ink);
  border-radius: 24px;
  box-shadow: 7px 7px 0 var(--ink);
  overflow: hidden;
}
.card.flat { box-shadow: 6px 6px 0 var(--ink); border-radius: 20px; }
.cardhead {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 18px 26px;
  border-bottom: 3px solid var(--ink);
}
.cardhead .htitle { font-size: 27px; font-weight: 900; }
.headtools { margin-left: auto; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.cardbody { padding: 22px 26px 26px; }
.stepnum {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 3px solid var(--ink);
  border-radius: 99px;
  font-size: 19px;
  font-weight: 900;
  flex: 0 0 auto;
}

/* ---------- Chips & Pillen ---------- */
.chip {
  background: #FFFFFF;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 15px;
  font-weight: 800;
  display: inline-block;
}
.chip.sm { padding: 2px 11px; font-size: 14.5px; }
.bigpill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: #FFFFFF;
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--ink);
  padding: 10px 18px;
  font-size: 18px;
  font-weight: 800;
}
/* ---------- Buttons (Prototyp-Verhalten: hover hebt, active drückt) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: #FFFFFF;
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 4px 4px 0 var(--ink);
  padding: 12px 20px;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: 4px 4px 0 var(--ink); }
.btn.dark { background: var(--ink); color: var(--offwhite); box-shadow: 4px 4px 0 #FFFFFF; }
.btn.dark:active { box-shadow: 1px 1px 0 #FFFFFF; }
.btn.gruen { background: var(--gruen); }
.btn.coral { background: var(--coral); }
.btn.gelb { background: var(--gelb); }
.btn.lila { background: var(--lila); }
.btn.rot { background: #E0392B; color: #FFF; }
.btn.big {
  border-radius: 16px;
  box-shadow: 6px 6px 0 var(--ink);
  padding: 16px 28px;
  font-size: 24px;
}
.btn.big:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
.btn.big:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--ink); }
.btn.pill { border-radius: 999px; }
.btn.armed { background: var(--gelb) !important; color: var(--ink) !important; box-shadow: 4px 4px 0 var(--ink) !important; animation: blink 1s infinite; }
.dicebox { width: 18px; height: 18px; background: var(--offwhite); border: 2px solid var(--offwhite); border-radius: 5px; display: inline-block; }
.dicebox.big { width: 22px; height: 22px; background: #FFFFFF; border: 2.5px solid var(--ink); border-radius: 6px; }

.roundbtn {
  background: transparent;
  border: 2.5px solid var(--ink);
  border-radius: 99px;
  display: grid;
  place-items: center;
  font-weight: 900;
  cursor: pointer;
  line-height: 1;
}
.roundbtn:hover { background: var(--coral); }
.roundbtn.qbtn { width: 34px; height: 34px; font-size: 15px; }

.numbtn {
  min-width: 64px;
  background: #FFFFFF;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 11px 14px;
  font-size: 24px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: none;
}
.numbtn.on { background: var(--gelb); box-shadow: 4px 4px 0 var(--ink); }

.poolpill {
  background: #FFFFFF;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--ink);
  padding: 8px 15px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}
.poolpill:hover { background: var(--lila); }
.poolpill.sel { background: var(--gelb); }

.linkbtn {
  background: transparent;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.linkbtn:hover { background: var(--gelb); }

.segwrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 4px;
}
.segwrap .seglabel { font-size: 13px; font-weight: 800; letter-spacing: 1px; padding: 0 8px; color: var(--m2); }
.segwrap .seg {
  background: transparent;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.segwrap .seg.on { background: var(--gelb); }

/* ---------- Inputs ---------- */
.input {
  background: var(--bg);
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 19px;
  font-weight: 700;
  outline: none;
  min-width: 0;
}
.input:focus { background: #FFFFFF; box-shadow: 4px 4px 0 var(--ink); }
.ghostinput {
  background: transparent;
  border: 0;
  border-bottom: 2.5px dashed #C9C1B4;
  padding: 2px 0;
  font-size: 20px;
  font-weight: 900;
  outline: none;
  min-width: 0;
}
.ghostinput:focus { border-bottom-color: var(--ink); }

/* ---------- Teilnehmerliste ---------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 12px; }
.prow {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  padding: 9px 10px 9px 12px;
}
.pnum {
  flex: 0 0 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: #FFFFFF;
  border: 2.5px solid var(--ink);
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 900;
}
.pname { flex: 1 1 auto; font-size: 19px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: transparent; border: 0; outline: none; min-width: 0; }
.pname:focus { text-decoration: underline; }
.px { flex: 0 0 26px; height: 26px; font-size: 15px; }

/* Bereichs-Karten (Start) */
.areabtn {
  position: relative;
  overflow: hidden;
  text-align: left;
  border: 3px solid var(--ink);
  border-radius: 24px;
  box-shadow: 8px 8px 0 var(--ink);
  padding: 30px 30px 34px;
  cursor: pointer;
}
.areabtn:hover { transform: translate(-2px, -2px); box-shadow: 10px 10px 0 var(--ink); }
.areabtn:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--ink); }
.areabtn .k { position: relative; display: block; font-size: 14px; font-weight: 800; letter-spacing: 2px; }
.areabtn .t { position: relative; display: block; margin-top: 8px; font-family: 'Baloo 2', cursive; font-weight: 800; font-size: 46px; line-height: 1; letter-spacing: -1px; }
.areabtn .d { position: relative; display: block; margin-top: 14px; font-size: 20px; font-weight: 700; max-width: 300px; line-height: 1.35; }
.areabtn .go {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  background: var(--ink);
  color: var(--offwhite);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 17px;
  font-weight: 800;
}
.counterpill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFFFFF;
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 5px 5px 0 var(--ink);
  padding: 10px 20px;
}
.counterpill .n { font-size: 34px; font-weight: 900; line-height: 1; }
.counterpill .l { font-size: 16px; font-weight: 800; line-height: 1.1; color: var(--m2); }

/* ---------- Team-Karten (Turnier-Setup) ---------- */
.teamgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; }
.teamcard {
  background: var(--bg);
  border: 2.5px solid var(--ink);
  border-radius: 18px;
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.teamcard .tnum {
  flex: 0 0 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: var(--gelb);
  border: 2.5px solid var(--ink);
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 900;
}
.seat {
  flex: 1 1 0;
  min-width: 0;
  background: #FFFFFF;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  padding: 9px 8px;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.seat:hover { background: var(--coral); }
.seat.empty { background: var(--line); }
.poolband { padding: 20px 26px; border-bottom: 3px dashed var(--dash); background: var(--softbg); }

/* ---------- Gruppen-Karten ---------- */
.groupgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(316px, 1fr)); gap: 18px; }
.grouphead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 3px solid var(--ink);
}
.grouphead .g { font-size: 27px; font-weight: 900; }
.stdhead {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 50px 50px;
  padding: 9px 16px 5px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 1.4px;
  color: var(--m1);
}
.stdrow {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 50px 50px;
  align-items: center;
  padding: 10px 16px;
  border-top: 2px solid var(--line);
  background: #FFFFFF;
}
.stdrow.qual { background: var(--qualbg); }
.rankball {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--bg);
  border: 2.5px solid var(--ink);
  border-radius: 99px;
  font-size: 16px;
  font-weight: 900;
}
.rankball.qual { background: var(--gruen); }
.stdrow .tname { font-size: 20px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stdrow .tmembers { font-size: 14.5px; font-weight: 700; color: var(--m2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stdrow .w { text-align: center; font-size: 23px; font-weight: 900; }
.stdrow .l { text-align: center; font-size: 23px; font-weight: 900; color: var(--m1); }
.tieband { border-top: 3px solid var(--ink); background: var(--gelb); padding: 12px 16px; display: flex; flex-direction: column; gap: 9px; }
.tieband .t1 { font-size: 17px; font-weight: 900; }
.tieband .t2 { font-size: 15px; font-weight: 700; color: var(--m4); }
.tiepick {
  background: #FFFFFF;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--ink);
  padding: 7px 15px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}
.tiepick:hover { background: var(--gruen); }

/* ---------- Tisch-Karten ---------- */
.tablegrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(354px, 100%), 1fr)); gap: 20px; }
.tablecard { background: #FFFFFF; border: 3px solid var(--ink); border-radius: 22px; box-shadow: 6px 6px 0 var(--ink); overflow: hidden; }
.tablehead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 3px solid var(--ink);
  background: var(--ink);
  color: var(--offwhite);
}
.tablehead .tnr { font-size: 23px; font-weight: 900; }
.tablehead .live { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: 1.6px; }
.tablehead .timer {
  background: var(--gelb);
  color: var(--ink);
  border: 2.5px solid var(--offwhite);
  border-radius: 999px;
  padding: 2px 11px;
  font-size: 17px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.vsgrid { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 10px; }
.vsbtn {
  text-align: left;
  background: var(--bg);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 4px 4px 0 var(--ink);
  padding: 14px;
  cursor: pointer;
}
.vsbtn:hover { background: var(--gruen); transform: translate(-1px, -1px); }
.vsbtn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.vsbtn.armed { background: var(--gelb); animation: blink 1s infinite; }
.vsbtn .n { display: block; font-size: 22px; font-weight: 900; line-height: 1.1; }
.vsbtn .m { display: block; margin-top: 5px; font-size: 15px; font-weight: 700; color: var(--m3); }
.nextband { margin-top: 4px; border-top: 2.5px dashed var(--dash); padding-top: 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.klabel { font-size: 13px; font-weight: 800; letter-spacing: 1.4px; color: var(--m1); }

/* ---------- KO-Baum ---------- */
.kowrap { overflow-x: auto; padding: 6px 10px 18px 6px; }
.kocols { display: flex; align-items: stretch; gap: 52px; min-width: 1080px; min-height: 690px; }
.kocol { flex: 0 0 300px; display: flex; flex-direction: column; }
.kocol.final { flex: 0 0 340px; justify-content: center; }
.kopair { position: relative; flex: 1 1 0; display: flex; flex-direction: column; justify-content: space-around; }
.komatch { position: relative; }
.kobox { background: #FFFFFF; border: 3px solid var(--ink); border-radius: 16px; box-shadow: 5px 5px 0 var(--ink); overflow: hidden; }
.kobox .klab { padding: 6px 12px; border-bottom: 2.5px solid var(--ink); background: var(--bg); font-size: 12.5px; font-weight: 800; letter-spacing: 1.4px; }
.kobox .klab.hf { background: var(--lila); }
.koslot {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFFFFF;
  border: 0;
  border-top: 2px solid var(--line);
  padding: 11px 12px;
  cursor: pointer;
  font-size: 19px;
  font-weight: 900;
}
.koslot:hover { background: var(--gelb); }
.koslot.won { background: var(--gruen); }
.koslot.lost { background: var(--line); }
.koslot.armed { background: var(--gelb); animation: blink 1s infinite; }
.koslot .sname { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.koslot .seed {
  flex: 0 0 24px;
  height: 24px;
  display: grid;
  place-items: center;
  background: #FFFFFF;
  border: 2.5px solid var(--ink);
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 900;
}
.kline { position: absolute; background: var(--ink); }
.finalbox { background: var(--gelb); border: 3px solid var(--ink); border-radius: 20px; box-shadow: 7px 7px 0 var(--ink); overflow: hidden; }
.finalbox .klab {
  padding: 9px 14px;
  border-bottom: 3px solid var(--ink);
  background: var(--ink);
  color: var(--offwhite);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 2px;
}
.finalbox .koslot { background: #FFFFFF; border-top: 2.5px solid var(--ink); padding: 16px 14px; font-size: 24px; }
.finalbox .koslot:hover { background: #FFFFFF; }
.finalbox .koslot.won { background: var(--gruen); }
.rowchip { border: 3px solid var(--ink); border-radius: 999px; box-shadow: 4px 4px 0 var(--ink); padding: 8px 18px; font-size: 20px; font-weight: 900; align-self: flex-start; }

/* ---------- Olympiade ---------- */
.oteamgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: 16px; }
.oteamcard { background: #FFFFFF; border: 3px solid var(--ink); border-radius: 18px; box-shadow: 5px 5px 0 var(--ink); overflow: hidden; cursor: pointer; }
.oteamcard.active { border-width: 4px; }
.oteamhead { padding: 11px 14px; border-bottom: 3px solid var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.oteamhead input { flex: 1 1 auto; min-width: 0; background: transparent; border: 0; font-size: 21px; font-weight: 900; outline: none; }
.countchip { background: #FFFFFF; border: 2.5px solid var(--ink); border-radius: 99px; padding: 1px 9px; font-size: 14px; font-weight: 800; }
.memberwrap { padding: 12px; display: flex; flex-wrap: wrap; gap: 8px; min-height: 132px; align-content: flex-start; }
.memberpill { background: var(--bg); border: 2.5px solid var(--ink); border-radius: 999px; padding: 5px 12px; font-size: 16px; font-weight: 800; cursor: pointer; }
.memberpill:hover { background: var(--coral); }
.activeband { padding: 8px 14px; border-top: 2.5px solid var(--ink); background: var(--gelb); font-size: 14px; font-weight: 900; letter-spacing: 1.2px; }

.ptsrow { display: flex; align-items: center; gap: 14px; background: var(--bg); border: 2.5px solid var(--ink); border-radius: 14px; padding: 9px 12px; }
.ptsrow .platz { flex: 0 0 auto; display: grid; place-items: center; min-width: 34px; height: 34px; border: 2.5px solid var(--ink); border-radius: 99px; font-size: 16px; font-weight: 900; }
.ptsrow .plabel { flex: 1 1 auto; font-size: 19px; font-weight: 800; }
.ptsrow .val { min-width: 56px; text-align: center; font-size: 25px; font-weight: 900; font-variant-numeric: tabular-nums; }
.pm { width: 36px; height: 36px; background: #FFFFFF; border: 2.5px solid var(--ink); border-radius: 10px; font-size: 20px; font-weight: 900; cursor: pointer; }
.pm.minus:hover { background: var(--coral); }
.pm.plus:hover { background: var(--gruen); }

.discrow { display: flex; align-items: center; gap: 12px; background: var(--bg); border: 2.5px solid var(--ink); border-radius: 14px; padding: 10px 12px; }
.discrow .dnum { flex: 0 0 30px; height: 30px; display: grid; place-items: center; background: #FFFFFF; border: 2.5px solid var(--ink); border-radius: 99px; font-size: 14px; font-weight: 900; }
.discrow input { flex: 1 1 auto; min-width: 0; font-size: 20px; font-weight: 800; background: transparent; border: 0; outline: none; }
.badge { border: 2.5px solid var(--ink); border-radius: 999px; padding: 2px 11px; font-size: 14px; font-weight: 800; background: #FFFFFF; }
.badge.done { background: var(--gruen); }

/* dunkles Gesamtstand-Panel */
.darkpanel { background: var(--ink); border: 3px solid var(--ink); border-radius: 24px; box-shadow: 8px 8px 0 var(--lila); overflow: hidden; }
.darkpanel .dhead { padding: 16px 26px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--offwhite); }
.darkpanel .dhead .k { font-size: 14px; font-weight: 900; letter-spacing: 2.4px; }
.darkpanel .dhead .s { font-size: 16px; font-weight: 700; color: var(--m5); }
.lbrow {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 14px 18px;
}
.lbrow.first { box-shadow: 0 0 0 4px var(--gelb); }
.lbrank { display: grid; place-items: center; width: 60px; height: 60px; background: #FFFFFF; border: 3px solid var(--ink); border-radius: 99px; font-size: 28px; font-weight: 900; }
.lbname { font-size: 30px; font-weight: 900; line-height: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbbadge { background: #FFFFFF; border: 2px solid var(--ink); border-radius: 999px; padding: 1px 9px; font-size: 13.5px; font-weight: 800; }
.lbpts { font-size: 46px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.lbpts-l { font-size: 17px; font-weight: 800; color: var(--m4); }

/* Wertungs-Editor */
.rankrow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; border: 3px solid var(--ink); border-radius: 16px; padding: 12px 14px; }
.rankrow .rball { flex: 0 0 auto; display: grid; place-items: center; width: 48px; height: 48px; background: #FFFFFF; border: 3px solid var(--ink); border-radius: 99px; font-size: 22px; font-weight: 900; }
.rankrow .rname { font-size: 24px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tietoggle { align-self: flex-start; margin-top: 4px; background: #FFFFFF; border: 2.5px solid var(--ink); border-radius: 999px; padding: 3px 11px; font-size: 14px; font-weight: 800; cursor: pointer; }
.tietoggle:hover { transform: translate(-1px, -1px); }
.tietoggle.on { background: var(--ink); color: var(--offwhite); }
.updown { width: 44px; height: 44px; background: #FFFFFF; border: 2.5px solid var(--ink); border-radius: 11px; font-size: 16px; font-weight: 900; cursor: pointer; line-height: 1; }
.updown:hover { background: var(--gelb); }
.discpick { text-align: left; display: flex; align-items: center; gap: 11px; background: var(--bg); border: 2.5px solid var(--ink); border-radius: 14px; padding: 11px 12px; font-size: 19px; font-weight: 800; cursor: pointer; width: 100%; }
.discpick:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.discpick.on { background: var(--gelb); }
.discpick .ddot { flex: 0 0 12px; height: 12px; border-radius: 99px; border: 2px solid var(--ink); }

/* ---------- TV / Zuschauer ---------- */
#tv { padding: 30px 36px 170px; min-height: 100vh; } /* unten Platz für die fixe QR-Box */
.tvpanel { background: var(--ink); border: 3px solid var(--ink); border-radius: 26px; box-shadow: 9px 9px 0 var(--blau); padding: 26px 28px 30px; color: var(--offwhite); }
.tvpanelhead { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.tvpanelhead .t { font-family: 'Baloo 2', cursive; font-weight: 800; font-size: 42px; line-height: 1; }
.livechip { background: var(--gelb); color: var(--ink); border-radius: 999px; padding: 4px 14px; font-size: 15px; font-weight: 900; letter-spacing: 1.4px; }
.tvcountdown { margin-left: auto; font-size: 17px; font-weight: 800; color: var(--m5); }
.tvgroupgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.tvcardw { background: #FFFFFF; color: var(--ink); border: 3px solid var(--ink); border-radius: 18px; overflow: hidden; }
.tvgrouphead { padding: 10px 16px; border-bottom: 3px solid var(--ink); font-size: 24px; font-weight: 900; }
.tvstdrow { display: grid; grid-template-columns: 42px minmax(0, 1fr) 44px; align-items: center; gap: 8px; padding: 11px 16px; border-top: 2px solid var(--line); background: #FFFFFF; }
.tvstdrow.qual { background: var(--qualbg); }
.tvstdrow .n { font-size: 21px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tvstdrow .w { text-align: right; font-size: 22px; font-weight: 900; }
.tvlbrow { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; align-items: center; gap: 18px; color: var(--ink); border: 3px solid var(--ink); border-radius: 20px; padding: 16px 22px; }
.tvlbrow .r { display: grid; place-items: center; width: 68px; height: 68px; background: #FFFFFF; border: 3px solid var(--ink); border-radius: 99px; font-size: 32px; font-weight: 900; }
.tvlbrow .n { font-size: 38px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tvlbrow .p { font-size: 52px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.progress { flex: 1 1 160px; height: 12px; background: #FFFFFF; border: 2.5px solid var(--ink); border-radius: 99px; overflow: hidden; }
.progress .bar { display: block; height: 100%; background: var(--blau); }

/* ---------- Overlays (Ziehung / Sieger / Podium) ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 40px; }
.overlay.champ { background: var(--coral); z-index: 70; overflow: hidden; gap: 22px; }
.overlay.podium { background: var(--lila); z-index: 70; overflow: hidden; gap: 22px; }

.champcard {
  position: relative;
  background: #FFFFFF;
  border: 4px solid var(--ink);
  border-radius: 30px;
  box-shadow: 14px 14px 0 var(--ink);
  padding: 44px 60px;
  text-align: center;
  animation: pop .6s cubic-bezier(.2, 1.4, .4, 1) both;
}
.champcard .k { font-size: 18px; font-weight: 900; letter-spacing: 3px; color: var(--m1); }
.champcard .n { margin-top: 12px; font-family: 'Baloo 2', cursive; font-weight: 800; font-size: 76px; line-height: 1; letter-spacing: -2px; }
.champcard .m { margin-top: 10px; font-size: 26px; font-weight: 800; color: var(--m3); }
.champcard .f { margin-top: 24px; display: inline-flex; align-items: center; gap: 10px; background: var(--gelb); border: 3px solid var(--ink); border-radius: 999px; padding: 10px 22px; font-size: 20px; font-weight: 900; }
.ovlabel { position: relative; font-size: 16px; font-weight: 900; letter-spacing: 4px; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti span { position: absolute; top: 0; width: 14px; height: 14px; border: 2px solid var(--ink); animation: fall linear infinite; }

/* Podium (Siegerehrung, Issue #18 im Prototyp-Stil) */
.podiumsteps { position: relative; display: flex; align-items: flex-end; gap: 18px; }
.podiumcol { display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(240px, 28vw); }
.podiumteam { text-align: center; }
.podiumteam .n { font-family: 'Baloo 2', cursive; font-weight: 800; font-size: 34px; line-height: 1; }
.podiumteam .p { margin-top: 4px; font-size: 19px; font-weight: 800; color: var(--m4); }
.podiumblock { width: 100%; border: 3px solid var(--ink); border-radius: 10px 10px 0 0; display: grid; place-items: center; font-size: 40px; font-weight: 900; font-family: 'Baloo 2', cursive; }
.podiumrest { position: relative; display: flex; flex-direction: column; gap: 10px; width: min(560px, 92vw); }
.podiumrow {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  background: #FFFFFF;
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 10px 16px;
}
.podiumrow.hiddenrow { opacity: .35; }
.podiumrow .r { display: grid; place-items: center; width: 44px; height: 44px; background: var(--bg); border: 2.5px solid var(--ink); border-radius: 99px; font-size: 20px; font-weight: 900; }
.podiumrow .n { font-size: 24px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podiumrow .p { font-size: 20px; font-weight: 800; color: var(--m4); }

.warnband { background: var(--gelb); border: 3px solid var(--ink); border-radius: 16px; padding: 12px 18px; font-size: 17px; font-weight: 800; }
.hint { font-size: 16px; font-weight: 700; color: var(--m2); text-wrap: pretty; }
.hint.l { font-size: 18px; color: var(--m3); }

/* ---------- Responsive (wie Prototyp: 900px) ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; border-right: 0; border-bottom: 3px solid var(--ink); gap: 14px; padding: 12px 14px; }
  .navgroup, .nav-col { flex-direction: row; gap: 6px; }
  .navtitle, .side-foot, .hidemobile { display: none; }
  .logo { font-size: 24px; }
  .logo br { display: none; }
  .logo-chip { margin-top: 2px; padding: 1px 9px; font-size: 11px; }
  .roundbtn.qbtn { width: 44px; height: 44px; font-size: 17px; }
  .main { padding: 22px 16px 60px; }
  h1.title { font-size: 38px; }
  h1.title.xl { font-size: 40px; }
  .headtools { margin-left: 0; }
  .px { flex: 0 0 36px; height: 36px; font-size: 17px; }
  #tv { padding: 16px 12px 70px; } /* unten Platz für den fixen Sound-Button */
  .tvpanel { padding: 18px 14px 22px; border-radius: 20px; }
  .tvpanelhead .t { font-size: 28px; }
  .tvcountdown { margin-left: 0; }
  .tvlbrow { grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; padding: 10px 14px; }
  .tvlbrow .r { width: 44px; height: 44px; font-size: 22px; }
  .tvlbrow .n { font-size: 22px; }
  .tvlbrow .p { font-size: 30px; }
  .lbrow { grid-template-columns: 52px minmax(0, 1fr) auto; }
  .lbrank { width: 44px; height: 44px; font-size: 20px; }
  .lbname { font-size: 21px; }
  .lbpts { font-size: 30px; }
  .champcard { padding: 26px 22px; }
  .champcard .n { font-size: 44px; }
  .overlay { padding: 24px 12px; }
  .podiumsteps { gap: 10px; }
  .podiumteam .n { font-size: 20px; }
  .podiumteam .p { font-size: 14px; }
  .podiumblock { font-size: 26px; }
  .qrbox { display: none; }
}

/* TV-Tabs: nur auf Handy/Tablet sichtbar — „Live" folgt der Admin-Regie,
   „Bierpong"/„Olympiade" sind frei stöberbar; der große TV bleibt tab-los. */
#sound { bottom: 16px; }
.tvtabs { display: none; }
@media (max-width: 900px) {
  .tvtabs {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; gap: 8px; /* über den Overlays (70) */
    background: #FFF; border-top: 3px solid var(--ink);
    padding: 8px 10px;
  }
  .tvtabs button {
    flex: 1 1 0; border: 2.5px solid var(--ink); border-radius: 999px; background: #FFF;
    font: inherit; font-size: 16px; font-weight: 800; padding: 10px 6px; cursor: pointer;
  }
  .tvtabs button.on { background: var(--gelb); }
  #tv { padding-bottom: 140px; }
  #sound { bottom: 78px; }
}

/* QR (TV) */
.qrbox {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: #FFFFFF;
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 6px;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  color: var(--ink);
  z-index: 40;
}
.qrbox img { display: block; width: 92px; height: 92px; image-rendering: pixelated; }

/* Speichern fehlgeschlagen (z. B. Key/Cookie weg): unübersehbarer Balken, sonst tippt man ins Leere */
body.saveerr::before {
  content: "⚠ NICHT GESPEICHERT — Seite mit ?key=… neu laden";
  position: fixed; inset: 0 0 auto 0; z-index: 200;
  padding: 12px 16px; text-align: center;
  background: #c62828; color: #fff; font-weight: 800; letter-spacing: .02em;
}
