/* ========================================================================
   DPH Flow — Casino Croupier Performance App
   Tablet-first prototype (820 × 1180 portrait)
   ======================================================================== */

:root {
  /* Theme: IGD Dark (default) — IGD purple + charcoal */
  --bg-deep: #18171c;
  --bg-felt: #232227;
  --bg-card: #2d2c33;
  --bg-card-2: #383740;
  --line: #45444f;
  --line-soft: rgba(143, 95, 191, 0.15);

  --ink: #f3f1ef;
  --ink-soft: #c5c2c9;
  --ink-mute: #8a8691;

  --gold: #8f5fbf;             /* IGD purple */
  --gold-bright: #a780d1;
  --gold-deep: #5e2d91;
  --gold-rgb: 143, 95, 191;
  --ink-on-accent: #ffffff;

  --good: #6dc18c;
  --warn: #e8b250;
  --bad: #e86b5e;

  --accent: var(--gold);

  /* Type */
  --font-display: "Manrope", -apple-system, system-ui, sans-serif;
  --font-sans: "Manrope", -apple-system, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset,
                 0 18px 40px -22px rgba(0, 0, 0, 0.6);
}

/* Theme: IGD Light — professional consulting */
[data-theme="igd-light"] {
  --bg-deep: #f3f2f5;
  --bg-felt: #eeedf1;
  --bg-card: #ffffff;
  --bg-card-2: #f7f6fa;
  --line: #e2dfe7;
  --line-soft: rgba(94, 45, 145, 0.10);

  --ink: #2c2b30;
  --ink-soft: #5b5963;
  --ink-mute: #8a8691;

  --gold: #5e2d91;
  --gold-bright: #8f5fbf;
  --gold-deep: #3e1d63;
  --gold-rgb: 94, 45, 145;
  --ink-on-accent: #ffffff;

  --good: #2e8c54;
  --warn: #c98322;
  --bad: #c44a3e;

  --shadow-card: 0 1px 0 rgba(255, 255, 255, 1) inset,
                 0 10px 30px -18px rgba(94, 45, 145, 0.18),
                 0 1px 2px rgba(20, 18, 30, 0.04);
}

/* Theme: Royale (legacy felt+gold for those who prefer casino glitz) */
[data-theme="royale"] {
  --bg-deep: #0a1a14;
  --bg-felt: #103024;
  --bg-card: #16382a;
  --bg-card-2: #1d4632;
  --line: #29543f;
  --line-soft: rgba(var(--gold-rgb), 0.12);
  --ink: #f4ead6;
  --ink-soft: #cdbf99;
  --ink-mute: #8a8068;
  --gold: #d4b25a;
  --gold-bright: #ecc972;
  --gold-deep: #8a6f2a;
  --gold-rgb: 212, 178, 90;
  --ink-on-accent: #1a1408;
  --font-display: "Cormorant Garamond", "Playfair Display", Georgia, serif;
}

/* ============== Reset / base ============== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ============== App layout ============== */
.stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(var(--gold-rgb), 0.06), transparent 60%),
    radial-gradient(900px 500px at 90% 100%, rgba(var(--gold-rgb), 0.04), transparent 60%),
    var(--bg-deep);
}

.tablet {
  width: 820px;
  height: 1180px;
  background: var(--bg-felt);
  border-radius: 36px;
  box-shadow:
    0 0 0 8px #1a1a1a,
    0 0 0 10px #2a2a2a,
    0 40px 80px -20px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}
[data-theme="igd-light"] .tablet {
  box-shadow:
    0 0 0 8px #1a1a1a,
    0 0 0 10px #2a2a2a,
    0 40px 80px -20px rgba(60, 30, 90, 0.25);
}

.tablet::before {
  /* subtle felt texture */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.015) 1px, transparent 0);
  background-size: 3px 3px;
  z-index: 0;
}

/* status bar */
.status-bar {
  height: 36px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 1;
}
.status-bar .sb-right { display: flex; gap: 8px; align-items: center; }
.status-bar svg { display: block; }

