:root {
  --bg: #f4f1e9;
  --paper: #fffdf8;
  --ink: #171717;
  --muted: #68655e;
  --accent: #ff7043;
  --accent-dark: #dc4f28;
  --line: #d9d4c8;
  --phone: #202020;
  --radius: 28px;
  --shadow: 0 28px 70px rgba(20, 20, 20, .16);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

button, a { -webkit-tap-highlight-color: transparent; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5vw;
  background: rgba(244, 241, 233, .88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(217, 212, 200, .7);
}

.logo, .footer-logo {
  font-weight: 950;
  letter-spacing: -.08em;
  font-size: 1.5rem;
}

.site-header nav {
  display: flex;
  gap: 32px;
  font-size: .9rem;
  font-weight: 650;
}

.site-header nav a { transition: opacity .2s ease; }
.site-header nav a:hover { opacity: .55; }

.header-button {
  padding: 10px 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-weight: 750;
}

.hero {
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: 4vw;
  max-width: 1400px;
  margin: auto;
  padding: 7vw 5vw 8vw;
  overflow: hidden;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: .73rem;
  font-weight: 850;
  letter-spacing: .18em;
}

.hero h1 {
  max-width: 750px;
  margin: 0;
  font-size: clamp(4rem, 8vw, 8.5rem);
  line-height: .88;
  letter-spacing: -.075em;
}

.hero h1 span { color: var(--accent); }

.hero-text {
  max-width: 620px;
  margin: 34px 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.7vw, 1.25rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
}

.primary { color: white; background: var(--accent); }
.primary:hover { background: var(--accent-dark); }
.secondary { border: 1px solid var(--line); background: transparent; }

.hero-phone-wrap {
  position: relative;
  min-height: 610px;
  display: grid;
  place-items: center;
}

.phone-shadow {
  position: absolute;
  width: 300px;
  height: 70px;
  bottom: 80px;
  border-radius: 50%;
  background: rgba(0,0,0,.16);
  filter: blur(24px);
}

.phone {
  position: relative;
  width: min(360px, 62vw);
  aspect-ratio: .56;
  padding: 16px;
  border-radius: 48px;
  background: linear-gradient(145deg, #303030, #101010);
  box-shadow: var(--shadow);
  transform: rotate(6deg);
  animation: float 5s ease-in-out infinite;
}

.phone::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 44px;
  pointer-events: none;
}

.phone-camera {
  position: absolute;
  z-index: 2;
  top: 28px;
  left: 50%;
  width: 76px;
  height: 21px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #090909;
}

.phone-screen {
  height: calc(100% - 34px);
  border-radius: 35px;
  margin-top: 10px;
  padding: 18px;
  background: #ded8ca;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.screen-module {
  width: 100%;
  height: 100%;
  border: 2px solid #181818;
  border-radius: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.8), transparent 28%),
    linear-gradient(135deg, #f4ead1, #c9b98e);
  box-shadow: inset 0 0 0 8px rgba(255,255,255,.2);
}

.screen-module strong {
  font-size: clamp(5rem, 10vw, 8rem);
  line-height: .8;
  letter-spacing: -.08em;
}

.module-label, .module-hint {
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .16em;
}

.module-hint { margin-top: 24px; opacity: .6; }

.phone-bottom {
  position: absolute;
  left: 50%;
  bottom: 9px;
  width: 80px;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 99px;
  background: rgba(255,255,255,.3);
}

.floating-card {
  position: absolute;
  padding: 14px 18px;
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 15px 45px rgba(0,0,0,.12);
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1.25;
}

.card-one { left: 3%; top: 25%; transform: rotate(-7deg); }
.card-two { right: 2%; bottom: 19%; transform: rotate(5deg); }

@keyframes float {
  0%, 100% { transform: rotate(6deg) translateY(0); }
  50% { transform: rotate(3deg) translateY(-14px); }
}

.section {
  max-width: 1200px;
  margin: auto;
  padding: 10vw 5vw;
}

.intro {
  text-align: center;
  max-width: 920px;
}

h2 {
  margin: 0;
  font-size: clamp(3rem, 6vw, 6.4rem);
  line-height: .92;
  letter-spacing: -.065em;
}

.lead {
  max-width: 760px;
  margin: 30px auto 0;
  color: var(--muted);
  font-size: 1.15rem;
}

.how {
  border-top: 1px solid var(--line);
}

.section-heading { margin-bottom: 55px; }
.centered { text-align: center; }
.centered .lead { margin-top: 25px; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.step {
  min-height: 280px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.step-number {
  margin-bottom: 75px;
  color: var(--accent);
  font-size: .8rem;
  font-weight: 900;
  letter-spacing: .1em;
}

.step h3 {
  margin: 0 0 10px;
  font-size: 1.45rem;
  letter-spacing: -.03em;
}

.step p { margin: 0; color: var(--muted); }

.games {
  max-width: none;
  padding-left: 5vw;
  padding-right: 5vw;
  background: var(--ink);
  color: white;
}

.game-grid {
  max-width: 1200px;
  margin: 70px auto 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.game-card {
  min-height: 380px;
  padding: 34px;
  border-radius: var(--radius);
  background: #292929;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.game-card-top {
  width: 100%;
  display: flex;
  justify-content: space-between;
  color: #a8a8a8;
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .13em;
}

.game-card h3 {
  margin: auto 0 12px;
  font-size: clamp(2.4rem, 4vw, 4.4rem);
  line-height: .92;
  letter-spacing: -.06em;
}

.game-card p {
  max-width: 470px;
  color: #bdbdbd;
  margin: 0 0 25px;
}

.why {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8vw;
  align-items: center;
}

.why-copy p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 540px;
  margin-top: 30px;
}

.benefits {
  border-top: 1px solid var(--line);
}

.benefits div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.benefits strong { color: var(--accent); font-size: .8rem; }
.benefits span { font-size: 1.2rem; font-weight: 750; }

.final-cta {
  text-align: center;
  padding-bottom: 13vw;
}

.final-cta .button { margin-top: 40px; }

footer {
  padding: 40px 5vw;
  display: flex;
  align-items: center;
  gap: 25px;
  border-top: 1px solid var(--line);
}

footer p { color: var(--muted); }
.copyright { margin-left: auto; font-size: .8rem; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
}

.modal.is-open { display: block; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  z-index: 2;
  width: min(760px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  margin: 14px auto;
  padding: 34px;
  border-radius: 30px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 30px 100px rgba(0,0,0,.3);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #ece8df;
  font-size: 1.7rem;
  cursor: pointer;
}

.game-title {
  margin: 30px 0 8px;
  font-size: clamp(2.5rem, 6vw, 4.8rem);
  line-height: .9;
  letter-spacing: -.06em;
}

.game-description { color: var(--muted); }

.game-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin: 28px 0 20px;
}

.status { font-weight: 800; }

.connect-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 440px;
  margin: 25px auto;
}

.connect-tile {
  aspect-ratio: 1;
  border: 2px solid #242424;
  border-radius: 18px;
  background: #e8e0ce;
  cursor: pointer;
  position: relative;
  transition: transform .15s ease;
}

.connect-tile:hover { transform: scale(1.03); }

.connect-tile::before,
.connect-tile::after {
  content: "";
  position: absolute;
  background: var(--accent);
  border-radius: 999px;
}

.connect-tile::before {
  width: 12px;
  height: 70%;
  left: calc(50% - 6px);
  top: 15%;
}

.connect-tile::after {
  height: 12px;
  width: 70%;
  top: calc(50% - 6px);
  left: 15%;
}

.connect-tile[data-rotation="1"] { transform: rotate(90deg); }
.connect-tile[data-rotation="2"] { transform: rotate(180deg); }
.connect-tile[data-rotation="3"] { transform: rotate(270deg); }
.connect-tile[data-rotation="1"]:hover,
.connect-tile[data-rotation="2"]:hover,
.connect-tile[data-rotation="3"]:hover { transform: rotate(var(--rot)) scale(1.03); }

.memory-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 500px;
  margin: 25px auto;
}

.memory-card {
  aspect-ratio: 1;
  border: 0;
  border-radius: 18px;
  background: #222;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform .2s ease, background .2s ease;
}

.memory-card.flipped,
.memory-card.matched {
  background: #e8e0ce;
  color: var(--ink);
}

.memory-card.flipped { transform: rotateY(180deg); }

@media (max-width: 850px) {
  .site-header nav { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 13vw; }
  .hero-phone-wrap { min-height: 520px; }
  .steps, .game-grid, .why { grid-template-columns: 1fr; }
  .step { min-height: 220px; }
  .step-number { margin-bottom: 45px; }
  .why { gap: 50px; }
}

@media (max-width: 520px) {
  .site-header { height: 66px; padding: 0 20px; }
  .header-button { padding: 8px 14px; }
  .hero, .section { padding-left: 20px; padding-right: 20px; }
  .hero h1 { font-size: 4rem; }
  .hero-phone-wrap { min-height: 450px; }
  .phone { width: 270px; }
  .floating-card { display: none; }
  .game-grid { margin-top: 45px; }
  .game-card { min-height: 340px; padding: 25px; }
  .modal-panel { padding: 25px 18px; }
  .connect-board { gap: 7px; }
  .memory-board { gap: 7px; }
  footer { flex-wrap: wrap; }
  .copyright { margin-left: 0; width: 100%; }
}


/* Interaktív telefonos játékbemutató */
.game-modal-panel {
  width: min(900px, calc(100% - 28px));
  text-align: center;
}

.module-description {
  max-width: 650px;
  margin: 18px auto 22px;
}

.module-description .eyebrow {
  color: var(--accent);
}

.module-description h2 {
  font-size: clamp(2.7rem, 6vw, 5rem);
  margin-bottom: 12px;
}

.module-description p {
  max-width: 620px;
  margin: 0 auto;
  color: var(--muted);
}

.play-phone-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 5vw, 55px);
  margin: 10px auto 20px;
}

