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

/* =========================================================
   JamTech – közös stíluslap (világos téma)
   Hangulat: keverőpult papíron. A mester prompt és a
   résztvevői hozzászólások külön "sávok".
   ========================================================= */

:root {
  --paper:     #F1F4F9;
  --surface:   #FFFFFF;
  --surface-2: #E9EDF5;
  --line:      #D3DAE8;
  --line-soft: #E4E9F2;
  --text:      #161A2B;
  --muted:     #626A85;
  --teal:      #0C8F84;
  --teal-dk:   #086F66;
  --magenta:   #C2277D;
  --amber:     #A96A00;
  --danger:    #C42F3D;

  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Consolas, monospace;

  --r: 10px;
  --shadow: 0 1px 2px rgba(22,26,43,.05), 0 6px 20px rgba(22,26,43,.05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  height: 300px;
  background: linear-gradient(180deg, rgba(12,143,132,.09), transparent 85%);
  pointer-events: none;
  z-index: 0;
}

h1 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .6rem; }
h2 { font-size: .95rem; letter-spacing: .01em; margin: 0 0 .6rem; font-weight: 600; }
h2.mt { margin-top: 1.8rem; }
p  { margin: 0 0 .8rem; }
a  { color: var(--teal-dk); text-decoration: none; }
a:hover { text-decoration: underline; }

.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .35rem;
}
.muted { color: var(--muted); font-weight: 400; }
.hint  { color: var(--muted); font-size: .88rem; }
.error { color: var(--danger); font-size: .88rem; margin: 0; }
.ok    { color: var(--teal-dk); font-size: .88rem; margin: 0; }
.empty { color: var(--muted); font-style: italic; }
.link-sm { font-size: .85rem; }

/* ---------- vázak ---------- */
.wrap { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 1.6rem 1.2rem 4rem; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
@media (max-width: 880px) { .cols { grid-template-columns: 1fr; } }

.is-centered { display: grid; place-items: center; min-height: 100vh; padding: 1.2rem; }
.gate {
  position: relative; z-index: 1;
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 2rem 1.6rem;
}

.panel {
  position: relative; z-index: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 1.3rem;
}

/* ---------- fejléc ---------- */
.topbar {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .8rem 1.2rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(6px);
}
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--text); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--teal); color: #fff;
  font-family: var(--mono); font-size: .72rem; font-weight: 600;
}
.topbar nav { display: flex; gap: 1.1rem; font-size: .88rem; }
.topbar nav a { color: var(--muted); }
.topbar nav a:hover { color: var(--teal-dk); }

.sess-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }

/* ---------- űrlapelemek ---------- */
.stack { display: flex; flex-direction: column; gap: .45rem; }
.stack label, .panel > label { font-size: .82rem; color: var(--muted); margin-top: .5rem; }

input, textarea, select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  padding: .6rem .7rem;
}
textarea { font-family: var(--mono); font-size: .9rem; line-height: 1.5; resize: vertical; }
input:hover, textarea:hover, select:hover { border-color: #B9C3D6; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
input:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); }

.btn {
  display: inline-block;
  margin-top: .7rem;
  padding: .62rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--sans); font-size: .92rem; font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.btn:hover { border-color: var(--teal); background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--teal-dk); border-color: var(--teal-dk); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: transparent; }

.switch-row { display: flex; flex-direction: column; gap: .5rem; margin-top: 1.1rem; }
.switch { display: flex; align-items: center; gap: .55rem; font-size: .88rem; color: var(--text); cursor: pointer; }
.switch input { width: auto; accent-color: var(--teal); }

/* ---------- QR és kód ---------- */
.qr-block { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; }
.qr { background: #fff; padding: 8px; border: 1px solid var(--line); border-radius: 8px; line-height: 0; }
.qr svg, .qr img { display: block; width: 148px; height: 148px; }
.qr-lg svg, .qr-lg img { width: 230px; height: 230px; }
.join-code {
  font-family: var(--mono); font-size: 1.9rem; font-weight: 600;
  letter-spacing: .18em; color: var(--teal-dk); margin: 0;
}
.join-url { font-size: .85rem; color: var(--muted); word-break: break-all; margin: .2rem 0 .4rem; }

.code-chip {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .1em;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 5px; padding: .1rem .4rem; margin-left: .5rem; color: var(--teal-dk);
}

.sess-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .8rem; }
.sess-list li { display: flex; flex-direction: column; gap: .1rem; border-left: 2px solid var(--line); padding-left: .7rem; }
.sess-list a { color: var(--text); }
.sess-list .muted { font-size: .78rem; font-family: var(--mono); }

