:root{
  --bg:#0b0f17;
  --panel:#121a27;
  --panel2:#0f1622;
  --text:#e8eefc;
  --muted:#9fb0d0;
  --border:rgba(255,255,255,.12);
  --accent:#6aa6ff;
  --accent2:#88ffcc;
  --shadow:0 12px 32px rgba(0,0,0,.35);
  --radius:18px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(106,166,255,.25), transparent 60%),
    radial-gradient(900px 500px at 80% 10%, rgba(136,255,204,.16), transparent 55%),
    var(--bg);
}

a{ color:inherit; text-decoration:none; }
a:hover{ text-decoration:underline; }

.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px;
  border-bottom:1px solid var(--border);
  background:rgba(10,14,22,.65);
  backdrop-filter: blur(10px);
}

.brand{ display:flex; align-items:center; gap:10px; }
.logo{ font-size:22px; }
.name{ font-weight:800; letter-spacing:.2px; }
.badge{
  font-size:12px;
  color:var(--muted);
  border:1px solid var(--border);
  padding:4px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.04);
}

.nav{ display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.nav-link{
  padding:8px 10px;
  border-radius:999px;
  border:1px solid transparent;
  color:var(--muted);
}
.nav-link:hover{
  border-color:var(--border);
  background:rgba(255,255,255,.04);
  color:var(--text);
}

.container{
  max-width:1200px;
  margin:0 auto;
  padding:18px;
}

.head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
  margin-bottom:14px;
}

h1{ margin:10px 0 6px; font-size:34px; }
h2{ margin:0 0 10px; font-size:18px; }
.muted{ color:var(--muted); }

.controls{ display:flex; gap:10px; flex-wrap:wrap; align-items:flex-end; }

.field{ display:grid; gap:6px; }
.field span{ font-size:12px; color:var(--muted); }

input, select{
  height:40px;
  padding:0 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.03);
  color:var(--text);
  outline:none;
}
input:focus, select:focus{ border-color: rgba(106,166,255,.55); }

.btn{
  height:40px;
  padding:0 14px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  color:var(--text);
  cursor:pointer;
}
.btn:hover{ background:rgba(255,255,255,.07); }
.btn.primary{
  border-color: rgba(106,166,255,.45);
  background: rgba(106,166,255,.18);
}
.btn.primary:hover{ background: rgba(106,166,255,.25); }

.btn.ghost{
  height:34px;
  border-radius:12px;
  background: rgba(255,255,255,.03);
  color: var(--muted);
}
.btn.ghost:hover{
  background: rgba(255,255,255,.06);
  color: var(--text);
}

.layout{
  display:grid;
  grid-template-columns: 1.55fr 1fr;
  gap:14px;
}
@media (max-width: 980px){
  .layout{ grid-template-columns:1fr; }
}

.panel{
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding:14px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), transparent), var(--panel2);
  box-shadow: var(--shadow);
}

/* --- Stage --- */
.stage-top{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
  color:var(--muted);
  font-size:13px;
  margin-bottom:10px;
}

.flag-wrap{
  display:grid;
  gap:10px;
}

.flag-frame{
  position:relative;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  overflow:hidden;
  min-height: 520px;
  display:grid;
  place-items:center;
}

.flag-frame img{
  width: min(720px, 92%);
  height: auto;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  user-select:none;
  -webkit-user-drag: none;
  transition: filter .18s ease, transform .18s ease;
}

.overlay{
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:0;
  transition: opacity .18s ease;
  background:
    radial-gradient(900px 500px at 20% 0%, rgba(106,166,255,.20), transparent 60%),
    radial-gradient(900px 500px at 80% 10%, rgba(136,255,204,.12), transparent 55%);
}

.overlay.on{ opacity:1; }

.hint{
  margin:0;
  font-size:12px;
  color:var(--muted);
}

/* --- Chat --- */
.chat .guess{ display:flex; gap:8px; }
.chat .guess input{ flex:1; }

.quick{
  margin-top:10px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.log{
  margin-top:12px;
  height:280px;
  overflow:auto;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.02);
  padding:10px;
  font-size:13px;
}

.msg{ margin:0 0 10px; }
.meta{ color:var(--muted); font-size:12px; }

.footer{
  margin:14px auto 18px;
  max-width:1200px;
  padding:0 18px;
  display:flex;
  justify-content:center;
  color:var(--muted);
}


/* Optional: sorgt für weiches Update beim Ändern von Blur/Zoom */
.flag-frame img{
  transition: filter .08s linear, transform .08s linear;
}

/* ===========================
   FLAGS THEME (PURPLE ACCENT)
   =========================== */

:root{
  --t-accent: rgba(186, 140, 255, .95);
  --t-accentSoft: rgba(186, 140, 255, .14);
  --accent: var(--t-accent);
}

/* Focus */
input:focus, select:focus{
  border-color: rgba(186,140,255,.55);
  box-shadow: 0 0 0 4px rgba(186,140,255,.14);
}

/* Primary buttons */
.btn.primary{
  border-color: rgba(186,140,255,.45);
  background: rgba(186,140,255,.18);
}
.btn.primary:hover{
  background: rgba(186,140,255,.25);
}

/* Badge tint */
.badge{
  background: linear-gradient(90deg, rgba(186,140,255,.10), rgba(136,255,204,.06));
}

/* Purple overlay glow (optional) */
.overlay{
  background:
    radial-gradient(900px 500px at 20% 0%, rgba(186,140,255,.18), transparent 60%),
    radial-gradient(900px 500px at 80% 10%, rgba(136,255,204,.10), transparent 55%);
}

/* Mobile: flag stage height should not force huge scroll */
@media (max-width: 720px){
  h1{ font-size: 28px; }
  .controls{ width:100%; }
  .controls .btn{ flex: 1 1 auto; }

  .flag-frame{
    min-height: min(52vh, 420px);
  }
  .flag-frame img{
    width: min(560px, 94%);
  }
}

.sep{ opacity:.5; }
.footer a{ color: inherit; }
.footer a:hover{ text-decoration: underline; }

html { background: var(--bg); }
body { background: none; }

body::before{
  content:"";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;

  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(106,166,255,.25), transparent 60%),
    radial-gradient(900px 500px at 80% 10%, rgba(136,255,204,.16), transparent 55%),
    var(--bg);
}

/* ===========================
   iOS keyboard: prevent auto-zoom
   =========================== */
html{
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (max-width: 980px){
  input, select, textarea, button{
    font-size: 16px;      /* <- wichtig: verhindert iOS Zoom */
    line-height: 1.2;
  }
}
