:root {
  --bg: #15161a;
  --card: #1d1f24;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #ecebe8;
  --muted: rgba(236, 235, 232, 0.5);
  --muted-2: rgba(236, 235, 232, 0.35);
  --accent: #c96a4a;
  --accent-hover: #dd8365;
  --danger: #d66050;
  --sans: 'DM Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
}

button,
input,
textarea,
select {
  font-family: inherit;
  color: inherit;
}
input,
textarea {
  outline: none;
}
::placeholder {
  color: rgba(236, 235, 232, 0.32);
}

button {
  cursor: pointer;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(-50%, 14px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
@keyframes grow {
  from {
    transform: scaleY(0.04);
  }
  to {
    transform: scaleY(1);
  }
}
@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(4vw, -3vh, 0) scale(1.15);
  }
}
@keyframes sheen {
  0% {
    transform: translateX(-120%);
  }
  60%,
  100% {
    transform: translateX(220%);
  }
}
@keyframes pulseGlow {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.86);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ---------- aurora background ---------- */

.aurora {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.aurora .blob-a {
  position: absolute;
  top: -18vh;
  left: -8vw;
  width: 56vw;
  height: 56vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 106, 74, 0.28), transparent 66%);
  filter: blur(30px);
  animation: drift 26s ease-in-out infinite;
}
.aurora .blob-b {
  position: absolute;
  bottom: -24vh;
  right: -12vw;
  width: 52vw;
  height: 52vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74, 120, 201, 0.2), transparent 66%);
  filter: blur(34px);
  animation: drift 34s ease-in-out infinite reverse;
}
.aurora .grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 20%, #000, transparent 78%);
}
.app-content {
  position: relative;
  z-index: 1;
}

.muted {
  color: var(--muted);
}
.mono {
  font-family: var(--mono);
}
[hidden] {
  display: none !important;
}

/* ---------- login ---------- */

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-wrap {
  width: 100%;
  max-width: 390px;
  animation: rise 0.45s ease both;
}
.login-kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
}
.login-title {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin-top: 14px;
}
.login-sub {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14.5px;
}
.login-card {
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 30px;
}
.btn-ms,
.btn-gh {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  width: 100%;
  min-height: 50px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
}
.btn-ms {
  background: var(--text);
  color: var(--bg);
}
.btn-ms:hover {
  background: #fff;
}
.btn-gh {
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
}
.btn-gh:hover {
  background: rgba(255, 255, 255, 0.06);
}
.ms-logo {
  display: inline-flex;
  flex-wrap: wrap;
  width: 15px;
  height: 15px;
}
.ms-logo span {
  width: 7px;
  height: 7px;
}
.gh-logo {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--text);
  display: inline-block;
}
.login-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 0;
}
.login-or .line {
  flex: 1;
  height: 1px;
  background: var(--border-strong);
}
.login-or span {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--muted-2);
}
.btn-guest {
  width: 100%;
  min-height: 44px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.login-foot {
  margin: 14px 0 0;
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(236, 235, 232, 0.3);
  line-height: 1.7;
}

/* ---------- loading skeleton ---------- */

@keyframes skelPulse {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 0.7;
  }
}
.skeleton {
  max-width: 1100px;
  margin: 0 auto;
  padding: 26px 20px;
}
.skel-head {
  margin-bottom: 26px;
}
.skel-title,
.skel-row {
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  animation: skelPulse 1.4s ease-in-out infinite;
}
.skel-title {
  width: 220px;
  height: 38px;
  margin-bottom: 26px;
}
.skel-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.skel-kpis .skel-row {
  height: 62px;
}
.skel-card {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
}
.skel-card .skel-row {
  height: 20px;
}
.skel-card .skel-row:nth-child(1) {
  width: 40%;
}
.skel-card .skel-row:nth-child(3) {
  width: 82%;
}
.skel-card .skel-row:nth-child(5) {
  width: 64%;
}
@media (max-width: 859px) {
  .skel-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- app shell ---------- */

.app-shell {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

.sidebar {
  width: 246px;
  flex: none;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  padding: 26px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, rgba(29, 31, 36, 0.92), rgba(21, 22, 26, 0.86));
  backdrop-filter: blur(16px);
}
.brand {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.sidebar .brand {
  font-size: 21px;
  letter-spacing: -0.025em;
  line-height: 1.12;
  background: linear-gradient(120deg, #ecebe8 20%, #c96a4a 130%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-tag {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 5px;
}
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 12px 0 14px;
  border: none;
  border-radius: 11px;
  font-size: 14px;
  text-align: left;
  background: transparent;
  color: rgba(236, 235, 232, 0.55);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(201, 106, 74, 0.24), rgba(255, 255, 255, 0.05));
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent);
}
.nav-item span:first-child {
  flex: 1;
  text-align: left;
}
.nav-item .count {
  font-family: var(--mono);
  font-size: 10.5px;
  opacity: 0.45;
}
.write-btn {
  min-height: 44px;
  width: 100%;
  border: none;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--accent-hover), var(--accent));
  color: var(--bg);
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 10px 26px -10px rgba(201, 106, 74, 0.9);
  transition: transform 0.18s, box-shadow 0.18s;
}
.write-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -10px rgba(201, 106, 74, 1);
}
.me-row {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.me-info {
  flex: 1;
  min-width: 0;
}
.me-name {
  font-size: 13.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.me-status {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted-2);
}
.logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--muted-2);
  font-size: 15px;
  padding: 6px;
  line-height: 1;
}

