/* HomlokMester v1 - Mobilra és fekvő homlok-játékra optimalizált design */

:root {
  --bg: #080f1e;
  --card: rgba(15, 23, 42, 0.88);
  --glass: rgba(30, 41, 59, 0.65);
  --border: rgba(148, 163, 184, 0.2);
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent2: #818cf8;
  --green: #10b981;
  --orange: #f59e0b;
  --red: #ef4444;
  --radius: 16px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

input, select {
  user-select: text;
  -webkit-user-select: text;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(56, 189, 248, 0.16), transparent 44%),
    radial-gradient(circle at 84% 88%, rgba(168, 85, 247, 0.16), transparent 45%),
    linear-gradient(180deg, #0c1428 0%, #060b16 100%);
}

#app {
  position: relative;
  width: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hidden { display: none !important; }

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Főmenü és Összegzés középre igazítása széles kijelzőn */
#home-screen, #summary-screen {
  max-width: 640px;
  margin: 0 auto;
}

/* ==================== TOP BAR ==================== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: max(12px, env(safe-area-inset-top)) 14px 10px;
  background: rgba(15, 23, 42, 0.78);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.28), rgba(168, 85, 247, 0.3));
  border: 1px solid rgba(125, 211, 252, 0.4);
  display: grid;
  place-items: center;
  font-size: 22px;
}

.brand-wrap h1 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.status-line {
  display: flex;
  gap: 6px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.status-pill {
  font-size: 0.67rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.status-pill.offline {
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.4);
}

.muted-pill {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.25);
}

.muted-pill.authed {
  background: rgba(56, 189, 248, 0.16);
  color: #bae6fd;
  border-color: rgba(56, 189, 248, 0.4);
}

.top-actions { display: flex; gap: 7px; align-items: center; }

.btn-chip {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(125, 211, 252, 0.35);
  background: rgba(56, 189, 248, 0.15);
  color: #e0f2fe;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(30, 41, 59, 0.78);
  color: var(--text);
  font-size: 18px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

/* ==================== FŐKÉPERNYŐ TARTALOM ==================== */
.home-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mode-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(15, 23, 42, 0.7);
  padding: 4px;
  border-radius: 12px;
}

.seg-btn {
  padding: 8px 6px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
}

.seg-btn.active {
  background: linear-gradient(135deg, #0284c7, #6366f1);
  color: #fff;
}

.teams-box {
  background: rgba(30, 41, 59, 0.45);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.teams-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
  color: #cbd5e1;
}

.mini-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.step-btn {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.8);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.team-names-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.team-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.team-input {
  flex: 1;
  min-width: 0;
  padding: 7px 9px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.8);
  color: #fff;
  font-size: 0.84rem;
}

.team-del-btn {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: none;
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  cursor: pointer;
  flex-shrink: 0;
}

.rules-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-radius: 11px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(30, 41, 59, 0.55);
  color: #e2e8f0;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.edit-hint { color: var(--accent); margin-left: auto; }

/* Korosztály fülek */
.age-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.age-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 4px;
  border-radius: 13px;
  border: 1.5px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.7);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.age-emo { font-size: 1.25rem; }

.age-tab.active {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.18);
  color: #fff;
}

.age-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: #cbd5e1;
}

.age-banner p { margin: 0; }

.community-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #bae6fd;
  background: rgba(30, 41, 59, 0.6);
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  cursor: pointer;
}

/* Témakörök rács */
.decks-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.deck-card {
  position: relative;
  text-align: left;
  background: rgba(15, 23, 42, 0.82);
  border: 2px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  padding: 12px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.deck-card:active { transform: scale(0.97); }

.deck-card.selected {
  border-color: var(--deck-color, var(--accent));
  background: rgba(30, 41, 59, 0.95);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.22);
}

.deck-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.deck-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.9);
  border: 1.5px solid var(--deck-color, var(--accent));
  display: grid;
  place-items: center;
  font-size: 22px;
}

.deck-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.35);
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
}

.deck-card.selected .deck-check {
  background: var(--deck-color, var(--accent));
  border-color: transparent;
  color: #07101f;
}

.deck-name { font-weight: 800; font-size: 0.92rem; line-height: 1.2; }
.deck-desc { font-size: 0.73rem; color: var(--muted); line-height: 1.3; flex: 1; }

.deck-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.deck-count { font-size: 0.72rem; font-weight: 700; color: #cbd5e1; }

.deck-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  color: #bae6fd;
}

