/* ========================================================================
   Team Cr4zy — Clash-of-Clans Style
   ======================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Lilita+One&family=Fredoka:wght@400;500;600;700&display=swap');

:root {
  /* Gold */
  --gold-light: #ffe79a;
  --gold: #ffcb47;
  --gold-mid: #f5a623;
  --gold-dark: #b67018;
  --gold-deep: #5a3a0d;
  /* Holz */
  --wood-light: #8a4f24;
  --wood: #4f2d12;
  --wood-dark: #2a1606;
  --wood-shadow: #120703;
  /* Stein */
  --stone-light: #998871;
  --stone: #6e5f4a;
  --stone-dark: #3d3325;
  /* Status */
  --green: #5dcc55;
  --green-deep: #1f7d2c;
  --red: #d04444;
  --red-deep: #7a1a1a;
  --blue: #5fa8ff;
  --blue-deep: #1f4a85;
  --purple: #b76dff;
  /* Schrift */
  --text: #fff8e0;
  --text-soft: #f3dca0;
  --text-dim: #b9a47a;
  --ink: #2a1a07;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Fredoka', system-ui, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, #6a9b3e 0%, transparent 60%),
    radial-gradient(ellipse 100% 80% at 50% 110%, #1a2c0d 0%, transparent 70%),
    linear-gradient(180deg, #355c1d 0%, #1f3812 50%, #16280d 100%) fixed;
  background-attachment: fixed;
  position: relative;
  overflow-x: hidden;
}

/* feines Stoff-Pattern */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    repeating-linear-gradient(45deg, rgba(0,0,0,0.05) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 6px);
  mix-blend-mode: overlay;
}
/* Vignette */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 100% 80% at 50% 50%, transparent 50%, rgba(0,0,0,0.55) 100%);
}

h1, h2, h3, .display { font-family: 'Lilita One', cursive; letter-spacing: 0.5px; font-weight: 400; }

/* ========================================================================
   TOPBAR — wie ein Holz-Banner
   ======================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 28px;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,0.05) 0 2px, transparent 2px 18px),
    linear-gradient(180deg, var(--wood-light) 0%, var(--wood) 50%, var(--wood-dark) 100%);
  border-bottom: 4px solid var(--wood-dark);
  box-shadow:
    inset 0 -3px 0 rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,200,120,0.18),
    0 10px 30px rgba(0,0,0,0.5);
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand .logo {
  width: 60px; height: 60px;
  display: grid; place-items: center;
  font-family: 'Lilita One', cursive; font-size: 22px;
  color: var(--ink);
  background:
    radial-gradient(circle at 30% 25%, #fff5c4 0%, var(--gold) 35%, var(--gold-mid) 65%, var(--gold-dark) 100%);
  border-radius: 50%;
  border: 4px solid var(--wood-dark);
  position: relative;
  box-shadow:
    inset 0 -4px 6px rgba(0,0,0,0.35),
    inset 0 4px 6px rgba(255,255,255,0.6),
    0 4px 0 var(--wood-shadow),
    0 8px 20px rgba(0,0,0,0.5),
    0 0 24px rgba(255,200,80,0.35);
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}
.brand h1 {
  margin: 0; font-size: 28px; line-height: 1;
  color: var(--gold-light);
  text-shadow:
    2px 2px 0 var(--wood-dark),
    3px 3px 0 rgba(0,0,0,0.6),
    0 0 18px rgba(255,200,80,0.25);
}
.brand small { color: var(--text-dim); font-weight: 500; font-size: 12px; letter-spacing: 0.5px; }

/* ========================================================================
   TABS — Stein-Buttons
   ======================================================================== */
nav#tabs { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
nav#tabs button {
  background: linear-gradient(180deg, var(--stone-light) 0%, var(--stone) 100%);
  color: var(--text);
  border: 2px solid var(--stone-dark);
  padding: 9px 18px;
  border-radius: 10px;
  font-family: 'Lilita One', cursive;
  font-size: 14px;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.18);
  transition: transform 0.08s, filter 0.15s;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}
