/* =============================================================================
   Pokertimer – styles.css
   Klassisk pokertema: filtgrøn baggrund, guld/messing-accenter, cremefarvet
   tekst og mørke paneler med let læder- og glaseffekt.
   ============================================================================= */

/* ----- Designtokens -------------------------------------------------------- */
:root {
  --felt-1: #17603f;
  --felt-2: #0d3d2a;
  --felt-3: #06231a;

  --gold: #c9a35a;
  --gold-2: #e8cd8f;
  --gold-3: #8f6d34;
  --gold-line: rgba(201, 163, 90, 0.22);
  --gold-line-2: rgba(201, 163, 90, 0.42);
  --gold-glow: rgba(232, 205, 143, 0.18);

  --cream: #f3ead7;
  --cream-2: rgba(243, 234, 215, 0.74);
  --cream-3: rgba(243, 234, 215, 0.5);
  --cream-4: rgba(243, 234, 215, 0.14);

  --panel-a: rgba(26, 20, 15, 0.88);
  --panel-b: rgba(13, 10, 8, 0.92);
  --glass: rgba(12, 10, 8, 0.5);
  --input-bg: rgba(0, 0, 0, 0.28);

  --danger: #d77a63;
  --danger-bg: rgba(160, 60, 42, 0.32);
  --positive: #a6d2a1;

  --radius: 14px;
  --radius-sm: 9px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --left-w: 252px;
  --right-w: clamp(240px, 16.667vw, 460px);

  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Didot", "Bodoni 72", "Bodoni MT", "Playfair Display", "Cormorant Garamond", Cambria, Georgia, serif;
}

.app.left-collapsed { --left-w: 72px; }
.app.right-collapsed { --right-w: 84px; }

/* ----- Grundlæggende -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  color: var(--cream);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  background-color: var(--felt-3);
  /* Filt: lys midte, mørk vignet og en meget svag vævet tekstur */
  background-image:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.05) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse 70% 60% at 50% 42%, rgba(255, 255, 255, 0.07), transparent 70%),
    radial-gradient(ellipse at 50% 40%, var(--felt-1) 0%, var(--felt-2) 55%, var(--felt-3) 100%);
  background-attachment: fixed;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; opacity: 0.45; }

:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; border-radius: 6px; }

.ico { width: 20px; height: 20px; flex: none; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--cream-3); }
.small { font-size: 0.85em; }
.pos { color: var(--positive); }
.neg { color: var(--danger); }
.warn-text { color: var(--gold-2); }

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}

/* ----- Layout: tre zoner ---------------------------------------------------- */
.app {
  display: grid;
  grid-template-columns: var(--left-w) minmax(0, 1fr) var(--right-w);
  height: 100vh;
  height: 100dvh;
  transition: grid-template-columns 0.38s var(--ease);
}

/* Læder-panel */
.sidebar,
.players,
.slide-panel,
.modal {
  background:
    radial-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1.2px) 0 0 / 4px 4px,
    linear-gradient(180deg, var(--panel-a), var(--panel-b));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* ----- Venstre sidebar ------------------------------------------------------ */
.sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden auto;
  border-right: 1px solid var(--gold-line);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03), 10px 0 40px rgba(0, 0, 0, 0.25);
  padding: 16px 12px;
  z-index: 3;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 18px;
  border-bottom: 1px solid var(--gold-line);
  margin-bottom: 14px;
}
.brand-mark { color: var(--gold); }
.brand-mark .ico { width: 30px; height: 30px; }
.brand-name {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--gold-2);
  flex: 1;
  white-space: nowrap;
}

.nav-title {
  padding: 0 10px 8px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream-3);
}

.nav, .nav-bottom { display: flex; flex-direction: column; gap: 2px; }
.nav-bottom { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--gold-line); }

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--cream-2);
  text-align: left;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.nav-item:hover { background: rgba(201, 163, 90, 0.09); color: var(--cream); }
.nav-item.is-active {
  background: linear-gradient(90deg, rgba(201, 163, 90, 0.2), rgba(201, 163, 90, 0.05));
  color: var(--gold-2);
  box-shadow: inset 2px 0 0 var(--gold);
}
.nav-item.is-current::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}
.nav-label { transition: opacity 0.2s; }

/* Minimeret sidebar: kun ikoner */
.left-collapsed .sidebar { padding: 16px 10px; }
.left-collapsed .sidebar .nav-label { display: none; }
.left-collapsed .brand { flex-direction: column; gap: 12px; padding: 4px 0 14px; }
.left-collapsed .nav-item { justify-content: center; padding: 12px 0; }
.left-collapsed .nav-item.is-current::after { right: 4px; top: 8px; margin: 0; }

