:root {
  --ink: #2b2433;
  --ink-soft: #5b5266;
  --paper: #fffdf6;
  --rule: #cfe0f2;
  --margin: #ef9a9a;
  --yellow: #ffe979;
  --pink: #ffc4d8;
  --green: #cdf0ad;
  --blue: #c3e4ff;
  --orange: #ffd39c;
  --accent: #ff6a4a;
  --accent-dark: #c4442a;
  --cover: #3f6eb5;
  --cover-dark: #2c528c;
  --folder: #e7b26a;
  --folder-light: #f2c785;
  --board: #2e4a39;
  --board-dark: #22382b;
  --wood: #8b5a32;
  --chalk: #f3efe4;
  --chalk-yellow: #fbe58f;
  --chalk-pink: #f7b4c8;
  --hand: 'Caveat', 'Segoe Print', 'Comic Sans MS', cursive;
  --ui: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
  background: #3a2c2a;
}
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.05; font-weight: 700; }
p { margin: 0; }

/* ---------- Klassenzimmer-Hintergrund ---------- */
.bg {
  position: fixed;
  inset: -4%;
  background-size: cover;
  background-position: center 45%;
  opacity: 0;
  transition: opacity 1.4s ease;
  animation: drift 38s ease-in-out infinite alternate;
  z-index: -3;
}
.bg.blossom { background-image: url('img/klasse-kirschblueten.jpg'); }
.bg.sea { background-image: url('img/klasse-meer.jpg'); }
body[data-scene='blossom'] .bg.blossom,
body[data-scene='sea'] .bg.sea { opacity: 1; }
@keyframes drift { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.06) translate(-1.2%, 0.8%); } }
.veil {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(40, 24, 36, 0) 0%, rgba(40, 24, 36, 0.35) 75%),
    linear-gradient(180deg, rgba(30, 20, 30, 0.1), rgba(30, 20, 30, 0.45));
}