/* App shell */
.app {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  z-index: 1;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* ============== Top bar ============== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.topbar .title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
  line-height: 1;
}
.topbar .subtitle {
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 4px;
  font-weight: 600;
}
.topbar .back {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: 0.15s;
}
.topbar .back:hover { background: var(--bg-card); color: var(--ink); }
.topbar .right { display: flex; gap: 10px; align-items: center; }

.avatar-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 100px;
  cursor: pointer;
}
.avatar-pill .av {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: var(--ink-on-accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.avatar-pill .nm { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.avatar-pill .rl { font-size: 10px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap; }

/* ============== Buttons ============== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: none;
  cursor: pointer;
  transition: 0.15s;
  text-decoration: none;
  user-select: none;
}
.btn-primary {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: var(--ink-on-accent);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.3) inset,
    0 0 0 1px var(--gold-deep),
    0 10px 24px -10px rgba(var(--gold-rgb), 0.5);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: var(--bg-card); color: var(--ink); }

.btn-danger {
  background: rgba(232, 107, 94, 0.12);
  color: var(--bad);
  border: 1px solid rgba(232, 107, 94, 0.3);
}

.btn-block { width: 100%; padding: 18px; font-size: 16px; }

/* ============== Form fields ============== */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field label {
  font-size: 11px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
}
.input, .select {
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 15px;
  font-family: var(--font-sans);
  outline: none;
  transition: 0.15s;
  width: 100%;
}
.input:focus, .select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(var(--gold-rgb), 0.12);
}
.input::placeholder { color: var(--ink-mute); }

/* ============== Cards ============== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
}

.gold-rule {
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    var(--gold) 30%,
    var(--gold) 70%,
    transparent);
  opacity: 0.5;
}

/* ============== Specific screens ============== */

/* Login */
.login-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 50px;
  background:
    radial-gradient(800px 500px at 50% 20%, rgba(var(--gold-rgb), 0.10), transparent 70%),
    var(--bg-felt);
}
.brand-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 48px;
}
.brand-mark .logo {
  width: 90px; height: 90px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-deep));
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-on-accent);
  box-shadow: 0 20px 40px -16px rgba(var(--gold-rgb), 0.5);
  position: relative;
}
.brand-mark .logo svg { width: 50px; height: 50px; }
.brand-mark h1 {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 600;
  margin: 12px 0 0;
  letter-spacing: 0.02em;
}
.brand-mark .tag {
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-weight: 600;
}
.brand-mark .logo-img {
  width: 220px;
  height: auto;
  display: block;
  margin-bottom: 8px;
}
[data-theme="igd-light"] .brand-mark .logo-img {
  filter: drop-shadow(0 10px 24px rgba(var(--gold-rgb), 0.18));
}
/* On dark themes, host the PNG inside a light card so it stays legible */
[data-theme="igd-dark"] .brand-mark .logo-wrap,
:root:not([data-theme]) .brand-mark .logo-wrap,
[data-theme="royale"] .brand-mark .logo-wrap {
  background: #ffffff;
  padding: 22px 30px 16px;
  border-radius: 22px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.4) inset,
    0 24px 50px -20px rgba(var(--gold-rgb), 0.45),
    0 0 0 1px rgba(255,255,255,0.04);
  margin-bottom: 14px;
}
[data-theme="igd-light"] .brand-mark .logo-wrap {
  background: transparent;
  padding: 0;
  box-shadow: none;
  margin-bottom: 14px;
}
.brand-mark .logo {
  width: 90px; height: 90px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-deep));
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-on-accent);
  box-shadow: 0 20px 40px -16px rgba(var(--gold-rgb), 0.5);
  position: relative;
}
.brand-mark .logo svg { width: 50px; height: 50px; }
.brand-mark h1 {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 600;
  margin: 12px 0 0;
  letter-spacing: 0.02em;
}
.brand-mark .tag {
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-weight: 600;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.role-chip {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: 0.15s;
}
.role-chip .ic {
  height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
}
.role-chip .lb {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  font-weight: 600;
  margin-top: 6px;
}
.role-chip.active {
  background: var(--bg-card-2);
  border-color: var(--gold);
  color: var(--ink);
  box-shadow: 0 0 0 3px rgba(var(--gold-rgb), 0.12);
}
.role-chip.active .lb { color: var(--gold-bright); }

/* Login copyright footer */
.login-screen .copyright {
  margin-top: 32px;
  text-align: center;
  font-size: 10.5px;
  color: var(--ink-mute);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  opacity: 0.75;
}
[data-theme="igd-light"] .login-screen .copyright {
  opacity: 0.6;
}
.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 22px 28px 28px;
}
.home-grid.full { grid-template-columns: 1fr; }