nav#tabs button:hover { filter: brightness(1.18); }
nav#tabs button:active { transform: translateY(2px); box-shadow: inset 0 -1px 0 rgba(0,0,0,0.3); }
nav#tabs button.active {
  background: linear-gradient(180deg, var(--gold-light), var(--gold), var(--gold-mid));
  color: var(--ink);
  border-color: var(--gold-dark);
  text-shadow: 1px 1px 0 rgba(255,255,255,0.45);
  box-shadow:
    inset 0 -3px 0 var(--gold-dark),
    inset 0 1px 0 rgba(255,255,255,0.6),
    0 0 14px rgba(255,200,80,0.55);
}

.auth-area { display: flex; align-items: center; gap: 10px; }
#user-info {
  color: var(--text-soft); font-size: 13px; font-weight: 600;
  background: rgba(0,0,0,0.35);
  padding: 6px 12px; border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

/* ========================================================================
   BUTTONS — 3D-poliert
   ======================================================================== */
button, .btn {
  font-family: 'Fredoka', sans-serif; font-weight: 600;
  background: linear-gradient(180deg, var(--stone-light), var(--stone));
  color: var(--text);
  border: 2px solid var(--stone-dark);
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow:
    inset 0 -3px 0 rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 2px 4px rgba(0,0,0,0.35);
  transition: transform 0.08s, filter 0.15s;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
  font-size: 14px;
}
button:hover { filter: brightness(1.12); }
button:active { transform: translateY(2px); box-shadow: inset 0 -1px 0 rgba(0,0,0,0.3); }
button:disabled { opacity: 0.4; cursor: not-allowed; }

button.primary, .btn.primary {
  background: linear-gradient(180deg, #7be77b 0%, var(--green) 50%, var(--green-deep) 100%);
  color: white;
  border-color: #155621;
  box-shadow:
    inset 0 -4px 0 #155621,
    inset 0 1px 0 rgba(255,255,255,0.45),
    0 4px 0 #0c3a14,
    0 8px 16px rgba(0,0,0,0.45);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.45);
}
button.gold {
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-mid) 100%);
  color: var(--ink);
  border-color: var(--gold-dark);
  box-shadow:
    inset 0 -4px 0 var(--gold-dark),
    inset 0 1px 0 rgba(255,255,255,0.55),
    0 4px 0 var(--gold-deep),
    0 8px 16px rgba(0,0,0,0.4),
    0 0 12px rgba(255,200,80,0.35);
  text-shadow: 1px 1px 0 rgba(255,255,255,0.4);
}
button.danger {
  background: linear-gradient(180deg, #f08585, var(--red), var(--red-deep));
  color: white;
  border-color: var(--red-deep);
  box-shadow:
    inset 0 -4px 0 var(--red-deep),
    inset 0 1px 0 rgba(255,255,255,0.35),
    0 4px 0 #3a0a0a,
    0 8px 16px rgba(0,0,0,0.4);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.45);
}
button.ghost {
  background: rgba(0,0,0,0.35);
  border: 2px solid rgba(255,200,100,0.35);
  color: var(--gold-light);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.4);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}

/* ========================================================================
   LAYOUT
   ======================================================================== */
main { padding: 28px 24px; max-width: 1500px; margin: 0 auto; position: relative; z-index: 1; }
.pane { display: none; }
.pane.active { display: block; animation: fade 0.22s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ========================================================================
   KARTEN — Holzbrett mit goldenem Innenrahmen
   ======================================================================== */
.card {
  position: relative;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,0.05) 0 1px, transparent 1px 14px),
    linear-gradient(180deg, #553719 0%, #36210f 60%, #2a1808 100%);
  border: 4px solid var(--wood-dark);
  border-radius: 18px;
  padding: 26px;
  margin-bottom: 24px;
  box-shadow:
    inset 0 0 0 2px rgba(255,200,120,0.08),
    inset 0 -10px 0 rgba(0,0,0,0.32),
    inset 0 4px 0 rgba(255,220,150,0.07),
    0 8px 0 var(--wood-shadow),
    0 14px 32px rgba(0,0,0,0.6);
}
/* goldener Innenrahmen */
.card::before {
  content: ''; position: absolute; inset: 6px;
  border: 2px solid rgba(255,200,100,0.22);
  border-radius: 12px;
  pointer-events: none;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.4);
}
/* Niet-Optik in den Ecken */
.card::after {
  content: '';
  position: absolute; inset: 10px;
  background-image:
    radial-gradient(circle at top left, var(--gold) 0 4px, transparent 5px),
    radial-gradient(circle at top right, var(--gold) 0 4px, transparent 5px),
    radial-gradient(circle at bottom left, var(--gold) 0 4px, transparent 5px),
    radial-gradient(circle at bottom right, var(--gold) 0 4px, transparent 5px);
  background-repeat: no-repeat;
  pointer-events: none;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.6));
}
.card h2 {
  margin: 0 0 18px;
  font-size: 24px;
  color: var(--gold-light);
  text-shadow:
    2px 2px 0 var(--wood-dark),
    3px 3px 0 rgba(0,0,0,0.55),
    0 0 14px rgba(255,210,100,0.2);
}

