* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #0a1628;
  color: #e8eaf0;
  padding: 20px;
  min-height: 100vh;
}

/* ── Topbar / Nav ─────────────────────────────────────────────────── */
.topbar { max-width: 1400px; margin: 0 auto 18px; }
.topbar h1 { text-align: center; font-size: 1.6rem; color: #ffd700; text-shadow: 0 0 20px rgba(255,215,0,0.4); margin-bottom: 10px; }
.userbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; }
.userbar .me { color: #aab; font-size: 0.9rem; }
.userbar .me strong { color: #ffd700; }
.nav-group { display: flex; flex-wrap: wrap; gap: 6px; }
.nav-link {
  background: #1e2d4a; color: #ccd; border: 1px solid #334;
  padding: 5px 12px; border-radius: 18px; font-size: 0.82rem;
  text-decoration: none; transition: all 0.2s;
}
.nav-link:hover { background: #2a3d5e; color: #fff; }
.nav-link.active { background: #ffd700; color: #0a1628; border-color: #ffd700; font-weight: bold; }
.nav-trade { font-size: 0.78rem; opacity: 0.85; }
.logout-form { margin: 0; }
.btn-logout {
  background: transparent; color: #ccd; border: 1px solid #334;
  padding: 5px 12px; border-radius: 18px; cursor: pointer; font-size: 0.82rem;
}
.btn-logout:hover { background: #8b0000; color: #fff; border-color: #8b0000; }

/* ── Summary ─────────────────────────────────────────────────────── */
.summary-bar { max-width: 1400px; margin: 0 auto 16px; text-align: center; }
.summary-bar h2 { color: #ffd700; font-size: 1.1rem; margin-bottom: 6px; }
.summary-bar p { color: #aab; font-size: 0.95rem; margin-bottom: 8px; }
.summary-bar p strong { color: #ff8c00; font-size: 1.1rem; }
.total-bar-wrap { max-width: 600px; margin: 0 auto; background: #1e2d4a; border-radius: 8px; height: 12px; overflow: hidden; }
.total-bar { height: 100%; background: linear-gradient(90deg, #ff8c00, #e64a19); border-radius: 8px; transition: width 0.3s; }

/* ── Filter bar ──────────────────────────────────────────────────── */
.filter-bar { text-align: center; margin: 14px 0 20px; }
.filter-btn {
  background: #1e2d4a; color: #ccd; border: 1px solid #334;
  padding: 6px 16px; border-radius: 20px; cursor: pointer; margin: 3px;
  font-size: 0.82rem; transition: all 0.2s;
}
.filter-btn:hover, .filter-btn.active {
  background: #ffd700; color: #0a1628; border-color: #ffd700; font-weight: bold;
}
.btn-download {
  display: inline-block;
  background: #1a5e20; color: #fff; border: 1px solid #1a5e20;
  padding: 6px 16px; border-radius: 20px; margin: 3px;
  font-size: 0.82rem; text-decoration: none; transition: all 0.2s;
}
.btn-download:hover { background: #2e8b3a; border-color: #2e8b3a; }

/* ── Grid + Cards ────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; max-width: 1400px; margin: 0 auto; }

.team-card { background: #132038; border: 1px solid #1e3055; border-radius: 10px; overflow: hidden; transition: box-shadow 0.2s; }
.team-card:hover { box-shadow: 0 4px 20px rgba(255,140,0,0.30); }
.team-complete:hover { box-shadow: 0 4px 20px rgba(212,175,55,0.55); }

/* Intro / Coke spans */
.intro-card, .coke-card { grid-column: 1 / -1; }

.intro-card .team-header { background: linear-gradient(135deg, #0c1e3a 0%, #162848 50%, #0c1e3a 100%); border-bottom-color: #263a5a; }
.intro-card .team-name { color: #c0b0f0; }
.intro-card:hover { box-shadow: 0 4px 20px rgba(160,140,220,0.35) !important; }

.coke-card .team-header { background: linear-gradient(135deg, #8b0000 0%, #cc0000 45%, #8b0000 100%); border-bottom-color: #cc0000; }
.coke-card .team-name { color: #fff; font-weight: 800; letter-spacing: 0.03em; }
.coke-card .team-count { color: rgba(255,255,255,0.85); }
.coke-card .team-progress-fill { background: linear-gradient(90deg, #cc0000, #ff3333); }
.coke-card:hover { box-shadow: 0 4px 20px rgba(204,0,0,0.45) !important; }

.team-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: #1a2d4e; border-bottom: 1px solid #243555; }
.team-name { font-weight: 700; font-size: 0.95rem; color: #e8f0ff; }
.team-count { font-size: 0.8rem; color: #aab; white-space: nowrap; }
.team-progress { height: 4px; background: #0d1e36; }
.team-progress-fill { height: 100%; background: linear-gradient(90deg, #ff8c00, #e64a19); transition: width 0.3s; }

.stickers { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; padding: 10px; }
.sticker-label { display: flex; flex-direction: column; align-items: center; cursor: pointer; padding: 4px 2px; border-radius: 6px; transition: background 0.15s; user-select: none; }
.sticker-label:hover { background: #1e3860; }
.sticker-label input[type="checkbox"] { display: none; }
.sticker-label input[type="checkbox"][disabled] ~ * { cursor: default; }
.sticker-label:has(input[disabled]) { cursor: default; }
.sticker-box {
  width: 24px; height: 24px; border-radius: 5px; border: 2px solid #334;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; background: #0d1e36;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.sticker-num { font-size: 0.62rem; color: #778; margin-top: 2px; }

/* Standard: "fehlt mir" = orange/red */
input:checked + .sticker-box { background: #e64a19; border-color: #e64a19; box-shadow: 0 0 8px rgba(230,74,25,0.55); }
input:checked + .sticker-box::after { content: '!'; color: white; font-weight: bold; font-size: 14px; }
input:not(:checked) + .sticker-box::after { content: ''; }
label:has(input:checked) .sticker-num { color: #ff8c00; font-weight: bold; }

/* ── Foil stickers (unchanged from original) ─────────────────────── */
@keyframes foil-sweep {
  0%   { background-position: 220% center; }
  100% { background-position: -220% center; }
}
.foil-sticker .sticker-box {
  background: linear-gradient(110deg, #0d1e36 20%, #2a4460 38%, #6a90b0 50%, #2a4460 62%, #0d1e36 80%);
  background-size: 300% auto;
  border-color: #4a6a8a;
  animation: foil-sweep 4s linear infinite;
}
.foil-sticker input:checked + .sticker-box {
  background: linear-gradient(110deg, #5a3018 15%, #c25a25 38%, #ffae5e 50%, #c25a25 62%, #5a3018 85%);
  background-size: 300% auto;
  border-color: #ff8c00;
  box-shadow: 0 0 10px rgba(255,140,0,0.65);
}
.foil-sticker input:checked + .sticker-box::after { color: #0a1628; }
.foil-sticker:has(input:checked) .sticker-num { color: #ff8c00; font-weight: bold; }

/* ── Coca-Cola stickers (unchanged from original) ────────────────── */
.coke-sticker .sticker-box { border-color: #5a0a0a; background: #110608; }
.coke-sticker input:checked + .sticker-box { background: #e61c23; border-color: #e61c23; box-shadow: 0 0 10px rgba(230,28,35,0.55); }
.coke-sticker input:checked + .sticker-box::after { color: #fff; }
.coke-sticker:has(input:checked) .sticker-num { color: #e61c23; font-weight: bold; }

/* ── "Complete" = no missing left ─────────────────────────────── */
@keyframes gold-shimmer {
  0%   { box-shadow: 0 0 8px 3px rgba(212,175,55,0.45); }
  50%  { box-shadow: 0 0 14px 5px rgba(212,175,55,0.65); }
  100% { box-shadow: 0 0 8px 3px rgba(212,175,55,0.45); }
}
.team-complete .team-header { background: linear-gradient(135deg, #b8860b 0%, #d4af37 45%, #c8960c 100%); animation: gold-shimmer 5s ease-in-out infinite; border-bottom-color: #d4af37; }
.team-complete .team-name { color: #0a1628; font-weight: 800; letter-spacing: 0.02em; }
.team-complete .team-count { color: #0a1628; }

/* ── Login ───────────────────────────────────────────────────────── */
.login-wrap { display: flex; justify-content: center; padding: 40px 10px; }
.login-form { background: #132038; border: 1px solid #1e3055; border-radius: 10px; padding: 24px 28px; width: 100%; max-width: 360px; }
.login-form h2 { color: #ffd700; margin-bottom: 16px; text-align: center; }
.login-form label { display: block; margin-bottom: 12px; }
.login-form label span { display: block; font-size: 0.85rem; color: #aab; margin-bottom: 4px; }
.login-form input, .login-form select {
  width: 100%; padding: 8px 10px; background: #0d1e36; color: #e8f0ff;
  border: 1px solid #334; border-radius: 6px; font-size: 0.95rem;
}
.login-form button {
  width: 100%; padding: 9px; margin-top: 6px;
  background: #ffd700; color: #0a1628; border: none; border-radius: 6px;
  font-weight: bold; font-size: 0.95rem; cursor: pointer;
}
.login-form button:hover { background: #ffea61; }
.login-form .error { background: #4a1c1c; color: #ffb8b8; padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; font-size: 0.85rem; }

/* ── Trade view ──────────────────────────────────────────────────── */
.legend { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; font-size: 0.82rem; color: #aab; margin-top: 6px; }
.legend-item::before { content: '■ '; margin-right: 4px; }
.legend-help::before { color: #00c853; }
.legend-mine::before { color: #ff8c00; }

.trade-sticker { cursor: help !important; }
.trade-helpable .sticker-box { background: #00c853; border-color: #00c853; box-shadow: 0 0 8px rgba(0,200,83,0.5); }
.trade-helpable .sticker-box::after { content: '✓'; color: white; font-weight: bold; font-size: 13px; }
.trade-helpable .sticker-num { color: #00c853; font-weight: bold; }
.trade-mine-too .sticker-box { background: #6a4220; border-color: #ff8c00; box-shadow: 0 0 6px rgba(255,140,0,0.3); opacity: 0.85; }
.trade-mine-too .sticker-box::after { content: '!'; color: #fff; font-weight: bold; }
.trade-mine-too .sticker-num { color: #aa7340; opacity: 0.85; }

/* Foil tweaks for trade colours */
.trade-card .foil-sticker.trade-helpable .sticker-box {
  background: linear-gradient(110deg, #1c4a26 15%, #2e8a44 38%, #6effa0 50%, #2e8a44 62%, #1c4a26 85%);
  background-size: 300% auto;
  border-color: #00c853;
  box-shadow: 0 0 10px rgba(0,200,83,0.55);
}
.trade-card .foil-sticker.trade-mine-too .sticker-box {
  background: linear-gradient(110deg, #4a3018 15%, #a25a25 38%, #d0aa5e 50%, #a25a25 62%, #4a3018 85%);
  background-size: 300% auto;
  border-color: #ff8c00;
}

/* ── Responsive (mobile) ─────────────────────────────────────────── */
@media (max-width: 720px) {
  body { padding: 12px; }
  .topbar h1 { font-size: 1.3rem; }
  .userbar { gap: 6px; }
  .userbar .me { width: 100%; text-align: center; margin-bottom: 4px; }
  .nav-link, .btn-logout { padding: 6px 10px; font-size: 0.78rem; }
  .nav-trade { font-size: 0.74rem; }
  .summary-bar h2 { font-size: 1rem; }
  .summary-bar p { font-size: 0.88rem; }
  .grid { grid-template-columns: 1fr; gap: 10px; }
  .intro-card, .coke-card { grid-column: auto; }
  .stickers { grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 10px 8px; }
  .sticker-box { width: 32px; height: 32px; border-radius: 6px; }
  .sticker-num { font-size: 0.7rem; }
  .sticker-label { padding: 6px 2px; }
  input:checked + .sticker-box::after, .trade-helpable .sticker-box::after, .trade-mine-too .sticker-box::after { font-size: 16px; }
  .filter-btn { padding: 7px 14px; font-size: 0.85rem; }
  .legend { font-size: 0.75rem; gap: 10px; }
}

@media (max-width: 380px) {
  .stickers { grid-template-columns: repeat(4, 1fr); }
  .topbar h1 { font-size: 1.15rem; }
}

@media print {
  body { background: white; color: black; padding: 10px; }
  .userbar, .filter-bar, .logout-form { display: none; }
  .team-card { border: 1px solid #ccc; break-inside: avoid; background: white; }
  .team-header { background: #003087 !important; animation: none !important; }
  .team-name, .team-count { color: white !important; }
  .sticker-box { border-color: #999; background: white; animation: none !important; }
  input:checked + .sticker-box { background: #e64a19; border-color: #e64a19; }
  .total-bar-wrap { background: #ddd; }
}