.action-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  cursor: pointer;
  transition: 0.18s;
  position: relative;
  overflow: hidden;
}
.action-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
}
.action-card.primary {
  background: linear-gradient(140deg, var(--bg-card-2), var(--bg-card) 70%);
  border-color: var(--line);
}
.action-card.primary::after {
  content: "";
  position: absolute;
  right: -30px; top: -30px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, var(--gold) 0%, transparent 70%);
  opacity: 0.18;
}
.action-card .ic {
  color: var(--gold);
  margin-bottom: 14px;
}
.action-card .ti {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
}
.action-card .desc {
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 4px;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

.section-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 28px 12px;
  margin-top: 8px;
}
.section-h .lbl {
  font-size: 11px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
}
.section-h .link {
  font-size: 12px;
  color: var(--gold);
  cursor: pointer;
  font-weight: 600;
}

.recent-list {
  padding: 0 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.recent-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: 0.15s;
}
.recent-item:hover { border-color: var(--gold); }
.recent-item .av {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bg-card-2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 0.04em;
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.recent-item .body { flex: 1; min-width: 0; }
.recent-item .nm { font-size: 14px; font-weight: 600; color: var(--ink); }
.recent-item .meta {
  font-size: 11px;
  color: var(--ink-mute);
  margin-top: 2px;
  letter-spacing: 0.03em;
}
.recent-item .stat { font-family: var(--font-mono); font-size: 18px; font-weight: 600; color: var(--ink); }
.recent-item .stat .u { font-size: 10px; color: var(--ink-mute); margin-left: 2px; }

.dot-good { color: var(--good); }
.dot-warn { color: var(--warn); }
.dot-bad { color: var(--bad); }

/* New Measurement (form) */
.form-screen {
  flex: 1;
  overflow-y: auto;
  padding: 4px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.form-screen::-webkit-scrollbar { width: 0; }

.steps-bar {
  display: flex;
  gap: 8px;
  margin: 6px 0 6px;
}
.steps-bar .step {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
}
.steps-bar .step.done { background: var(--gold); }
.steps-bar .step.current {
  background: linear-gradient(90deg, var(--gold) 50%, var(--line) 50%);
}

.croupier-pick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.croupier-tile {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: 0.15s;
  position: relative;
}
.croupier-tile:hover { border-color: var(--gold); }
.croupier-tile.active {
  border-color: var(--gold);
  background: var(--bg-card-2);
  box-shadow: 0 0 0 3px rgba(var(--gold-rgb), 0.15);
}
.croupier-tile .av {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-on-accent);
  font-weight: 700;
  font-size: 14px;
}
.croupier-tile .nm {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}
.croupier-tile .rt {
  font-size: 10px;
  color: var(--ink-mute);
  margin-top: 2px;
  font-family: var(--font-mono);
}

.option-grid {
  display: grid;
  gap: 8px;
}
.option-grid.g2 { grid-template-columns: 1fr 1fr; }
.option-grid.g3 { grid-template-columns: repeat(3, 1fr); }
.option-grid.g4 { grid-template-columns: repeat(4, 1fr); }
.option-grid.g6 { grid-template-columns: repeat(6, 1fr); }

.opt {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: 0.15s;
}
.opt:hover { border-color: var(--gold); color: var(--ink); }
.opt.active {
  background: var(--bg-card-2);
  border-color: var(--gold);
  color: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(var(--gold-rgb), 0.12);
}
.opt .top { font-size: 18px; font-family: var(--font-display); font-weight: 600; color: var(--ink); }
.opt.active .top { color: var(--gold-bright); }
.opt .sub { font-size: 10px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 2px; }

.occupancy-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.occ {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 6px;
  font-size: 18px;
  font-family: var(--font-display);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: 0.15s;
}
.occ.active {
  background: var(--bg-card-2);
  border-color: var(--gold);
  color: var(--gold-bright);
}

.footer-cta {
  position: relative;
  padding: 18px 28px 24px;
  border-top: 1px solid var(--line-soft);
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.2));
}

