:root {
  --ink: #1b0b3a;
  --muted: #6b5f85;
  --line: #ebe5f5;
  --red: #e21b3c;
  --blue: #1368ce;
  --yellow: #ffa602;
  --green: #26890c;
  --ok: #1f7a0a;
  --bad: #d61a3a;
  --radius: 18px;
  --shadow: 0 18px 40px rgba(12, 0, 40, 0.35);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  background:
    radial-gradient(1000px 600px at 10% -10%, rgba(167, 139, 250, 0.35), transparent 60%),
    radial-gradient(900px 700px at 110% 110%, rgba(236, 72, 153, 0.25), transparent 60%),
    linear-gradient(165deg, #5b21b6 0%, #3b0f8a 45%, #220a55 100%);
  background-attachment: fixed;
  color: #fff;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0 0 0.5em;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

button,
input,
textarea,
select {
  font: inherit;
}

.hidden {
  display: none !important;
}

/* ---------- Logo (vier Farbkacheln wie im Spiel) ---------- */

.logo {
  justify-self: center;
  width: 76px;
  height: 76px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 8px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
}
.logo i {
  border-radius: 7px;
}
.logo i:nth-child(1) {
  background: var(--red);
}
.logo i:nth-child(2) {
  background: var(--blue);
}
.logo i:nth-child(3) {
  background: var(--yellow);
}
.logo i:nth-child(4) {
  background: var(--green);
}
.logo.sm {
  width: 38px;
  height: 38px;
  padding: 4px;
  gap: 3px;
  border-radius: 10px;
  box-shadow: none;
}
.logo.sm i {
  border-radius: 3px;
}

/* ---------- Knoepfe ---------- */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 0;
  border-radius: 12px;
  padding: 0.75em 1.4em;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.25);
  transition: transform 0.08s, box-shadow 0.08s, background 0.15s, opacity 0.15s;
}
.btn:hover {
  background: #f4efff;
}
.btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.15);
}
.btn.primary {
  background: linear-gradient(#34ab13, #22830b);
  color: #fff;
}
.btn.primary:hover {
  background: linear-gradient(#3cb817, #26900d);
}
.btn.danger {
  background: linear-gradient(#f0304f, #d61a3a);
  color: #fff;
}
.btn.danger:hover {
  background: linear-gradient(#f5405d, #e02443);
}
.btn.ghost {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  box-shadow: none;
}
.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.24);
}
.btn.small {
  padding: 0.45em 0.9em;
  font-size: 0.9rem;
  border-radius: 10px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2);
}
.btn.big {
  font-size: 1.35rem;
  padding: 0.8em 2.2em;
}

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

/* ---------- Formulare ---------- */

.field {
  display: block;
  width: 100%;
  padding: 0.75em 0.95em;
  border: 2px solid #ddd5ef;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field::placeholder {
  color: #9b92b4;
}
.field:focus {
  outline: none;
  border-color: var(--yellow);
  box-shadow: 0 0 0 4px rgba(255, 166, 2, 0.25);
}
textarea.field {
  min-height: 160px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.85rem;
  resize: vertical;
}
label.row {
  display: flex;
  gap: 0.55em;
  align-items: center;
  cursor: pointer;
}
input[type='checkbox'] {
  width: 1.1em;
  height: 1.1em;
  accent-color: var(--green);
}
.error {
  background: #fde8ec;
  color: #8a0f26;
  border-radius: 12px;
  padding: 0.65em 0.95em;
  font-weight: 700;
}
.note {
  background: #fff6d2;
  color: #5a4600;
  border-radius: 12px;
  padding: 0.65em 0.95em;
  font-weight: 600;
}

/* ---------- Karten und Verwaltung ---------- */

.card {
  background: #fff;
  color: var(--ink);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
}
.card h2,
.card h3 {
  color: var(--ink);
  font-size: 1.25rem;
}
.muted {
  color: var(--muted);
}

.admin {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
  display: grid;
  gap: 1.25rem;
}
.admin header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 0.25rem 0;
}
.admin header h1 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 900;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.stack {
  display: grid;
  gap: 0.75rem;
}
.rowflex {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}
.spacer {
  flex: 1;
}
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.75rem 0.95rem;
  border: 2px solid var(--line);
  border-radius: 14px;
  transition: background 0.15s, border-color 0.15s;
}
.list li:hover {
  background: #faf8ff;
  border-color: #dcd2f0;
}
.list .title {
  font-weight: 800;
  flex: 1;
  min-width: 160px;
}
.login {
  max-width: 380px;
  margin: 16vh auto 0;
  padding: 0 1rem;
}
.login .card {
  display: grid;
  gap: 0.9rem;
  padding: 1.8rem;
}
.login .card h2 {
  text-align: center;
  margin: 0;
  font-size: 1.4rem;
}