.deck-tag.priv { background: rgba(168, 85, 247, 0.2); color: #e9d5ff; }
.deck-tag.pub { background: rgba(16, 185, 129, 0.2); color: #a7f3d0; }

.empty-box {
  grid-column: 1 / -1;
  text-align: center;
  padding: 24px 14px;
  border-radius: 14px;
  border: 1px dashed var(--border);
  color: var(--muted);
  font-size: 0.86rem;
}

/* Főképernyő lábléc */
.home-footer {
  padding: 10px 14px max(14px, env(safe-area-inset-bottom));
  background: rgba(15, 23, 42, 0.88);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.selection-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: #cbd5e1;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
}

/* ==================== 2. KÉSZENLÉTI / HOMLOKRA TARTÁS KÉPERNYŐ ==================== */
.ready-screen {
  background: radial-gradient(circle at center, #132242 0%, #070d1a 100%);
  align-items: center;
  justify-content: center;
  padding: 16px;
  position: relative;
}

.ready-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: 14px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border);
  color: #fff;
  padding: 8px 14px;
  border-radius: 11px;
  font-weight: 700;
  cursor: pointer;
  z-index: 5;
}

.ready-content {
  width: 100%;
  max-width: 560px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.turn-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(168, 85, 247, 0.28));
  border: 1px solid rgba(125, 211, 252, 0.45);
  font-weight: 800;
  font-size: 0.92rem;
}

.style-pill {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.16);
  padding: 4px 12px;
  border-radius: 999px;
}

.phone-illustration { font-size: 2.6rem; }

.ready-content h2 {
  margin: 0;
  font-size: clamp(1.25rem, 4vw, 1.75rem);
}

.ready-hint {
  margin: 0;
  color: #cbd5e1;
  font-size: 0.9rem;
  max-width: 440px;
}

.gesture-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 4px 0;
}

.g-chip {
  padding: 7px 12px;
  border-radius: 11px;
  font-size: 0.82rem;
}

.g-ok { background: rgba(16, 185, 129, 0.18); border: 1px solid rgba(16, 185, 129, 0.45); color: #a7f3d0; }
.g-pass { background: rgba(245, 158, 11, 0.18); border: 1px solid rgba(245, 158, 11, 0.45); color: #fde68a; }

.tilt-meter-box {
  width: 100%;
  max-width: 380px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
}

.tilt-meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.tilt-track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.45) 0%, rgba(148, 163, 184, 0.2) 35%, rgba(148, 163, 184, 0.2) 65%, rgba(245, 158, 11, 0.45) 100%);
}

.tilt-center-zone {
  position: absolute;
  left: 38%;
  width: 24%;
  top: 0;
  bottom: 0;
  border-left: 2px dashed rgba(255, 255, 255, 0.35);
  border-right: 2px dashed rgba(255, 255, 255, 0.35);
}

.tilt-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #38bdf8;
  border: 3px solid #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px #38bdf8;
  transition: left 0.06s linear;
}

.ready-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 6px;
}

.countdown-big {
  font-size: clamp(5rem, 22dvh, 9rem);
  font-weight: 900;
  color: #38bdf8;
  text-shadow: 0 0 36px rgba(56, 189, 248, 0.55);
  line-height: 1;
}

.countdown-sub {
  font-size: 1.2rem;
  font-weight: 700;
  color: #e2e8f0;
}

/* ==================== 3. AKTÍV JÁTÉK KÉPERNYŐ ==================== */
.play-screen {
  background: linear-gradient(135deg, #0b1630 0%, #101f44 50%, #091328 100%);
  position: relative;
}

.play-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(10px, env(safe-area-inset-top)) 16px 8px;
  z-index: 10;
}

.play-abort-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
}

.play-timer {
  font-size: clamp(1.7rem, 5dvh, 2.5rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  padding: 4px 20px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 2px solid rgba(56, 189, 248, 0.55);
  color: #fff;
}

.play-timer.urgent {
  border-color: #ef4444;
  background: rgba(185, 28, 28, 0.75);
  animation: pulseTimer 0.6s infinite;
}

@keyframes pulseTimer {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.play-stats {
  display: flex;
  gap: 6px;
  align-items: center;
}

.play-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.28);
  font-weight: 800;
  font-size: 0.88rem;
}

