@font-face {
  font-family: "Exo 2";
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url("../fonts/exo2-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Exo 2";
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url("../fonts/exo2-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url("../fonts/source-sans-3-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url("../fonts/source-sans-3-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #081018;
  --bg-2: #10202c;
  --ink: #e7f0f7;
  --muted: #93a9ba;
  --line: rgba(232, 196, 122, 0.32);
  --amber: #e8c47a;
  --amber-2: #f6e2b8;
  --ink-amber: #1c1408;
  --mint: #7ee0c6;
  --coral: #f25f5c;
  --blue: #8ec8e8;
  --card: rgba(16, 32, 44, 0.92);
  --display: "Exo 2", "Segoe UI", sans-serif;
  --body: "Source Sans 3", "Segoe UI", "Noto Sans", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--body);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(126, 224, 198, 0.08), transparent 55%),
    radial-gradient(700px 380px at 110% 0%, rgba(232, 196, 122, 0.1), transparent 50%),
    var(--bg);
  min-height: 100dvh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 20px 30px, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1px 1px at 80px 140px, rgba(232, 196, 122, 0.8), transparent),
    radial-gradient(1.5px 1.5px at 160px 70px, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1px 1px at 40px 100px, rgba(142, 200, 232, 0.7), transparent);
  background-size: 220px 180px;
  opacity: 0.35;
}
body.jatekban { overflow: hidden; }
body.jatekban::before { display: none; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
::selection { background: var(--amber); color: var(--ink-amber); }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.screen { display: none; min-height: 100dvh; padding: 28px 18px 56px; }
.screen.on { display: block; }
.doboz { width: min(1080px, 100%); margin: 0 auto; }

.fejlec { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.marka {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--amber);
  margin: 0;
}
.vissza, .szellem, .hud-gombok button, .masodlagos {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--amber-2);
  border-radius: 999px;
  padding: 8px 14px;
}
.elsodleges, .nehez-kartya, .lecke-kartya {
  border: 1px solid var(--line);
}
.elsodleges {
  background: var(--amber);
  color: var(--ink-amber);
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
}
.gombok { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(40px, 6vw, 68px); line-height: 0.95; }
h2 { font-size: clamp(28px, 4vw, 40px); }
.bevezeto { color: var(--muted); font-size: 18px; max-width: 46rem; line-height: 1.45; }
.lab { color: var(--muted); margin-top: 28px; font-size: 14px; }