/* Stat-Kacheln */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  position: relative;
  background:
    radial-gradient(circle at 30% 0%, rgba(255,255,255,0.55) 0%, transparent 50%),
    linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-mid) 100%);
  border: 4px solid var(--wood-dark);
  border-radius: 14px;
  padding: 16px 18px;
  color: var(--ink);
  box-shadow:
    inset 0 -6px 0 rgba(0,0,0,0.22),
    inset 0 2px 0 rgba(255,255,255,0.5),
    0 6px 0 var(--wood-shadow),
    0 10px 22px rgba(0,0,0,0.45);
  text-shadow: 1px 1px 0 rgba(255,255,255,0.4);
}
.stat-card .label { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; opacity: 0.85; }
.stat-card .value { font-family: 'Lilita One', cursive; font-size: 30px; line-height: 1.05; margin-top: 4px; }

/* ========================================================================
   FORMULARE
   ======================================================================== */
input, select, textarea {
  font-family: 'Fredoka', sans-serif;
  background: linear-gradient(180deg, #fef6dd, #f1e0a9);
  color: var(--ink);
  border: 3px solid var(--wood-dark);
  padding: 9px 14px;
  border-radius: 8px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.25), inset 0 -1px 0 rgba(255,255,255,0.5);
  font-size: 14px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.25), 0 0 12px rgba(255,200,80,0.5);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.form-grid button { grid-column: 1 / -1; justify-self: start; }

/* ========================================================================
   KRIEGS-TABELLE
   ======================================================================== */
.war-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.war-toolbar .left, .war-toolbar .right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.war-toolbar h2 { margin: 0; }

.war-mode {
  display: inline-flex; gap: 0;
  background: rgba(0,0,0,0.4);
  border: 3px solid var(--wood-dark);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}
.war-mode button {
  border: none; border-radius: 0; background: transparent;
  color: var(--text-soft); padding: 10px 18px;
  box-shadow: none;
  font-family: 'Lilita One', cursive;
  letter-spacing: 0.5px;
}
.war-mode button.active {
  background: linear-gradient(180deg, var(--gold-light), var(--gold), var(--gold-mid));
  color: var(--ink);
  text-shadow: 1px 1px 0 rgba(255,255,255,0.45);
  box-shadow: inset 0 -3px 0 var(--gold-dark);
}

/* War-Banner mit Schild-Look */
.war-banner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  background:
    radial-gradient(circle at 50% -20%, rgba(255,200,100,0.15) 0%, transparent 60%),
    linear-gradient(180deg, var(--stone) 0%, var(--stone-dark) 100%);
  border: 4px solid var(--wood-dark);
  border-radius: 16px;
  margin-bottom: 18px;
  box-shadow:
    inset 0 -8px 0 rgba(0,0,0,0.35),
    inset 0 2px 0 rgba(255,255,255,0.08),
    0 6px 0 var(--wood-shadow),
    0 12px 26px rgba(0,0,0,0.5);
  position: relative;
}
.war-banner::before {
  content: ''; position: absolute; inset: 6px;
  border: 2px solid rgba(255,200,100,0.18);
  border-radius: 10px;
  pointer-events: none;
}

