/* Billentyűverseny – pasztell, lekerekített, "bootstrap-érzetű" felület */

:root {
  --bg: #f5f2fb;
  --surface: #ffffff;
  --surface-2: #faf8ff;
  --ink: #3a3656;
  --ink-soft: #6f6a8f;
  --line: #e7e2f3;

  --lavender: #e4dcfb;
  --lavender-d: #8e7bd8;
  --mint: #d3efe3;
  --mint-d: #4fa585;
  --peach: #ffe0cf;
  --peach-d: #de8a5f;
  --sky: #d7e9fb;
  --sky-d: #5b93c9;
  --butter: #fff2c4;
  --butter-d: #c9a23a;
  --rose: #fbdbe4;
  --rose-d: #cf6f8c;

  --gold: #f4d77c;
  --silver: #dfe3ec;
  --bronze: #f0c9a6;

  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --shadow-sm: 0 2px 8px rgba(80, 64, 140, 0.08);
  --shadow: 0 8px 28px rgba(80, 64, 140, 0.12);
  --shadow-lg: 0 18px 50px rgba(80, 64, 140, 0.18);

  --font: 'Baloo 2', 'Segoe UI', system-ui, sans-serif;
  --fs-base: clamp(17px, 1.05vw + 8px, 22px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font);
  font-size: var(--fs-base);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

h1, h2, h3, h4 { margin: 0; font-weight: 800; line-height: 1.15; }
h1 { font-size: 2.6em; }
h2 { font-size: 1.7em; }
h3 { font-size: 1.2em; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.8em; }
.error-text { color: var(--rose-d); font-weight: 600; }

/* Háttér: lassan mozgó pasztell foltok */
.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.bg-blobs span {
  position: absolute;
  width: 46vmax; height: 46vmax;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: drift 26s ease-in-out infinite alternate;
}
.bg-blobs span:nth-child(1) { background: var(--lavender); top: -18vmax; left: -12vmax; }
.bg-blobs span:nth-child(2) { background: var(--mint); bottom: -20vmax; right: -10vmax; animation-delay: -6s; }
.bg-blobs span:nth-child(3) { background: var(--peach); top: 30%; right: 25%; width: 30vmax; height: 30vmax; animation-delay: -12s; opacity: 0.35; }
.bg-blobs span:nth-child(4) { background: var(--sky); bottom: 10%; left: 15%; width: 28vmax; height: 28vmax; animation-delay: -18s; opacity: 0.4; }
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(4vmax, 3vmax) scale(1.08); }
}

/* Görgetősáv nélküli, egérgörgővel görgethető konténer */
.scroll-area {
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  overscroll-behavior: contain;
}
.scroll-area::-webkit-scrollbar { display: none; }

/* --- alapelemek --- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font: inherit; font-weight: 700;
  border: 0; border-radius: 999px;
  padding: 0.55em 1.3em;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s;
  color: var(--ink);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-lg { font-size: 1.15em; padding: 0.7em 1.7em; }
.btn-sm { font-size: 0.8em; padding: 0.4em 1em; }
.btn-primary { background: linear-gradient(135deg, #a898ec, #8e7bd8); color: #fff; box-shadow: 0 6px 18px rgba(142, 123, 216, 0.35); }
.btn-soft { background: var(--lavender); }
.btn-ghost { background: rgba(255, 255, 255, 0.7); box-shadow: var(--shadow-sm); }
.btn-danger { background: var(--rose); color: #8f3150; }

.pill {
  display: inline-flex; align-items: center; gap: 0.4em;
  padding: 0.2em 0.9em;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
  font-size: 0.85em;
  white-space: nowrap;
}
.pill-lavender { background: var(--lavender); }
.pill-mint { background: var(--mint); }
.pill-peach { background: var(--peach); }
.pill-dot::before { content: ''; width: 0.6em; height: 0.6em; border-radius: 50%; background: currentColor; }
.pill.live { color: var(--mint-d); }
.pill.idle { color: var(--ink-soft); }

.avatar {
  flex: none;
  width: 2.2em; height: 2.2em;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: 0.9em;
  color: var(--ink);
  object-fit: cover;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.8);
}

.view { position: fixed; inset: 0; display: flex; flex-direction: column; }

/* --- fejléc --- */
.topbar {
  display: flex; align-items: center; gap: 1em;
  padding: 0.7em 1.4em;
  flex: none;
}
.brand { font-weight: 800; font-size: 1.25em; display: flex; align-items: center; gap: 0.35em; white-space: nowrap; }
.brand-key {
  display: inline-grid; place-items: center;
  width: 1.7em; height: 1.7em; border-radius: 10px;
  background: var(--lavender); color: var(--lavender-d);
}
.round-info { flex: 1; display: flex; justify-content: center; gap: 0.6em; flex-wrap: wrap; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 0.6em; }
.me-chip { display: flex; align-items: center; gap: 0.45em; font-weight: 700; background: rgba(255, 255, 255, 0.75); border-radius: 999px; padding: 0.2em 0.9em 0.2em 0.25em; box-shadow: var(--shadow-sm); white-space: nowrap; }
.me-chip .avatar { width: 1.8em; height: 1.8em; font-size: 0.75em; }
.me-chip .badge { font-size: 0.7em; background: var(--butter); border-radius: 999px; padding: 0 0.6em; }