.play-phone {
  position: relative;
  width: min(300px, 55vw);
  aspect-ratio: .56;
  padding: 13px;
  border-radius: 42px;
  background: linear-gradient(145deg, #303030, #101010);
  box-shadow: 0 25px 65px rgba(0,0,0,.24);
  transition: transform .25s ease;
}

.play-phone.switching {
  transform: scale(.96) rotate(-2deg);
}

.play-phone-camera {
  position: absolute;
  z-index: 3;
  top: 24px;
  left: 50%;
  width: 65px;
  height: 18px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #080808;
}

.play-phone-screen {
  height: calc(100% - 28px);
  margin-top: 8px;
  padding: 13px;
  border-radius: 31px;
  background: #ded8ca;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.play-phone-bottom {
  position: absolute;
  left: 50%;
  bottom: 7px;
  width: 68px;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 99px;
  background: rgba(255,255,255,.3);
}

.module-arrow {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease;
}

.module-arrow:hover {
  transform: scale(1.08);
  background: #eee9de;
}

.module-switcher-label {
  display: flex;
  justify-content: space-between;
  max-width: 520px;
  margin: 0 auto 26px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .1em;
}

.module-screen-art {
  width: 100%;
  height: 100%;
  border: 2px solid #181818;
  border-radius: 22px;
  background: linear-gradient(135deg, #f4ead1, #c9b98e);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.module-screen-art strong {
  font-size: 4rem;
  line-height: .9;
  letter-spacing: -.07em;
}

.module-screen-art span {
  margin-top: 14px;
  font-size: .6rem;
  font-weight: 900;
  letter-spacing: .12em;
}

#gameContent {
  text-align: left;
  max-width: 650px;
  margin: 0 auto;
}

#gameContent .game-title,
#gameContent .game-description,
#gameContent .game-toolbar {
  display: none;
}

#gameContent .connect-board,
#gameContent .memory-board {
  margin-top: 10px;
}

@media (max-width: 600px) {
  .play-phone-stage {
    gap: 9px;
  }

  .play-phone {
    width: min(245px, 62vw);
  }

  .module-arrow {
    width: 46px;
    height: 46px;
    font-size: 1.55rem;
  }

  .module-switcher-label {
    font-size: .58rem;
  }
}


/* A kipróbálható játék közvetlenül a telefon kijelzőjében jelenik meg. */
.play-phone-screen {
  position: relative;
  align-items: stretch;
  justify-content: stretch;
}

.play-game {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 2px solid #181818;
  border-radius: 22px;
  background: #e8e0ce;
  padding: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.play-game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
  font-size: .48rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.play-game-title {
  margin: 0 0 8px;
  font-size: clamp(1rem, 3.5vw, 1.5rem);
  line-height: .95;
  letter-spacing: -.05em;
}

.play-game-info {
  margin: 0 0 10px;
  font-size: .56rem;
  line-height: 1.3;
  opacity: .7;
}

.phone-connect-board {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.phone-connect-tile {
  min-width: 0;
  min-height: 0;
  border: 1.5px solid #242424;
  border-radius: 8px;
  background: #f3ead7;
  cursor: pointer;
  position: relative;
  padding: 0;
}

.phone-connect-tile::before,
.phone-connect-tile::after {
  content: "";
  position: absolute;
  background: var(--accent);
  border-radius: 999px;
}

.phone-connect-tile::before {
  width: 7px;
  height: 72%;
  left: calc(50% - 3.5px);
  top: 14%;
}

.phone-connect-tile::after {
  height: 7px;
  width: 72%;
  top: calc(50% - 3.5px);
  left: 14%;
}

.phone-connect-tile[data-rotation="1"] { transform: rotate(90deg); }
.phone-connect-tile[data-rotation="2"] { transform: rotate(180deg); }
.phone-connect-tile[data-rotation="3"] { transform: rotate(270deg); }

.phone-connect-status,
.phone-memory-status {
  margin-top: 7px;
  font-size: .52rem;
  font-weight: 900;
  text-align: center;
}

.phone-memory-board {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.phone-memory-card {
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 8px;
  background: #222;
  color: white;
  font-size: clamp(.8rem, 4vw, 1.3rem);
  cursor: pointer;
}

.phone-memory-card.flipped,
.phone-memory-card.matched {
  background: #f3ead7;
  color: var(--ink);
}

.phone-memory-card:disabled {
  cursor: default;
}

.phone-reset {
  align-self: center;
  margin-top: 7px;
  min-height: 25px;
  padding: 0 10px;
  font-size: .5rem;
}


/* MODUL 01 – fizikailag is megvalósítható golyós labirintus */
.maze-play-game .play-game-info {
  margin-bottom: 7px;
}

.phone-maze-board {
  --maze-cols: 11;
  --maze-rows: 13;
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(var(--maze-cols), 1fr);
  grid-template-rows: repeat(var(--maze-rows), 1fr);
  aspect-ratio: 11 / 13;
  width: min(100%, 190px);
  margin: 0 auto;
  overflow: hidden;
  border: 1.5px solid #242424;
  border-radius: 9px;
  background:
    linear-gradient(rgba(255,255,255,.22), rgba(255,255,255,0)),
    #f3ead7;
  box-shadow: inset 0 2px 8px rgba(0,0,0,.08);
  touch-action: none;
}

.maze-wall {
  z-index: 1;
  margin: -0.5px;
  border-radius: 2px;
  background: #242424;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}

.maze-start,
.maze-exit {
  z-index: 2;
  display: grid;
  place-items: center;
  font-size: .27rem;
  font-weight: 950;
  letter-spacing: .02em;
  pointer-events: none;
}

.maze-start { color: #757067; }

.maze-exit {
  color: white;
  background: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.18);
}

.maze-ball {
  position: absolute;
  z-index: 5;
  width: calc(58% / var(--maze-cols));
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #ffffff 0 10%, #e7e7e7 22%, #9d9d9d 58%, #4b4b4b 100%);
  box-shadow: 0 2px 4px rgba(0,0,0,.38), inset -1px -1px 2px rgba(0,0,0,.25);
  will-change: left, top;
  pointer-events: none;
}

.maze-ball.won {
  transform: translate(-50%, -50%) scale(1.25);
  box-shadow: 0 0 0 4px rgba(255,112,67,.25), 0 3px 8px rgba(0,0,0,.35);
}

.phone-maze-status {
  margin-top: 6px;
  min-height: 1em;
  font-size: .5rem;
  font-weight: 900;
  text-align: center;
}

.maze-controls {
  width: 86px;
  margin: 5px auto 0;
  display: grid;
  grid-template-columns: repeat(3, 26px);
  grid-template-rows: repeat(2, 24px);
  gap: 3px;
  justify-content: center;
}

.maze-control {
  border: 1px solid rgba(23,23,23,.22);
  border-radius: 7px;
  background: rgba(255,255,255,.38);
  color: var(--ink);
  font: inherit;
  font-size: .72rem;
  font-weight: 950;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  touch-action: none;
  user-select: none;
  transition: transform .08s ease, background .08s ease, box-shadow .08s ease;
}

.maze-control.is-active {
  transform: translateY(1px) scale(.95);
  background: white;
  box-shadow: inset 0 0 0 1px var(--accent);
}

.maze-control.up { grid-column: 2; grid-row: 1; }
.maze-control.left { grid-column: 1; grid-row: 2; }
.maze-control.down { grid-column: 2; grid-row: 2; }
.maze-control.right { grid-column: 3; grid-row: 2; }

@media (max-width: 600px) {
  .phone-maze-board { width: min(100%, 160px); }
  .maze-controls { margin-top: 4px; }
  .maze-play-game .phone-reset { margin-top: 5px; }
}

/* 2026-09 finomítás: a kijelzőn csak maga a játékterület látszódjon,
   a készülék pedig jobban hasonlítson a fizikai, felülnézeti prototípusra. */
.play-phone {
  width: min(340px, 58vw);
  aspect-ratio: 0.62;
  padding: 14px 14px 72px;
  border: 6px solid #000;
  border-radius: 4px;
  background: #efefef;
  box-shadow: 0 22px 60px rgba(0,0,0,.18);
  transition: transform .2s ease;
}

.play-phone::before {
  content: "";
  position: absolute;
  inset: 10px 10px 58px;
  border: 4px solid #000;
  pointer-events: none;
}

.play-phone.switching {
  transform: scale(.98) rotate(-1deg);
}

.play-phone-camera {
  display: none;
}

.play-phone-screen {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 4px solid #000;
  border-radius: 0;
  background: #dadada;
  overflow: hidden;
  display: grid;
  place-items: stretch;
}

.play-phone-bottom {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 10px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: transparent;
}

.phone-decor {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
}

.phone-decor.home {
  width: 22px;
  height: 16px;
  border: 4px solid #000;
  border-top: 0;
}

.phone-decor.home::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -10px;
  width: 14px;
  height: 14px;
  border-left: 4px solid #000;
  border-top: 4px solid #000;
  transform: translateX(-50%) rotate(45deg);
  background: transparent;
}

.phone-decor.circle {
  width: 30px;
  height: 30px;
  border: 4px solid #000;
  border-radius: 50%;
}

.phone-decor.back {
  width: 38px;
  height: 24px;
  border: 4px solid #000;
  border-left: 0;
  border-radius: 0 12px 12px 0;
}

.phone-decor.back::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 50%;
  width: 14px;
  height: 14px;
  border-left: 4px solid #000;
  border-bottom: 4px solid #000;
  transform: translate(-65%, -50%) rotate(45deg);
  background: transparent;
}

.module-utility {
  max-width: 520px;
  margin: 4px auto 14px;
}

.module-utility-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.module-status-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.module-status {
  font-size: .82rem;
  font-weight: 900;
}

.module-utility-hint {
  margin: 0;
  max-width: 390px;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.35;
}

.utility-reset {
  min-height: 38px;
  padding: 0 16px;
}

.phone-maze-board {
  --maze-cols: 11;
  --maze-rows: 19;
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(var(--maze-cols), 1fr);
  grid-template-rows: repeat(var(--maze-rows), 1fr);
  background: #ececec;
  touch-action: none;
}

.maze-wall {
  z-index: 1;
  margin: -0.5px;
  border-radius: 0;
  background: #111;
  box-shadow: none;
}

.maze-start,
.maze-exit {
  z-index: 2;
  display: grid;
  place-items: center;
  font-size: .34rem;
  font-weight: 950;
  letter-spacing: .02em;
  pointer-events: none;
}

.maze-start {
  color: #666;
}

.maze-exit {
  color: #fff;
  background: var(--accent);
}

.maze-ball {
  position: absolute;
  z-index: 5;
  width: calc(58% / var(--maze-cols));
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #ffffff 0 10%, #ececec 22%, #a3a3a3 58%, #4b4b4b 100%);
  box-shadow: 0 2px 4px rgba(0,0,0,.38), inset -1px -1px 2px rgba(0,0,0,.25);
  will-change: left, top;
  pointer-events: none;
}

.maze-ball.won {
  transform: translate(-50%, -50%) scale(1.25);
  box-shadow: 0 0 0 4px rgba(255,112,67,.25), 0 3px 8px rgba(0,0,0,.35);
}

.phone-maze-status,
.phone-memory-status {
  min-height: 1em;
  text-align: center;
}

.maze-controls {
  width: 112px;
  display: grid;
  grid-template-columns: repeat(3, 34px);
  grid-template-rows: repeat(2, 32px);
  gap: 5px;
  justify-content: center;
}

.maze-control {
  border: 1px solid rgba(23,23,23,.22);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: .9rem;
  font-weight: 950;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  touch-action: none;
  user-select: none;
  transition: transform .08s ease, background .08s ease, box-shadow .08s ease;
}

.maze-control.is-active {
  transform: translateY(1px) scale(.96);
  background: #fff7f3;
  box-shadow: inset 0 0 0 1px var(--accent);
}

.maze-control.up { grid-column: 2; grid-row: 1; }
.maze-control.left { grid-column: 1; grid-row: 2; }
.maze-control.down { grid-column: 2; grid-row: 2; }
.maze-control.right { grid-column: 3; grid-row: 2; }

.phone-memory-board {
  width: 100%;
  height: 100%;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  align-content: stretch;
  background: #ece3cf;
}

.phone-memory-card {
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 10px;
  background: #222;
  color: white;
  font-size: clamp(.95rem, 4vw, 1.45rem);
  font-weight: 900;
  cursor: pointer;
}

.phone-memory-card.flipped,
.phone-memory-card.matched {
  background: #fff8eb;
  color: var(--ink);
}

@media (max-width: 600px) {
  .play-phone {
    width: min(280px, 68vw);
    padding: 11px 11px 62px;
  }

  .play-phone::before {
    inset: 7px 7px 50px;
    border-width: 3px;
  }

  .play-phone-screen {
    border-width: 3px;
  }

  .play-phone-bottom {
    left: 12px;
    right: 12px;
    bottom: 8px;
  }

  .phone-decor.home {
    width: 20px;
    height: 14px;
    border-width: 3px;
  }

  .phone-decor.home::before,
  .phone-decor.back::before,
  .phone-decor.circle,
  .phone-decor.back {
    border-width: 3px;
  }

  .phone-decor.circle {
    width: 26px;
    height: 26px;
  }

  .phone-decor.back {
    width: 32px;
    height: 20px;
  }

  .module-utility {
    margin-top: 2px;
  }

  .module-utility-hint {
    font-size: .66rem;
  }

  .maze-controls {
    width: 100px;
    grid-template-columns: repeat(3, 30px);
    grid-template-rows: repeat(2, 28px);
    gap: 4px;
  }

  .phone-memory-board {
    gap: 6px;
    padding: 8px;
  }

  .maze-start,
  .maze-exit {
    font-size: .27rem;
  }
}

/* 2026-09-07 finomítások: nyelvváltó, igazított alsó díszgombok, szögletes modul */
.header-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.55);
}