.war-banner .side { display: flex; align-items: center; gap: 16px; }
.war-banner .side.right { justify-content: flex-end; text-align: right; }
.war-banner .badge {
  width: 72px; height: 72px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold), var(--gold-mid));
  border: 4px solid var(--wood-dark);
  display: grid; place-items: center;
  font-family: 'Lilita One', cursive; font-size: 22px;
  color: var(--ink);
  box-shadow:
    inset 0 -5px 0 rgba(0,0,0,0.25),
    inset 0 2px 0 rgba(255,255,255,0.5),
    0 4px 0 var(--wood-shadow),
    0 0 18px rgba(255,200,80,0.35);
  flex-shrink: 0;
  overflow: hidden;
}
.war-banner .badge img { width: 100%; height: 100%; object-fit: cover; }
.war-banner .info .name {
  font-family: 'Lilita One', cursive; font-size: 24px; color: var(--gold-light);
  text-shadow: 2px 2px 0 var(--wood-dark), 3px 3px 0 rgba(0,0,0,0.6);
}
.war-banner .info .stats { font-size: 13px; color: var(--text-soft); }
.war-banner .vs {
  font-family: 'Lilita One', cursive; font-size: 42px;
  color: var(--gold-light);
  text-shadow:
    3px 3px 0 var(--wood-dark),
    4px 4px 0 rgba(0,0,0,0.6),
    0 0 22px rgba(255,200,80,0.4);
  padding: 0 14px;
  text-align: center;
  line-height: 1;
}
.war-banner .vs .score {
  font-size: 20px; color: var(--text); margin-top: 6px;
  text-shadow: 2px 2px 0 var(--wood-dark);
}

.war-status-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.war-status-strip .pill {
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.08) 0%, transparent 60%),
    rgba(0,0,0,0.45);
  border: 2px solid rgba(255,200,100,0.35);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.35);
}
.war-status-strip .pill strong { color: var(--gold-light); margin-left: 4px; }

.war-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 960px) {
  .war-grid { grid-template-columns: 1fr; }
  .war-banner { grid-template-columns: 1fr; text-align: center; }
  .war-banner .side.right { justify-content: center; text-align: center; }
}

.war-side-card {
  position: relative;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,0.04) 0 1px, transparent 1px 12px),
    linear-gradient(180deg, #4a2c12 0%, #2a1808 100%);
  border: 4px solid var(--wood-dark);
  border-radius: 14px;
  padding: 16px;
  box-shadow:
    inset 0 -8px 0 rgba(0,0,0,0.4),
    inset 0 2px 0 rgba(255,200,120,0.06),
    0 6px 0 var(--wood-shadow);
}
.war-side-card.opp {
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,0.04) 0 1px, transparent 1px 12px),
    linear-gradient(180deg, #4a1c1c 0%, #240e0e 100%);
}
.war-side-card .side-title {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px dashed rgba(255,200,100,0.2);
}
.war-side-card .side-title h3 {
  margin: 0; font-size: 20px;
  color: var(--gold-light);
  text-shadow: 2px 2px 0 var(--wood-dark);
}
.war-side-card.opp .side-title h3 { color: #ffb0b0; }

.player-row {
  display: grid;
  grid-template-columns: 36px 1fr auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255,200,100,0.08);
  font-size: 14px;
  border-radius: 6px;
  transition: background 0.15s;
}
.player-row:last-child { border-bottom: none; }
.player-row:hover { background: rgba(255,255,255,0.03); }
.player-row.me {
  background: linear-gradient(90deg, rgba(255,210,90,0.12), rgba(255,210,90,0.04));
  border-radius: 8px;
}
.player-row .pos {
  display: grid; place-items: center;
  font-family: 'Lilita One', cursive;
  background: linear-gradient(180deg, #5c4a30, #3a2c1a);
  border-radius: 8px;
  width: 32px; height: 32px;
  color: var(--gold-light);
  font-size: 14px;
  border: 1px solid var(--wood-dark);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.35);
}
.player-row .pname { font-weight: 600; }
.player-row .pname small { display: block; color: var(--text-dim); font-size: 11px; font-weight: 400; }
.player-row .th-badge {
  background: linear-gradient(180deg, #5c4a30, #3a2c1a);
  color: var(--gold-light);
  font-family: 'Lilita One', cursive;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  border: 2px solid var(--wood-dark);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.35);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}