/* --- belépés --- */
#view-login { align-items: center; justify-content: center; }
.login-card {
  width: min(560px, 92vw);
  padding: 2.4em 2.2em;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 0.9em;
  border-radius: var(--radius-lg);
}
.logo-keys { display: flex; gap: 0.5em; margin-bottom: 0.3em; }
.logo-keys span {
  width: 2.4em; height: 2.4em; border-radius: 14px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 1.4em;
  box-shadow: 0 5px 0 rgba(80, 64, 140, 0.12);
  animation: keybounce 2.4s ease-in-out infinite;
}
.logo-keys span:nth-child(1) { background: var(--peach); }
.logo-keys span:nth-child(2) { background: var(--mint); animation-delay: 0.2s; }
.logo-keys span:nth-child(3) { background: var(--sky); animation-delay: 0.4s; }
@keyframes keybounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-8px); }
}
.dev-login {
  margin-top: 0.8em; padding: 0.9em 1em; width: 100%;
  border: 2px dashed var(--line); border-radius: var(--radius-sm);
  display: flex; flex-wrap: wrap; gap: 0.5em; align-items: center; justify-content: center;
  font-size: 0.85em;
}
.dev-title { width: 100%; font-weight: 700; color: var(--ink-soft); }
.dev-login input[name=name] {
  font: inherit; padding: 0.35em 0.8em; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); min-width: 0; flex: 1;
}
.check { display: inline-flex; gap: 0.3em; align-items: center; }

/* --- várakozó --- */
.lobby-main {
  flex: 1; min-height: 0;
  display: flex; gap: 1.6em;
  padding: 0.5em 1.6em 1.6em;
  justify-content: center;
}
.lobby-center { flex: 1; max-width: 1100px; display: flex; flex-direction: column; min-height: 0; }
.lobby-head { text-align: center; padding: 1em 0 1.2em; }
.waiting-dots { display: flex; gap: 0.5em; justify-content: center; margin-top: 0.6em; }
.waiting-dots span { width: 0.7em; height: 0.7em; border-radius: 50%; background: var(--lavender-d); opacity: 0.4; animation: dot 1.4s ease-in-out infinite; }
.waiting-dots span:nth-child(2) { animation-delay: 0.2s; }
.waiting-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot { 0%, 100% { opacity: 0.3; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.15); } }

.user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.9em;
  align-content: start;
  padding: 0.4em;
}
.user-card {
  display: flex; align-items: center; gap: 0.7em;
  padding: 0.75em 1em;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
  animation: popIn 0.35s ease both;
}
.user-card .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card .tag { margin-left: auto; font-size: 0.7em; background: var(--butter); border-radius: 999px; padding: 0 0.6em; }