.lang-button {
  min-width: 42px;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .06em;
  cursor: pointer;
}

.lang-button.is-active {
  background: var(--ink);
  color: #fff;
}

.play-phone {
  border-radius: 3px;
}

.play-phone-screen,
.phone-maze-board,
.phone-memory-board {
  border-radius: 0 !important;
}

.play-phone-bottom {
  left: 12px;
  right: auto;
  bottom: 10px;
  width: 128px;
  height: 40px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 12px;
}

.phone-decor.home {
  transform: translateY(1px);
}

.phone-decor.circle {
  transform: translateY(1px);
}

.phone-decor.back {
  transform: translateY(-1px);
}

.module-description h2 {
  font-size: clamp(2.5rem, 6vw, 4.6rem);
}

.module-switcher-label {
  margin-top: 2px;
}

@media (max-width: 850px) {
  .header-tools {
    gap: 8px;
  }

  .lang-button {
    min-width: 38px;
    min-height: 32px;
    padding: 0 10px;
  }
}

@media (max-width: 600px) {
  .site-header {
    gap: 8px;
  }

  .header-tools {
    margin-left: auto;
  }

  .lang-switch {
    padding: 3px;
  }

  .lang-button {
    min-width: 34px;
    min-height: 30px;
    font-size: .72rem;
  }

  .play-phone-bottom {
    left: 9px;
    width: 108px;
    height: 34px;
    gap: 10px;
    bottom: 8px;
  }
}

/* 2026-09-07: alsó díszgombok igazítása + 2. modul sínpályás rendező játék */
.play-phone-bottom {
  left: 18px;
  right: auto;
  bottom: 12px;
  width: 118px;
  height: 28px;
  display: block;
}

.phone-decor {
  position: absolute;
  bottom: 0;
  display: block;
}

.phone-decor.home {
  left: 0;
  width: 18px;
  height: 14px;
  border: 4px solid #000;
  border-top: 0;
  transform: none;
}

.phone-decor.home::before {
  left: 50%;
  top: -10px;
  width: 13px;
  height: 13px;
  border-left: 4px solid #000;
  border-top: 4px solid #000;
  transform: translateX(-50%) rotate(45deg);
}

.phone-decor.circle {
  left: 30px;
  width: 24px;
  height: 24px;
  border: 4px solid #000;
  border-radius: 50%;
  transform: none;
}

.phone-decor.circle::before,
.phone-decor.circle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 20px;
  background: #000;
  transform-origin: center;
}

.phone-decor.circle::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.phone-decor.circle::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.phone-decor.back {
  left: 62px;
  width: 34px;
  height: 18px;
  border: 4px solid #000;
  border-left: 0;
  border-radius: 0 999px 999px 0;
  transform: none;
}

.phone-decor.back::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 50%;
  width: 12px;
  height: 12px;
  border-left: 4px solid #000;
  border-bottom: 4px solid #000;
  transform: translate(-75%, -50%) rotate(45deg);
}

.phone-sort-board {
  --sort-cols: 7;
  --sort-rows: 11;
  width: 100%;
  height: 100%;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(var(--sort-cols), 1fr);
  grid-template-rows: repeat(var(--sort-rows), 1fr);
  background: #111;
  gap: 0;
}

.sort-track-cell {
  border: 0;
  margin: 0;
  padding: 0;
  background: #e9e9e9;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
  cursor: default;
}

.sort-track-cell[disabled] {
  opacity: 1;
}

.sort-track-cell.goal {
  position: relative;
}

.sort-track-cell.goal::after {
  content: "";
  position: absolute;
  inset: 19%;
  border: 2px dashed rgba(255,112,67,.78);
  border-radius: 50%;
}

.sort-track-cell.reachable {
  background: #fff4dd;
  box-shadow: inset 0 0 0 2px var(--accent);
  cursor: pointer;
}

.sort-token {
  margin: 10%;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fffef9 0 18%, #ffddb8 19%, #ffb779 52%, #ff7043 100%);
  color: #151515;
  font: inherit;
  font-size: .85rem;
  font-weight: 950;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.32);
  cursor: pointer;
  z-index: 2;
  position: relative;
}