.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr); gap: 28px; align-items: center; }
.hero svg { width: 100%; height: auto; }
.ablak { fill: #0c1a26; stroke: rgba(232, 196, 122, 0.45); }
.meteor { fill: #6d6258; stroke: #e8c47a; }
.hajo { fill: #e7f0f7; stroke: #e8c47a; }
.sugar { stroke: #7ee0c6; stroke-width: 2; }

.csoport { margin: 22px 0 8px; color: var(--amber); font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; }
.racs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.lecke-kartya, .nehez-kartya {
  text-align: left;
  background: var(--card);
  border-radius: 16px;
  padding: 14px 14px 16px;
  color: var(--ink);
}
.lecke-kartya:hover, .nehez-kartya:hover, .elsodleges:hover { transform: translateY(-2px); }
.lecke-kartya .cim { font-family: var(--display); font-weight: 800; font-size: 18px; }
.lecke-kartya .alcim, .nehez-kartya p, .lecke-kartya .leiras { color: var(--muted); margin: 6px 0 0; line-height: 1.35; }
.sapkak { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.sapkak i, .csillag {
  font-style: normal;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
  color: var(--amber-2);
  background: #132838;
}
.ajanlott { outline: 2px solid var(--mint); }
.szalag {
  display: inline-block;
  margin-bottom: 8px;
  color: #08221c;
  background: var(--mint);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}
.nehez-kartya h3 { font-size: 22px; }
.nehez-kartya { min-height: 140px; }

.szoveg h3 { margin: 22px 0 8px; font-size: 22px; }
.szoveg p, .szoveg li { line-height: 1.5; max-width: 42rem; }
.szoveg ul { padding-left: 1.2rem; }

#eredmenyek { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; margin-top: 12px; }
.tabla th, .tabla td { text-align: left; padding: 8px 10px; border-bottom: 1px solid rgba(232, 196, 122, 0.16); }
.tabla th { color: var(--muted); font-weight: 600; }
.ures { color: var(--muted); }

#screen-play.on {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(180px, 1fr) auto auto;
  height: 100dvh;
  min-height: 100dvh;
  padding: 0;
  overflow: hidden;
}
.hud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(232, 196, 122, 0.2);
  background: rgba(8, 16, 24, 0.92);
}
.hud strong { font-family: var(--display); margin-right: 8px; }
.hud span { color: var(--muted); margin-right: 8px; }
.hud-sav { flex: 1 1 160px; display: flex; align-items: center; gap: 8px; }
.sav {
  flex: 1;
  height: 8px;
  background: #173246;
  border-radius: 99px;
  overflow: hidden;
}
#hud-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--mint), var(--amber)); }
.hud-gombok { display: flex; gap: 6px; }
.hud-gombok button { padding: 6px 10px; }

.szinpad { position: relative; min-height: 0; background: #070f18; }
.szinpad canvas { width: 100%; height: 100%; display: block; }
.kozben, .uzenet { position: absolute; pointer-events: none; }
.kozben {
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(48px, 8vw, 92px);
  color: var(--amber);
  text-shadow: 0 0 28px rgba(232, 196, 122, 0.45);
}
.uzenet {
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  max-width: min(680px, 92%);
  text-align: center;
  background: rgba(8, 16, 24, 0.82);
  border: 1px solid var(--line);
  color: var(--amber-2);
  border-radius: 999px;
  padding: 6px 14px;
}

#sugo-sor { padding: 4px 12px 0; text-align: center; }
.prompt {
  font-weight: 700;
  font-size: clamp(26px, 4vw, 46px);
  line-height: 1.35;
  letter-spacing: 0.02em;
  padding-top: 0.2em;
}
.prompt .kesz { color: var(--mint); }
.prompt .most { color: var(--amber); box-shadow: inset 0 -3px 0 var(--amber); }
.prompt .hatra { color: var(--ink); }
.prompt .szokoz { display: inline-block; width: 0.55em; }
.prompt .most.szokoz { background: rgba(232, 196, 122, 0.22); box-shadow: inset 0 -3px 0 var(--amber); }
.prompt .jel {
  font-style: normal;
  margin-left: 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  vertical-align: super;
}
.ujjtipp { margin: 2px 0 6px; color: var(--amber-2); min-height: 1.2em; }

.kb-tartó { padding: 0 10px 10px; }
.kb { width: min(980px, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: 4px; user-select: none; touch-action: manipulation; }
.kb-sor { display: flex; gap: 4px; }
.kb-sor.behuzas { padding-left: 3%; }
.key {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: clamp(32px, 5.5dvh, 48px);
  border-radius: 8px;
  border: 1px solid rgba(232, 196, 122, 0.2);
  background: #132838;
  color: var(--ink);
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.key small { font-size: 9px; color: var(--muted); min-height: 10px; }
.key b { font-size: clamp(13px, 1.6vw, 18px); font-weight: 700; }
.key.szeles { flex: 1.6 1 0; }
.key.space { flex: 7 1 0; font-weight: 700; }
.key.disz { opacity: 0.55; font-size: 12px; }
.key.otthon { background: #173246; }
.key .dudor { position: absolute; bottom: 4px; width: 10px; height: 2px; border-radius: 2px; background: var(--amber); }
.key.uj { box-shadow: inset 0 -2px 0 var(--mint); }
.key.kesobb { opacity: 0.35; }
.key.kovetkezo {
  background: var(--amber);
  color: var(--ink-amber);
  opacity: 1;
  transform: translateY(-2px);
  border-color: var(--amber);
}
.key.kovetkezo small, .key.kovetkezo b { color: var(--ink-amber); }
.key.lenyomva { outline: 2px solid var(--mint); }
.kb.shiftel .key small { color: var(--ink); font-size: 12px; font-weight: 700; }
.kb.shiftel .key b { color: var(--muted); font-size: 11px; }
.kb.shiftel .key.kovetkezo small, .kb.shiftel .key.kovetkezo b { color: var(--ink-amber); }

.nagy-kijelzo {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(64px, 12vw, 120px);
  line-height: 1;
  min-height: 1.1em;
  margin: 10px 0;
}
#keys-ujj { color: var(--amber-2); min-height: 1.4em; font-size: 20px; }

#overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(8, 16, 24, 0.78);
  display: grid;
  place-items: center;
  padding: 18px;
}
.panel {
  width: min(520px, 100%);
  max-height: min(86dvh, 680px);
  overflow: auto;
  background: #10202c;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
}
.panel h2 { margin-bottom: 8px; }
.panel .csillagsor { font-size: 28px; color: var(--amber); letter-spacing: 4px; margin: 8px 0; }
.stat { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid rgba(232, 196, 122, 0.14); }
.stat b { font-weight: 700; }
.hibak { margin: 10px 0; color: var(--amber-2); }

#catcher {
  position: fixed;
  opacity: 0;
  pointer-events: none;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  font-size: 16px;
  border: 0;
  padding: 0;
}

@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; }
  .hero svg { max-width: 420px; }
  h1 { font-size: 42px; }
}
@media (max-height: 760px) {
  .prompt { font-size: 26px; }
  .key { height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .lecke-kartya:hover, .nehez-kartya:hover, .key.kovetkezo { transform: none; }
}