/* Admin beállítások: fejléc + görgethető, kéthasábos törzs + mindig látható lábléc az indítógombbal */
.admin-panel {
  width: clamp(540px, 46vw, 860px); flex: none;
  display: flex; flex-direction: column;
  align-self: stretch;
  min-height: 0; max-height: 100%;
  overflow: hidden;
}
.admin-head { padding: 0.9em 1.3em 0.4em; flex: none; }
.admin-body {
  flex: 1 1 auto; min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2em;
  padding: 0.4em 1.3em 1em;
  align-content: start;
}
.admin-col { display: flex; flex-direction: column; gap: 0.6em; min-width: 0; }
.admin-foot {
  flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 1em;
  padding: 0.8em 1.3em;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.admin-foot .muted { flex: 1; }
.admin-sub { font-weight: 700; color: var(--ink-soft); font-size: 0.85em; margin-top: 0.3em; }

.timing-options { display: flex; flex-direction: column; gap: 0.5em; }
.timing-opt {
  display: grid; grid-template-columns: 1fr auto; gap: 0.1em 0.6em; align-items: center;
  padding: 0.45em 0.8em; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 2px solid var(--line);
  font-size: 0.9em; font-weight: 600;
}
.timing-opt .val { font-weight: 800; background: var(--lavender); border-radius: 999px; padding: 0 0.6em; min-width: 4.2em; text-align: center; }
.timing-opt input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: var(--lavender-d); margin: 0.2em 0 0; }
.round-options { display: flex; flex-direction: column; gap: 0.4em; }
.round-opt {
  display: flex; align-items: center; gap: 0.6em;
  padding: 0.45em 0.8em; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 2px solid var(--line);
  cursor: pointer; font-weight: 600; font-size: 0.9em;
  transition: background 0.2s, border-color 0.2s;
}
.round-opt:has(input:checked) { background: var(--lavender); border-color: #cfc3f5; }
.round-opt input { accent-color: var(--lavender-d); width: 1.1em; height: 1.1em; }
.round-opt .num { width: 1.6em; height: 1.6em; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 800; font-size: 0.85em; }

.switch { display: flex; align-items: center; gap: 0.6em; cursor: pointer; font-weight: 600; font-size: 0.9em; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span {
  flex: none; width: 2.6em; height: 1.5em; border-radius: 999px;
  background: var(--line); position: relative; transition: background 0.2s;
}
.switch span::after {
  content: ''; position: absolute; top: 0.18em; left: 0.18em;
  width: 1.14em; height: 1.14em; border-radius: 50%; background: #fff;
  box-shadow: var(--shadow-sm); transition: transform 0.2s;
}
.switch input:checked + span { background: var(--mint-d); }
.switch input:checked + span::after { transform: translateX(1.1em); }

/* --- játék --- */
.game-main {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: 1fr clamp(280px, 24vw, 380px);
  gap: 1.4em;
  padding: 0.3em 1.4em 1.4em;
}
.stage {
  min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1em;
  text-align: center;
}
.role-banner {
  font-size: 1.35em; font-weight: 800;
  padding: 0.35em 1.4em;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  min-height: 1.9em;
}
.role-banner.master { background: var(--butter); animation: wiggle 1.4s ease-in-out infinite; }
.role-banner.spectator { background: var(--sky); }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-1.5deg); } 75% { transform: rotate(1.5deg); } }

.timer-row { display: flex; align-items: center; gap: 1em; }
.timer { position: relative; width: clamp(92px, 9vw, 130px); aspect-ratio: 1; --timer-color: var(--lavender-d); --timer-bg: var(--lavender); }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-track { fill: var(--surface); stroke: var(--timer-bg); stroke-width: 10; }
.timer-bar {
  fill: none; stroke: var(--timer-color); stroke-width: 10; stroke-linecap: round;
  stroke-dasharray: 326.73; stroke-dashoffset: 0;
}
.timer-num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 2.2em; font-weight: 800; color: var(--timer-color);
}
.timer.task { --timer-color: var(--peach-d); --timer-bg: var(--peach); }
.timer.answers { --timer-color: var(--mint-d); --timer-bg: var(--mint); }
.timer.urgent .timer-num { animation: pulse 0.5s ease-in-out infinite alternate; }
.timer.off { opacity: 0.35; }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.12); } }
.timer-label {
  font-size: 1.3em; font-weight: 800;
  padding: 0.3em 1em; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm);
  text-align: left;
}
.timer-label.task { background: var(--peach); }
.timer-label.answers { background: var(--mint); }

