@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #0f1216;
  --panel: #171b21;
  --panel-2: #1d222a;
  --border: #262c36;
  --text: #e7e9ec;
  --text-dim: #8a929e;
  --on-air: #ff5a3c;
  --live: #2dd4bf;
  --gold: #ffb020;
  --danger: #e5484d;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 15% 0%, rgba(45, 212, 191, 0.06), transparent 40%),
    radial-gradient(circle at 85% 10%, rgba(255, 90, 60, 0.05), transparent 35%);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  min-height: 100vh;
}

.mono { font-family: 'JetBrains Mono', monospace; }

#login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; }

.login-box {
  width: min(360px, 90vw);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  text-align: center;
}
.login-box .on-air-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-dim); display: inline-block; margin-right: 8px; }
.login-box h1 { font-family: 'Space Grotesk', sans-serif; font-size: 1.4rem; margin: 4px 0 24px; letter-spacing: 0.02em; }
.login-box input {
  width: 100%; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); font-size: 0.95rem; margin-bottom: 14px;
}
.login-box button { width: 100%; }
.login-error { color: var(--danger); font-size: 0.85rem; min-height: 18px; margin-bottom: 4px; }

#app { display: none; max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; }

header.top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px; padding-bottom: 18px; border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .signal { width: 12px; height: 12px; border-radius: 50%; background: var(--text-dim); box-shadow: 0 0 0 3px rgba(255,255,255,0.03); transition: background 0.3s, box-shadow 0.3s; }
.brand .signal.on { background: var(--on-air); box-shadow: 0 0 12px 2px rgba(255, 90, 60, 0.55); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.brand h1 { font-family: 'Space Grotesk', sans-serif; font-size: 1.25rem; margin: 0; letter-spacing: 0.01em; }
.brand .sub { color: var(--text-dim); font-size: 0.8rem; margin-top: 2px; }

.twitch-badge { font-size: 0.75rem; padding: 5px 10px; border-radius: 20px; border: 1px solid var(--border); color: var(--text-dim); }
.twitch-badge.connected { color: var(--live); border-color: rgba(45,212,191,0.35); }

button.logout-link { background: none; border: none; color: var(--text-dim); font-size: 0.8rem; cursor: pointer; text-decoration: underline; }

.grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; }
@media (max-width: 820px) { .grid { grid-template-columns: 1fr; } }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.panel h2 { font-family: 'Space Grotesk', sans-serif; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin: 0 0 16px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.78rem; color: var(--text-dim); margin-bottom: 6px; }
.field input[type="text"], .field input[type="password"] {
  width: 100%; padding: 11px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); font-family: 'JetBrains Mono', monospace; font-size: 0.95rem;
}

.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

button {
  border: none; border-radius: 8px; padding: 11px 16px; font-size: 0.88rem; font-weight: 600;
  cursor: pointer; transition: transform 0.05s, opacity 0.2s; font-family: 'Inter', sans-serif;
}
button:active { transform: scale(0.98); }
button:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary { background: var(--live); color: #06211d; }
.btn-danger { background: var(--danger); color: #2a0709; }
.btn-gold { background: var(--gold); color: #2b1900; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }

.status-line { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-dim); margin-top: 12px; }
.status-line .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); }
.status-line.active .dot { background: var(--on-air); box-shadow: 0 0 8px 1px rgba(255,90,60,0.6); }
.status-line.active { color: var(--on-air); }

.weight-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 14px; }
.weight-item label { font-size: 0.75rem; color: var(--text-dim); display: flex; justify-content: space-between; }
.weight-item input { width: 100%; margin-top: 6px; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font-family: 'JetBrains Mono', monospace; }

.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-dim); margin-bottom: 14px; }

.pool-bar { height: 8px; border-radius: 4px; overflow: hidden; display: flex; background: var(--panel-2); margin-bottom: 14px; border: 1px solid var(--border); }
.pool-bar .seg { height: 100%; }

.entry-list { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.entry-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 10px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--border); font-size: 0.85rem; }
.entry-row.won { opacity: 0.45; }
.entry-name { font-family: 'JetBrains Mono', monospace; display: flex; align-items: center; gap: 8px; }

.badge { font-size: 0.65rem; padding: 2px 6px; border-radius: 4px; font-weight: 600; text-transform: uppercase; }
.badge.sub { background: rgba(45,212,191,0.15); color: var(--live); }
.badge.vip { background: rgba(255,176,32,0.18); color: var(--gold); }
.badge.mod { background: rgba(120,144,255,0.18); color: #7f94ff; }

.remove-x { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 0.9rem; padding: 2px 6px; }
.remove-x:hover { color: var(--danger); }

.empty-state { color: var(--text-dim); font-size: 0.85rem; text-align: center; padding: 24px 0; }

#winner-banner {
  display: none; background: linear-gradient(135deg, rgba(255,176,32,0.15), rgba(255,90,60,0.1));
  border: 1px solid rgba(255,176,32,0.35); border-radius: var(--radius); padding: 16px 20px;
  margin-bottom: 20px; font-family: 'Space Grotesk', sans-serif; font-size: 1.1rem; text-align: center;
}
#winner-banner .username { color: var(--gold); }

.winners-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.winner-chip { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; padding: 5px 10px; border-radius: 20px; background: rgba(255,176,32,0.12); color: var(--gold); border: 1px solid rgba(255,176,32,0.3); display: inline-flex; align-items: center; gap: 6px; }
.winner-requeue-btn { background: none; border: none; color: var(--gold); cursor: pointer; font-size: 0.85rem; line-height: 1; padding: 0; opacity: 0.75; }
.winner-requeue-btn:hover { opacity: 1; color: var(--live); }

.count-tag { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--text-dim); }

/* ---------- nyelvváltó ---------- */
.lang-switch {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 1100;
  display: flex;
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}
.lang-switch button {
  padding: 5px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  border: none;
}
.lang-switch button.selected { background: var(--live); color: #06211d; }

/* fejlécbe ágyazott verzió: normál flex elem, nincs fixen pozicionálva */
.lang-switch.lang-switch-inline {
  position: static;
  top: auto;
  right: auto;
  z-index: auto;
}

#winner-chat-toasts {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  width: min(340px, 90vw);
}

.watch-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--live);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  overflow: hidden;
  animation: watch-in 0.18s ease-out;
}
@keyframes watch-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.watch-box-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
}
.watch-box-header .name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--live);
  font-weight: 600;
  flex: 1;
}
.watch-box-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 2px 4px;
}
.watch-box-close:hover { color: var(--danger); }

.watch-box-messages {
  padding: 8px 10px;
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.watch-box-empty {
  color: var(--text-dim);
  font-size: 0.78rem;
  font-style: italic;
}
.watch-box-msg {
  font-size: 0.82rem;
  color: var(--text);
  word-break: break-word;
}
.watch-box-ts {
  color: var(--gold);
  font-size: 0.72rem;
}


/* ---------- kapcsolat-mód váltó ---------- */
.method-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.method-tab {
  flex: 1; padding: 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text-dim); font-size: 0.8rem; font-weight: 600; text-align: center; cursor: pointer;
}
.method-tab.selected { border-color: var(--live); color: var(--live); background: rgba(45,212,191,0.08); }
.method-section { display: none; }
.method-section.visible { display: block; }
.error-box {
  display: none; color: var(--danger); font-size: 0.78rem; margin-top: 8px; padding: 8px 10px;
  background: rgba(229,72,77,0.1); border-radius: 6px;
}