/* Fallende Blütenblätter */
.petals { position: fixed; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; transition: opacity 1s; }
body[data-scene='sea'] .petals { opacity: 0; }
.petal {
  position: absolute;
  top: -5vh;
  width: 12px;
  height: 9px;
  background: linear-gradient(135deg, #ffd6e3, #f59bb8);
  border-radius: 80% 0 80% 0;
  opacity: 0.85;
  animation: fall var(--t, 12s) linear var(--delay, 0s) infinite;
}
@keyframes fall {
  0% { transform: translate(0, -5vh) rotate(0deg); }
  50% { transform: translate(var(--sway, 40px), 50vh) rotate(220deg); }
  100% { transform: translate(calc(var(--sway, 40px) * -0.5), 108vh) rotate(480deg); }
}

/* ---------- Layout ---------- */
.screen {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 16px 64px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.screen.narrow { max-width: 600px; }
.screen.center { min-height: 70dvh; justify-content: center; align-items: center; text-align: center; }
.hand { font-family: var(--hand); font-size: 24px; }
.light { color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); }
.caption {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 18px rgba(0, 0, 0, 0.45);
  font-weight: 600;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}
.hint { color: var(--ink-soft); font-size: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 0; }
.center-row { justify-content: center; }

/* Topbar als Papier-Etiketten */
.topbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.topbar .spacer { flex: 1; }
.tag {
  background: var(--paper);
  border-radius: 4px;
  padding: 3px 12px;
  font-family: var(--hand);
  font-size: 21px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  transform: rotate(-1deg);
}
.tag:nth-child(2) { transform: rotate(1.2deg); background: var(--yellow); }
.tag b { letter-spacing: 0.08em; }
.tag-btn { border: none; cursor: pointer; }
.tag-btn:hover { background: var(--pink); }

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 10px 22px;
  font-family: var(--hand);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  background: var(--paper);
  box-shadow: 0 4px 0 #cfc6b4, 0 8px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.08s, box-shadow 0.08s;
  touch-action: manipulation;
}
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #cfc6b4, 0 3px 8px rgba(0, 0, 0, 0.25); }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 4px 0 var(--accent-dark), 0 8px 16px rgba(0, 0, 0, 0.3); }
.btn.primary:active:not(:disabled) { box-shadow: 0 1px 0 var(--accent-dark); }
.btn.blue { background: var(--cover); color: #fff; box-shadow: 0 4px 0 var(--cover-dark), 0 8px 16px rgba(0, 0, 0, 0.3); }
.btn.yellow { background: var(--yellow); box-shadow: 0 4px 0 #c9b24a, 0 8px 16px rgba(0, 0, 0, 0.25); }
.btn.big { width: 100%; font-size: 30px; padding: 12px 20px; }
.btn.small { font-size: 21px; padding: 4px 14px; }
.btn:disabled { background: #e7e1d6; color: #9a9184; box-shadow: 0 4px 0 #c9c1b3; cursor: not-allowed; }
.link-btn { background: none; border: none; text-decoration: underline; cursor: pointer; color: var(--ink-soft); font-size: 14px; padding: 4px; }
.sticky-bottom { position: sticky; bottom: 14px; z-index: 6; max-width: 600px; width: 100%; margin: 0 auto; }

/* ---------- Schulheft ---------- */
.notebook {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 8px auto 0;
  perspective: 1800px;
}
.page {
  position: relative;
  background-color: var(--paper);
  background-image: linear-gradient(transparent 35px, var(--rule) 35px, var(--rule) 36px, transparent 36px);
  background-size: 100% 36px;
  background-position: 0 14px;
  border-radius: 4px 14px 14px 4px;
  padding: 26px 22px 30px 58px;
  box-shadow: 0 1px 0 #e8e2d2, 0 2px 0 #fff, 0 3px 0 #e2dccb, 0 22px 50px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.page::before { content: ''; position: absolute; left: 44px; top: 0; bottom: 0; width: 2px; background: var(--margin); }
/* Heftklammern */
.page::after {
  content: '';
  position: absolute;
  left: 10px;
  top: 22%;
  width: 6px;
  height: 56%;
  background:
    linear-gradient(#a9adb5, #e8eaee 50%, #9a9ea6) top / 6px 36px no-repeat,
    linear-gradient(#a9adb5, #e8eaee 50%, #9a9ea6) bottom / 6px 36px no-repeat;
  border-radius: 3px;
}
.cover {
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: 4px 14px 14px 4px;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.04) 0 2px, transparent 2px 6px),
    linear-gradient(135deg, var(--cover), var(--cover-dark));
  box-shadow: inset 8px 0 0 rgba(0, 0, 0, 0.18), 0 22px 50px rgba(0, 0, 0, 0.45);
  transform-origin: left center;
  backface-visibility: hidden;
  display: grid;
  place-items: center;
  animation: coverOpen 1.15s cubic-bezier(0.55, 0.05, 0.3, 1) 0.45s forwards;
  pointer-events: none;
}
.cover-label {
  background: var(--paper);
  border-radius: 8px;
  padding: 12px 24px 14px;
  min-width: 60%;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  border: 2px solid #d8d0bd;
}
.cover-label small { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.15em; color: var(--ink-soft); }
.cover-label strong { display: block; font-family: var(--hand); font-size: 48px; color: var(--cover-dark); border-bottom: 2px solid var(--rule); }
@keyframes coverOpen {
  0% { transform: rotateY(0); }
  85% { opacity: 1; }
  100% { transform: rotateY(-178deg); opacity: 0; visibility: hidden; }
}
.page-title { font-family: var(--hand); font-size: clamp(52px, 13vw, 78px); line-height: 0.85; color: var(--ink); }
.page-title span { color: var(--accent); display: inline-block; transform: rotate(-5deg); }
.hand-h { font-family: var(--hand); font-size: 32px; color: var(--cover-dark); }
.hand-h .count { font-size: 22px; color: var(--ink-soft); }
.tagline { font-family: var(--hand); font-size: 26px; color: var(--ink-soft); }

.line-field { display: flex; flex-direction: column; gap: 2px; font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); }
.line-input {
  width: 100%;
  border: none;
  border-bottom: 2px dashed #9bb7d6;
  background: transparent;
  font-family: var(--hand);
  font-size: 30px;
  color: var(--cover-dark);
  padding: 2px 4px;
  outline: none;
  text-transform: none;
  letter-spacing: 0;
}
.line-input:focus { border-bottom-style: solid; border-bottom-color: var(--cover); }
.line-input.invalid { border-bottom-color: var(--accent); background: rgba(255, 106, 74, 0.08); }
.code-input { text-transform: uppercase; letter-spacing: 0.3em; text-align: center; font-weight: 700; }
.or { text-align: center; font-family: var(--hand); font-size: 22px; color: var(--ink-soft); }
.rules summary { cursor: pointer; font-family: var(--hand); font-size: 26px; color: var(--cover-dark); }
.rules ol { margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 15px; }

/* Lobby-Code mit Textmarker */
.code-hand { text-align: center; }
.marker {
  font-family: var(--hand);
  font-size: 76px;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 0 14px 0 calc(14px + 0.14em);
  background: linear-gradient(100deg, transparent 2%, rgba(255, 233, 80, 0.85) 4%, rgba(255, 220, 60, 0.75) 96%, transparent 98%) 0 60% / 100% 58% no-repeat;
}
.roll { margin: 0; padding-left: 28px; display: flex; flex-direction: column; font-family: var(--hand); font-size: 28px; }
.roll li { min-height: 36px; display: flex; align-items: center; gap: 8px; }
.roll li.offline { opacity: 0.45; }
.roll .pname { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stamp {
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 1px 7px;
  border: 2px solid currentColor;
  border-radius: 4px;
  transform: rotate(-4deg);
}
.stamp.host { color: #c0392b; }
.stamp.you { color: var(--cover); }
.kick { margin-left: auto; border: none; background: none; cursor: pointer; font-size: 18px; color: var(--ink-soft); }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.settings-grid .full { grid-column: 1 / -1; }
.set-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.set-field select, .set-field textarea {
  border: 2px solid #c6d4e4;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  padding: 7px 9px;
  font-size: 16px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
}
.set-field textarea { font-family: var(--hand); font-size: 22px; resize: vertical; }
.seg { display: flex; border: 2px solid #c6d4e4; border-radius: 8px; overflow: hidden; background: rgba(255, 255, 255, 0.8); }
.seg label { position: relative; flex: 1; text-align: center; padding: 7px 4px; cursor: pointer; font-size: 15px; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--ink); }
.seg label + label { border-left: 2px solid #c6d4e4; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--cover); color: #fff; }
.seg label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: -4px; }
.summary { font-family: var(--hand); font-size: 25px; display: flex; flex-direction: column; }

/* ---------- Sticky Notes ---------- */
.sticky {
  --r: -1.5deg;
  position: relative;
  background: var(--yellow);
  padding: 22px 18px 18px;
  border-radius: 2px 2px 3px 22px / 2px 2px 3px 8px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12), 0 14px 22px -8px rgba(0, 0, 0, 0.5);
  transform: rotate(var(--r));
  font-family: var(--hand);
}
.sticky::before {
  content: '';
  position: absolute;
  top: -11px;
  left: 50%;
  width: 96px;
  height: 24px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(1px);
}
.c0 { background: var(--yellow); }
.c1 { background: var(--pink); }
.c2 { background: var(--green); }
.c3 { background: var(--blue); }
.c4 { background: var(--orange); }
.slap { animation: slap 0.5s cubic-bezier(0.2, 1.5, 0.45, 1) var(--d, 0ms) both; }
@keyframes slap {
  0% { opacity: 0; transform: translateY(-40px) scale(1.7) rotate(calc(var(--r) * -5)); }
  55% { opacity: 1; transform: translateY(0) scale(0.95) rotate(var(--r)); }
  75% { transform: scale(1.02) rotate(var(--r)); }
  100% { opacity: 1; transform: scale(1) rotate(var(--r)); }
}
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 34px 26px; padding-top: 8px; }

.theme-note {
  --r: -2deg;
  align-self: center;
  width: min(440px, 100%);
  text-align: center;
  padding: 24px 22px 20px;
}
.theme-note .kicker { font-family: var(--ui); font-size: 12px; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.7; }
.theme-note h2 { font-size: clamp(46px, 12vw, 68px); overflow-wrap: anywhere; }
.clock {
  position: absolute;
  right: -14px;
  top: -18px;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid #3b3b3b;
  display: grid;
  place-items: center;
  font-family: var(--ui);
  font-weight: 800;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
  transform: rotate(6deg);
}
.clock.low { background: var(--accent); color: #fff; border-color: var(--accent-dark); animation: tickPulse 1s infinite; }
@keyframes tickPulse { 50% { transform: rotate(6deg) scale(1.1); } }

.note-head { display: flex; align-items: center; gap: 8px; font-size: 28px; font-weight: 700; }
.note-head .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-label { font-size: 22px; color: rgba(43, 36, 51, 0.7); margin-top: 4px; }
.note-input {
  width: 100%;
  border: none;
  border-bottom: 2px dashed rgba(43, 36, 51, 0.35);
  background: transparent;
  font-family: var(--hand);
  font-size: 28px;
  line-height: 1.15;
  padding: 2px 2px;
  outline: none;
  color: #1f3d73;
  resize: none;
}
.note-input::placeholder { color: rgba(43, 36, 51, 0.35); }
.note-input:focus { border-bottom-style: solid; border-bottom-color: rgba(31, 61, 115, 0.6); }
.note-input.invalid { border-bottom-color: var(--accent); background: rgba(255, 106, 74, 0.12); }
.sticky.complete::after {
  content: '✓';
  position: absolute;
  right: 10px;
  top: 6px;
  font-family: var(--ui);
  font-weight: 800;
  font-size: 22px;
  color: #2f8a4a;
}
.avatar {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--ui);
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18);
}

.wait-note { align-self: center; width: min(420px, 100%); text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; padding: 26px 22px 22px; }
.wait-note h2 { font-size: 44px; }
.wait-note .big { font-size: 56px; line-height: 1; }
.wait-note p { font-size: 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.chip { font-family: var(--ui); font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 3px; background: rgba(255, 255, 255, 0.7); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
.chip.done { background: #2f8a4a; color: #fff; }
.chip.off { opacity: 0.45; }

/* ---------- Hefter (Abstimmung) ---------- */
.folder { position: relative; margin-top: 26px; perspective: 1600px; animation: rise 0.45s ease-out var(--d, 0ms) both; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
.folder-tab {
  position: absolute;
  top: -30px;
  left: 18px;
  max-width: calc(100% - 36px);
  background: var(--folder);
  padding: 2px 18px 6px;
  border-radius: 10px 10px 0 0;
  font-family: var(--hand);
  font-size: 25px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.folder-tab .avatar { width: 26px; height: 26px; font-size: 12px; }
.folder-body {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 40%),
    var(--folder);
  border-radius: 4px 14px 14px 14px;
  padding: 26px 18px 22px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45);
}
.folder-flap {
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: 4px 14px 14px 14px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.25), transparent 60%),
    var(--folder-light);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.05);
  transform-origin: left center;
  backface-visibility: hidden;
  display: grid;
  place-items: center;
  font-family: var(--hand);
  font-size: 38px;
  color: rgba(80, 50, 20, 0.6);
  animation: flapOpen 0.9s cubic-bezier(0.55, 0.05, 0.3, 1) calc(var(--d, 0ms) + 250ms) forwards;
  pointer-events: none;
}
@keyframes flapOpen {
  0% { transform: rotateY(0); }
  85% { opacity: 1; }
  100% { transform: rotateY(-175deg); opacity: 0; visibility: hidden; }
}
.folder .notes-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 26px 20px; }
.option {
  border: none;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 120px;
  font-size: 22px;
  touch-action: manipulation;
  transition: transform 0.15s, box-shadow 0.15s;
}
.option .term { font-size: 32px; font-weight: 700; line-height: 1; overflow-wrap: anywhere; }
.option .reason { font-size: 22px; color: rgba(43, 36, 51, 0.8); overflow-wrap: anywhere; }
.option:hover:not(:disabled) { box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12), 0 22px 28px -8px rgba(0, 0, 0, 0.55); }
.option.selected { outline: 4px solid var(--accent); outline-offset: 3px; }
.option.selected::after {
  content: '★';
  position: absolute;
  right: -12px;
  top: -14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 22px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  animation: pop 0.3s cubic-bezier(0.2, 1.8, 0.4, 1);
}
@keyframes pop { from { transform: scale(0); } }
.option:disabled { cursor: not-allowed; filter: saturate(0.4); opacity: 0.75; }
.option .mine { font-family: var(--ui); font-size: 11px; font-weight: 800; letter-spacing: 0.1em; color: var(--cover-dark); }
.empty-note { font-family: var(--hand); font-size: 24px; color: rgba(60, 40, 20, 0.75); }