.sort-token::before {
  content: "";
  position: absolute;
  inset: -5%;
  border-radius: 50%;
  border: 2px dotted rgba(0,0,0,.26);
}

.sort-token.selected {
  transform: scale(1.06);
  box-shadow: 0 0 0 3px rgba(255,112,67,.35), 0 2px 8px rgba(0,0,0,.34);
}

.sort-token span {
  position: relative;
  z-index: 1;
}

.phone-sort-status {
  min-height: 1em;
  text-align: center;
}

.sort-rule-box {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: .78rem;
  font-weight: 800;
}

.sort-rule-box strong {
  color: var(--accent);
}

@media (max-width: 600px) {
  .play-phone-bottom {
    left: 12px;
    bottom: 9px;
    width: 102px;
    height: 24px;
  }

  .phone-decor.home {
    width: 16px;
    height: 12px;
    border-width: 3px;
  }

  .phone-decor.home::before {
    top: -8px;
    width: 11px;
    height: 11px;
    border-left-width: 3px;
    border-top-width: 3px;
  }

  .phone-decor.circle {
    left: 27px;
    width: 21px;
    height: 21px;
    border-width: 3px;
  }

  .phone-decor.circle::before,
  .phone-decor.circle::after {
    width: 2px;
    height: 16px;
  }

  .phone-decor.back {
    left: 56px;
    width: 30px;
    height: 15px;
    border-width: 3px;
  }

  .phone-decor.back::before {
    width: 10px;
    height: 10px;
    border-left-width: 3px;
    border-bottom-width: 3px;
  }

  .sort-token {
    font-size: .72rem;
  }

  .sort-rule-box {
    font-size: .7rem;
  }
}

/* Végleges alsó díszgomb-elrendezés: a teljes telefon alján, fix 3 oszlopban. */
.play-phone-bottom {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 14px !important;
  width: auto !important;
  height: 32px !important;
  padding: 0 42px !important;
  margin: 0 !important;
  transform: none !important;
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  align-items: center !important;
  justify-items: center !important;
  gap: 0 !important;
  background: transparent !important;
}

.play-phone-bottom .phone-decor {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  margin: 0 !important;
  transform: none !important;
}

.play-phone-bottom .phone-decor.home {
  width: 20px !important;
  height: 15px !important;
}

.play-phone-bottom .phone-decor.circle {
  width: 25px !important;
  height: 25px !important;
}

.play-phone-bottom .phone-decor.back {
  width: 34px !important;
  height: 18px !important;
}

/* MODUL 02 – nyolckorongos, 3D-ben is megvalósítható sínrendező. */
.phone-sort-board {
  --sort-cols: 7;
  --sort-rows: 17;
  padding: 7px;
  background: #111;
}

.sort-track-cell {
  min-width: 0;
  min-height: 0;
}

.sort-track-cell.goal::after {
  inset: 12%;
  border-width: 1.5px;
}

.sort-token {
  margin: 5%;
  min-width: 0;
  min-height: 0;
  font-size: clamp(.56rem, 2.1vw, .78rem);
}

.sort-token::before {
  inset: -3%;
  border-width: 1.5px;
}

.sort-rule-box {
  max-width: 520px;
}

@media (max-width: 600px) {
  .play-phone-bottom {
    bottom: 11px !important;
    height: 28px !important;
    padding: 0 30px !important;
  }

  .play-phone-bottom .phone-decor.home {
    width: 17px !important;
    height: 13px !important;
  }

  .play-phone-bottom .phone-decor.circle {
    width: 22px !important;
    height: 22px !important;
  }

  .play-phone-bottom .phone-decor.back {
    width: 30px !important;
    height: 16px !important;
  }

  .phone-sort-board {
    padding: 5px;
  }

  .sort-token {
    margin: 4%;
    font-size: .55rem;
  }
}

/* MODUL 02 – 11 korong, 5 vízszintes sín, sínként max. 3 hely. */
.phone-sort-board {
  --sort-cols: 3 !important;
  --sort-rows: 9 !important;
  padding: 10px 14px !important;
  grid-template-columns: repeat(3, 1fr) !important;
  grid-template-rows: repeat(9, 1fr) !important;
  background: #111 !important;
  overflow: hidden !important;
}

.sort-track-cell {
  min-width: 0 !important;
  min-height: 0 !important;
  border-radius: 0 !important;
  background: #e9e9e9 !important;
  box-shadow: none !important;
}

/* A függőleges fő sín köztes részei keskeny átjárók, itt nincs megállóhely. */
.sort-track-cell.connector {
  width: 34% !important;
  justify-self: center !important;
  background: #e9e9e9 !important;
}

.sort-track-cell.reachable {
  background: #fff3d8 !important;
  box-shadow: inset 0 0 0 2px var(--accent) !important;
}

.sort-track-cell.goal::after {
  inset: 18% !important;
  border-width: 1.5px !important;
}

.sort-token {
  width: 40% !important;
  max-width: 38px !important;
  min-width: 27px !important;
  aspect-ratio: 1 !important;
  align-self: center !important;
  justify-self: center !important;
  margin: 0 !important;
  font-size: clamp(.58rem, 2vw, .78rem) !important;
}

@media (max-width: 600px) {
  .phone-sort-board {
    padding: 7px 10px !important;
  }

  .sort-token {
    width: 42% !important;
    min-width: 23px !important;
    max-width: 32px !important;
    font-size: .58rem !important;
  }
}

/* 2026-09-07 final finomítások a telefon gombjaihoz és a Sínrendező modulhoz */
.play-phone {
  padding: 10px 10px 44px !important;
}

.play-phone::before {
  display: none !important;
}

.play-phone-screen {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  border: 4px solid #000 !important;
  border-radius: 0 !important;
}

.play-phone-bottom {
  position: absolute !important;
  left: 12px !important;
  right: 12px !important;
  bottom: 8px !important;
  width: auto !important;
  height: 30px !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr 1fr !important;
  align-items: end !important;
  justify-items: center !important;
  gap: 0 !important;
  background: transparent !important;
}

.play-phone-bottom .phone-decor {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  transform: none !important;
  margin: 0 !important;
}

.play-phone-bottom .phone-decor.home {
  width: 18px !important;
  height: 13px !important;
  border: 4px solid #000 !important;
  border-top: 0 !important;
  margin-bottom: 0 !important;
}

.play-phone-bottom .phone-decor.home::before {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  top: -9px !important;
  width: 12px !important;
  height: 12px !important;
  border-left: 4px solid #000 !important;
  border-top: 4px solid #000 !important;
  transform: translateX(-50%) rotate(45deg) !important;
  background: transparent !important;
}

.play-phone-bottom .phone-decor.circle {
  width: 28px !important;
  height: 28px !important;
  border: 4px solid #000 !important;
  border-radius: 50% !important;
}

.play-phone-bottom .phone-decor.circle::before,
.play-phone-bottom .phone-decor.circle::after {
  display: none !important;
  content: none !important;
}

.play-phone-bottom .phone-decor.back {
  width: 34px !important;
  height: 16px !important;
  border: 4px solid #000 !important;
  border-left: 0 !important;
  border-radius: 0 999px 999px 0 !important;
}

.play-phone-bottom .phone-decor.back::before,
.play-phone-bottom .phone-decor.back::after {
  display: none !important;
  content: none !important;
}

.phone-sort-board {
  --sort-cols: 3;
  --sort-rows: 9;
  padding: 6px !important;
  background: #0d0d0d !important;
  align-items: stretch !important;
  justify-items: stretch !important;
  border-radius: 0 !important;
}

.sort-track-cell {
  border: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #e8e8e8 !important;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12) !important;
  border-radius: 0 !important;
}

.sort-track-cell.connector {
  background: #e8e8e8 !important;
}

.sort-track-cell.reachable {
  background: #fff2de !important;
  box-shadow: inset 0 0 0 2px var(--accent) !important;
}

.sort-track-cell.goal::after {
  display: none !important;
  content: none !important;
}

.sort-track-cell.goal {
  background: #ececec !important;
}

.sort-token {
  margin: 5% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  font-size: 1rem !important;
  box-shadow: 0 3px 7px rgba(0,0,0,.34) !important;
}

.sort-token::before {
  inset: -4% !important;
}

@media (max-width: 600px) {
  .play-phone {
    padding: 8px 8px 38px !important;
  }

  .play-phone-screen {
    border-width: 3px !important;
  }

  .play-phone-bottom {
    left: 9px !important;
    right: 9px !important;
    bottom: 6px !important;
    height: 26px !important;
  }

  .play-phone-bottom .phone-decor.home {
    width: 15px !important;
    height: 11px !important;
    border-width: 3px !important;
  }

  .play-phone-bottom .phone-decor.home::before {
    top: -7px !important;
    width: 10px !important;
    height: 10px !important;
    border-left-width: 3px !important;
    border-top-width: 3px !important;
  }

  .play-phone-bottom .phone-decor.circle {
    width: 24px !important;
    height: 24px !important;
    border-width: 3px !important;
  }

  .play-phone-bottom .phone-decor.back {
    width: 28px !important;
    height: 14px !important;
    border-width: 3px !important;
  }

  .phone-sort-board {
    padding: 5px !important;
  }

  .sort-token {
    font-size: .88rem !important;
  }
}