/* ----- Knapper -------------------------------------------------------------- */
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--cream-2);
  border: 1px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  flex: none;
}
.icon-btn:hover { background: rgba(201, 163, 90, 0.12); color: var(--gold-2); border-color: var(--gold-line); }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.sm .ico { width: 16px; height: 16px; }
.icon-btn.solid { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #1d160c; }
.icon-btn.solid:hover { filter: brightness(1.08); color: #1d160c; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s, filter 0.2s, transform 0.15s;
}
.btn .ico { width: 18px; height: 18px; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.wide { width: 100%; }

.btn-primary {
  background: linear-gradient(180deg, var(--gold-2), var(--gold) 60%, var(--gold-3));
  color: #1d160c;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary:hover { filter: brightness(1.07); }

.btn-ghost { border: 1px solid var(--gold-line-2); color: var(--cream); background: rgba(201, 163, 90, 0.06); }
.btn-ghost:hover:not(:disabled) { border-color: var(--gold); background: rgba(201, 163, 90, 0.14); color: var(--gold-2); }

.btn-danger { background: var(--danger-bg); border: 1px solid rgba(215, 122, 99, 0.55); color: #f6d6cc; }
.btn-danger:hover { background: rgba(180, 70, 50, 0.48); }

.btn-text { padding: 8px 10px; color: var(--gold-2); font-weight: 500; }
.btn-text:hover { color: var(--cream); }
.danger-text { color: var(--danger); }

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ----- Midten: uret --------------------------------------------------------- */
.center {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: clamp(14px, 2vh, 28px) clamp(16px, 3vw, 48px);
  container-type: inline-size;
  overflow: hidden auto;
}

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar-actions { display: flex; gap: 6px; }

.game-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  background: var(--glass);
  color: var(--gold-2);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.game-chip .ico { width: 18px; height: 18px; }

.clock-stage {
  /* Må aldrig klemmes mindre end indholdet – så overlapper intet; i værste fald scroller midten */
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(6px, 1.3vh, 20px);
  padding: 1.5vh 0;
}

.level-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; }
.level-chip {
  font-family: var(--font-display);
  font-size: clamp(20px, min(3.2cqw, 4.4vh), 46px);
  letter-spacing: 0.08em;
  color: var(--gold-2);
  padding: 0 0.6em;
  position: relative;
}
.level-chip::before,
.level-chip::after {
  content: "";
  position: absolute;
  top: 50%;
  width: clamp(24px, 5cqw, 80px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.level-chip::before { right: 100%; }
.level-chip::after { left: 100%; transform: scaleX(-1); }
.level-note {
  width: 100%;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cream-3);
}

.pause-flag {
  height: 0;
  overflow: visible;
  opacity: 0;
  transform: translateY(-6px);
  font-size: clamp(13px, min(1.6cqw, 2.4vh), 24px);
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.is-paused .pause-flag { opacity: 1; transform: none; height: auto; }

.clock {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(64px, min(25cqw, 29vh), 560px);
  line-height: 0.92;
  letter-spacing: 0.01em;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--cream);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), 0 0 60px var(--gold-glow);
  transition: opacity 0.4s, color 0.4s, text-shadow 0.4s;
}
.clock.clock-up { font-size: clamp(64px, min(16cqw, 26vh), 380px); }
/* Nedtælling før ny runde: en ring der tømmes, med sekundtallet i midten.
   Ser bevidst helt anderledes ud end rundens ur, så den ikke forveksles med det. */
.in-buffer .pause-flag {
  opacity: 1;
  transform: none;
  height: auto;
  font-size: clamp(16px, min(2.2cqw, 3.2vh), 34px);
  letter-spacing: 0.35em;
  color: var(--gold-2);
}
.buffer-ring {
  position: relative;
  width: clamp(150px, min(24cqw, 30vh), 380px);
  aspect-ratio: 1;
  animation: rise 0.4s var(--ease);
}
.buffer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: rgba(0, 0, 0, 0.32); stroke: rgba(201, 163, 90, 0.16); stroke-width: 6; }
.ring-fill {
  fill: none;
  stroke: var(--gold-2);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 8px rgba(232, 205, 143, 0.55));
  transition: stroke-dashoffset 0.25s linear;
}
.buffer-num {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.buffer-num span {
  font-family: var(--font-display);
  font-size: clamp(56px, min(10cqw, 13vh), 170px);
  color: var(--gold-2);
  font-variant-numeric: lining-nums tabular-nums;
  text-shadow: 0 0 40px rgba(232, 205, 143, 0.4);
}
.buffer-num small {
  margin-top: 4px;
  font-size: clamp(11px, min(1.2cqw, 1.7vh), 18px);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cream-3);
}
.is-paused .buffer-ring { opacity: 0.55; }
.buffer-label {
  margin-bottom: -0.6vh;
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
}
.in-buffer .blinds .blind-value { color: var(--gold-2); }
.setting-select { width: auto; min-width: 150px; }
.clock.is-warning { color: var(--gold-2); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), 0 0 70px rgba(232, 205, 143, 0.38); }
.is-paused .clock { opacity: 0.42; }
.clock-caption { font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--cream-3); margin-top: -0.5vh; }

.progress {
  width: min(78cqw, 980px);
  height: 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 0 1px rgba(201, 163, 90, 0.16);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-3), var(--gold), var(--gold-2));
  box-shadow: 0 0 12px rgba(232, 205, 143, 0.4);
  transition: width 0.25s linear;
}
.is-paused .progress-fill { opacity: 0.5; }

.blinds {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(14px, 3cqw, 56px);
  margin-top: 0.6vh;
}
.blind-label {
  font-size: clamp(11px, min(1.1cqw, 1.7vh), 18px);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cream-3);
  margin-bottom: 2px;
}
.blind-value {
  font-family: var(--font-display);
  font-size: clamp(28px, min(6.2cqw, 7.5vh), 150px);
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--cream);
}
.blind-sep {
  font-family: var(--font-display);
  font-size: clamp(24px, min(5cqw, 6vh), 110px);
  color: var(--gold-3);
  line-height: 1;
  padding-bottom: 0.08em;
}
.blind-ante { padding-left: clamp(14px, 3cqw, 56px); border-left: 1px solid var(--gold-line); }
.blind-ante .blind-value { color: var(--gold-2); font-size: clamp(22px, min(4.4cqw, 5.4vh), 110px); }
.blind-ante.is-empty .blind-value { color: var(--cream-4); }