.player-row .attacks { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* Angriffs-Pille */
.attack-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,0.4);
  border: 2px solid var(--wood-dark);
  padding: 5px 11px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  min-width: 96px;
  justify-content: center;
  transition: filter 0.1s, transform 0.1s;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.35);
}
.attack-pill:hover { filter: brightness(1.2); transform: translateY(-1px); }
.attack-pill.locked { cursor: not-allowed; opacity: 0.65; }
.attack-pill.done {
  background: linear-gradient(180deg, #7be77b, var(--green), var(--green-deep));
  border-color: #155621;
  box-shadow: inset 0 -3px 0 #155621, inset 0 1px 0 rgba(255,255,255,0.3);
  color: white;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
}
.attack-pill.empty {
  background: rgba(0,0,0,0.5);
  color: var(--text-dim);
  border-style: dashed;
}
.attack-pill .stars { letter-spacing: 1px; color: var(--gold-light); text-shadow: 1px 1px 0 rgba(0,0,0,0.5); }
.attack-pill.done .stars { color: #fff8c0; }
.attack-pill .pct { color: white; font-weight: 700; }
.attack-pill .time { color: rgba(255,255,255,0.85); font-size: 10px; opacity: 0.9; }

.notes-btn {
  background: transparent;
  border: 2px dashed rgba(255, 215, 100, 0.4);
  color: var(--gold-light);
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  box-shadow: none;
  text-shadow: none;
}
.notes-btn:hover { background: rgba(255, 215, 100, 0.12); border-style: solid; }
.notes-btn .count {
  background: var(--gold);
  color: var(--ink);
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10px;
  margin-left: 4px;
  font-weight: 700;
  box-shadow: 0 0 6px rgba(255,200,80,0.4);
}

/* ========================================================================
   MITGLIEDER LISTE
   ======================================================================== */
.member-row {
  display: grid;
  grid-template-columns: 50px 1fr auto auto auto auto;
  gap: 14px;
  padding: 12px;
  align-items: center;
  border-bottom: 1px solid rgba(255,200,100,0.08);
  border-radius: 8px;
  transition: background 0.15s;
}
.member-row:hover { background: rgba(255,255,255,0.03); }
.member-row .num {
  font-family: 'Lilita One', cursive;
  color: var(--gold-light);
  background: linear-gradient(180deg, #5c4a30, #3a2c1a);
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 2px solid var(--wood-dark);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.35);
}
.member-row .role-tag {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-dim);
  background: rgba(0,0,0,0.35);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
}
.member-row .trophies {
  font-family: 'Lilita One', cursive;
  color: var(--gold-light);
  font-size: 16px;
  text-shadow: 1px 1px 0 var(--wood-dark);
}
.member-row .actions { display: flex; gap: 6px; }
.member-row .icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  padding: 0;
  font-size: 16px;
}

/* ========================================================================
   War Log
   ======================================================================== */