/* Counter (live measurement) */
.counter-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-felt);
  position: relative;
  overflow: hidden;
}
.counter-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 400px at 50% 60%, rgba(var(--gold-rgb), 0.06), transparent 70%);
  pointer-events: none;
}

.counter-head {
  padding: 22px 28px 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  z-index: 1;
}
.counter-head .who .nm {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
}
.counter-head .who .meta {
  font-size: 11px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-top: 4px;
  font-weight: 600;
}
.counter-head .who .meta b { color: var(--gold); font-weight: 700; }

.counter-stats {
  display: flex;
  gap: 18px;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}
.cstat {
  flex: 1;
  background: rgba(0,0,0,0.18);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.cstat .lb {
  font-size: 10px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
}
.cstat .vl {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 4px;
  letter-spacing: -0.02em;
}
.cstat .vl .u { font-size: 11px; color: var(--ink-mute); margin-left: 4px; font-family: var(--font-sans); }

.counter-circle-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  padding: 0 28px;
}

.tap-zone {
  width: 100%;
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.tap-circle {
  width: 380px;
  height: 380px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 35% 30%, var(--bg-card-2), var(--bg-felt) 65%);
  box-shadow:
    0 0 0 1px var(--line),
    0 0 0 12px rgba(var(--gold-rgb), 0.05),
    0 0 0 13px rgba(var(--gold-rgb), 0.10),
    0 30px 60px -20px rgba(0, 0, 0, 0.7);
  transition: transform 0.08s ease-out, box-shadow 0.18s;
}
.tap-zone:active .tap-circle {
  transform: scale(0.97);
  box-shadow:
    0 0 0 1px var(--gold),
    0 0 0 12px rgba(var(--gold-rgb), 0.12),
    0 0 0 13px rgba(var(--gold-rgb), 0.18),
    0 30px 60px -20px rgba(0, 0, 0, 0.7);
}
.tap-circle::after {
  /* progress ring */
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--progress, 0) * 1%), transparent 0);
  -webkit-mask: radial-gradient(transparent 184px, #000 186px);
          mask: radial-gradient(transparent 184px, #000 186px);
  opacity: 0.85;
}

.tap-circle .num {
  font-family: var(--font-mono);
  font-size: 130px;
  font-weight: 600;
  line-height: 1;
  color: var(--gold-bright);
  letter-spacing: -0.04em;
  text-shadow: 0 0 40px rgba(var(--gold-rgb), 0.4);
}
.tap-circle .lb {
  position: absolute;
  bottom: 90px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  color: var(--ink-mute);
  font-weight: 700;
}
.tap-circle .dph-proj {
  position: absolute;
  top: 80px;
  font-family: var(--font-mono);
  font-size: 22px;
  color: var(--ink);
  font-weight: 600;
}
.tap-circle .dph-proj .u {
  font-size: 11px;
  color: var(--ink-mute);
  margin-left: 4px;
  font-family: var(--font-sans);
}

.tap-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--ink-mute);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}

.ripple {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--gold);
  opacity: 0.7;
  pointer-events: none;
  animation: ripple 0.7s ease-out forwards;
}
@keyframes ripple {
  from { transform: scale(0.4); opacity: 0.8; }
  to { transform: scale(1.3); opacity: 0; }
}

.counter-foot {
  padding: 20px 28px 24px;
  display: flex;
  gap: 10px;
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line-soft);
  background: rgba(0,0,0,0.18);
}
.counter-foot .btn { flex: 1; }

.iconbtn {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: 0.15s;
  flex-shrink: 0;
}
.iconbtn:hover { color: var(--ink); border-color: var(--gold); }