.next-level {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 4px 12px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  background: var(--glass);
  font-size: clamp(14px, min(1.5cqw, 2.2vh), 26px);
  color: var(--cream-2);
}
.next-label { font-size: 0.72em; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.next-level strong { color: var(--cream); font-weight: 600; font-variant-numeric: tabular-nums; }

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.6cqw, 22px);
  margin-top: 1vh;
}
.ctrl-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 64px;
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  color: var(--cream-2);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s, background 0.2s;
}
.ctrl-btn .ico {
  width: clamp(38px, 5.2vh, 46px);
  height: clamp(38px, 5.2vh, 46px);
  padding: clamp(9px, 1.3vh, 12px);
  border-radius: 50%;
  border: 1px solid var(--gold-line-2);
  background: var(--glass);
  transition: border-color 0.2s, background 0.2s;
}
.ctrl-btn:hover { color: var(--gold-2); }
.ctrl-btn:hover .ico { border-color: var(--gold); background: rgba(201, 163, 90, 0.12); }

.play-btn {
  display: grid;
  place-items: center;
  width: clamp(64px, min(8cqw, 9.5vh), 120px);
  height: clamp(64px, min(8cqw, 9.5vh), 120px);
  border-radius: 50%;
  color: #1d160c;
  background: radial-gradient(circle at 35% 30%, var(--gold-2), var(--gold) 55%, var(--gold-3));
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 0 0 6px rgba(201, 163, 90, 0.12);
  transition: transform 0.2s var(--ease), box-shadow 0.3s, filter 0.2s;
}
.play-btn .ico { width: 42%; height: 42%; stroke-width: 1.6; }
.play-btn:not(.is-running) .ico { fill: #1d160c; margin-left: 6%; }
.play-btn:hover:not(:disabled) { transform: scale(1.04); filter: brightness(1.06); }
.play-btn.is-running { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 0 0 6px rgba(201, 163, 90, 0.2), 0 0 40px rgba(232, 205, 143, 0.25); }

.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1px;
  border-radius: var(--radius);
  border: 1px solid var(--gold-line);
  background: var(--gold-line);
  overflow: hidden;
  margin-top: 1vh;
}
.stat {
  flex: 1 1 140px;
  padding: clamp(10px, 1.4vh, 18px) 16px;
  background: rgba(10, 9, 7, 0.72);
  text-align: center;
}
.stat[data-action] { cursor: pointer; transition: background 0.2s; }
.stat[data-action]:hover { background: rgba(30, 24, 16, 0.85); }
.stat-label { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--cream-3); }
.stat-value {
  font-family: var(--font-display);
  font-size: clamp(20px, min(2.4cqw, 3.4vh), 44px);
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--cream);
  white-space: nowrap;
}
.stat-sub { font-size: 0.6em; color: var(--cream-3); }

/* Vinder-banner */
.winner-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px 14px 20px;
  border: 1px solid var(--gold-line-2);
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(201, 163, 90, 0.18), rgba(10, 9, 7, 0.6));
  text-align: left;
  animation: rise 0.5s var(--ease);
}
.winner-banner > .ico { width: 36px; height: 36px; color: var(--gold-2); }
.winner-name { font-family: var(--font-display); font-size: 26px; color: var(--cream); }

/* Tomt udgangspunkt */
.clock-stage.idle { gap: 18px; }
.idle-mark { color: var(--gold); opacity: 0.85; }
.idle-mark .ico { width: 84px; height: 84px; stroke-width: 1; }
.idle-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, min(7cqw, 10vh), 110px);
  letter-spacing: 0.02em;
  color: var(--cream);
}
.idle-text { max-width: 560px; margin: 0; color: var(--cream-2); font-size: 16px; }
.idle-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 6px; }

/* ----- Højre panel: spillere ------------------------------------------------ */
.players {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-left: 1px solid var(--gold-line);
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.03), -10px 0 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  z-index: 3;
}

.players-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 18px 14px 12px 18px;
}
.players-head.compact { justify-content: center; padding: 16px 0 10px; }
.players-count { font-family: var(--font-display); font-size: 30px; line-height: 1.1; }
.players-count span { font-size: 0.6em; color: var(--cream-3); }

.add-player {
  display: flex;
  gap: 8px;
  padding: 0 14px 14px 18px;
  border-bottom: 1px solid var(--gold-line);
}
.add-player input { flex: 1; min-width: 0; }

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold-line);
  background: var(--input-bg);
  color: var(--cream);
  transition: border-color 0.2s, background 0.2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); background: rgba(0, 0, 0, 0.38); }
input::placeholder { color: var(--cream-3); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
select option { background: #1a140f; color: var(--cream); }
input[type="number"] { font-variant-numeric: tabular-nums; }

.player-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  align-content: start;
  gap: 14px 6px;
  padding: 16px 12px 24px;
}
.empty { grid-column: 1 / -1; color: var(--cream-3); font-size: 14px; text-align: center; margin: 24px 8px; }

.player { position: relative; transition: opacity 0.3s; }
.player-main {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px 8px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}
.player-main:hover { background: rgba(201, 163, 90, 0.07); }
.player.is-selected .player-main { border-color: var(--gold-line-2); background: rgba(201, 163, 90, 0.1); }
.player.is-out { opacity: 0.42; }
.player.is-out .avatar { filter: grayscale(0.85); }

.avatar-wrap { position: relative; display: inline-block; }
.avatar {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.04em;
  color: var(--cream);
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 70%, white 18%), var(--c) 60%, color-mix(in srgb, var(--c) 70%, black));
  box-shadow: 0 0 0 2px rgba(201, 163, 90, 0.55), 0 0 0 5px rgba(0, 0, 0, 0.35), 0 6px 16px rgba(0, 0, 0, 0.4);
  flex: none;
}
.avatar.sm { width: 40px; height: 40px; font-size: 14px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }

.player-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 500;
}
.player-meta { font-size: 12px; color: var(--cream-3); font-variant-numeric: tabular-nums; }
.player-claimed {
  display: block;
  max-width: 100%;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--gold);
}

.badge {
  position: absolute;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}
