/* Hextech-inspired theme: deep navy, gold trim, teal magic accents. */
:root {
  --void: #010a13;
  --navy: #091428;
  --navy-2: #0a1e32;
  --gold-1: #f0e6d2;
  --gold-2: #c8aa6e;
  --gold-3: #c89b3c;
  --gold-4: #785a28;
  --gold-5: #463714;
  --teal: #0ac8b9;
  --teal-dark: #0a323c;
  --text: #a09b8c;
  --danger: #e84057;
  --serif: "Cinzel", "Marcellus", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  color: var(--text);
  font: 15px/1.4 var(--sans);
  background:
    radial-gradient(ellipse 70% 60% at 62% 50%, rgba(10, 200, 185, 0.10), transparent 70%),
    radial-gradient(ellipse at top, #0b2240 0%, var(--void) 70%),
    var(--void);
}

/* faint hexagon pattern */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28 0l28 16v32L28 64 0 48V16zM28 64l28 16v32M28 64L0 80v32' fill='none' stroke='%23c8aa6e' stroke-width='1'/%3E%3C/svg%3E");
}

/* ---------- header ---------- */

header {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--gold-5);
  background: linear-gradient(180deg, rgba(9, 20, 40, 0.95), rgba(1, 10, 19, 0.6));
}
header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-3), transparent);
}

h1 {
  margin: 0;
  font: 700 clamp(1.5rem, 3vw, 2.3rem) / 1.1 var(--serif);
  letter-spacing: 0.03em; /* no capitals: the capital A in "GlücksrAdi" is the point */
  background: linear-gradient(180deg, var(--gold-1) 0%, var(--gold-2) 55%, var(--gold-4) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hint {
  margin: 4px 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal);
}

.session { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.status { font-size: 0.85rem; margin-right: 6px; }
.status.online::before { content: "◆ "; color: var(--teal); }
.status.offline::before { content: "◆ "; color: var(--danger); }

/* ---------- buttons ---------- */

button, .button {
  font: 600 0.78rem/1 var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: #cdbe91;
  background: linear-gradient(180deg, #1e2328, #10161c);
  border: 2px solid transparent;
  border-image: linear-gradient(180deg, var(--gold-2), var(--gold-4)) 1;
  padding: 10px 16px;
  cursor: pointer;
  display: inline-block;
  transition: color 0.15s, box-shadow 0.15s, background 0.15s;
}
button:hover:not(:disabled), .button:hover {
  color: var(--gold-1);
  background: linear-gradient(180deg, #2a3138, #161d24);
  box-shadow: 0 0 12px rgba(200, 170, 110, 0.35);
}
button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- layout ---------- */

main {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(240px, 300px) 1fr minmax(220px, 270px);
  gap: 24px;
  padding: 20px 28px 24px;
}

.panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 18px;
  background: linear-gradient(180deg, rgba(9, 20, 40, 0.92), rgba(1, 10, 19, 0.92));
  border: 1px solid var(--gold-4);
  box-shadow: inset 0 0 0 3px rgba(1, 10, 19, 0.9), inset 0 0 0 4px var(--gold-5), 0 10px 40px rgba(0, 0, 0, 0.5);
}

h2 {
  margin: 0 0 12px;
  font: 700 1.05rem var(--serif);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold-2);
}
.count { font: 600 0.8rem var(--sans); letter-spacing: 0.05em; color: var(--teal); text-transform: none; }
.legend { margin: -6px 0 10px; font-size: 0.75rem; color: var(--gold-4); }

#add-form { display: flex; gap: 8px; margin-bottom: 14px; }
#add-form input {
  flex: 1;
  min-width: 0;
  font: inherit;
  color: var(--gold-1);
  padding: 9px 12px;
  background: var(--void);
  border: 1px solid var(--gold-5);
  outline: none;
}
#add-form input:focus { border-color: var(--gold-2); box-shadow: 0 0 8px rgba(200, 170, 110, 0.3); }
#add-form button { padding: 8px 14px; font-size: 1.1rem; }

.chips {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  list-style: none;
  margin: 0 -6px 14px 0;
  padding: 0 6px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-4) transparent;
}

.chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px 8px 12px;
  background: rgba(30, 35, 40, 0.7);
  border: 1px solid var(--gold-5);
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: none;
  transform: rotate(45deg);
  border: 1px solid var(--gold-4);
}
.chip span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip:hover { border-color: var(--gold-3); color: var(--gold-1); }
.chip.on-wheel {
  color: var(--gold-1);
  border-color: var(--teal);
  background: linear-gradient(90deg, rgba(10, 200, 185, 0.18), rgba(10, 50, 60, 0.5));
}
.chip.on-wheel::before { background: var(--teal); border-color: var(--teal); box-shadow: 0 0 6px var(--teal); }
.chip.absent { opacity: 0.55; }
.chip.absent:hover { opacity: 1; }
.chip.safe { color: var(--gold-1); border-color: var(--gold-3); background: rgba(200, 155, 60, 0.1); }
.chip.safe::before { background: var(--gold-3); border-color: var(--gold-3); }
.chip.out { color: #5b5a56; border-color: #2b2f33; background: rgba(30, 35, 40, 0.4); }
.chip.out span { text-decoration: line-through; }
.chip.out::before { border-color: #3c3c41; }
.chip.dragging { opacity: 0.4; }
.chip .tag {
  flex: none;
  padding: 2px 6px; /* same as the "sicher" switch, so both line up */
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-3);
}
.chip.out .tag { color: #6b6a66; }
.chip .icon {
  border: 0;
  border-image: none;
  background: none;
  padding: 2px 6px;
  font-size: 0.85rem;
  letter-spacing: 0;
  color: var(--gold-4);
  opacity: 0;
}
.chip .icon.word { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; }
.chip:hover .icon, .chip .icon:focus { opacity: 1; }
.chip .icon.word.active { opacity: 1; color: var(--gold-3); }
.chip .icon.word.active:hover { color: var(--gold-1); }
.chip .icon:hover { color: var(--gold-1); box-shadow: none; background: none; }
.chip .icon.x:hover { color: var(--danger); }

.empty { color: var(--gold-4); font-style: italic; padding: 4px 2px; }

.panel-actions { display: flex; gap: 8px; }
.panel-actions button { flex: 1; padding: 10px 8px; }

/* ---------- right column: game panel (top), emotes (bottom) ---------- */

.side { min-height: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.panel.game { min-height: 0; }

.emotes {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(9, 20, 40, 0.92), rgba(1, 10, 19, 0.92));
  border: 1px solid var(--gold-4);
  box-shadow: inset 0 0 0 3px rgba(1, 10, 19, 0.9), inset 0 0 0 4px var(--gold-5);
}
.emote-btn {
  flex: 1;
  max-width: 52px;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-image: none;
  border-radius: 50%;
  background: none;
  transition: transform 0.12s, filter 0.12s, opacity 0.2s;
}
.emote-btn img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.emote-btn:hover:not(:disabled) { transform: scale(1.15); box-shadow: none; background: none; filter: drop-shadow(0 0 6px rgba(200, 170, 110, 0.7)); }
.emote-btn:active:not(:disabled) { transform: scale(0.95); }
.emote-btn:disabled { opacity: 0.35; cursor: default; }

/* emotes popping up over the wheel */
.emote-layer { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.emote-pop {
  position: absolute;
  width: 24%;
  aspect-ratio: 1;
  translate: -50% -50%;
  animation: emote-out 0.6s ease-in 2.5s forwards;
}
.emote-pop img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation:
    emote-in 0.4s cubic-bezier(0.2, 1.6, 0.4, 1) both,
    emote-wobble 0.7s ease-in-out 0.4s 3;
}
@keyframes emote-in { from { scale: 0.2; } to { scale: 1; } }
@keyframes emote-wobble {
  0%, 100% { rotate: 0deg; translate: 0 0; }
  25% { rotate: calc(var(--tilt) * 9deg); translate: 0 -6%; }
  75% { rotate: calc(var(--tilt) * -9deg); translate: 0 -3%; }
}
@keyframes emote-out { to { opacity: 0; translate: -50% -80%; } }
@media (prefers-reduced-motion: reduce) {
  .emote-pop img { animation: none; }
}
#game-no { color: var(--gold-1); }
.game-info { margin: -4px 0 16px; font-size: 0.85rem; line-height: 1.5; }
.game-info strong { color: var(--teal); font-weight: 600; }
h3 {
  margin: 0 0 8px;
  font: 600 0.72rem var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-4);
}
/* padding keeps the rotated diamonds and their glow inside the scroll box, which would clip them */
.out-list { list-style: none; margin: -6px -10px 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.out-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 700 1.15rem var(--serif);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.out-list li::before {
  content: "";
  width: 11px;
  height: 11px;
  flex: none;
  transform: rotate(45deg);
  background: var(--c);
  box-shadow: 0 0 8px var(--c);
}
.out-list li { color: var(--c); }
.out-list .none { font: italic 0.85rem var(--sans); letter-spacing: 0; text-transform: none; color: var(--gold-4); }
.out-list .none::before { display: none; }

button.primary {
  width: 100%;
  padding: 12px;
  font-size: 0.85rem;
  color: var(--gold-1);
  background: linear-gradient(180deg, #0a323c, #06222a);
  border-image: linear-gradient(180deg, var(--teal), #005a82) 1;
}
button.primary:hover:not(:disabled) { background: linear-gradient(180deg, #0d4350, #082c36); box-shadow: 0 0 14px rgba(10, 200, 185, 0.4); }

/* ---------- wheel ---------- */

.wheel-area {
  min-height: 0;
  container-type: size;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}
.wheel-area.drag-over { border-color: var(--teal); background: rgba(10, 200, 185, 0.05); }

.wheel-wrap {
  position: relative;
  width: min(100cqw, 100cqh);
  height: min(100cqw, 100cqh);
  border-radius: 50%;
  box-shadow: 0 0 60px rgba(10, 200, 185, 0.22), 0 0 120px rgba(10, 200, 185, 0.08);
}

#wheel {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}
#wheel.grabbing { cursor: grabbing; }
#wheel.locked { cursor: default; }

/* result banner across the wheel */
.result {
  position: absolute;
  left: -4%;
  right: -4%;
  top: 50%;
  transform: translateY(-50%);
  padding: 16px 20px 18px;
  display: flex;
  flex-direction: column;
  align-items: center; /* each line only as wide as its text, so the glow line matches the words */
  text-align: center;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(1, 10, 19, 0.94) 14%, rgba(1, 10, 19, 0.94) 86%, transparent);
  border-top: 2px solid;
  border-bottom: 2px solid;
  border-image: linear-gradient(90deg, transparent, var(--gold-2) 20%, var(--gold-1) 50%, var(--gold-2) 80%, transparent) 1;
}
/* Announcer text styled after the in-game kill banner: heavy wedge serif in capitals,
   cream-to-gold gradient with a dark shadow, a thin glowing line underneath
   (blue for first blood, red for a fallen ally). */
.result .announce {
  position: relative;
  padding-bottom: 10px;
  font: 800 clamp(1.6rem, 6.4cqmin, 3.6rem) / 1.05 "Beaufort for LOL", Georgia, "DejaVu Serif", "Noto Serif Display", serif;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #fff6dc 0%, #f4e2b2 36%, #dcbc7c 66%, #b08c50 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.75)) drop-shadow(0 0 8px rgba(0, 0, 0, 0.6));
}
.result .announce.small { font-size: clamp(1.15rem, 4.4cqmin, 2.5rem); }
.result .announce::after {
  content: "";
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: 0;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #0b6fb5 18%, #3cc8ff 50%, #0b6fb5 82%, transparent);
  box-shadow: 0 0 10px rgba(60, 200, 255, 0.8);
}
.result .announce.small::after {
  background: linear-gradient(90deg, transparent, #8a1424 18%, #ff4a5e 50%, #8a1424 82%, transparent);
  box-shadow: 0 0 10px rgba(255, 74, 94, 0.8);
}
.result .whos { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 1.2em; margin-top: 10px; }
.result .who {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font: 700 clamp(1.1rem, 3.6cqmin, 2rem) / 1 var(--serif);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c);
  text-shadow: 0 0 12px var(--c);
}
.result .who::before {
  content: "";
  width: 0.55em;
  height: 0.55em;
  transform: rotate(45deg);
  background: var(--c);
  box-shadow: 0 0 10px var(--c);
}
.result .sub {
  display: block;
  margin-top: 6px;
  font: 600 clamp(0.7rem, 1.8cqmin, 0.95rem) var(--sans);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text);
}
.result[hidden] { display: none; }
.result.pop { animation: reveal 0.6s cubic-bezier(0.2, 1.3, 0.4, 1); }
@keyframes reveal {
  from { opacity: 0; transform: translateY(-50%) scaleX(0.3); }
  to { opacity: 1; transform: translateY(-50%) scaleX(1); }
}

/* ---------- crying Amumus when the birthday boy has to sit out ---------- */

.amumu-rain { position: fixed; inset: 0; z-index: 6; pointer-events: none; overflow: hidden; }
.amumu-rain img {
  position: absolute;
  top: 0;
  aspect-ratio: 1;
  translate: 0 -150px;
  animation-name: amumu-fall;
  animation-timing-function: cubic-bezier(0.35, 0, 0.75, 1); /* starts slow, speeds up like falling */
  animation-fill-mode: both;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45));
}
@keyframes amumu-fall {
  0% { translate: 0 -150px; rotate: var(--r0); }
  25% { translate: var(--sway) 22vh; }
  50% { translate: 0 50vh; rotate: var(--r1); }
  75% { translate: calc(var(--sway) * -1) 78vh; }
  100% { translate: 0 calc(100vh + 50px); rotate: var(--r0); }
}

/* ---------- statistics dialog ---------- */

.stats {
  width: min(760px, 94vw);
  max-height: 86vh;
  padding: 22px 24px;
  color: var(--text);
  background: linear-gradient(180deg, #0a1a30, var(--void));
  border: 1px solid var(--gold-4);
  box-shadow: inset 0 0 0 3px rgba(1, 10, 19, 0.9), inset 0 0 0 4px var(--gold-5), 0 20px 80px rgba(0, 0, 0, 0.7);
}
.stats[open] { display: flex; flex-direction: column; }
.stats::backdrop { background: rgba(1, 10, 19, 0.75); }
.stats-head { display: flex; align-items: center; justify-content: space-between; }
.stats-head h2 { margin: 0; font-size: 1.3rem; }
.stats-head button { padding: 6px 10px; }
.stats-note { font-size: 0.82rem; line-height: 1.5; margin: 12px 0 16px; }
.stats-note strong { color: var(--gold-2); }
.stats-note em { color: var(--gold-1); font-style: normal; }
.stats-scroll { overflow-y: auto; min-height: 0; }
.stats table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.stats th {
  position: sticky;
  top: 0;
  background: #0a1a30;
  text-align: right;
  padding: 8px 10px;
  font: 600 0.7rem var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-4);
  border-bottom: 1px solid var(--gold-5);
}
.stats td { padding: 8px 10px; text-align: right; border-bottom: 1px solid rgba(70, 55, 20, 0.4); font-variant-numeric: tabular-nums; }
.stats th:first-child, .stats td:first-child { text-align: left; }
.stats td:first-child { color: var(--gold-1); font-weight: 600; }
.stats td.coef { font-weight: 700; color: var(--gold-1); }
.stats td.verdict { white-space: nowrap; }
.stats .pech { color: #ff6b7d; }
.stats .glueck { color: var(--teal); }
.stats .normal { color: var(--text); }
.stats .verdict { opacity: 0.8; }
.stats .verdict.strong { opacity: 1; font-weight: 700; }
.stats .empty { text-align: center; font-style: italic; color: var(--gold-4); padding: 20px; }
.stats-raw { margin-top: 14px; align-self: flex-end; font-size: 0.8rem; color: var(--gold-3); }

/* ---------- "private page" (/privat) and the tiny logo leading there ---------- */

body.page { height: auto; min-height: 100dvh; overflow: auto; grid-template-rows: auto 1fr; }
.page-main { display: block; width: 100%; max-width: 760px; margin: 0 auto; }
.page-section { margin-bottom: 20px; line-height: 1.6; }
.page-section p { margin: 0 0 10px; }
.page-section ul { margin: 0; padding-left: 20px; }
.page-section li { margin-bottom: 8px; }
.page-section strong { color: var(--gold-1); }
.muted { color: var(--gold-4); font-size: 0.85rem; }
body.page .page-main { margin-top: 12vh; max-width: 420px; text-align: center; }
.logo-link { display: inline-flex; opacity: 0.6; transition: opacity 0.15s; }
.logo-link:hover { opacity: 1; }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 10;
  padding: 10px 20px;
  color: var(--gold-1);
  background: rgba(1, 10, 19, 0.95);
  border: 1px solid var(--danger);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}
.toast.info { border-color: var(--teal); }

/* ---------- small screens: stack and scroll ---------- */

@media (max-width: 900px) {
  body { height: auto; min-height: 100dvh; overflow: auto; grid-template-rows: auto auto; }
  header { padding: 12px 16px; }
  main { grid-template-columns: 1fr; padding: 16px; gap: 16px; align-content: start; }
  .wheel-area { order: -2; height: min(92vw, 72vh); }
  .side { order: -1; }
  .chips { max-height: 40vh; }
}