.task-frame {
  width: min(100%, 880px);
  min-height: clamp(220px, 34vh, 400px);
  display: grid; place-items: center;
  padding: 1.4em;
  border-radius: 36px;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, #c9bdf5, #bfe6d6, #ffd4bd, #cfe3fa) border-box;
  border: 8px solid transparent;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.task-frame::before {
  content: ''; position: absolute; inset: 12px; border-radius: 26px;
  border: 2px dashed var(--line); pointer-events: none;
}
.task-content { display: flex; flex-direction: column; align-items: center; gap: 0.4em; position: relative; }
.task-content.pop { animation: popIn 0.4s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.task-parts { display: flex; gap: 0.35em; align-items: flex-start; justify-content: center; flex-wrap: wrap; }
.task-part { display: flex; flex-direction: column; align-items: center; }
.task-char {
  font-size: clamp(90px, 15vh, 190px);
  font-weight: 800; line-height: 1;
  min-width: 1.1em;
  padding: 0.08em 0.25em 0;
  border-radius: 24px;
  background: var(--surface-2);
  box-shadow: inset 0 -8px 0 rgba(80, 64, 140, 0.07);
}
.task-char.long { font-size: clamp(60px, 10vh, 130px); padding: 0.18em 0.35em 0.08em; }
.task-hint { font-size: 1em; color: var(--ink-soft); font-weight: 700; margin-top: 0.2em; }
.task-big-text { font-size: clamp(40px, 6vh, 72px); font-weight: 800; }
.task-sub { font-size: 1.2em; color: var(--ink-soft); font-weight: 600; max-width: 32em; }
.task-question { font-size: clamp(90px, 16vh, 180px); font-weight: 800; color: var(--lavender); line-height: 1; animation: floaty 2s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.slots { display: flex; gap: 0.4em; justify-content: center; margin-top: 0.3em; }
.slot {
  min-width: 2.2em; height: 2.2em; padding: 0 0.4em;
  border-radius: 12px; border: 3px dashed var(--line);
  display: grid; place-items: center;
  font-size: 1.4em; font-weight: 800;
}
.slot.filled { border-style: solid; border-color: #cfc3f5; background: var(--lavender); animation: popIn 0.25s ease both; }

.feedback { min-height: 2.6em; font-size: 1.35em; font-weight: 800; display: flex; align-items: center; gap: 0.5em; }
.feedback .fb { padding: 0.25em 1.1em; border-radius: 999px; animation: popIn 0.3s ease both; }
.fb.ok { background: var(--mint); color: #2f6f58; }
.fb.bad { background: var(--rose); color: #8f3150; animation: shake 0.4s ease both; }
.fb.info { background: var(--surface); box-shadow: var(--shadow-sm); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}
.master-note { min-height: 1.3em; font-size: 0.75em; color: var(--ink-soft); }

.side { min-height: 0; display: flex; flex-direction: column; gap: 0.7em; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 0.3em; }
.player-list { flex: 1; min-height: 0; position: relative; padding: 0.3em; }
.player-card {
  display: flex; align-items: center; gap: 0.6em;
  padding: 0.55em 0.9em 0.55em 0.55em;
  margin-bottom: 0.55em;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 2px solid transparent;
  transition: background 0.3s, border-color 0.3s, opacity 0.3s;
}
.player-card .place { width: 1.7em; text-align: center; font-weight: 800; color: var(--ink-soft); }
.player-card .name { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-card .score { font-weight: 800; font-size: 1.2em; min-width: 1.6em; text-align: right; }
.player-card .mark { width: 1.3em; text-align: center; font-weight: 800; }
.player-card.me { border-color: #cfc3f5; }
.player-card.master { background: var(--butter); }
.player-card.absent { opacity: 0.45; }
.player-card.ok { background: var(--mint); }
.player-card.ok .mark { color: var(--mint-d); }
.player-card .master-tag { font-size: 0.7em; background: #fff; border-radius: 999px; padding: 0 0.5em; font-weight: 700; }
.player-card.bump .score { animation: bump 0.6s ease; }
@keyframes bump { 40% { transform: scale(1.5); color: var(--mint-d); } }

.admin-answers { padding: 0.8em 1em; max-height: 40%; display: flex; flex-direction: column; gap: 0.4em; font-size: 0.8em; }
.admin-answers h4 { font-size: 1em; }
.ans-row { display: flex; gap: 0.5em; align-items: center; padding: 0.2em 0; border-bottom: 1px dashed var(--line); }
.ans-row .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ans-row .st { font-weight: 700; }
.ans-row .st.correct { color: var(--mint-d); }
.ans-row .st.wrong, .ans-row .st.retry { color: var(--rose-d); }
.admin-task { font-weight: 800; background: var(--butter); border-radius: var(--radius-sm); padding: 0.2em 0.6em; }
.sync-bad { color: var(--rose-d); font-weight: 800; }

/* --- játék vége --- */
.overlay {
  position: fixed; inset: 0; z-index: 20;
  display: grid; place-items: center;
  background: rgba(245, 242, 251, 0.75);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.4s ease both;
}
.final-card {
  width: min(900px, 94vw);
  max-height: 92vh;
  display: flex; flex-direction: column; align-items: center; gap: 0.8em;
  padding: 2.8em 2.4em 1.8em;
  border-radius: 40px;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    repeating-linear-gradient(45deg, #d9cff8 0 14px, #ffe0cf 14px 28px, #d3efe3 28px 42px, #d7e9fb 42px 56px) border-box;
  border: 12px solid transparent;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: popIn 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.final-ribbon {
  position: absolute; top: -0.9em;
  font-size: 2em; font-weight: 800;
  padding: 0.15em 1.4em;
  border-radius: 999px;
  background: linear-gradient(135deg, #b8a9f0, #8e7bd8);
  color: #fff;
  box-shadow: 0 8px 20px rgba(142, 123, 216, 0.4);
  white-space: nowrap;
}
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 1em; margin-top: 0.8em; width: 100%; }
.podium-place {
  flex: 1; max-width: 240px;
  display: flex; flex-direction: column; align-items: center; gap: 0.3em;
  animation: rise 0.7s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}
.podium-place .medal { font-size: 2.6em; line-height: 1; }
.podium-place .pname { font-weight: 800; font-size: 1.25em; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-place .block {
  width: 100%; border-radius: 22px 22px 12px 12px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 1.6em;
  box-shadow: inset 0 -10px 0 rgba(0, 0, 0, 0.05);
}
.podium-place.p1 { order: 2; animation-delay: 0.5s; }
.podium-place.p2 { order: 1; animation-delay: 0.25s; }
.podium-place.p3 { order: 3; animation-delay: 0.1s; }
.podium-place.p1 .block { background: var(--gold); height: 9em; font-size: 2em; }
.podium-place.p2 .block { background: var(--silver); height: 6.5em; }
.podium-place.p3 .block { background: var(--bronze); height: 5em; }
.podium-place.p1 .avatar { width: 3.4em; height: 3.4em; font-size: 1.1em; box-shadow: 0 0 0 5px var(--gold); }
.podium-place .avatar { width: 2.8em; height: 2.8em; }
@keyframes rise { from { opacity: 0; transform: translateY(60px); } to { opacity: 1; transform: none; } }
.final-rest { width: 100%; max-height: 28vh; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.5em; }
.final-rest .player-card { margin: 0; }
.final-actions { display: flex; gap: 1em; align-items: center; margin-top: 0.4em; }

.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute; top: -5vh;
  width: 12px; height: 18px; border-radius: 4px;
  animation: fall linear forwards;
}
@keyframes fall { to { transform: translateY(115vh) rotate(720deg); } }

/* --- üzenetek --- */
.conn-banner {
  position: fixed; top: 0.8em; left: 50%; transform: translateX(-50%); z-index: 40;
  background: var(--peach); padding: 0.4em 1.3em; border-radius: 999px;
  box-shadow: var(--shadow); font-weight: 700;
  display: flex; gap: 0.8em; align-items: center;
}
.toast {
  position: fixed; bottom: 1.2em; left: 50%; transform: translateX(-50%); z-index: 40;
  background: var(--ink); color: #fff; padding: 0.5em 1.4em; border-radius: 999px;
  box-shadow: var(--shadow); font-weight: 600;
  animation: popIn 0.3s ease both;
}

@keyframes popIn { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.pop-in { animation: popIn 0.5s cubic-bezier(0.2, 1.3, 0.4, 1) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* kisebb (pl. 1366×768) képernyőkre */
@media (max-height: 800px) {
  .task-frame { min-height: 30vh; }
  .stage { gap: 0.6em; }
}
/* keskenyebb ablakban a beállítások egy hasábba kerülnek (a törzs görgethető marad) */
@media (max-width: 1250px) {
  .admin-panel { width: clamp(340px, 40vw, 520px); }
  .admin-body { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
  .game-main { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 30vh); }
  .lobby-main { flex-direction: column; }
  .lobby-center { flex: 0 1 auto; min-height: 18vh; }
  .admin-panel { width: 100%; flex: 1 1 auto; }
  .admin-body { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .admin-body { grid-template-columns: 1fr; }
}