.avatar-badge {
  border-radius: 50%;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  color: #15161a;
}
.avatar-guest {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  background: rgba(255, 255, 255, 0.1);
}

.main {
  flex: 1;
  min-width: 0;
  padding: clamp(18px, 3.5vw, 36px) clamp(15px, 3.5vw, 36px) 110px;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
}

.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.mobile-header .brand {
  font-size: 19px;
}
.mobile-header .brand-tag {
  font-size: 9px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.page-title {
  margin: 0;
  font-size: clamp(30px, 6vw, 44px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.02;
  background: linear-gradient(105deg, #ecebe8 30%, rgba(236, 235, 232, 0.55) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.page-sub {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  max-width: 56ch;
}

.empty-state {
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  padding: 40px 24px;
  text-align: center;
}
.empty-state .title {
  font-size: 16px;
  font-weight: 500;
}
.empty-state p {
  margin: 8px auto 18px;
  max-width: 42ch;
  color: var(--muted);
  font-size: 14px;
}

.btn-primary-sm {
  min-height: 44px;
  padding: 0 20px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: var(--bg);
  font-size: 14px;
  font-weight: 700;
}

/* ---------- KPI strip (Rangliste) ---------- */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.kpi-tile {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  padding: 15px 16px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.018));
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: pop 0.4s ease both;
}
.kpi-tile .edge {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
}
.kpi-tile .label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(236, 235, 232, 0.4);
}
.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 8px;
  min-height: 28px;
  flex-wrap: wrap;
}
.kpi-num {
  font-family: var(--mono);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  background: linear-gradient(150deg, #ecebe8, rgba(236, 235, 232, 0.5));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.kpi-num.accent {
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  color: var(--accent);
}
.kpi-leader {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
}
.kpi-unit {
  font-family: var(--mono);
  font-size: 10.5px;
  color: rgba(236, 235, 232, 0.35);
}

/* ---------- podium + standings ---------- */

.podium-card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 24px 18px 0;
  margin-bottom: 14px;
  background: radial-gradient(120% 130% at 50% -20%, rgba(201, 106, 74, 0.16), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.podium-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(8px, 2.5vw, 22px);
  height: 250px;
}
.podium-col {
  flex: 1;
  max-width: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.podium-col:hover {
  transform: translateY(-4px);
}
.podium-crown {
  font-size: 17px;
  line-height: 1;
  margin-bottom: 4px;
  filter: drop-shadow(0 0 8px rgba(201, 106, 74, 0.7));
  animation: pulseGlow 3s ease-in-out infinite;
}
.podium-wins {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.podium-label {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  color: rgba(236, 235, 232, 0.32);
  margin-bottom: 8px;
}
.podium-bar {
  position: relative;
  overflow: hidden;
  width: 100%;
  border-radius: 9px 9px 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 7px;
  transform-origin: bottom;
  animation: grow 0.8s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}
.podium-rank {
  position: relative;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}
.podium-sheen {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  animation: sheen 3.6s ease-in-out infinite;
  animation-delay: 1s;
}
.podium-avatar {
  /* box-shadow is combined with the avatar's own gradient highlight in JS (avatarFor already
     sets an inline box-shadow, which always wins over a stylesheet rule regardless of specificity). */
  position: relative;
  z-index: 2;
  margin-top: -17px;
}
.podium-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 7px;
  text-align: center;
  line-height: 1.2;
}
.podium-quote {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted-2);
  margin-top: 2px;
}

.card {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012));
  border: 1px solid rgba(255, 255, 255, 0.085);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  overflow: hidden;
}
.card.hoverable {
  transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.24s, box-shadow 0.24s;
}
.card.hoverable:hover {
  transform: translateY(-3px);
  border-color: rgba(201, 106, 74, 0.4);
  box-shadow: 0 16px 34px -18px rgba(0, 0, 0, 0.8);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}
.kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.history-cols,
.history-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) minmax(0, 1.2fr) 104px;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}
.history-cols {
  padding-top: 10px;
  padding-bottom: 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.history-row {
  padding-top: 11px;
  padding-bottom: 11px;
}
.history-row:last-child {
  border-bottom: none;
}
.history-row:hover {
  background: rgba(255, 255, 255, 0.045);
}
.col-game,
.col-winner {
  min-width: 0;
}
.history-row .col-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.history-row .col-game {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.col-winner {
  display: flex;
  align-items: center;
  gap: 8px;
}
.winner-stack {
  display: flex;
  flex: none;
}
.winner-stack > * + * {
  margin-left: -8px;
}
.history-row .col-winner .name {
  font-size: 14px;
  color: rgba(236, 235, 232, 0.8);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.col-mark {
  text-align: right;
  line-height: 1;
}
.history-row .col-mark {
  font-size: 15px;
}

/* ---------- chronik ---------- */

.chronik-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.session-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.session-date {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
}
.session-place {
  font-size: 14px;
  color: rgba(236, 235, 232, 0.75);
}
.session-meta {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted-2);
}
.game-row {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}
.game-row:last-child {
  border-bottom: none;
}
.game-row-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.winner-avatars {
  display: flex;
  flex: none;
}
.winner-avatars .avatar-badge:not(:first-child) {
  margin-left: -9px;
}
.game-info {
  flex: 1;
  min-width: 150px;
}
.game-name-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.game-name-row .name {
  font-size: 15px;
  font-weight: 500;
}
.taint-mark {
  font-size: 15px;
  line-height: 1;
}
.game-sub {
  font-size: 12.5px;
  color: var(--muted-2);
  margin-top: 2px;
}
.edit-btn {
  flex: none;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  background: transparent;
  color: rgba(236, 235, 232, 0.6);
  font-size: 12.5px;
}
.edit-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.note-box {
  margin: 9px 0 0 0;
  padding: 9px 12px;
  border-left: 2px solid var(--accent);
  background: rgba(201, 106, 74, 0.07);
  border-radius: 0 8px 8px 0;
  font-size: 13.5px;
  color: rgba(236, 235, 232, 0.7);
}

/* ---------- eintragen ---------- */

.record-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 15px;
  align-items: start;
}
.step-card {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012));
  border: 1px solid rgba(255, 255, 255, 0.085);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 18px;
}
.step-card.disabled {
  opacity: 0.45;
  pointer-events: none;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field span.label {
  font-size: 12.5px;
  color: var(--muted);
}
.field input,
.field textarea,
.note-textarea {
  min-height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  padding: 0 12px;
  font-size: 14.5px;
}
.field input[type='date'] {
  color-scheme: dark;
}
.field textarea,
.note-textarea {
  padding: 11px 12px;
  resize: vertical;
  width: 100%;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 99px;
  font-size: 13.5px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: rgba(236, 235, 232, 0.85);
  transition: background 0.14s, border-color 0.14s;
}
.chip.has-avatar {
  padding: 0 13px 0 5px;
}
.chip.active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}
.chip.dashed {
  border-style: dashed;
  color: var(--muted);
}
.primary-btn {
  width: 100%;
  min-height: 46px;
  margin-top: 16px;
  border: none;
  border-radius: 11px;
  font-size: 14.5px;
  font-weight: 700;
  background: var(--accent);
  color: var(--bg);
}
.primary-btn:disabled {
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(236, 235, 232, 0.3);
}
.open-session-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(201, 106, 74, 0.35);
  background: rgba(201, 106, 74, 0.07);
  border-radius: 12px;
}
.open-session-close {
  margin-top: 12px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: transparent;
  color: rgba(236, 235, 232, 0.7);
  font-size: 13px;
}
.taint-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 0;
  padding: 13px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg);
}
.taint-row .emoji {
  font-size: 22px;
  line-height: 1;
}
.taint-row .copy {
  flex: 1;
  min-width: 0;
}
.taint-row .copy .t1 {
  font-size: 14px;
  font-weight: 500;
}
.taint-row .copy .t2 {
  font-size: 12.5px;
  color: var(--muted-2);
  margin-top: 1px;
}
.switch {
  width: 46px;
  height: 27px;
  border-radius: 99px;
  border: none;
  padding: 3px;
  display: flex;
  background: rgba(255, 255, 255, 0.14);
}
.switch.on {
  background: var(--accent);
  justify-content: flex-end;
}
.switch .knob {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--text);
  display: block;
}
.switch.on .knob {
  background: var(--bg);
}
.open-games-list {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.open-game-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.open-game-row .label {
  font-size: 14.5px;
  flex: 1;
  min-width: 0;
}
.open-game-row .remove {
  border: none;
  background: transparent;
  color: rgba(236, 235, 232, 0.35);
  font-size: 16px;
  padding: 2px 4px;
  line-height: 1;
}

/* ---------- bibliothek ---------- */

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.library-card {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012));
  border: 1px solid rgba(255, 255, 255, 0.085);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.24s, box-shadow 0.24s;
}
.library-card:hover {
  transform: translateY(-5px);
  border-color: rgba(201, 106, 74, 0.45);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.85);
}
.library-card.add-card {
  border-style: dashed;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 180px;
  color: var(--muted);
  font-size: 13.5px;
  cursor: pointer;
}
.library-card.add-card .plus {
  font-size: 26px;
  line-height: 1;
  color: var(--muted-2);
}
.library-card.add-card.add-card-open {
  align-items: stretch;
  padding: 16px;
  cursor: default;
}
.library-art {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.library-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.art-placeholder {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--muted-2);
  text-transform: uppercase;
  text-align: center;
  padding: 0 12px;
}
.library-body {
  padding: 14px 16px 15px;
}
.library-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.library-title-row .name {
  font-size: 15.5px;
  font-weight: 500;
  flex: 1;
  min-width: 0;
}
.library-title-row .plays {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
}
.library-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}
.library-champ {
  display: flex;
  align-items: center;
  gap: 9px;
}
.library-champ .info .name {
  font-size: 13.5px;
}
.library-champ .info .wins {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted-2);
}
.library-champ .mark {
  margin-left: auto;
  font-size: 15px;
}
.library-never {
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(236, 235, 232, 0.3);
}