/* Result screen */
.result-screen {
  flex: 1;
  overflow-y: auto;
  padding: 0 28px 28px;
}
.result-hero {
  text-align: center;
  padding: 30px 0 20px;
}
.result-hero .who {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
}
.result-hero .ctx {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  margin-top: 6px;
  font-weight: 600;
}
.result-hero .dph-big {
  font-family: var(--font-mono);
  font-size: 110px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.05em;
  margin: 14px 0 4px;
}
.result-hero .dph-big.good { color: var(--good); }
.result-hero .dph-big.warn { color: var(--warn); }
.result-hero .dph-big.bad { color: var(--bad); }
.result-hero .dph-lbl {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--ink-mute);
  font-weight: 700;
}
.result-hero .verdict {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
}
.verdict.good { background: rgba(109, 193, 140, 0.12); color: var(--good); border: 1px solid rgba(109, 193, 140, 0.3); }
.verdict.warn { background: rgba(232, 178, 80, 0.12); color: var(--warn); border: 1px solid rgba(232, 178, 80, 0.3); }
.verdict.bad { background: rgba(232, 107, 94, 0.12); color: var(--bad); border: 1px solid rgba(232, 107, 94, 0.3); }

/* Comparison styles */
.cmp-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 14px;
}
.cmp-card .h {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  font-weight: 700;
  margin-bottom: 16px;
}

/* Bar comparison */
.cmp-bar {
  position: relative;
  height: 56px;
  background: var(--bg-felt);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.cmp-bar .zone {
  position: absolute;
  top: 0;
  bottom: 0;
}
.cmp-bar .zone.bad { background: rgba(232, 107, 94, 0.18); }
.cmp-bar .zone.warn { background: rgba(232, 178, 80, 0.18); }
.cmp-bar .zone.good { background: rgba(109, 193, 140, 0.18); }
.cmp-bar .marker-std {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
}
.cmp-bar .marker-std::before {
  content: "EST";
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.14em;
}
.cmp-bar .marker-val {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid var(--bg-felt);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.cmp-scale {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  margin-top: 8px;
}
.cmp-legend {
  display: flex;
  gap: 14px;
  margin-top: 18px;
  font-size: 11px;
}
.cmp-legend .lg-it { display: flex; align-items: center; gap: 6px; color: var(--ink-soft); }
.cmp-legend .sw { width: 12px; height: 12px; border-radius: 4px; }

/* Gauge */
.gauge {
  position: relative;
  width: 280px;
  height: 160px;
  margin: 0 auto;
}
.gauge svg { width: 100%; height: 100%; overflow: visible; }
.gauge .gauge-val {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 600;
}
.gauge .gauge-lbl {
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-mute);
  font-weight: 700;
}

/* Bars (mini chart) */
.team-bars {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  align-items: end;
  height: 160px;
  padding: 0 10px;
}
.tb { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.tb .bar {
  width: 60px;
  border-radius: 10px 10px 4px 4px;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8px;
  color: var(--ink-on-accent);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
}
.tb .bar.you { background: linear-gradient(180deg, var(--gold-bright), var(--gold)); }
.tb .bar.std { background: linear-gradient(180deg, var(--ink-soft), var(--ink-mute)); }
.tb .bar.team { background: linear-gradient(180deg, var(--bg-card-2), var(--line)); color: var(--ink); }
.tb .lb { font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-mute); font-weight: 700; }

/* Detail metrics row */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.metric {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
}
.metric .vl { font-family: var(--font-mono); font-size: 22px; font-weight: 600; color: var(--ink); }
.metric .vl .u { font-size: 11px; color: var(--ink-mute); margin-left: 2px; font-family: var(--font-sans); }
.metric .lb { font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-mute); margin-top: 4px; font-weight: 700; }

/* History list */
.hist-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 28px 28px;
  overflow-y: auto;
  flex: 1;
}
.hist-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.hist-row .date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
  width: 64px;
  flex-shrink: 0;
  text-align: center;
  border-right: 1px solid var(--line);
  padding-right: 12px;
}
.hist-row .date b { display: block; color: var(--ink); font-size: 18px; font-weight: 600; margin-bottom: 2px; }
.hist-row .info { flex: 1; min-width: 0; }
.hist-row .info .g { font-size: 14px; font-weight: 600; color: var(--ink); }
.hist-row .info .m { font-size: 11px; color: var(--ink-mute); margin-top: 2px; letter-spacing: 0.03em; }
.hist-row .dph {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
}