/* 2026-09-07 – bead/korong jellegű Sínrendező + végleges alsó díszgomb-igazítás */
.play-phone {
  padding: 10px 10px 52px !important;
}

.play-phone-bottom {
  left: 12px !important;
  right: 12px !important;
  bottom: 7px !important;
  height: 40px !important;
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  align-items: center !important;
  justify-items: center !important;
}

.play-phone-bottom .phone-decor {
  position: relative !important;
  inset: auto !important;
  margin: 0 !important;
  transform: none !important;
  box-sizing: border-box !important;
}

/* A ház teljes rajza a saját 32x32-es dobozán BELÜL marad, ezért nem ül magasabban. */
.play-phone-bottom .phone-decor.home {
  width: 32px !important;
  height: 32px !important;
  border: 0 !important;
  background: transparent !important;
}

.play-phone-bottom .phone-decor.home::before {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  left: 50% !important;
  top: 5px !important;
  width: 16px !important;
  height: 16px !important;
  border-left: 4px solid #000 !important;
  border-top: 4px solid #000 !important;
  transform: translateX(-50%) rotate(45deg) !important;
  background: transparent !important;
}

.play-phone-bottom .phone-decor.home::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  left: 50% !important;
  bottom: 3px !important;
  width: 19px !important;
  height: 16px !important;
  border: 4px solid #000 !important;
  border-top: 0 !important;
  transform: translateX(-50%) !important;
  background: transparent !important;
}

/* A középső kör szándékosan nagyobb a két szélső ikonnál. */
.play-phone-bottom .phone-decor.circle {
  width: 38px !important;
  height: 38px !important;
  border: 4px solid #000 !important;
  border-radius: 50% !important;
  background: transparent !important;
}

.play-phone-bottom .phone-decor.circle::before,
.play-phone-bottom .phone-decor.circle::after {
  display: none !important;
  content: none !important;
}

/* Vissza díszgomb: nyitott, lekerekített forma, külön '<' jel nélkül. */
.play-phone-bottom .phone-decor.back {
  width: 34px !important;
  height: 20px !important;
  border: 4px solid #000 !important;
  border-left: 0 !important;
  border-radius: 0 999px 999px 0 !important;
  background: transparent !important;
}

.play-phone-bottom .phone-decor.back::before,
.play-phone-bottom .phone-decor.back::after {
  display: none !important;
  content: none !important;
}

/* Sínrendező: a kockaszerű mezők eltűnnek, csak a folyamatos sínek és a nagy korongok maradnak. */
.phone-sort-board {
  --sort-cols: 3;
  --sort-rows: 9;
  position: relative !important;
  display: grid !important;
  grid-template-columns: repeat(var(--sort-cols), 1fr) !important;
  grid-template-rows: repeat(var(--sort-rows), 1fr) !important;
  padding: 8px !important;
  overflow: hidden !important;
  background: #111 !important;
  touch-action: none !important;
}

.sort-rail {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  background: #e8e8e8;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
}

.sort-spine {
  left: calc(100% / 6);
  top: calc(100% / 18);
  bottom: calc(100% / 18);
  width: 10px;
  transform: translateX(-50%);
  border-radius: 999px;
}

.sort-lane {
  left: calc(100% / 6);
  right: 5%;
  height: 10px;
  transform: translateY(-50%);
  border-radius: 0 999px 999px 0;
}

.sort-track-cell,
.sort-track-cell.connector,
.sort-track-cell.goal {
  z-index: 1 !important;
  border: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  opacity: 0 !important;
  border-radius: 0 !important;
}

.sort-track-cell.reachable {
  background: transparent !important;
  box-shadow: none !important;
  opacity: 0 !important;
}

.sort-track-cell.goal::after,
.sort-track-cell.reachable::after {
  display: none !important;
  content: none !important;
}

.sort-token {
  z-index: 4 !important;
  place-self: center !important;
  width: min(72%, 68px) !important;
  min-width: 46px !important;
  max-width: 68px !important;
  aspect-ratio: 1 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 3px solid rgba(0,0,0,.28) !important;
  border-radius: 50% !important;
  background:
    radial-gradient(circle at 34% 28%, rgba(255,255,255,.9) 0 9%, rgba(255,255,255,.25) 10% 20%, transparent 21%),
    hsl(var(--token-hue), 86%, 57%) !important;
  color: #111 !important;
  font-size: 1.05rem !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  box-shadow: 0 3px 7px rgba(0,0,0,.42), inset 0 -5px 8px rgba(0,0,0,.14) !important;
  cursor: grab !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  touch-action: none !important;
  transition: transform .16s ease, box-shadow .16s ease !important;
}

.sort-token::before {
  display: none !important;
  content: none !important;
}

.sort-token:hover {
  transform: scale(1.04);
}

.sort-token.selected {
  box-shadow: 0 0 0 4px rgba(255,112,67,.30), 0 4px 9px rgba(0,0,0,.42) !important;
}

.sort-token.dragging {
  z-index: 10 !important;
  cursor: grabbing !important;
  box-shadow: 0 7px 15px rgba(0,0,0,.48) !important;
}