.warlog-entry {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 14px;
  padding: 14px;
  align-items: center;
  border-bottom: 1px solid rgba(255,200,100,0.1);
}
.result-tag {
  font-family: 'Lilita One', cursive;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 8px;
  text-align: center;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
  border: 2px solid;
}
.result-tag.win { background: linear-gradient(180deg, #7be77b, var(--green-deep)); color: white; border-color: #0c3a14; box-shadow: inset 0 -3px 0 #0c3a14; }
.result-tag.lose { background: linear-gradient(180deg, #f08585, var(--red-deep)); color: white; border-color: #3a0a0a; box-shadow: inset 0 -3px 0 #3a0a0a; }
.result-tag.tie { background: linear-gradient(180deg, var(--gold-light), var(--gold-mid)); color: var(--ink); border-color: var(--gold-deep); box-shadow: inset 0 -3px 0 var(--gold-deep); text-shadow: 1px 1px 0 rgba(255,255,255,0.4); }

table.data { width: 100%; border-collapse: collapse; margin-top: 12px; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid rgba(255,200,100,0.1); text-align: left; }
table.data th { color: var(--gold-light); font-family: 'Lilita One', cursive; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }

/* ========================================================================
   DIALOGE — Pergament im Holzrahmen
   ======================================================================== */
dialog {
  border: 4px solid var(--wood-dark);
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,0.04) 0 1px, transparent 1px 14px),
    linear-gradient(180deg, #553719 0%, #2a1808 100%);
  color: var(--text);
  border-radius: 18px;
  padding: 26px;
  min-width: 380px;
  max-width: 720px;
  box-shadow:
    inset 0 0 0 2px rgba(255,200,120,0.12),
    inset 0 -8px 0 rgba(0,0,0,0.35),
    0 16px 40px rgba(0,0,0,0.7);
}
dialog::backdrop {
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(3px);
}
dialog form { display: flex; flex-direction: column; gap: 12px; }
dialog label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-soft); font-weight: 600; }
dialog label.checkbox { flex-direction: row; align-items: center; }
dialog textarea { min-height: 90px; resize: vertical; }
dialog h2 {
  margin: 0 0 8px; font-size: 24px;
  color: var(--gold-light);
  text-shadow: 2px 2px 0 var(--wood-dark), 3px 3px 0 rgba(0,0,0,0.6);
}
.modal-body { display: flex; flex-direction: column; gap: 14px; }

.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.right { justify-content: flex-end; }

.hint { color: var(--text-dim); font-size: 13px; margin-top: 8px; font-style: italic; }
.error { color: #ff9a9a; min-height: 1.2em; font-weight: 600; }

/* Sterne-Picker */
.stars-picker { display: flex; gap: 6px; }
.stars-picker button {
  background: linear-gradient(180deg, var(--stone-light), var(--stone));
  border: 2px solid var(--stone-dark);
  padding: 8px 14px;
  font-size: 16px;
  border-radius: 8px;
}
.stars-picker button.active {
  background: linear-gradient(180deg, var(--gold-light), var(--gold), var(--gold-mid));
  color: var(--ink);
  border-color: var(--gold-dark);
  box-shadow: inset 0 -3px 0 var(--gold-dark), 0 0 14px rgba(255,200,80,0.55);
}

/* Notizen */
.note-item {
  background: linear-gradient(180deg, #fbf2d6, #ecd896);
  color: var(--ink);
  border: 2px solid var(--wood-dark);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 3px 4px 0 rgba(0,0,0,0.35);
  position: relative;
}
.note-item::before {
  content: '';
  position: absolute; left: 50%; top: -8px;
  width: 28px; height: 10px; transform: translateX(-50%);
  background: linear-gradient(180deg, #f08585, var(--red));
  border-radius: 3px;
  box-shadow: 1px 2px 0 rgba(0,0,0,0.4);
}
.note-item .meta { color: var(--gold-deep); font-size: 12px; margin-bottom: 6px; font-weight: 600; }
.note-item .meta button { background: transparent; border: none; color: var(--red-deep); padding: 0 4px; cursor: pointer; box-shadow: none; text-shadow: none; }
.note-item .content { white-space: pre-wrap; }

/* ========================================================================
   PLAYER-DETAIL MODAL
   ======================================================================== */
.player-detail .head {
  display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center;
  margin-bottom: 14px;
}
.player-detail .avatar {
  width: 80px; height: 80px;
  display: grid; place-items: center;
  background: linear-gradient(180deg, var(--gold-light), var(--gold-mid));
  border: 4px solid var(--wood-dark);
  border-radius: 14px;
  font-family: 'Lilita One', cursive;
  font-size: 26px;
  color: var(--ink);
  box-shadow: inset 0 -4px 0 rgba(0,0,0,0.25), 0 4px 0 var(--wood-shadow);
  text-shadow: 1px 1px 0 rgba(255,255,255,0.4);
}
.player-detail .name { font-family: 'Lilita One', cursive; color: var(--gold-light); font-size: 22px; text-shadow: 2px 2px 0 var(--wood-dark); }
.player-detail .sub { color: var(--text-dim); font-size: 13px; }

.kpi-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin: 12px 0;
}
.kpi {
  background: rgba(0,0,0,0.35);
  border: 2px solid rgba(255,200,100,0.25);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}
.kpi .l { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.kpi .v { font-family: 'Lilita One', cursive; color: var(--gold-light); font-size: 18px; }

.heroes h4 {
  margin: 14px 0 6px; color: var(--gold-light);
  font-family: 'Lilita One', cursive; font-size: 14px; text-transform: uppercase; letter-spacing: 1px;
}
.hero-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.hero-pill {
  background: rgba(0,0,0,0.35);
  border: 2px solid rgba(255,200,100,0.25);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px;
}
.hero-pill .lvl {
  background: linear-gradient(180deg, var(--gold-light), var(--gold-mid));
  color: var(--ink);
  font-family: 'Lilita One', cursive;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--wood-dark);
  text-shadow: 1px 1px 0 rgba(255,255,255,0.4);
}
.hero-pill.maxed .lvl { box-shadow: 0 0 10px rgba(255,200,80,0.5); }

/* ========================================================================
   8-BALL POOL
   ======================================================================== */
.pool-header {
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.pool-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pool-stat {
  background: rgba(0,0,0,0.45);
  border: 2px solid rgba(255,200,100,0.35);
  padding: 8px 16px; border-radius: 999px;
  color: var(--text-soft); font-weight: 600; font-size: 14px;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.35);
}
.pool-stat strong {
  color: var(--gold-light);
  font-family: 'Lilita One', cursive;
  font-size: 20px;
  margin-left: 6px;
  text-shadow: 1px 1px 0 var(--wood-dark);
}

.pool-wrap { display: flex; flex-direction: column; gap: 12px; align-items: center; }

.pool-frame {
  position: relative;
  padding: 22px;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,0.04) 0 1px, transparent 1px 14px),
    linear-gradient(180deg, var(--wood-light) 0%, var(--wood) 50%, var(--wood-dark) 100%);
  border: 4px solid var(--wood-dark);
  border-radius: 22px;
  box-shadow:
    inset 0 0 0 2px rgba(255,200,120,0.15),
    inset 0 -10px 0 rgba(0,0,0,0.35),
    inset 0 4px 0 rgba(255,220,150,0.08),
    0 12px 0 var(--wood-shadow),
    0 18px 36px rgba(0,0,0,0.6);
  max-width: 100%;
}
.pool-frame::before {
  content: '';
  position: absolute; inset: 8px;
  border: 2px solid rgba(255,200,100,0.25);
  border-radius: 16px;
  pointer-events: none;
}
.pool-frame::after {
  content: '';
  position: absolute; inset: 14px;
  background-image:
    radial-gradient(circle at top left, var(--gold) 0 5px, transparent 6px),
    radial-gradient(circle at top right, var(--gold) 0 5px, transparent 6px),
    radial-gradient(circle at bottom left, var(--gold) 0 5px, transparent 6px),
    radial-gradient(circle at bottom right, var(--gold) 0 5px, transparent 6px);
  background-repeat: no-repeat;
  pointer-events: none;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.7));
}