/* Sparkline */
.spark-card {
  margin: 0 28px 18px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.spark-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}
.spark-head .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--ink-mute); font-weight: 700; }
.spark-head .avg { font-family: var(--font-mono); font-size: 28px; font-weight: 600; color: var(--ink); }
.spark-head .avg .u { font-size: 11px; color: var(--ink-mute); margin-left: 4px; font-family: var(--font-sans); }
.spark-svg { width: 100%; height: 100px; }

/* Standards table */
.std-table {
  padding: 0 28px 28px;
  overflow-y: auto;
  flex: 1;
}
.std-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
  align-items: center;
}
.std-row.h {
  background: transparent;
  border: none;
  padding: 8px 16px;
}
.std-row .gn { font-size: 14px; font-weight: 600; color: var(--ink); }
.std-row .vl {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--ink);
  font-weight: 600;
  width: 70px;
  text-align: center;
}
.std-row .vl input {
  width: 60px;
  background: var(--bg-felt);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 15px;
  text-align: center;
  padding: 6px 4px;
  border-radius: 8px;
}
.std-row .vl input:focus { border-color: var(--gold); outline: none; }
.std-row .hlb { font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-mute); font-weight: 700; }

/* Shuffle */
.shuffle-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 28px 28px;
}
.shuffle-timer-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shuffle-timer {
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, var(--bg-card-2), var(--bg-felt) 65%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 1px var(--line),
    0 0 0 12px rgba(var(--gold-rgb), 0.05),
    0 30px 60px -20px rgba(0, 0, 0, 0.7);
  position: relative;
}
.shuffle-timer .time {
  font-family: var(--font-mono);
  font-size: 88px;
  font-weight: 600;
  color: var(--gold-bright);
  letter-spacing: -0.04em;
  line-height: 1;
}
.shuffle-timer .ms {
  font-family: var(--font-mono);
  font-size: 28px;
  color: var(--ink-mute);
  margin-top: 4px;
}
.shuffle-timer .lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  color: var(--ink-mute);
  margin-top: 14px;
  font-weight: 700;
}

.shuffle-history-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.15);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}
.shuffle-history-row .n { font-family: var(--font-mono); font-size: 13px; color: var(--ink-mute); width: 30px; }
.shuffle-history-row .t { font-family: var(--font-mono); font-size: 18px; font-weight: 600; color: var(--ink); flex: 1; }
.shuffle-history-row .delta { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.delta.good { color: var(--good); }
.delta.bad { color: var(--bad); }

/* Empty state */
.empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
  color: var(--ink-mute);
}
.empty .ic { color: var(--gold); opacity: 0.5; margin-bottom: 18px; }
.empty .ti { font-family: var(--font-display); font-size: 24px; color: var(--ink); margin-bottom: 6px; }
.empty .ds { font-size: 13px; line-height: 1.5; max-width: 300px; }

/* Modal */
.modal-back {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 28px;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
}
.modal h3 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 6px;
}
.modal p {
  font-size: 13px;
  color: var(--ink-mute);
  margin: 0 0 18px;
  line-height: 1.5;
}
.modal .actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.modal .actions .btn { flex: 1; }

/* Toast */
.toast {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--gold);
  border-radius: 100px;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
  font-size: 13px;
  font-weight: 600;
  z-index: 20;
  animation: toast-in 0.3s ease-out;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Lang chip */
.lang-chip {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 4px;
  gap: 2px;
}
.lang-chip button {
  background: transparent;
  border: none;
  color: var(--ink-mute);
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.lang-chip button.active { background: var(--gold); color: var(--ink-on-accent); }

/* Search field */
.search-field {
  position: relative;
}
.search-field svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-mute);
}
.search-field input { padding-left: 42px; }

/* Misc utilities */
.row { display: flex; gap: 10px; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.mt-12 { margin-top: 12px; }
.mt-18 { margin-top: 18px; }
.gold { color: var(--gold); }
.mono { font-family: var(--font-mono); }
.tnum { font-variant-numeric: tabular-nums; }