.sort-token span {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

@media (max-width: 600px) {
  .play-phone {
    padding: 8px 8px 45px !important;
  }

  .play-phone-bottom {
    left: 9px !important;
    right: 9px !important;
    bottom: 5px !important;
    height: 35px !important;
  }

  .play-phone-bottom .phone-decor.home {
    width: 28px !important;
    height: 28px !important;
  }

  .play-phone-bottom .phone-decor.home::before {
    top: 4px !important;
    width: 14px !important;
    height: 14px !important;
    border-left-width: 3px !important;
    border-top-width: 3px !important;
  }

  .play-phone-bottom .phone-decor.home::after {
    bottom: 2px !important;
    width: 17px !important;
    height: 14px !important;
    border-width: 3px !important;
    border-top: 0 !important;
  }

  .play-phone-bottom .phone-decor.circle {
    width: 34px !important;
    height: 34px !important;
    border-width: 3px !important;
  }

  .play-phone-bottom .phone-decor.back {
    width: 30px !important;
    height: 18px !important;
    border-width: 3px !important;
    border-left: 0 !important;
  }

  .sort-spine,
  .sort-lane {
    width: 8px;
  }

  .sort-lane {
    width: auto;
    height: 8px;
  }

  .sort-token {
    width: min(75%, 58px) !important;
    min-width: 40px !important;
    max-width: 58px !important;
    font-size: .9rem !important;
  }
}

/* A korongok közel kitöltik a három sínpozíció szélességét, a bead-rack jelleghez. */
.sort-token {
  width: min(82%, 76px) !important;
  min-width: 50px !important;
  max-width: 76px !important;
}

@media (max-width: 600px) {
  .sort-token {
    width: min(82%, 62px) !important;
    min-width: 43px !important;
    max-width: 62px !important;
  }
}

/* 2026-09-07 finomhangolás: alsó ikonok pontosabb illesztése, sínkapcsolatok javítása, korongok ne lógjanak ki */
.play-phone-bottom {
  left: 10px !important;
  right: 10px !important;
  bottom: 7px !important;
  height: 40px !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr 1fr !important;
  align-items: end !important;
  justify-items: center !important;
}

.play-phone-bottom .phone-decor {
  position: relative !important;
  align-self: end !important;
  justify-self: center !important;
}

/* Bal oldali ház ikon: külön tető + külön test, pontosabban illesztve */
.play-phone-bottom .phone-decor.home {
  width: 24px !important;
  height: 24px !important;
  border: 0 !important;
  background: transparent !important;
}

.play-phone-bottom .phone-decor.home::before {
  content: "" !important;
  position: absolute !important;
  left: 5px !important;
  top: 2px !important;
  width: 11px !important;
  height: 11px !important;
  border-left: 4px solid #000 !important;
  border-top: 4px solid #000 !important;
  transform: rotate(45deg) !important;
  background: transparent !important;
}

.play-phone-bottom .phone-decor.home::after {
  content: "" !important;
  position: absolute !important;
  left: 6px !important;
  bottom: 1px !important;
  width: 12px !important;
  height: 10px !important;
  border: 4px solid #000 !important;
  border-top: 0 !important;
  background: transparent !important;
}

/* Középső kör legyen ténylegesen nagyobb */
.play-phone-bottom .phone-decor.circle {
  width: 34px !important;
  height: 34px !important;
  border: 4px solid #000 !important;
  border-radius: 50% !important;
  background: transparent !important;
}

/* Jobb oldali vissza gomb egyszerű, kisebb, a körnél érezhetően kisebb */
.play-phone-bottom .phone-decor.back {
  width: 30px !important;
  height: 16px !important;
  border: 4px solid #000 !important;
  border-left: 0 !important;
  border-radius: 0 999px 999px 0 !important;
  background: transparent !important;
}

.phone-sort-board {
  padding: 10px 8px !important;
}

/* Vastagabb, jobban illeszkedő sínek */
.sort-spine {
  left: calc(100% / 6) !important;
  top: calc(100% / 18) !important;
  bottom: calc(100% / 18) !important;
  width: 12px !important;
  transform: translateX(-50%) !important;
  border-radius: 999px !important;
}

.sort-lane {
  left: calc(100% / 6) !important;
  right: 7% !important;
  height: 12px !important;
  transform: translateY(-50%) !important;
  border-radius: 0 999px 999px 0 !important;
}

/* A korongok töltsék ki jobban a sínhelyet, de ne lógjanak ki felül/alul */
.sort-token {
  width: 82% !important;
  height: 82% !important;
  min-width: 0 !important;
  max-width: none !important;
  max-height: none !important;
  aspect-ratio: 1 !important;
  place-self: center !important;
  font-size: 1rem !important;
}

.sort-token.selected {
  transform: scale(1.02) !important;
}

@media (max-width: 600px) {
  .play-phone-bottom {
    left: 8px !important;
    right: 8px !important;
    bottom: 5px !important;
    height: 34px !important;
  }

  .play-phone-bottom .phone-decor.home {
    width: 20px !important;
    height: 20px !important;
  }

  .play-phone-bottom .phone-decor.home::before {
    left: 5px !important;
    top: 2px !important;
    width: 9px !important;
    height: 9px !important;
    border-left-width: 3px !important;
    border-top-width: 3px !important;
  }

  .play-phone-bottom .phone-decor.home::after {
    left: 5px !important;
    bottom: 1px !important;
    width: 10px !important;
    height: 8px !important;
    border-width: 3px !important;
    border-top: 0 !important;
  }

  .play-phone-bottom .phone-decor.circle {
    width: 30px !important;
    height: 30px !important;
    border-width: 3px !important;
  }

  .play-phone-bottom .phone-decor.back {
    width: 26px !important;
    height: 14px !important;
    border-width: 3px !important;
    border-left: 0 !important;
  }

  .sort-spine,
  .sort-lane {
    width: 10px !important;
  }

  .sort-lane {
    height: 10px !important;
  }

  .sort-token {
    width: 78% !important;
    height: 78% !important;
    font-size: .92rem !important;
  }
}

/* 2026-09-07 utolsó finomítások: ház ikon pontos tetőillesztés, valódi kör korongok, egybefüggő sínhatás */
.play-phone-bottom {
  left: 10px !important;
  right: 10px !important;
  bottom: 6px !important;
  height: 38px !important;
  align-items: end !important;
  justify-items: center !important;
}

.play-phone-bottom .phone-decor.home {
  width: 24px !important;
  height: 22px !important;
  border: 0 !important;
  background: transparent !important;
}

.play-phone-bottom .phone-decor.home::before {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  top: 1px !important;
  width: 12px !important;
  height: 12px !important;
  border-left: 4px solid #000 !important;
  border-top: 4px solid #000 !important;
  transform: translateX(-50%) rotate(45deg) !important;
  background: transparent !important;
}

.play-phone-bottom .phone-decor.home::after {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  bottom: 0 !important;
  width: 14px !important;
  height: 10px !important;
  border: 4px solid #000 !important;
  border-top: 0 !important;
  transform: translateX(-50%) !important;
  background: transparent !important;
}

.play-phone-bottom .phone-decor.circle {
  width: 36px !important;
  height: 36px !important;
  border: 4px solid #000 !important;
  border-radius: 50% !important;
}

.play-phone-bottom .phone-decor.back {
  width: 30px !important;
  height: 16px !important;
  border: 4px solid #000 !important;
  border-left: 0 !important;
  border-radius: 0 999px 999px 0 !important;
}

.phone-sort-board {
  --token-size: 50px;
  --rail-thickness: 12px;
  --spine-x: calc(100% / 6);
  padding: 10px 8px !important;
}

.sort-rail {
  background: #ececec !important;
  box-shadow: none !important;
}

.sort-spine {
  left: var(--spine-x) !important;
  width: var(--rail-thickness) !important;
  border-radius: 999px !important;
}

.sort-lane {
  left: var(--spine-x) !important;
  right: 7% !important;
  height: var(--rail-thickness) !important;
  border-radius: 999px !important;
}

.sort-joint {
  position: absolute;
  left: var(--spine-x);
  width: calc(var(--rail-thickness) + 2px);
  height: calc(var(--rail-thickness) + 2px);
  transform: translate(-50%, -50%);
  border-radius: 2px;
  background: #ececec;
  z-index: 1;
  pointer-events: none;
}

.sort-token {
  width: var(--token-size) !important;
  height: var(--token-size) !important;
  min-width: var(--token-size) !important;
  min-height: var(--token-size) !important;
  max-width: var(--token-size) !important;
  max-height: var(--token-size) !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 50% !important;
  place-self: center !important;
  font-size: clamp(.9rem, calc(var(--token-size) * 0.3), 1.05rem) !important;
}

@media (max-width: 600px) {
  .play-phone-bottom {
    left: 8px !important;
    right: 8px !important;
    bottom: 5px !important;
    height: 32px !important;
  }

  .play-phone-bottom .phone-decor.home {
    width: 20px !important;
    height: 18px !important;
  }

  .play-phone-bottom .phone-decor.home::before {
    top: 1px !important;
    width: 10px !important;
    height: 10px !important;
    border-left-width: 3px !important;
    border-top-width: 3px !important;
  }

  .play-phone-bottom .phone-decor.home::after {
    width: 12px !important;
    height: 8px !important;
    border-width: 3px !important;
    border-top: 0 !important;
  }

  .play-phone-bottom .phone-decor.circle {
    width: 30px !important;
    height: 30px !important;
    border-width: 3px !important;
  }

  .play-phone-bottom .phone-decor.back {
    width: 26px !important;
    height: 14px !important;
    border-width: 3px !important;
    border-left: 0 !important;
  }
}

/* 2026-09-07: középpontosított korongok/sínek és SVG alsó ikonok */
.play-phone-bottom {
  left: 10px !important;
  right: 10px !important;
  bottom: 5px !important;
  height: 40px !important;
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  align-items: center !important;
  justify-items: center !important;
  gap: 0 !important;
}

.play-phone-bottom svg.phone-decor {
  position: static !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  border: 0 !important;
  background: transparent !important;
  overflow: visible !important;
  fill: none !important;
  stroke: #000 !important;
  stroke-width: 4 !important;
  stroke-linecap: square !important;
  stroke-linejoin: miter !important;
  box-sizing: border-box !important;
}

.play-phone-bottom svg.phone-decor::before,
.play-phone-bottom svg.phone-decor::after {
  display: none !important;
  content: none !important;
}

.play-phone-bottom svg.phone-decor.home {
  width: 28px !important;
  height: 28px !important;
}

.play-phone-bottom svg.phone-decor.circle {
  width: 36px !important;
  height: 36px !important;
}

.play-phone-bottom svg.phone-decor.back {
  width: 30px !important;
  height: 30px !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.phone-sort-board {
  position: relative !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.sort-rail-svg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.sort-rail-line {
  stroke: #ececec;
  stroke-width: var(--rail-thickness);
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Régi külön sín-elemek már nem vesznek részt a rajzolásban. */
.sort-spine,
.sort-lane,
.sort-joint {
  display: none !important;
}

.sort-track-cell,
.sort-track-cell.connector,
.sort-track-cell.goal,
.sort-track-cell.reachable {
  position: absolute !important;
  width: 28% !important;
  height: 18% !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  z-index: 2 !important;
}

.sort-token {
  position: absolute !important;
  width: var(--token-size) !important;
  height: var(--token-size) !important;
  min-width: var(--token-size) !important;
  min-height: var(--token-size) !important;
  max-width: var(--token-size) !important;
  max-height: var(--token-size) !important;
  aspect-ratio: 1 / 1 !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  place-self: unset !important;
  border-radius: 50% !important;
  box-sizing: border-box !important;
}

.sort-token:hover {
  transform: translate(-50%, -50%) scale(1.035) !important;
}

.sort-token.selected {
  transform: translate(-50%, -50%) scale(1.035) !important;
}

@media (max-width: 600px) {
  .play-phone-bottom {
    left: 8px !important;
    right: 8px !important;
    bottom: 4px !important;
    height: 34px !important;
  }

  .play-phone-bottom svg.phone-decor {
    stroke-width: 3.5 !important;
  }

  .play-phone-bottom svg.phone-decor.home {
    width: 24px !important;
    height: 24px !important;
  }

  .play-phone-bottom svg.phone-decor.circle {
    width: 31px !important;
    height: 31px !important;
  }

  .play-phone-bottom svg.phone-decor.back {
    width: 26px !important;
    height: 26px !important;
  }
}

/* 2026-09-07 utolsó igazítás: alsó 3 ikon középvonalban, nagyobb középső kör */
.play-phone-bottom {
  left: 12px !important;
  right: 12px !important;
  bottom: 6px !important;
  height: 44px !important;
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  align-items: center !important;
  justify-items: center !important;
}

.play-phone-bottom svg.phone-decor {
  align-self: center !important;
  justify-self: center !important;
  vertical-align: middle !important;
}

.play-phone-bottom svg.phone-decor.home {
  width: 26px !important;
  height: 26px !important;
}

.play-phone-bottom svg.phone-decor.circle {
  width: 40px !important;
  height: 40px !important;
}

.play-phone-bottom svg.phone-decor.back {
  width: 28px !important;
  height: 28px !important;
}

@media (max-width: 600px) {
  .play-phone-bottom {
    left: 9px !important;
    right: 9px !important;
    bottom: 4px !important;
    height: 38px !important;
  }

  .play-phone-bottom svg.phone-decor.home {
    width: 22px !important;
    height: 22px !important;
  }

  .play-phone-bottom svg.phone-decor.circle {
    width: 34px !important;
    height: 34px !important;
  }

  .play-phone-bottom svg.phone-decor.back {
    width: 24px !important;
    height: 24px !important;
  }
}

/* ============================================================
   ÖSSZES JÁTÉK / ALL GAMES OLDAL
   ============================================================ */
.all-games-action {
  display: flex;
  justify-content: center;
  margin: 34px auto 0;
}

.all-games-button {
  min-width: 180px;
  border: 1px solid rgba(255,255,255,.35);
  background: transparent;
  color: #fff;
}

.all-games-button:hover {
  background: #fff;
  color: var(--ink);
}

.catalog-page {
  min-height: 100vh;
  background: var(--bg);
}

.catalog-header .catalog-nav {
  display: flex;
}

.catalog-main {
  min-height: calc(100vh - 76px);
}

.catalog-hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(80px, 10vw, 145px) 5vw 56px;
  text-align: center;
}

.catalog-hero h1 {
  margin: 0;
  font-size: clamp(4rem, 9vw, 8.5rem);
  line-height: .88;
  letter-spacing: -.075em;
}

.catalog-hero > p:not(.eyebrow) {
  max-width: 760px;
  margin: 28px auto 0;
  color: var(--muted);
  font-size: 1.1rem;
}

.catalog-section {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 5vw clamp(90px, 12vw, 150px);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.catalog-game-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--paper);
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  outline: none;
}

.catalog-game-card:hover,
.catalog-game-card:focus-visible {
  transform: translateY(-5px);
  border-color: #bdb7aa;
  box-shadow: 0 24px 55px rgba(0,0,0,.12);
}

.catalog-card-media {
  height: 285px;
  padding: 22px;
  background: #1b1b1b;
}

.catalog-card-body {
  min-height: 285px;
  padding: 30px;
  display: flex;
  flex-direction: column;
}

.catalog-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--accent);
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .13em;
}