/* ---------- profil ---------- */

.profile-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.profile-card {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012));
  border: 1px solid rgba(255, 255, 255, 0.085);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 18px;
}
.profile-head {
  display: flex;
  align-items: center;
  gap: 13px;
}
.profile-head .name {
  font-size: 18px;
  font-weight: 600;
}
.profile-head .tagline {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted-2);
  margin-top: 2px;
}
.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.stat-box {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 13px;
  padding: 14px 15px;
}
.stat-box .label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.stat-box .big {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  margin-top: 5px;
  line-height: 1;
}
.stat-box .mid {
  font-size: 15px;
  font-weight: 500;
  margin-top: 6px;
  line-height: 1.2;
}
.stat-box .sub {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--accent);
  margin-top: 3px;
}
.stat-box .sub.muted2 {
  color: var(--muted-2);
}

/* ---------- fotos ---------- */

.fotos-empty {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 44px 24px;
  text-align: center;
  background: var(--card);
}
.fotos-empty .emoji {
  font-size: 26px;
  line-height: 1;
}
.fotos-empty .title {
  font-size: 16px;
  font-weight: 500;
  margin-top: 12px;
}
.fotos-empty p {
  margin: 8px auto 0;
  max-width: 44ch;
  color: var(--muted);
  font-size: 14px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.photo-tile {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--card);
  overflow: hidden;
}
.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 6px 9px;
  font-size: 11.5px;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65), transparent);
}
.photo-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 99px;
  background: rgba(21, 22, 26, 0.78);
  color: var(--text);
  font-size: 14px;
  line-height: 1;
  backdrop-filter: blur(4px);
}
.photo-delete.confirm {
  padding: 0 12px;
  border-color: transparent;
  background: var(--danger);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

input[type='file'] {
  color-scheme: dark;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 13, 0.78);
  backdrop-filter: blur(3px);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal {
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 20px;
  animation: rise 0.2s ease both;
}
.modal-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.modal-head .title {
  font-size: 17px;
  font-weight: 600;
  flex: 1;
}
.admin-tag {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted-2);
}
.modal-section-label {
  font-size: 12.5px;
  color: var(--muted);
  margin: 16px 0 8px;
}
.modal-actions {
  display: flex;
  gap: 9px;
  margin-top: 18px;
}
.btn-ghost {
  flex: 1;
  min-height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: transparent;
  color: rgba(236, 235, 232, 0.7);
  font-size: 14px;
}
.btn-danger {
  flex: 1;
  min-height: 44px;
  border: none;
  border-radius: 11px;
  background: var(--danger);
  color: var(--bg);
  font-size: 13.5px;
  font-weight: 700;
}
.btn-accent {
  flex: 1;
  min-height: 44px;
  border: none;
  border-radius: 11px;
  background: var(--accent);
  color: var(--bg);
  font-size: 14px;
  font-weight: 700;
}
.delete-link {
  width: 100%;
  margin-top: 9px;
  min-height: 40px;
  border: none;
  border-radius: 11px;
  background: transparent;
  color: rgba(236, 235, 232, 0.45);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.confirm-box {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(214, 96, 80, 0.45);
  background: rgba(214, 96, 80, 0.1);
  border-radius: 12px;
}
.confirm-box .title {
  font-size: 14px;
  font-weight: 500;
}
.confirm-box p {
  margin: 5px 0 0;
  font-size: 13px;
  color: rgba(236, 235, 232, 0.6);
}

/* ---------- game detail sheet ---------- */

.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 13, 0.72);
  backdrop-filter: blur(3px);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.detail-sheet {
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 18px 18px 0 0;
  animation: rise 0.24s ease both;
}
.detail-art {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg);
  border-radius: 18px 18px 0 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(21, 22, 26, 0.7);
  color: var(--text);
  font-size: 17px;
  line-height: 1;
  backdrop-filter: blur(4px);
}
.detail-body {
  padding: 18px 18px 26px;
}
.detail-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.detail-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  margin-top: 4px;
}
.detail-desc {
  margin: 11px 0 0;
  font-size: 14.5px;
  color: rgba(236, 235, 232, 0.7);
}
.detail-pills {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.detail-pills span {
  font-family: var(--mono);
  font-size: 11px;
  padding: 6px 11px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(236, 235, 232, 0.7);
}
.detail-kicker {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 22px 0 10px;
}
.detail-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.detail-bar-row .pname {
  font-size: 13.5px;
  width: 78px;
  flex: none;
  color: rgba(236, 235, 232, 0.75);
}
.detail-bar-track {
  flex: 1;
  height: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.detail-bar-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
}
.detail-bar-row .pwins {
  font-family: var(--mono);
  font-size: 12.5px;
  width: 22px;
  text-align: right;
  color: rgba(236, 235, 232, 0.6);
}
.detail-rows {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.detail-match-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.detail-match-row:last-child {
  border-bottom: none;
}
.detail-match-row .date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-2);
  width: 82px;
  flex: none;
}
.detail-match-row .winner {
  flex: 1;
  min-width: 0;
  font-size: 14px;
}

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

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 11px 18px;
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.22s ease both;
  z-index: 80;
  max-width: 88vw;
  text-align: center;
}