/* Bounty sidder "på hovedet" af spilleren */
.badge-bounty {
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #1d160c;
  border: 1px solid #f5e2b3;
}
.badge-rebuy { bottom: -4px; left: -10px; background: #23324a; color: #cfe0ff; border: 1px solid rgba(207, 224, 255, 0.35); }
.badge-place { bottom: -4px; right: -10px; background: #191410; color: var(--cream-2); border: 1px solid var(--gold-line-2); }
.badge-place.is-winner { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #1d160c; }

.player-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--cream-3);
  opacity: 0;
  transition: opacity 0.2s, color 0.2s, background 0.2s;
}
.player-remove .ico { width: 14px; height: 14px; }
.player:hover .player-remove,
.player-remove:focus-visible { opacity: 1; }
.player-remove:hover { color: var(--danger); background: rgba(0, 0, 0, 0.4); }

/* Minimeret spillerpanel: kun små avatarer */
.mini-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 8px 0 20px;
}
.mini-player { border-radius: 50%; transition: opacity 0.3s, transform 0.2s; }
.mini-player:hover { transform: scale(1.06); }
.mini-player.is-out { opacity: 0.38; filter: grayscale(0.8); }
.mini-player.is-selected .avatar { box-shadow: 0 0 0 2px var(--gold-2), 0 0 0 5px rgba(201, 163, 90, 0.3); }
.mini-add {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px dashed var(--gold-line-2);
  color: var(--gold);
}
.mini-add:hover { border-color: var(--gold); background: rgba(201, 163, 90, 0.1); }

/* ----- Glidende paneler (opsætning og spillerdetaljer) ---------------------- */
.slide-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--gold-line);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.38s var(--ease), opacity 0.3s var(--ease), visibility 0s linear 0.38s, left 0.38s var(--ease), right 0.38s var(--ease);
}
.slide-panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: transform 0.38s var(--ease), opacity 0.3s var(--ease), visibility 0s, left 0.38s var(--ease), right 0.38s var(--ease);
}
.slide-left {
  left: var(--left-w);
  width: min(640px, calc(100vw - var(--left-w)));
  transform: translateX(-32px);
  border-left: 0;
}
.slide-right {
  right: var(--right-w);
  width: min(380px, 100vw);
  transform: translateX(32px);
  border-right: 0;
}

/* Gør panelernes position korrekt når sidebar/spillerpanel minimeres */
body:has(.app.left-collapsed) .slide-left { left: 72px; }
body:has(.app.right-collapsed) .slide-right { right: 84px; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 16px 22px;
  border-bottom: 1px solid var(--gold-line);
}
.panel-title { display: flex; align-items: center; gap: 14px; }
.panel-title h2 { margin: 2px 0 0; font-family: var(--font-display); font-weight: 400; font-size: 26px; }
.panel-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--gold-line-2);
  color: var(--gold-2);
  background: var(--glass);
}
.panel-body { flex: 1; overflow-y: auto; padding: 18px 22px 26px; }

.panel-head-actions { display: flex; gap: 4px; }
.info-btn.is-active { background: rgba(201, 163, 90, 0.18); color: var(--gold-2); border-color: var(--gold-line-2); }

/* Vend-effekt: opsætning på forsiden, guide på bagsiden */
.flip { position: relative; flex: 1; min-height: 0; perspective: 1800px; }
.flip-face {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transition: transform 0.6s var(--ease), opacity 0.6s var(--ease);
}
.flip-front { transform: rotateY(0deg); }
.flip-back { transform: rotateY(180deg); opacity: 0; pointer-events: none; }
.flip.is-flipped .flip-front { transform: rotateY(-180deg); opacity: 0; pointer-events: none; }
.flip.is-flipped .flip-back { transform: rotateY(0deg); opacity: 1; pointer-events: auto; }

.info-title { margin: 4px 0 6px; font-family: var(--font-display); font-weight: 400; font-size: 30px; }
.info-rules { margin: 18px 0; padding: 0; list-style: none; counter-reset: rule; display: flex; flex-direction: column; gap: 12px; }
.info-rules li {
  counter-increment: rule;
  position: relative;
  padding: 12px 14px 12px 52px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold-line);
  background: var(--glass);
  color: var(--cream);
}
.info-rules li::before {
  content: counter(rule);
  position: absolute;
  left: 14px;
  top: 11px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold-line-2);
  color: var(--gold-2);
  font-family: var(--font-display);
  font-size: 15px;
}
.info-good {
  margin: 0 0 20px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--gold);
  background: linear-gradient(90deg, rgba(201, 163, 90, 0.14), transparent);
}
.info-good p { margin: 4px 0 0; color: var(--cream-2); }
.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px 16px 22px;
  border-top: 1px solid var(--gold-line);
  background: rgba(0, 0, 0, 0.25);
}
.foot-note { font-size: 13px; color: var(--cream-3); }
.lead { margin: 0 0 6px; color: var(--cream-2); }

.section { padding: 16px 0 6px; }
.section + .section { border-top: 1px solid var(--gold-line); margin-top: 12px; }
.section-title {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; margin-bottom: 12px; }
.field-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label { font-size: 12px; color: var(--cream-2); letter-spacing: 0.02em; }
.field-hint { font-size: 12px; color: var(--cream-3); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap input { padding-right: 56px; }
.input-wrap .unit {
  position: absolute;
  right: 12px;
  font-size: 12px;
  color: var(--cream-3);
  pointer-events: none;
}
.input-wrap.small { width: 110px; }
.input-wrap.small input { padding-right: 30px; }

.segmented {
  display: inline-flex;
  padding: 3px;
  margin-bottom: 14px;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  background: var(--input-bg);
}
.segmented button {
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--cream-2);
  transition: background 0.2s, color 0.2s;
}
.segmented button.is-active { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #1d160c; font-weight: 600; }

.preset-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.preset {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold-line);
  background: var(--glass);
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}
.preset:hover { border-color: var(--gold-line-2); }
.preset.is-active { border-color: var(--gold); background: rgba(201, 163, 90, 0.14); }
.preset-name { font-weight: 600; font-size: 13px; }
.preset-range { font-size: 12px; color: var(--cream-3); }