.catalog-card-body h2 {
  margin: 34px 0 12px;
  font-size: clamp(2.5rem, 4.6vw, 4.6rem);
  line-height: .92;
  letter-spacing: -.06em;
}

.catalog-card-body p {
  max-width: 500px;
  margin: 0;
  color: var(--muted);
}

.catalog-card-open {
  margin-top: auto;
  padding-top: 30px;
  font-weight: 900;
}

.catalog-photo-placeholder {
  width: 100%;
  height: 100%;
  min-height: 260px;
  border: 1px dashed rgba(255,255,255,.28);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255,255,255,.035) 25%, transparent 25%) 0 0/22px 22px,
    linear-gradient(315deg, rgba(255,255,255,.035) 25%, transparent 25%) 0 0/22px 22px,
    #252525;
}

.catalog-photo-placeholder span {
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .14em;
  opacity: .62;
}

.catalog-photo-placeholder strong {
  font-size: clamp(3rem, 7vw, 6.4rem);
  line-height: .9;
  letter-spacing: -.06em;
}

.catalog-photo-placeholder.compact {
  min-height: 100%;
}

.catalog-physical-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.catalog-footer {
  padding: 40px 5vw;
  display: flex;
  align-items: center;
  gap: 25px;
  border-top: 1px solid var(--line);
}

.catalog-footer p {
  color: var(--muted);
}

.catalog-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
}

.catalog-modal.is-open {
  display: block;
}

.catalog-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(9px);
}

.catalog-modal-panel {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  margin: 14px auto;
  overflow: auto;
  border-radius: 30px;
  background: var(--paper);
  box-shadow: 0 32px 110px rgba(0,0,0,.35);
}

.catalog-modal-close {
  position: sticky;
  z-index: 20;
  top: 16px;
  float: right;
  margin: 16px 18px -58px 0;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #ece8df;
  color: var(--ink);
  font-size: 1.65rem;
  cursor: pointer;
}

.catalog-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(410px, 1.08fr);
  gap: 44px;
  padding: clamp(34px, 5vw, 66px);
}

.catalog-detail-copy {
  padding-top: 16px;
}

.catalog-detail-copy .eyebrow {
  color: var(--accent);
}

.catalog-detail-copy > h2 {
  margin: 0;
  font-size: clamp(3.4rem, 6vw, 6.2rem);
  line-height: .88;
  letter-spacing: -.07em;
}

.catalog-detail-description {
  margin: 25px 0 38px;
  color: var(--muted);
  font-size: 1.05rem;
}

.catalog-block-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 14px;
}

.catalog-block-heading h3 {
  margin: 0;
  font-size: 1.12rem;
}

.catalog-block-heading span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.catalog-physical-media {
  height: 260px;
  overflow: hidden;
  border-radius: 20px;
  background: #222;
}

.catalog-physical-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: .82rem;
}

.catalog-demo-block {
  min-width: 0;
}

.catalog-phone-stage {
  min-height: 555px;
  display: grid;
  place-items: center;
  padding: 18px;
  border-radius: 26px;
  background: #f1ede4;
}

.catalog-play-phone {
  width: min(330px, 72vw) !important;
}

.catalog-module-utility {
  margin-top: 16px;
}

@media (max-width: 900px) {
  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .catalog-detail-layout {
    grid-template-columns: 1fr;
  }

  .catalog-demo-block {
    border-top: 1px solid var(--line);
    padding-top: 34px;
  }
}

@media (max-width: 600px) {
  .catalog-header .catalog-nav {
    display: none;
  }

  .catalog-header .header-button {
    display: none;
  }

  .catalog-hero {
    padding-left: 20px;
    padding-right: 20px;
  }

  .catalog-hero h1 {
    font-size: 4.3rem;
  }

  .catalog-section {
    padding-left: 20px;
    padding-right: 20px;
  }

  .catalog-card-media {
    height: 220px;
  }

  .catalog-card-body {
    min-height: 250px;
    padding: 24px;
  }

  .catalog-modal-panel {
    width: calc(100% - 14px);
    max-height: calc(100vh - 14px);
    margin: 7px auto;
    border-radius: 22px;
  }

  .catalog-detail-layout {
    padding: 28px 18px 42px;
  }

  .catalog-detail-copy > h2 {
    font-size: 3.4rem;
  }

  .catalog-phone-stage {
    min-height: 485px;
    padding: 10px;
  }

  .catalog-physical-media {
    height: 220px;
  }
}

/* ============================================================
   MODUL 03 — FORGÓ ÚTVONAL
   ============================================================ */
.route-board {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 18px 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: 7px;
  background: #161616;
  overflow: hidden;
}

.route-tile {
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .12s ease;
}

.route-tile:hover {
  transform: scale(1.04);
}

.route-tile-art {
  width: 100%;
  height: 100%;
  display: block;
}

.route-disc {
  fill: #efeadf;
  stroke: #282828;
  stroke-width: 5;
}

.route-channel {
  stroke: var(--accent);
  stroke-width: 16;
  stroke-linecap: round;
}

.route-hub {
  fill: var(--accent);
  stroke: #282828;
  stroke-width: 3;
}

.route-edge-label {
  position: absolute;
  z-index: 5;
  padding: 4px 6px;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: .42rem;
  font-weight: 950;
  letter-spacing: .06em;
  pointer-events: none;
}

.route-start-label {
  left: 3px;
  top: 8.5%;
  transform: translateY(-50%);
}

.route-goal-label {
  right: 3px;
  bottom: 8.5%;
  transform: translateY(50%);
}

.route-board.solved .route-disc {
  fill: #fff5ee;
  stroke: var(--accent);
}

.route-board.solved .route-channel,
.route-board.solved .route-hub {
  stroke: var(--accent-dark);
}

/* ============================================================
   MODUL 04 — FOGASKERÉK LÁNC
   ============================================================ */
.gear-board {
  position: relative;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.05), transparent 46%),
    #151515;
  overflow: hidden;
}

.gear-board::before {
  content: "";
  position: absolute;
  inset: 7%;
  border: 2px solid rgba(255,255,255,.08);
  pointer-events: none;
}

.gear-blocker {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 2px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.04);
  pointer-events: none;
}

.gear-peg,
.gear-piece {
  position: absolute;
  transform: translate(-50%, -50%);
}

.gear-peg {
  z-index: 1;
  width: 17px;
  height: 17px;
  padding: 0;
  border: 3px solid #c7c1b5;
  border-radius: 50%;
  background: #736f67;
  box-shadow: inset 0 0 0 3px #222;
  opacity: .78;
}

.gear-peg:disabled {
  opacity: .58;
}

.gear-peg.available {
  width: 23px;
  height: 23px;
  border-color: var(--accent);
  background: #fff7f2;
  box-shadow: 0 0 0 5px rgba(255,112,67,.16);
  cursor: pointer;
  opacity: 1;
}

.gear-piece {
  z-index: 4;
  width: 25%;
  max-width: 82px;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: transparent;
}

button.gear-piece {
  cursor: pointer;
}

.gear-piece.fixed {
  pointer-events: none;
}

.gear-art {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  transform-origin: 50% 50%;
}

.gear-teeth,
.gear-body {
  fill: #d8d1c3;
  stroke: #262626;
  stroke-width: 3;
}

