:root{
  --bg: #fafafc;
  --card: #ffffff;
  --border: #e5e5e7;
  --text: #111111;
  --muted: #6e6e73;
  --accent: #0071e3; /* Apple blue */
  --accent-press: #005bb5;
  --radius: 20px;
  --shadow: 0 6px 24px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.06);
}
@media (prefers-color-scheme: dark){
  :root{
    --bg:#0b0b0d;
    --card:#141416;
    --border:#2a2a2e;
    --text:#f5f5f7;
    --muted:#9e9ea2;
    --accent:#2997ff;
    --accent-press:#147ce5;
    --shadow: 0 8px 30px rgba(0,0,0,.35);
  }
}

*{box-sizing:border-box;}
html, body{height:100%;}
body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container{
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.nav{
  display:flex; align-items:center; justify-content:space-between;
  padding: 12px 0 8px;
}
.brand{
  display:flex; gap:10px; align-items:center;
}
.brand .dot{
  width:14px; height:14px; border-radius:50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 20%, transparent);
}
.brand h1{font-size:22px; font-weight:700; margin:0; letter-spacing:.2px;}
.qr { height:56px; border-radius:12px; border:1px solid var(--border); }

.hero{
  margin: 12px 0 26px;
  padding: 28px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 12%, var(--card)) , var(--card));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.hero h2{ font-size: clamp(28px, 3.5vw, 40px); line-height:1.1; margin:0 0 8px; font-weight: 800; letter-spacing:-.3px; }
.hero p{ margin:0; color: var(--muted); font-size: 15px; }

.grid{
  display:grid; gap:20px;
  grid-template-columns: 1fr;
}
@media (min-width: 960px){
  .grid{ grid-template-columns: 1fr 1.2fr; }
}

.card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

label{ display:block; font-weight:600; margin-bottom:6px; font-size:14px;}
input, textarea{
  width:100%; padding: 13px 14px; border-radius:14px;
  border:1px solid var(--border); background:transparent; color:var(--text);
  outline:none; transition: border-color .2s ease, box-shadow .2s ease;
}
input:focus, textarea:focus{
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent);
}
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  padding: 12px 16px;
  border-radius: 999px;
  border:none; background: var(--accent); color: white;
  font-weight:600; letter-spacing:.2px; cursor:pointer;
  transition: transform .06s ease, filter .2s ease, background .2s ease;
}
.btn:active{ transform: translateY(1px); background: var(--accent-press); }
.btn-outline{
  background: transparent; color: var(--text);
  border:1px solid var(--border);
}
.btn-outline:hover{
  border-color: var(--accent);
}

.stack{ display:flex; flex-direction:column; gap: 14px; }
.row{ display:flex; gap:12px; }
.row > *{ flex:1; }

.list{ display:flex; flex-direction:column; gap: 10px; margin-top: 8px; }
.item{
  display:flex; align-items:center; justify-content:space-between;
  padding: 14px; border:1px solid var(--border); border-radius: 16px; background: color-mix(in srgb, var(--card) 96%, white);
}
.title{ font-weight:700; }
.meta{ color: var(--muted); font-size: 13px; }

.vote{
  display:flex; flex-direction:column; align-items:center; gap:6px;
}
.vote .count{ font-weight:800; }

.badge{
  display:inline-flex; align-items:center; gap:8px;
  padding: 6px 10px; border-radius:999px; font-size:12px;
  border:1px solid var(--border); color: var(--muted);
}

.footer{
  margin-top: 26px; display:flex; justify-content:flex-end;
}
.small{ font-size: 12px; color: var(--muted); }

/* Admin */
.table{ display:flex; flex-direction:column; gap:12px; }
.rowline{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px; border:1px solid var(--border); border-radius:16px; background: var(--card);
}
.actions{ display:flex; gap:10px; }
.tag{ font-size:12px; padding:4px 10px; border-radius:999px; border:1px solid var(--border); color: var(--muted); }
.tag.green{ color:#2aa84a; border-color: color-mix(in srgb, #2aa84a 40%, var(--border)); }

/* --- Admin UI polish --- */
.admin-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.admin-row{
  align-items:flex-start;
}

.admin-left{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width: 240px;
}

.admin-meta{
  line-height: 1.35;
  word-break: break-word;
}

.admin-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:flex-end;
}

/* Optional: gespielte Einträge leicht dezent (nur optisch) */
.admin-row.is-played{
  opacity: 0.85;
}

/* --- Admin cleanup buttons --- */
.danger-zone{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.btn-danger{ background:#b00020; }
.btn-danger:active{ background:#8a0019; }

.btn-warning{ background:#e67e22; }
.btn-warning:active{ background:#c86510; }

.btn-secondary{ background:#6e6e73; }
.btn-secondary:active{ background:#55555a; }

/* Tap-to-Zoom QR overlay */
.qr-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 9999;
  padding: 20px;
}

.qr-overlay-img{
  width: min(82vw, 420px);
  height: auto;
  border-radius: 18px;
  background: white;
  padding: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}

.qr-overlay-hint{
  color: rgba(255,255,255,.9);
  font-size: 14px;
}

/* iOS Safari: Prevent auto-zoom on form focus (needs >= 16px) */
input, textarea, select {
  font-size: 16px;
}