#pool-canvas {
  display: block;
  border-radius: 10px;
  background: #0d4d2e;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.5), 0 4px 18px rgba(0,0,0,0.5);
  cursor: crosshair;
  max-width: 100%;
  touch-action: none;
}

.pool-power {
  width: 100%;
  max-width: 900px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.pool-power-label {
  font-family: 'Lilita One', cursive;
  color: var(--gold-light);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-shadow: 1px 1px 0 var(--wood-dark);
  width: 70px;
  flex-shrink: 0;
}
.pool-power-bar {
  flex: 1;
  height: 18px;
  background: rgba(0,0,0,0.55);
  border: 3px solid var(--wood-dark);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}
#pool-power-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--green) 0%, var(--gold) 50%, var(--red) 100%);
  border-radius: 999px;
  transition: width 0.06s linear;
  box-shadow: 0 0 10px rgba(255,200,80,0.4);
}

.pool-message {
  text-align: center;
  font-family: 'Lilita One', cursive;
  font-size: 20px;
  color: var(--gold-light);
  text-shadow: 2px 2px 0 var(--wood-dark);
  min-height: 24px;
  margin: 8px 0;
}

@media (max-width: 960px) {
  #pool-canvas { width: 100%; height: auto; }
  .pool-frame { padding: 12px; }
}

/* ========================================================================
   MISC
   ======================================================================== */
.admin-only[hidden] { display: none !important; }
.auth-only[hidden] { display: none !important; }

@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; padding: 10px 16px; }
  nav#tabs { order: 3; flex-basis: 100%; overflow-x: auto; }
  main { padding: 16px 12px; }
  .card { padding: 18px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .player-row { grid-template-columns: 28px 1fr; gap: 8px; }
  .player-row .th-badge, .player-row .attacks, .player-row .notes-btn { grid-column: 2; justify-self: start; }
  .member-row { grid-template-columns: 40px 1fr auto; gap: 8px; }
  .member-row .role-tag, .member-row .th-badge, .member-row .trophies { grid-column: 2; justify-self: start; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}