.qcard {
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  display: grid;
  gap: 0.6rem;
}
.qcard .qhead {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
}
.qcard .grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.qcard .grid2 .ok {
  border-color: var(--green);
  background: #f3fbef;
}
@media (max-width: 640px) {
  .qcard .grid2 {
    grid-template-columns: 1fr;
  }
}
.badge {
  display: inline-block;
  padding: 0.2em 0.65em;
  border-radius: 999px;
  background: #efe9ff;
  color: #4c1d95;
  font-size: 0.8rem;
  font-weight: 800;
}

/* ---------- Antwortkacheln (Beamer und Handy) ---------- */

.tile-0 {
  background: var(--red);
}
.tile-1 {
  background: var(--blue);
}
.tile-2 {
  background: var(--yellow);
  color: var(--ink);
}
.tile-3 {
  background: var(--green);
}
.tile-2 .shape {
  fill: var(--ink);
}
.shape {
  width: 1.6em;
  height: 1.6em;
  flex: none;
  fill: #fff;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.15));
}

/* ---------- Beamer ---------- */

.stage {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 1rem;
  padding: 1.25rem 2.2rem 1.5rem;
}
.stage .topbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.05rem;
}
.stage .topbar .pill {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0.35em 1em;
  backdrop-filter: blur(6px);
}
.stage .topbar .pill:empty {
  display: none;
}
.stage .body {
  display: grid;
  align-content: center;
  gap: 1.5rem;
}
.stage .bottombar {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  align-items: center;
}

.lobby {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 3rem;
  align-items: start;
}
.lobby .hint {
  text-align: left;
}
@media (max-width: 900px) {
  .lobby {
    grid-template-columns: 1fr;
  }
}
.joinbox {
  background: #fff;
  color: var(--ink);
  border-radius: 24px;
  padding: 1.2rem;
  text-align: center;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
}
/* netgrade-Plakette: weisser Untergrund, damit das schwarze Logo lesbar bleibt */
.ng-badge {
  display: flex;
  margin: 0 auto;
  align-items: center;
  background: #fff;
  border-radius: 10px;
  padding: 0.35rem 0.75rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  vertical-align: middle;
  align-self: center;
  width: fit-content;
}
.footer .ng-badge {
  margin: 0;
}
.ng-badge img {
  height: 20px;
  width: auto;
  display: block;
}
.joinbox img,
.joinbox .qr {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}
.joinbox .qr svg {
  width: 100%;
  height: auto;
  display: block;
}
.joinbox .code {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 900;
  letter-spacing: 0.14em;
  margin-top: 0.5rem;
  font-variant-numeric: tabular-nums;
}
.joinbox .url {
  font-size: 0.92rem;
  color: var(--muted);
  word-break: break-all;
}
.players {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-content: flex-start;
}
.chip {
  background: #fff;
  color: var(--ink);
  border: 0;
  border-radius: 12px;
  padding: 0.45em 1em;
  font-weight: 800;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
  animation: pop 0.3s var(--ease);
  transition: opacity 0.4s ease;
}
.chip.off {
  opacity: 0.45;
}
.chip:hover {
  background: #ffd9e0;
}
@keyframes pop {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.qtext {
  background: #fff;
  color: var(--ink);
  border-radius: 22px;
  padding: 1.4rem 1.8rem;
  font-size: clamp(1.7rem, 3.4vw, 3.1rem);
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  white-space: pre-wrap;
  animation: rise-in 0.5s var(--ease) both;
}
.hint {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  opacity: 0.92;
}
.timer {
  width: 5.4rem;
  height: 5.4rem;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 2.3rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.22), 0 10px 24px rgba(0, 0, 0, 0.3);
}
.midrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
}
.answered {
  font-size: 1.5rem;
  font-weight: 900;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.answered small {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  opacity: 0.8;
}
.bar {
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25);
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd54a, var(--yellow));
  transition: width 0.25s linear, background 0.3s;
}
.bar.low > i {
  background: linear-gradient(90deg, #ff7a7a, var(--red));
}

.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.options > :nth-child(2) {
  animation-delay: 0.08s;
}
.options > :nth-child(3) {
  animation-delay: 0.16s;
}
.options > :nth-child(4) {
  animation-delay: 0.24s;
}
@media (max-width: 700px) {
  .options {
    grid-template-columns: 1fr;
  }
}
.opt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  border: 0;
  border-radius: 16px;
  padding: 1.1rem 1.3rem;
  color: #fff;
  font-family: inherit;
  font-weight: 800;
  font-size: clamp(1.2rem, 2.3vw, 1.9rem);
  text-align: left;
  min-height: 5.6rem;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.28);
  animation: tile-in 0.5s var(--ease) backwards;
  transition: transform 0.12s, box-shadow 0.12s, opacity 0.3s, filter 0.15s;
}
.opt .label {
  flex: 1;
  overflow-wrap: anywhere;
  line-height: 1.2;
}
.opt .count {
  font-size: 1.5rem;
  font-weight: 900;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 10px;
  padding: 0.05em 0.55em;
  min-width: 2.2em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.opt .share {
  flex-basis: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
  overflow: hidden;
}
.opt .share > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #fff;
  transition: width 0.8s var(--ease);
}
.opt.dim {
  opacity: 0.32;
}
.opt.right {
  outline: 5px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.28), 0 0 32px rgba(255, 255, 255, 0.35);
}
.opt .tick {
  font-size: 1.6rem;
  font-weight: 900;
}
button.opt {
  cursor: pointer;
}
button.opt:hover:not(:disabled) {
  filter: brightness(1.07);
  transform: translateY(-2px);
}
button.opt:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.28);
}