/* Fordeling af buy-in mellem præmiepulje og bounty */
.share-title { margin-top: 20px; }
.share-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
@media (max-width: 560px) { .share-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Sprogvalg (velkomstdialog) */
.lang-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.lang-option { flex-direction: row; justify-content: space-between; align-items: center; padding: 12px 14px; }
.lang-option .preset-name { font-size: 15px; }
.split {
  margin: 2px 0 18px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold-line);
  background: var(--glass);
}
.split-total { font-size: 14px; color: var(--cream-2); }
.split-total strong { color: var(--cream); font-size: 16px; }
.split-bar { display: flex; gap: 3px; height: 10px; margin: 10px 0; border-radius: 999px; overflow: hidden; }
.split-prize { background: linear-gradient(90deg, #3d8a63, #5aa77d); }
.split-bounty { background: linear-gradient(90deg, var(--gold-3), var(--gold-2)); }
.split-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--cream-2); }
.split-legend span { display: inline-flex; align-items: center; gap: 8px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot-prize { background: #5aa77d; }
.dot-bounty { background: var(--gold-2); }

/* Valgkort (fx bounty-type) */
.choice-title { margin: 4px 0 8px; }
.choice-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold-line);
  background: var(--glass);
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}
.choice:hover { border-color: var(--gold-line-2); }
.choice.is-active { border-color: var(--gold); background: rgba(201, 163, 90, 0.14); }
.choice-radio {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  border: 1px solid var(--gold-line-2);
  display: grid;
  place-items: center;
}
.choice.is-active .choice-radio { border-color: var(--gold); }
.choice.is-active .choice-radio::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold-2);
}
.choice-body { display: flex; flex-direction: column; gap: 2px; }
.choice-name { font-weight: 600; font-size: 14px; }
.choice-text { font-size: 13px; color: var(--cream-2); }

.struct-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 14px 0 10px;
  font-size: 13px;
  color: var(--cream-2);
}
.struct-summary strong { color: var(--gold-2); font-weight: 600; }

.table-scroll {
  max-height: 340px;
  overflow: auto;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
}
.modal .table-scroll { max-height: 56vh; }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 8px;
  background: #17120d;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cream-3);
  font-weight: 600;
  text-align: left;
  border-bottom: 1px solid var(--gold-line);
}
td { padding: 4px 6px; border-bottom: 1px solid rgba(201, 163, 90, 0.08); }
.struct td input { padding: 6px 8px; border-color: transparent; background: transparent; }
.struct td input:hover { border-color: var(--gold-line); }
.struct td input:focus { border-color: var(--gold); background: rgba(0, 0, 0, 0.35); }
.struct tr.is-current td { background: rgba(201, 163, 90, 0.16); }
.struct tr.is-current .lvl-no { color: var(--gold-2); font-weight: 700; }
.struct tr.is-past { opacity: 0.5; }
.lvl-no { width: 52px; padding-left: 12px; color: var(--cream-3); }
.row-actions { width: 72px; white-space: nowrap; text-align: right; }
.row-actions .icon-btn { opacity: 0.55; }
tr:hover .row-actions .icon-btn { opacity: 1; }

.templates { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--gold-line); display: flex; flex-direction: column; gap: 8px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input, .inline-form select { flex: 1; min-width: 0; }

/* Spillerdetaljer */
.player-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.name-input {
  border: 1px solid transparent !important;
  background: transparent !important;
  padding: 2px 6px !important;
  margin-left: -6px;
  font-family: var(--font-display);
  font-size: 24px !important;
}
.name-input:hover { border-color: var(--gold-line) !important; }
.name-input:focus { border-color: var(--gold) !important; background: rgba(0, 0, 0, 0.3) !important; }
.player-status { font-size: 13px; color: var(--gold); padding-left: 1px; }

.dstats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dstat { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--gold-line); background: var(--glass); }
.dstat-label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cream-3); }
.dstat-value { font-family: var(--font-display); font-size: 22px; font-variant-numeric: lining-nums tabular-nums; }
.dsection { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.dsection h4 { margin: 0; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.dsection.subtle { padding-top: 16px; border-top: 1px solid var(--gold-line); align-items: flex-start; }
.dnote { margin: 0; font-size: 13px; color: var(--cream-3); }
.buy-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--gold-line); border-radius: var(--radius-sm); overflow: hidden; }
.buy-list li { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-bottom: 1px solid rgba(201, 163, 90, 0.08); }
.buy-list li:last-child { border-bottom: 0; }
.buy-list li span { flex: 1; color: var(--cream-2); }

/* ----- Dialoger ------------------------------------------------------------- */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
  visibility: hidden;
}
.modal-root.is-open { pointer-events: auto; visibility: visible; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 12, 8, 0.62);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  border: 1px solid var(--gold-line-2);
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.modal-sm { width: min(520px, 100%); }
.modal-lg { width: min(920px, 100%); }
.modal-root.is-open .modal-backdrop { opacity: 1; }
.modal-root.is-open .modal { opacity: 1; transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 14px 24px; border-bottom: 1px solid var(--gold-line); }
.modal-head h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 26px; }
.modal-body { overflow-y: auto; padding: 18px 24px 24px; }
.modal-body > p:first-child { margin-top: 0; }
.modal-body .section-title { margin-top: 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--gold-line); background: rgba(0, 0, 0, 0.25); border-radius: 0 0 18px 18px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--gold-line); background: var(--gold-line); }
.tiles .stat-value { font-size: 26px; }