.gear-piece.source .gear-teeth,
.gear-piece.source .gear-body {
  fill: #ff8a5f;
}

.gear-piece.target .gear-teeth,
.gear-piece.target .gear-body {
  fill: #f5cf52;
}

.gear-piece.movable .gear-teeth,
.gear-piece.movable .gear-body {
  fill: #eee8db;
}

.gear-hole {
  fill: #151515;
  stroke: #292929;
  stroke-width: 2;
}

.gear-label {
  fill: #171717;
  font-family: inherit;
  font-size: 16px;
  font-weight: 950;
  pointer-events: none;
}

.gear-piece.source .gear-label,
.gear-piece.target .gear-label {
  font-size: 9px;
  letter-spacing: .02em;
}

.gear-piece.selected .gear-art {
  filter: drop-shadow(0 0 7px rgba(255,112,67,.8));
}

.gear-piece.powered .gear-teeth,
.gear-piece.powered .gear-body {
  stroke: var(--accent-dark);
  stroke-width: 4;
}

.gear-board.solved {
  box-shadow: inset 0 0 0 4px rgba(255,112,67,.22);
}

.gear-art.spin-cw {
  animation: gear-spin-cw 1.9s linear infinite;
}

.gear-art.spin-ccw {
  animation: gear-spin-ccw 1.9s linear infinite;
}

@keyframes gear-spin-cw {
  to { transform: rotate(360deg); }
}

@keyframes gear-spin-ccw {
  to { transform: rotate(-360deg); }
}

@media (max-width: 600px) {
  .route-board {
    padding: 12px 9px;
    gap: 5px;
  }

  .route-channel {
    stroke-width: 14;
  }

  .gear-piece {
    width: 27%;
  }

  .gear-peg {
    width: 14px;
    height: 14px;
    border-width: 2px;
  }
}

/* Gear-chain geometry: equal center spacing so neighboring physical gears visually mesh. */
.gear-board {
  --gear-size: 62px;
}

.gear-piece {
  width: var(--gear-size) !important;
  height: var(--gear-size) !important;
  max-width: none !important;
}

.gear-peg {
  width: calc(var(--gear-size) * .20) !important;
  height: calc(var(--gear-size) * .20) !important;
  min-width: 12px;
  min-height: 12px;
}

.gear-peg.available {
  width: calc(var(--gear-size) * .27) !important;
  height: calc(var(--gear-size) * .27) !important;
}

/* ============================================================
   MODUL 05 — HÍDÉPÍTŐ
   ============================================================ */
.bridge-board {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 38%, rgba(255,255,255,.07), transparent 46%),
    #171717;
  touch-action: manipulation;
}

.bridge-board::before {
  content: "";
  position: absolute;
  inset: 7%;
  border: 2px solid rgba(255,255,255,.07);
  pointer-events: none;
}

.bridge-lines {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.bridge-piece-line {
  stroke: #efeadf;
  stroke-width: 12;
  stroke-linecap: round;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.35));
}

.bridge-peg,
.bridge-blocked {
  position: absolute;
  transform: translate(-50%, -50%);
}

.bridge-peg {
  z-index: 4;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 4px solid #d9d3c7;
  border-radius: 50%;
  background: #5e5a54;
  color: #fff;
  box-shadow:
    inset 0 0 0 5px #242424,
    0 3px 7px rgba(0,0,0,.38);
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.bridge-peg:hover {
  transform: translate(-50%, -50%) scale(1.06);
}

.bridge-peg.selected {
  border-color: var(--accent);
  box-shadow:
    inset 0 0 0 5px #242424,
    0 0 0 5px rgba(255,112,67,.20),
    0 3px 7px rgba(0,0,0,.38);
}

.bridge-peg.available {
  border-color: #fff;
  box-shadow:
    inset 0 0 0 5px #242424,
    0 0 0 5px rgba(255,255,255,.12),
    0 3px 7px rgba(0,0,0,.38);
}

.bridge-peg.start,
.bridge-peg.goal {
  width: 50px;
  height: 50px;
  border-color: #171717;
  box-shadow: 0 3px 8px rgba(0,0,0,.42);
}

.bridge-peg.start {
  background: var(--accent);
}

.bridge-peg.goal {
  background: #f3c94c;
  color: #171717;
}

.bridge-peg span {
  display: block;
  font-size: .38rem;
  font-weight: 950;
  letter-spacing: .04em;
  line-height: 1;
}

.bridge-blocked {
  z-index: 3;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 3px solid #4a4742;
  border-radius: 12px;
  background: #292826;
  color: #8f8b82;
  box-shadow: inset 0 0 0 3px #151515;
  transform: translate(-50%, -50%) rotate(45deg);
}

.bridge-blocked span {
  transform: rotate(-45deg);
  font-size: 1.1rem;
  font-weight: 950;
}

.bridge-board.solved {
  box-shadow: inset 0 0 0 4px rgba(255,112,67,.22);
}

.bridge-board.solved .bridge-piece-line {
  stroke: var(--accent);
}

@media (max-width: 600px) {
  .bridge-peg {
    width: 34px;
    height: 34px;
    border-width: 3px;
    box-shadow: inset 0 0 0 4px #242424, 0 2px 5px rgba(0,0,0,.34);
  }

  .bridge-peg.start,
  .bridge-peg.goal {
    width: 42px;
    height: 42px;
  }

  .bridge-blocked {
    width: 31px;
    height: 31px;
  }

  .bridge-piece-line {
    stroke-width: 10;
  }
}

/* ============================================================
   2026-09-07 — MODUL 04: FOGASKERÉK ÚTVONAL
   A korábbi Fogaskerék lánc + Hídépítő összevont változata.
   ============================================================ */
.gear-route-board {
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.055), transparent 48%),
    #151515 !important;
  touch-action: none;
}

.gear-route-board::before {
  inset: 5% !important;
  border-radius: 18px;
}

.gear-route-board .gear-blocker {
  display: none !important;
}

.gear-route-board .gear-piece {
  width: var(--gear-size) !important;
  height: var(--gear-size) !important;
  max-width: none !important;
  max-height: none !important;
}

.gear-route-board .gear-piece.fixed.source {
  pointer-events: auto !important;
  cursor: grab !important;
  touch-action: none !important;
}

.gear-route-board .gear-piece.fixed.source.turning {
  cursor: grabbing !important;
}

.gear-route-board .gear-piece.fixed.target {
  pointer-events: none !important;
}

.gear-route-board .gear-art {
  transition: filter .16s ease;
  will-change: transform;
}

.gear-route-board .gear-piece.source .gear-teeth,
.gear-route-board .gear-piece.source .gear-body {
  fill: #ff8054 !important;
}

.gear-route-board .gear-piece.target .gear-teeth,
.gear-route-board .gear-piece.target .gear-body {
  fill: #f4ca49 !important;
}

.gear-route-board .gear-piece.movable .gear-teeth,
.gear-route-board .gear-piece.movable .gear-body {
  fill: #eee8dc !important;
}

.gear-route-board .gear-piece.powered .gear-teeth,
.gear-route-board .gear-piece.powered .gear-body {
  stroke: #ff7043 !important;
  stroke-width: 4 !important;
}

.gear-route-board .gear-peg {
  z-index: 2 !important;
  opacity: .9 !important;
}

.gear-route-board .gear-peg.parent-editable {
  cursor: pointer !important;
  opacity: 1 !important;
  border-color: #ddd4c4 !important;
}

.gear-route-board .gear-peg.parent-editable:hover {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 5px rgba(255,112,67,.14) !important;
}

.gear-obstacle {
  position: absolute;
  z-index: 5;
  width: var(--gear-obstacle-size);
  height: var(--gear-obstacle-size);
  transform: translate(-50%, -50%) rotate(45deg);
  padding: 0;
  border: 3px solid #dad2c4;
  border-radius: 7px;
  background: #353535;
  box-shadow: 0 3px 7px rgba(0,0,0,.34), inset 0 0 0 2px rgba(255,255,255,.05);
  color: #f2ede4;
  display: grid;
  place-items: center;
}

button.gear-obstacle {
  cursor: pointer;
}

.gear-obstacle span {
  display: block;
  transform: rotate(-45deg);
  font-size: clamp(.8rem, 3vw, 1.15rem);
  line-height: 1;
  font-weight: 950;
}

.gear-route-board.parent-mode .gear-peg,
.gear-route-board.parent-mode .gear-obstacle {
  transition: transform .12s ease, box-shadow .12s ease;
}

.gear-route-board.parent-mode .gear-obstacle:hover {
  transform: translate(-50%, -50%) rotate(45deg) scale(1.08);
  box-shadow: 0 0 0 5px rgba(255,112,67,.14), 0 3px 7px rgba(0,0,0,.34);
}

.gear-route-board.solved {
  box-shadow: inset 0 0 0 4px rgba(255,112,67,.30) !important;
}

.gear-control-row {
  align-items: center;
  gap: 12px;
}

.gear-control-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.gear-control-buttons .button {
  white-space: nowrap;
}

@media (max-width: 700px) {
  .gear-control-row {
    align-items: stretch;
    flex-direction: column;
  }

  .gear-control-buttons {
    justify-content: stretch;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gear-control-buttons .button {
    min-width: 0;
    padding-left: 7px;
    padding-right: 7px;
    font-size: .72rem;
  }
}