.bonus-pill { border-color: rgba(250, 204, 21, 0.5); color: #fde047; }
.pass-pill { border-color: rgba(245, 158, 11, 0.5); color: #fdba74; }

.card-stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px max(16px, env(safe-area-inset-bottom));
  overflow: hidden;
}

/* Ovis képes kártya: hatalmas, kristálytiszta rajz! */
.picture-card {
  position: relative;
  width: min(92vw, 76dvh);
  height: min(74dvh, 88vw);
  max-width: 560px;
  max-height: 440px;
  background: radial-gradient(circle at center, #ffffff 0%, #f1f5f9 100%);
  border-radius: 30px;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.45), 0 0 0 5px rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.picture-svg-holder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.picture-svg-holder svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  filter: drop-shadow(0 6px 12px rgba(15, 23, 42, 0.14));
}

.parent-hint-label {
  position: absolute;
  bottom: 10px;
  right: 14px;
  background: rgba(15, 23, 42, 0.75);
  color: #f8fafc;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Szöveges kártya */
.word-card {
  width: 100%;
  max-width: 820px;
  min-height: 54dvh;
  background: rgba(15, 23, 42, 0.72);
  border: 3px solid rgba(125, 211, 252, 0.35);
  border-radius: 30px;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.word-card-emoji {
  font-size: clamp(2.6rem, 11dvh, 5rem);
  line-height: 1;
}

.word-card-text {
  font-size: clamp(2.2rem, 11vw, 5.2rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: #ffffff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
  word-break: break-word;
}

.word-card-deck {
  font-size: 0.9rem;
  font-weight: 700;
  color: #93c5fd;
  background: rgba(56, 189, 248, 0.14);
  padding: 5px 14px;
  border-radius: 999px;
}

/* Érintéses vészirányítás */
.touch-controls {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.touch-zone {
  width: 24%;
  max-width: 170px;
  height: 100%;
  border: none;
  background: transparent;
  pointer-events: auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 14px;
  cursor: pointer;
}

.touch-zone span {
  font-size: 0.74rem;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 999px;
  opacity: 0.65;
}

.touch-pass span { background: rgba(245, 158, 11, 0.25); color: #fde68a; border: 1px solid rgba(245, 158, 11, 0.4); }
.touch-correct span { background: rgba(16, 185, 129, 0.25); color: #a7f3d0; border: 1px solid rgba(16, 185, 129, 0.4); }

/* Teljes képernyős villanó visszajelzés */
.action-flash {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 20px;
}

.action-flash.correct { background: rgba(5, 150, 105, 0.96); }
.action-flash.bonus { background: linear-gradient(135deg, #059669, #d97706); }
.action-flash.pass { background: rgba(217, 119, 6, 0.96); }
.action-flash.blocked { background: rgba(185, 28, 28, 0.95); }

.flash-icon { font-size: clamp(3.5rem, 16dvh, 6rem); font-weight: 900; }
.flash-text { font-size: clamp(2rem, 9dvh, 4rem); font-weight: 900; letter-spacing: 0.04em; }
.flash-sub { font-size: clamp(1rem, 4dvh, 1.6rem); font-weight: 800; color: #fef08a; }

/* ==================== 4. ÖSSZEGZÉS KÉPERNYŐ ==================== */
.summary-head {
  text-align: center;
  padding: max(16px, env(safe-area-inset-top)) 16px 12px;
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid var(--border);
}

.summary-head h2 { margin: 6px 0 4px; font-size: 1.3rem; }

.sum-score-hero {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
}

.points-big {
  font-size: 3rem;
  font-weight: 900;
  color: #38bdf8;
  line-height: 1;
}

.points-lbl { font-size: 1.1rem; font-weight: 700; color: var(--muted); }

.sum-breakdown {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 0.78rem;
}

.bd-chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--border);
  font-weight: 700;
}

.summary-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
}

.standings-box {
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 14px;
}

.standings-box h3 { margin: 0 0 8px; font-size: 0.95rem; }

.standings-list { display: flex; flex-direction: column; gap: 6px; }

.st-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.75);
  font-weight: 700;
  font-size: 0.9rem;
}

.st-row.leader { border: 1px solid #facc15; background: rgba(250, 204, 21, 0.12); }

.review-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.review-head h3 { margin: 0; font-size: 0.95rem; }
.muted-small { font-size: 0.76rem; color: var(--muted); }

.review-list { display: flex; flex-direction: column; gap: 7px; }

.review-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.78);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}

.review-row.hit { border-color: rgba(16, 185, 129, 0.45); background: rgba(16, 185, 129, 0.12); }
.review-row.miss { border-color: rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.08); color: #cbd5e1; }

.summary-footer {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 10px;
  padding: 12px 14px max(14px, env(safe-area-inset-bottom));
  background: rgba(15, 23, 42, 0.9);
  border-top: 1px solid var(--border);
}

/* ==================== GOMBOK & INPUTOK ==================== */
button { font-family: inherit; }

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #6366f1);
  color: #fff;
  border: none;
  border-radius: 13px;
  padding: 12px 18px;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.25);
}

.btn-primary:active { transform: scale(0.98); }
.btn-lg { padding: 14px 18px; font-size: 1.02rem; }
.btn-full { width: 100%; }

.btn-secondary {
  background: rgba(51, 65, 85, 0.85);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 13px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
}

.btn-ghost {
  background: rgba(30, 41, 59, 0.65);
  color: #cbd5e1;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 12px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

.btn-danger-outline {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn-sm { padding: 6px 10px; font-size: 0.78rem; }

/* ==================== MODALOK ==================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(2, 6, 23, 0.76);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.modal-card {
  width: 100%;
  max-width: 490px;
  max-height: 88dvh;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
}

.modal-tall { height: 84dvh; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-head h3 { margin: 0; font-size: 1.04rem; }

.close-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(30, 41, 59, 0.8);
  color: #fff;
  cursor: pointer;
}

.modal-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
}

.setting-block {
  background: rgba(30, 41, 59, 0.48);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 11px;
}

.setting-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.preset-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.preset-btn {
  flex: 1;
  min-width: 54px;
  padding: 7px 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.72);
  color: #cbd5e1;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
}

.preset-btn.active {
  background: rgba(56, 189, 248, 0.22);
  border-color: var(--accent);
  color: #fff;
}

input[type="range"] { width: 100%; accent-color: var(--accent); }

.select-input, .text-input, .num-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  font-size: 0.92rem;
  outline: none;
}

.two-col-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.mini-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.76rem;
  color: #cbd5e1;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.86rem;
  padding: 6px 0;
  cursor: pointer;
}

/* Studio / Privát profil */
.info-banner {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.82rem;
  color: #e0f2fe;
  line-height: 1.4;
  margin-bottom: 12px;
}

.tabs-bar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  padding: 10px 6px;
  background: transparent;
  border: none;
  border-bottom: 2.5px solid transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.field-label { display: block; font-size: 0.78rem; font-weight: 700; color: var(--muted); margin: 8px 0 5px; }

.pattern-prompt {
  text-align: center;
  margin: 10px 0 4px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #bae6fd;
}

.pattern-prompt.err { color: #fca5a5; }
.pattern-prompt.ok { color: #6ee7b7; }

.pattern-wrap { display: flex; justify-content: center; padding: 6px 0; }
.pattern-wrap canvas {
  touch-action: none;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border);
}

.center-row { text-align: center; margin-top: 6px; }

.studio-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.studio-userbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(30, 41, 59, 0.45);
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.sub-card {
  background: rgba(30, 41, 59, 0.48);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  padding: 12px;
}

.sub-card h4 { margin: 0 0 8px; font-size: 0.9rem; color: #bae6fd; }
.danger-card { border-color: rgba(239, 68, 68, 0.35); background: rgba(127, 29, 29, 0.18); }

.section-lbl { margin: 14px 0 8px; font-size: 0.84rem; color: var(--muted); }

.word-input-row { display: flex; gap: 8px; margin-top: 8px; }
.emoji-mini { width: 64px; text-align: center; flex-shrink: 0; }

.visibility-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.manage-list { display: flex; flex-direction: column; gap: 7px; }

.manage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid var(--border);
}

.manage-info { flex: 1; min-width: 0; }
.manage-title { font-weight: 700; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.manage-sub { font-size: 0.72rem; color: var(--muted); }

.manage-btns { display: flex; gap: 5px; flex-shrink: 0; }

.vis-toggle-btn {
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.vis-toggle-btn.pub { border-color: rgba(16, 185, 129, 0.5); color: #6ee7b7; }
.vis-toggle-btn.priv { border-color: rgba(168, 85, 247, 0.5); color: #e9d5ff; }

.del-mini-btn {
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  cursor: pointer;
}

.error-text { color: #fca5a5; font-size: 0.82rem; }

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  75% { transform: translateX(7px); }
}
.shake { animation: shakeX 0.32s ease; }

/* Toast */
.toast {
  position: fixed;
  top: max(64px, calc(env(safe-area-inset-top) + 52px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(125, 211, 252, 0.45);
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
  max-width: 92vw;
  text-align: center;
}