/* ---------- SÁVOK: ez a felület aláírása ---------- */
.tracks { display: flex; flex-direction: column; gap: .4rem; margin-top: .4rem; }
.track {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--magenta);
  border-radius: 6px;
  padding: .5rem .7rem .5rem 1rem;
  font-size: .9rem;
}
.track p { margin: 0; }
.track-master { border-left-color: var(--teal); margin-bottom: .6rem; }
.track-label {
  display: block;
  font-family: var(--mono); font-size: .65rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin-bottom: .2rem;
}
.track .who { color: var(--magenta); font-family: var(--mono); font-size: .78rem; }
.track.is-hidden { opacity: .4; border-left-color: var(--line); }
.track-actions { position: absolute; top: .35rem; right: .45rem; display: flex; gap: .35rem; }
.track-actions button {
  background: var(--surface); border: 1px solid var(--line); border-radius: 5px;
  color: var(--muted); font-size: .68rem; font-family: var(--mono);
  padding: .1rem .35rem; cursor: pointer;
}
.track-actions button:hover { color: var(--text); border-color: var(--magenta); }

.counter {
  font-family: var(--mono); font-size: .72rem; color: var(--magenta);
  border: 1px solid var(--line); border-radius: 5px; padding: .05rem .4rem; margin-left: .4rem;
}
.run-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: 1.1rem; }

.preview {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
  padding: .8rem; font-family: var(--mono); font-size: .82rem;
  white-space: pre-wrap; word-break: break-word; margin-top: .8rem; max-height: 340px; overflow: auto;
}
.answer {
  background: #FFFCF5; border: 1px solid #EFE2C8; border-left: 3px solid var(--amber);
  border-radius: 8px; padding: .9rem 1rem; white-space: pre-wrap; word-break: break-word;
}
details.round { border-top: 1px solid var(--line-soft); padding: .7rem 0; }
details.round summary { cursor: pointer; font-family: var(--mono); font-size: .82rem; color: var(--muted); }

/* ---------- résztvevői oldal ---------- */
.join-body { padding: 0; }
.join { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 2rem 1.2rem 4rem; }
.counter-line { font-family: var(--mono); font-size: .74rem; color: var(--muted); margin: .1rem 0 0; }
.mine { margin-top: 2rem; }
.mine ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.mine li {
  background: var(--surface); border: 1px solid var(--line-soft); border-left: 3px solid var(--magenta);
  border-radius: 6px; padding: .45rem .7rem; font-size: .9rem;
}
.status-line { margin-top: 1.6rem; font-family: var(--mono); font-size: .78rem; color: var(--muted); }
#answerWrap { margin-top: 2rem; }

/* a csapdamező: eltüntetve, de nem display:none — azt a botok kiszűrik */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- vetítővászon ---------- */
.screen-body { min-height: 100vh; background: var(--paper); }
.screen {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 300px 1fr; gap: 2.5rem;
  min-height: 100vh; padding: 2.5rem;
}
@media (max-width: 820px) { .screen { grid-template-columns: 1fr; padding: 1.4rem; } }
.screen-side { text-align: center; }
.screen-side .qr { display: inline-block; }
.screen-count { font-family: var(--mono); color: var(--magenta); margin-top: 1rem; }
.screen-main h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
.answer-lg { font-size: clamp(1rem, 1.7vw, 1.35rem); line-height: 1.6; }
.waiting { color: var(--muted); font-size: 1.05rem; margin-top: 1.6rem; }

/* a beküldött szavak fala a kivetítőn */
.wall-head {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted);
  margin: 2rem 0 .8rem;
  display: flex; align-items: center; gap: .6rem;
}
.wall-head::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.wall { display: flex; flex-wrap: wrap; gap: .6rem; align-content: flex-start; }
.chip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--magenta);
  border-radius: 9px;
  padding: .5rem .85rem;
  box-shadow: var(--shadow);
  max-width: 34ch;
  font-size: clamp(.95rem, 1.25vw, 1.15rem);
  line-height: 1.4;
}
.chip .who {
  display: block;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--magenta); margin-bottom: .1rem;
}
.chip.is-new { animation: pop .45s ease-out; }
@keyframes pop {
  from { opacity: 0; transform: translateY(6px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.ok-dot   { color: var(--teal-dk); font-family: var(--mono); font-size: .68rem; }
.warn-dot { color: var(--amber);   font-family: var(--mono); font-size: .68rem; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