/* ---------- Tafel ---------- */
.board-wrap { position: relative; padding-bottom: 18px; }
.board {
  position: relative;
  color: var(--chalk);
  font-family: var(--hand);
  border-radius: 6px;
  padding: 26px 24px 30px;
  background:
    radial-gradient(ellipse at 20% 15%, rgba(255, 255, 255, 0.07), transparent 45%),
    radial-gradient(ellipse at 80% 70%, rgba(255, 255, 255, 0.05), transparent 50%),
    radial-gradient(ellipse at 55% 40%, rgba(255, 255, 255, 0.04), transparent 35%),
    linear-gradient(160deg, var(--board), var(--board-dark));
  border: 14px solid var(--wood);
  border-image: linear-gradient(135deg, #a46c3d, #6e4424 40%, #9a6436 70%, #5e3a1e) 1;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.55), inset 0 0 80px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 26px;
  animation: boardIn 0.6s ease-out both;
}
@keyframes boardIn { from { opacity: 0; transform: translateY(20px) scale(0.98); } }
.tray {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 4px;
  height: 18px;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(#7a4c29, #5a361b);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.45);
}
.tray i { position: absolute; top: -4px; height: 8px; border-radius: 3px; }
.tray .chalk-w { left: 18%; width: 46px; background: #f6f2ea; }
.tray .chalk-p { left: 26%; width: 30px; background: var(--chalk-pink); transform: rotate(-8deg); }
.tray .sponge { right: 14%; width: 70px; height: 16px; top: -10px; background: linear-gradient(#e2c26a 0 40%, #4b4b4b 40%); border-radius: 3px; }
.chalk, .board h2, .board h3 { text-shadow: 0 0 1px rgba(255, 255, 255, 0.55), 0 0 8px rgba(255, 255, 255, 0.12); }
.write { animation: write 0.9s steps(18, end) var(--d, 0ms) both; }
@keyframes write { from { clip-path: inset(-20% 100% -20% -2%); } to { clip-path: inset(-20% -2% -20% -2%); } }
.board-title { font-size: clamp(40px, 9vw, 60px); text-align: center; }
.board-title small { display: block; font-size: 26px; color: var(--chalk-yellow); }
.board-section { display: flex; flex-direction: column; gap: 10px; }
.board-section h3 {
  font-size: 34px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid rgba(243, 239, 228, 0.5);
  padding-bottom: 2px;
  border-radius: 0 0 40% 10% / 0 0 6px 2px;
}
.board-section h3 .avatar { width: 30px; height: 30px; font-size: 13px; opacity: 0.9; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px 34px; }
.chalk-entry { display: flex; flex-direction: column; gap: 0; padding-left: 10px; }
.ce-top { display: flex; align-items: baseline; gap: 10px; }
.ce-term { font-size: 32px; font-weight: 700; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ce-pts { font-size: 30px; color: var(--chalk-yellow); white-space: nowrap; }
.ce-reason { font-size: 23px; opacity: 0.9; overflow-wrap: anywhere; }
.ce-meta { font-size: 21px; color: var(--chalk-pink); }
.ce-meta b { color: var(--chalk); font-weight: 700; }
.circled { position: relative; display: inline-block; padding: 0 6px; }
.circled::after {
  content: '';
  position: absolute;
  inset: -6px -10px -4px -10px;
  border: 2.5px solid var(--chalk-yellow);
  border-radius: 52% 46% 55% 44% / 60% 52% 48% 42%;
  transform: rotate(-3deg);
  animation: circle 0.6s ease-out calc(var(--d, 0ms) + 700ms) both;
}
@keyframes circle { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.crown { color: var(--chalk-yellow); }
.score-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 30px; }
.score-list li { display: flex; align-items: baseline; gap: 10px; }
.score-list .rank { width: 34px; color: var(--chalk-yellow); }
.score-list .pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-list .dots { flex: 1; border-bottom: 2px dotted rgba(243, 239, 228, 0.35); transform: translateY(-6px); min-width: 20px; }
.score-list .plus { color: var(--chalk-pink); font-size: 24px; }
.score-list .score { font-weight: 700; min-width: 40px; text-align: right; }

.podium { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: end; gap: 10px; max-width: 520px; width: 100%; margin: 6px auto 0; }
.podium .place { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; min-width: 0; }
.podium .pname { font-size: 30px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .pts { font-size: 22px; color: var(--chalk-pink); }
.podium .block {
  width: 100%;
  border: 3px solid var(--chalk);
  border-bottom: none;
  border-radius: 4px 6px 0 0 / 4px 10px 0 0;
  display: grid;
  place-items: center;
  font-size: 46px;
  font-weight: 700;
  animation: grow 0.8s cubic-bezier(0.2, 1.2, 0.4, 1) var(--d, 0ms) both;
  transform-origin: bottom;
}
@keyframes grow { from { transform: scaleY(0); } }
.podium .p1 .block { height: 150px; color: var(--chalk-yellow); border-color: var(--chalk-yellow); }
.podium .p2 .block { height: 105px; }
.podium .p3 .block { height: 75px; }
.podium .floor { grid-column: 1 / -1; height: 3px; background: var(--chalk); border-radius: 2px; }

/* ---------- Toast & Verbindung ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) rotate(-1.5deg);
  background: var(--pink);
  color: var(--ink);
  padding: 14px 20px 12px;
  font-family: var(--hand);
  font-size: 24px;
  max-width: calc(100vw - 32px);
  z-index: 60;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.45);
  animation: slap 0.45s cubic-bezier(0.2, 1.5, 0.45, 1) both;
  --r: -1.5deg;
}
.conn { position: sticky; top: 0; z-index: 50; background: var(--accent); color: #fff; text-align: center; padding: 6px; font-weight: 700; font-size: 14px; }

@media (max-width: 520px) {
  .page { padding: 22px 16px 26px 48px; }
  .page::before { left: 36px; }
  .page::after { left: 8px; }
  .settings-grid { grid-template-columns: 1fr; }
  .marker { font-size: 60px; }
  .notes-grid { grid-template-columns: 1fr; }
  .board { padding: 20px 16px 26px; border-width: 10px; }
  .board-grid { grid-template-columns: 1fr; }
  .clock { width: 62px; height: 62px; font-size: 16px; right: -8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition: none !important; }
  .petals { display: none; }
}