/* ---------- mobile bottom nav ---------- */

.mobile-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(24, 26, 30, 0.97);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-strong);
  display: none;
  align-items: center;
  gap: 4px;
  padding: 5px 4px 9px;
  z-index: 20;
}
.mobile-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-height: 54px;
  padding: 7px 2px;
  border: none;
  background: transparent;
  color: rgba(236, 235, 232, 0.45);
  transition: color 0.2s;
}
.mobile-nav-btn.active {
  color: var(--text);
}
.mobile-nav-btn .dot {
  width: 5px;
  height: 5px;
  border-radius: 99px;
  background: transparent;
  transition: width 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.2s;
}
.mobile-nav-btn.active .dot {
  width: 18px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.mobile-nav-btn .short {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.mobile-nav-group {
  flex: 1;
  display: flex;
  min-width: 0;
}
.mobile-nav-fab {
  flex: none;
  width: 66px;
  height: 66px;
  position: relative;
  top: -20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  line-height: 1;
  box-shadow: 0 12px 26px -8px rgba(0, 0, 0, 0.85), 0 0 0 6px rgba(24, 26, 30, 0.97);
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.mobile-nav-fab svg {
  stroke-width: 2.4;
}
.mobile-nav-fab.active {
  transform: scale(1.06);
}
.mobile-nav-fab:active {
  transform: scale(0.94);
}

/* ---------- inline add-item form (players/games onboarding) ---------- */

.inline-add {
  display: flex;
  gap: 7px;
  align-items: center;
}
.inline-add input {
  min-height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  background: var(--bg);
  padding: 0 14px;
  font-size: 13.5px;
  width: 160px;
}
.inline-add button {
  min-height: 40px;
  padding: 0 14px;
  border: none;
  border-radius: 99px;
  background: var(--accent);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
}

.error-text {
  color: var(--danger);
}

/* ---------- responsive ---------- */

@media (max-width: 859px) {
  .sidebar {
    display: none;
  }
  .mobile-header {
    display: flex;
  }
  .mobile-nav {
    display: flex;
  }
  .record-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .history-cols,
  .history-row {
    grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1fr) 62px;
    gap: 8px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .history-cols {
    font-size: 8.5px;
    letter-spacing: 0.06em;
  }
  .history-row .col-date {
    font-size: 11px;
  }
  .history-row .col-game,
  .history-row .col-winner .name {
    font-size: 13px;
    line-height: 1.3;
    white-space: normal;
    overflow: visible;
  }
  /* On a phone the avatars would eat the room the winners' names need, and every name has
     to stay readable — so the stack steps aside there. */
  .winner-stack {
    display: none;
  }
  .mobile-nav-btn .short {
    font-size: 10px;
  }
}