.board {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  width: min(720px, 100%);
  display: grid;
  gap: 0.5rem;
}
.board li {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: #fff;
  color: var(--ink);
  border-radius: 14px;
  padding: 0.7rem 1.2rem;
  font-weight: 800;
  font-size: 1.4rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  animation: rise-in 0.45s var(--ease) both;
}
.board li:nth-child(2) {
  animation-delay: 0.05s;
}
.board li:nth-child(3) {
  animation-delay: 0.1s;
}
.board li:nth-child(4) {
  animation-delay: 0.15s;
}
.board li:nth-child(5) {
  animation-delay: 0.2s;
}
.board .rank {
  width: 2.2em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.board li:nth-child(1) .rank {
  color: #c08400;
}
.board .name {
  flex: 1;
  overflow-wrap: anywhere;
}
.board .score {
  font-variant-numeric: tabular-nums;
}

.podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1.4rem;
  min-height: 340px;
}
.podium .place {
  width: min(220px, 28vw);
  text-align: center;
  font-weight: 900;
}
.podium .pname {
  font-size: 1.7rem;
  margin-bottom: 0.3rem;
  overflow-wrap: anywhere;
}
.podium .pscore {
  font-size: 1.1rem;
  font-weight: 700;
  opacity: 0.9;
  margin-bottom: 0.6rem;
}
.podium .block {
  border-radius: 14px 14px 0 0;
  display: grid;
  place-items: center;
  font-size: 3.2rem;
  color: #fff;
  box-shadow: inset 0 6px 0 rgba(255, 255, 255, 0.25);
  animation: rise 0.9s var(--ease) both;
  transform-origin: bottom;
}
.podium .p1 .block {
  height: 220px;
  background: linear-gradient(#ffd54a, #d89e00);
}
.podium .p2 .block {
  height: 160px;
  background: linear-gradient(#b4bccb, #7d8698);
  animation-delay: 0.2s;
}
.podium .p3 .block {
  height: 110px;
  background: linear-gradient(#cf8a52, #9a5a2c);
  animation-delay: 0.4s;
}
@keyframes rise {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}
@keyframes rise-in {
  from {
    transform: translateY(16px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes tile-in {
  from {
    transform: translateY(18px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.intro-title {
  text-align: center;
  font-size: clamp(2.1rem, 5vw, 4rem);
  font-weight: 900;
  letter-spacing: -0.02em;
}
.centered {
  text-align: center;
}
.big-number {
  font-size: clamp(4rem, 14vw, 9rem);
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* ---------- Handy ---------- */

.phone {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 1fr auto;
}
.phone .main {
  display: grid;
  align-content: center;
  gap: 1.1rem;
  padding: 1.25rem;
  width: min(520px, 100%);
  margin: 0 auto;
}
.phone .footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1.2rem;
  background: rgba(0, 0, 0, 0.25);
  font-weight: 800;
}
.phone h1 {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 900;
  margin: 0.2rem 0 0;
}
.phone .field {
  font-size: 1.3rem;
  text-align: center;
  font-weight: 700;
  padding: 0.85em;
}
.phone .btn {
  font-size: 1.25rem;
  padding: 0.85em 1em;
}
.phone .options {
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.phone .opt {
  flex-direction: column;
  justify-content: center;
  text-align: center;
  min-height: 9.5rem;
  font-size: 1.1rem;
  width: 100%;
  border: 0;
}
.phone .opt .shape {
  width: 2.4em;
  height: 2.4em;
}
.phone .opt .label {
  flex: none;
}
.phone .opt:disabled {
  cursor: default;
}
.phone .opt.chosen {
  outline: 5px solid #fff;
  outline-offset: 2px;
  opacity: 1;
}
@media (max-width: 380px) {
  .phone .options {
    grid-template-columns: 1fr;
  }
  .phone .opt {
    flex-direction: row;
    min-height: 5rem;
    text-align: left;
  }
}
.verdict {
  text-align: center;
  border-radius: 22px;
  padding: 2.2rem 1rem;
  font-weight: 900;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
  animation: pop-in 0.5s var(--ease) both;
}
.verdict.ok {
  background: linear-gradient(#2f9e13, var(--ok));
}
.verdict.bad {
  background: linear-gradient(#f0304f, var(--bad));
}
.verdict.none {
  background: linear-gradient(#5d5d70, #46465a);
}
.verdict .big {
  font-size: 2.5rem;
  letter-spacing: -0.02em;
}
.verdict .pts {
  font-size: 1.6rem;
  margin-top: 0.4rem;
}
.verdict .streak {
  margin-top: 0.6rem;
  font-size: 1.1rem;
}
@keyframes pop-in {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
.spinner {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  border: 6px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  margin: 0 auto;
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