table.data { border: 1px solid var(--gold-line); border-radius: var(--radius-sm); border-collapse: separate; border-spacing: 0; overflow: hidden; margin-top: 4px; }
table.data td { padding: 9px 12px; }
table.data th { padding: 9px 12px; position: static; }
table.data tfoot td { border-bottom: 0; border-top: 1px solid var(--gold-line); color: var(--cream-2); font-weight: 600; background: rgba(0, 0, 0, 0.2); }
table.data tr.is-winner td { background: rgba(201, 163, 90, 0.12); }
.num { text-align: right; white-space: nowrap; }
th.num { text-align: right; }

.tier-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tier-tabs button {
  position: relative;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  font-size: 13px;
  color: var(--cream-2);
  transition: border-color 0.2s, background 0.2s;
}
.tier-tabs button:hover { border-color: var(--gold-line-2); }
.tier-tabs button.is-active { border-color: var(--gold); background: rgba(201, 163, 90, 0.16); color: var(--gold-2); }
.tab-dot { display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-radius: 50%; background: var(--positive); vertical-align: middle; }
.payout-table td { padding: 6px 12px; }

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(215, 122, 99, 0.5);
  background: var(--danger-bg);
  color: #f6d6cc;
  font-size: 14px;
}
.alert.soft { border-color: var(--gold-line-2); background: rgba(201, 163, 90, 0.1); color: var(--cream-2); }
.alert .ico { margin-top: 1px; color: inherit; }

.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; color: var(--cream-2); }
.check input { width: 16px; height: 16px; accent-color: var(--gold); }

.winner-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--gold-line-2);
  background: linear-gradient(90deg, rgba(201, 163, 90, 0.2), rgba(0, 0, 0, 0.2));
}

.text-export { margin-top: 16px; }
.text-export summary { cursor: pointer; color: var(--gold-2); font-size: 14px; }
.text-export textarea { margin-top: 10px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; resize: vertical; }

/* Indstillinger */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--gold-line);
}
.setting-row .grow { flex: 1; }
.setting-row.compact { padding: 4px 0 14px; border-bottom: 0; }
.setting-title { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.setting-title .ico { width: 18px; height: 18px; color: var(--gold); }
.setting-sub { font-size: 13px; color: var(--cream-3); }

.switch { position: relative; width: 46px; height: 26px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--gold-line-2);
  transition: background 0.25s;
  pointer-events: none;
}
.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cream-2);
  transition: transform 0.25s var(--ease), background 0.25s;
}
.switch input:checked + span { background: rgba(201, 163, 90, 0.4); }
.switch input:checked + span::after { transform: translateX(20px); background: var(--gold-2); }
.switch input:focus-visible + span { outline: 2px solid var(--gold-2); outline-offset: 2px; }

.range { width: 100%; margin-top: 10px; accent-color: var(--gold); }

.shortcuts { padding-top: 16px; }
.shortcuts dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 12px 0 0; font-size: 14px; }
.shortcuts dt { white-space: nowrap; }
.shortcuts dd { margin: 0; color: var(--cream-2); }
kbd {
  display: inline-block;
  min-width: 26px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--gold-line-2);
  border-bottom-width: 2px;
  background: rgba(0, 0, 0, 0.35);
  font-family: var(--font-ui);
  font-size: 12px;
  text-align: center;
}

/* ----- Indløs bounty -------------------------------------------------------- */
.badge-bounty.is-hidden { min-width: 20px; padding: 0; font-family: var(--font-display); font-size: 13px; }

.pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 6px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--gold-line);
  background: var(--glass);
  min-width: 0;
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
}
/* Duellen øverst i "Indløs bounty" */
.pick-duel { margin: 2px 0 18px; }
.avatar-empty {
  background: rgba(0, 0, 0, 0.3) !important;
  color: var(--gold-2) !important;
  font-family: var(--font-display);
  font-size: 28px !important;
  box-shadow: 0 0 0 2px var(--gold), 0 0 0 5px rgba(201, 163, 90, 0.2) !important;
  border: 0;
  animation: pulse-ring 1.6s ease-in-out infinite;
}
@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 2px var(--gold), 0 0 0 5px rgba(201, 163, 90, 0.2); }
  50% { box-shadow: 0 0 0 2px var(--gold-2), 0 0 0 10px rgba(201, 163, 90, 0.08); }
}
.pick-instruction {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, rgba(201, 163, 90, 0.16), transparent);
  font-size: 15px;
  color: var(--cream);
}
.pick-instruction strong { color: var(--gold-2); }
.pick-note { font-size: 11px; color: var(--cream-3); margin-top: -4px; }
.pick:hover { border-color: var(--gold-line-2); transform: translateY(-2px); }
.pick.is-selected { border-color: var(--gold); background: rgba(201, 163, 90, 0.18); }
.pick.is-selected .avatar { box-shadow: 0 0 0 2px var(--gold-2), 0 0 0 5px rgba(201, 163, 90, 0.35), 0 6px 16px rgba(0, 0, 0, 0.4); }

.reveal { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 6px 0 4px; text-align: center; }
.reveal-duel { display: flex; align-items: center; justify-content: center; gap: 18px; }
.reveal-player { display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 500; max-width: 130px; }
.reveal-player span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.reveal-player.is-out .avatar { filter: grayscale(0.85); opacity: 0.6; }
.reveal-vs { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }

.reveal-card { width: min(320px, 100%); height: 190px; perspective: 1000px; }
.reveal-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.9s var(--ease);
  animation: sealed 1.5s ease-in-out;
}
.reveal.is-revealed .reveal-inner { transform: rotateY(180deg); animation: none; }
.reveal-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 18px;
  border: 1px solid var(--gold-line-2);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.reveal-back {
  color: var(--gold-2);
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  background:
    repeating-linear-gradient(45deg, rgba(201, 163, 90, 0.07) 0 6px, transparent 6px 12px),
    radial-gradient(circle at 50% 40%, #23402f, #0f2419);
}
.reveal-back .ico { width: 64px; height: 64px; stroke-width: 1.1; }
.reveal-front {
  transform: rotateY(180deg);
  background: radial-gradient(circle at 50% 30%, rgba(232, 205, 143, 0.28), rgba(20, 16, 11, 0.95) 70%);
  padding: 16px;
}
.reveal-amount {
  font-family: var(--font-display);
  font-size: 56px;
  line-height: 1;
  color: var(--gold-2);
  font-variant-numeric: lining-nums tabular-nums;
  text-shadow: 0 0 30px rgba(232, 205, 143, 0.4);
}
.reveal-sub { font-size: 13px; color: var(--cream-2); }
.reveal-caption { margin: 0; font-size: 14px; color: var(--cream-3); }

@keyframes sealed {
  0%, 100% { transform: rotateY(0) scale(1); }
  20% { transform: rotateY(-8deg) scale(1.02); }
  40% { transform: rotateY(8deg) scale(1.02); }
  60% { transform: rotateY(-5deg) scale(1.03); }
  80% { transform: rotateY(5deg) scale(1.03); }
}

/* ----- Toast ---------------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 60;
  max-width: min(640px, calc(100vw - 32px));
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid var(--gold-line-2);
  background: rgba(15, 12, 9, 0.94);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  color: var(--cream);
  font-size: 14px;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  pointer-events: none;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ----- Scrollbars ----------------------------------------------------------- */
* { scrollbar-width: thin; scrollbar-color: rgba(201, 163, 90, 0.3) transparent; }

/* ----- Responsivt ----------------------------------------------------------- */

/* Store skærme / TV: lidt større brødtekst og avatarer */
@media (min-width: 2200px) {
  body { font-size: 17px; }
  .avatar { width: 72px; height: 72px; font-size: 23px; }
  .player-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .player-name { font-size: 16px; }
  .ctrl-btn .ico { width: 58px; height: 58px; padding: 15px; }
  .ctrl-btn { font-size: 13px; }
}

/* Mindre skærme (fx smalt browservindue): sidebar viser kun ikoner, spillerpanel under uret.
   Gælder ikke telefoner på langs – de har deres egen kompakte visning længere nede. */
@media (max-width: 900px) and (min-height: 561px) {
  body { overflow: auto; }
  .app,
  .app.left-collapsed,
  .app.right-collapsed {
    --left-w: 64px;
    grid-template-columns: 64px minmax(0, 1fr);
    grid-template-rows: minmax(100dvh, auto) auto;
    height: auto;
  }
  .sidebar { position: sticky; top: 0; height: 100dvh; grid-row: 1 / span 2; padding: 14px 8px; }
  .sidebar .nav-label { display: none; }
  .brand { flex-direction: column; gap: 12px; padding: 4px 0 14px; }
  .brand .collapse-btn { display: none; }
  .nav-item { justify-content: center; padding: 12px 0; }
  .players { grid-column: 2; border-left: 0; border-top: 1px solid var(--gold-line); max-height: none; }
  .players .collapse-btn { display: none; }
  .player-grid { overflow: visible; }
  .mini-list { flex-direction: row; flex-wrap: wrap; justify-content: center; padding: 12px; }
  .slide-left,
  body:has(.app.left-collapsed) .slide-left { left: 64px; width: calc(100vw - 64px); }
  .slide-right,
  body:has(.app.right-collapsed) .slide-right { right: 0; width: min(400px, calc(100vw - 64px)); }
  .controls { flex-wrap: wrap; }
}

@media (max-width: 560px) {
  .center { padding: 12px; }
  .field-grid, .field-grid.three { grid-template-columns: 1fr; }
  .preset-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .controls { flex-wrap: nowrap; gap: 6px; }
  .ctrl-btn { min-width: 0; padding: 4px 2px; }
  .ctrl-btn .ico { width: 40px; height: 40px; padding: 10px; }
  .ctrl-btn span { display: none; }
  .play-btn { width: 64px; height: 64px; }
  .clock { font-size: clamp(64px, 30cqw, 140px); }
  .blind-ante { padding-left: 14px; }
  .modal-root { padding: 10px; }
  .modal-body { padding: 14px 16px 20px; }
  .panel-foot { flex-direction: column; align-items: stretch; }
}

/* ----- Telefon på langs (lav skærmhøjde) ------------------------------------
   Uret til venstre, blinds og knapper til højre, smalle sidepaneler. */
.stage-main, .stage-side { display: contents; }

@media (orientation: landscape) and (max-height: 560px) {
  body { overflow: hidden; }
  .app,
  .app.left-collapsed,
  .app.right-collapsed {
    --left-w: 56px;
    --right-w: 64px;
    grid-template-columns:
      calc(56px + env(safe-area-inset-left)) minmax(0, 1fr) calc(64px + env(safe-area-inset-right));
  }

  /* Sidebar: kun ikoner */
  .sidebar { padding: 8px 6px; padding-left: calc(6px + env(safe-area-inset-left)); }
  .sidebar .nav-label,
  .brand .collapse-btn { display: none; }
  .brand { flex-direction: column; gap: 6px; padding: 0 0 8px; margin-bottom: 6px; }
  .brand-mark .ico { width: 24px; height: 24px; }
  .nav-item { justify-content: center; padding: 5px 0; }
  .nav-item .ico { width: 18px; height: 18px; }
  .nav-bottom { padding-top: 4px; }

  /* Spillerpanel: kun små avatarer */
  .players { padding-right: env(safe-area-inset-right); }
  .players .collapse-btn { display: none; }
  .players-head.compact { padding: 6px 0 2px; }
  .mini-list { gap: 8px; padding: 6px 0 12px; }
  .avatar.sm,
  .mini-add { width: 36px; height: 36px; font-size: 13px; }

  /* Midten: to kolonner */
  .center { padding: 8px 14px 10px; }
  .topbar .icon-btn { width: 32px; height: 32px; }
  .game-chip { padding: 4px 12px 4px 10px; font-size: 11px; }
  /* Altid to kolonner side om side (grid ombryder ikke som flex-wrap gør) */
  .clock-stage {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: center;
    align-content: center;
    align-items: center;
    gap: 6px 3cqw;
    padding: 4px 0;
  }
  .clock-stage.idle { display: flex; flex-direction: column; gap: 8px; }
  .stage-main,
  .stage-side { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
  .winner-banner { grid-column: 1 / -1; justify-content: center; padding: 6px 12px; gap: 10px; }
  .winner-name { font-size: 18px; }

  .level-chip { font-size: 18px; }
  .level-chip::before,
  .level-chip::after { width: 20px; }
  .level-note { font-size: 10px; }
  .pause-flag { font-size: 11px; }
  .in-buffer .pause-flag { font-size: 13px; }
  .clock { font-size: clamp(52px, min(15cqw, 34vh), 220px); }
  .clock.clock-up { font-size: clamp(40px, min(10cqw, 26vh), 180px); }
  .progress { width: min(36cqw, 420px); }
  .buffer-ring { width: clamp(100px, 32vh, 180px); }
  .buffer-num span { font-size: clamp(38px, 12vh, 80px); }
  .buffer-skip { padding: 6px 12px; font-size: 13px; }

  .blinds { gap: 14px; margin-top: 0; }
  .blind-label { font-size: 10px; letter-spacing: 0.14em; }
  .blind-value { font-size: clamp(24px, 9vh, 48px); }
  .blind-sep { font-size: clamp(20px, 7vh, 38px); }
  .blind-ante { padding-left: 14px; }
  .blind-ante .blind-value { font-size: clamp(18px, 6.5vh, 34px); }
  .next-level { font-size: 12px; padding: 5px 12px; }

  .controls { gap: 6px; margin-top: 2px; flex-wrap: nowrap; }
  .ctrl-btn { min-width: 0; padding: 2px; }
  .ctrl-btn span { display: none; }
  .ctrl-btn .ico { width: 38px; height: 38px; padding: 9px; }
  .play-btn { width: 56px; height: 56px; }

  .stats { margin-top: 4px; flex-wrap: nowrap; }
  .stat { flex: 1 1 0; min-width: 0; padding: 5px 8px; }
  .stat-label { font-size: 9px; letter-spacing: 0.1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .stat-value { font-size: clamp(14px, 4.6vh, 22px); }

  .idle-mark .ico { width: 48px; height: 48px; }
  .idle-title { font-size: 36px; }
  .idle-text { font-size: 14px; }

  /* Glidende paneler og dialoger */
  .slide-left,
  body:has(.app.left-collapsed) .slide-left {
    left: calc(56px + env(safe-area-inset-left));
    width: calc(100vw - 56px - env(safe-area-inset-left));
  }
  .slide-right,
  body:has(.app.right-collapsed) .slide-right {
    right: calc(64px + env(safe-area-inset-right));
    width: min(380px, calc(100vw - 130px));
  }
  .panel-head { padding: 10px 14px; }
  .panel-title h2 { font-size: 20px; }
  .panel-icon { width: 36px; height: 36px; }
  .panel-body { padding: 12px 16px 18px; }
  .panel-foot { padding: 8px 14px; }
  .modal-root { padding: 8px; }
  .modal { max-height: calc(100dvh - 16px); }
  .modal-head { padding: 10px 14px 8px 18px; }
  .modal-head h2 { font-size: 20px; }
  .modal-body { padding: 12px 18px 16px; }
  .reveal-card { height: 140px; }
  .reveal-amount { font-size: 40px; }
  .toast { bottom: 10px; }
}

.add-player.in-modal { padding: 0; border: 0; margin-bottom: 8px; }

/* ----- Berøringsskærme ------------------------------------------------------ */
button,
.stat[data-action] { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

@media (hover: none) {
  /* Knapper der ellers kun vises ved mus-over, skal altid kunne ses */
  .player-remove,
  .row-actions .icon-btn { opacity: 1; }
}

@media (pointer: coarse) {
  /* Mindst 16px forhindrer, at iPhone zoomer ind, når man trykker i et felt */
  input, select, textarea { font-size: 16px; }
}

/* ----- Højkant på iPad/telefon: bed om at vende skærmen --------------------- */
.rotate-notice { display: none; }

@media (orientation: portrait) and (pointer: coarse) {
  .rotate-notice {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px;
    text-align: center;
    color: var(--cream);
    background: radial-gradient(ellipse at 50% 40%, var(--felt-1) 0%, var(--felt-2) 55%, var(--felt-3) 100%);
  }
  .rotate-icon { width: 96px; height: 96px; color: var(--gold); animation: rotate-hint 2.6s ease-in-out infinite; }
  .rotate-notice h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 34px; }
  .rotate-notice p { margin: 0; max-width: 320px; color: var(--cream-2); }
  .app,
  .slide-panel,
  .modal-root,
  .toast { visibility: hidden !important; }
}

@keyframes rotate-hint {
  0%, 20% { transform: rotate(0deg); }
  50%, 75% { transform: rotate(90deg); } /* med uret – samme vej som pilen */
  100% { transform: rotate(0deg); }
}

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