* { box-sizing: border-box; }

:root {
  --green: #4cc93f;
  --green-dark: #2f9e2a;
  --green-soft: #e6f9e2;
  --blue: #4aa8ff;
  --yellow: #ffd23f;
  --ink: #23422a;
  --panel: #ffffff;
  --radius: 22px;
}

html, body { overflow-x: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Comic Sans MS", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #dff5ff 0%, #eefbe8 45%, #d9f5cd 100%);
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3 { margin: 0; }

/* ---------- экраны ---------- */
.screen { display: none; min-height: 100vh; padding: 18px; }
.screen.active { display: block; animation: screenIn .35s ease; }
@keyframes screenIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.hidden { display: none !important; }

/* ---------- кнопки ---------- */
.btn {
  border: none; cursor: pointer; font-family: inherit; font-weight: 700;
  border-radius: 999px; transition: transform .12s ease, box-shadow .12s ease, filter .12s;
  color: #fff; background: var(--green);
  box-shadow: 0 5px 0 var(--green-dark);
  padding: 12px 22px; font-size: 18px;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--green-dark); }
.btn:hover { filter: brightness(1.05); }
.btn-big { font-size: clamp(20px, 3vw, 28px); padding: 18px 42px; }
.btn-primary { background: var(--green); box-shadow: 0 5px 0 var(--green-dark); }
.btn-secondary { background: var(--blue); box-shadow: 0 5px 0 #2c7fd0; }
.btn-ghost { background: #fff; color: var(--ink); box-shadow: 0 5px 0 #cfd8d2; }
.btn-run { background: var(--yellow); color: #5a4300; box-shadow: 0 5px 0 #d9ab00; font-size: 22px; padding: 14px 26px; }
.btn-chip { background: #fff; color: var(--ink); box-shadow: 0 4px 0 #cfd8d2; font-size: 16px; padding: 9px 16px; }
.btn:disabled { filter: grayscale(.6) opacity(.7); cursor: not-allowed; }

.icon-btn {
  border: none; background: #fff; border-radius: 18px; cursor: pointer;
  width: 54px; height: 54px; font-size: 24px; box-shadow: 0 4px 0 #cfd8d2;
  transition: transform .12s;
}
.icon-btn:active { transform: translateY(3px); }
.sound-btn { position: fixed; top: 14px; right: 14px; z-index: 60; }
/* Единственная кнопка «Домой» — левый верхний угол экрана (на всех экранах, кроме главной) */
.home-btn {
  position: fixed; top: 14px; left: 14px; z-index: 60;
  background: linear-gradient(145deg, #ffffff, #eaf7e6);
  border: 3px solid #bfe6b3; font-size: 26px;
}
.home-btn:hover { background: linear-gradient(145deg, #ffffff, #dff5d8); }
.back-btn { position: static; margin-bottom: 10px; }

/* ---------- главный экран ---------- */
#screen-home { display: none; align-items: center; justify-content: center; text-align: center; }
#screen-home.active { display: flex; }
.home-inner { max-width: 760px; width: 100%; padding: 20px; }
.title { font-size: clamp(38px, 7vw, 72px); line-height: 1.05; letter-spacing: -1px; }
.title-accent { color: var(--green-dark); }
.subtitle { font-size: clamp(18px, 3vw, 28px); margin: 14px 0 6px; color: #3c6a48; }

.hero-frog {
  position: relative; width: min(320px, 70vw); height: min(320px, 70vw);
  margin: 6px auto 10px; display: flex; align-items: center; justify-content: center;
}
.hero-frog .frog-pos { position: relative; width: 62%; height: 62%; }
.hero-shadow {
  position: absolute; bottom: 12%; left: 50%; transform: translateX(-50%);
  width: 55%; height: 26px; background: rgba(35, 80, 40, .22); border-radius: 50%; filter: blur(3px);
}
.hero-flower { position: absolute; font-size: 34px; animation: sway 3s ease-in-out infinite; }
.hero-flower.f1 { left: 4%; bottom: 18%; }
.hero-flower.f2 { right: 6%; bottom: 30%; animation-delay: .6s; }
.hero-flower.f3 { left: 20%; top: 6%; animation-delay: 1.2s; }
@keyframes sway { 0%,100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }

.home-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }

/* ---------- как играть ---------- */
.how-inner, .levels-inner { max-width: 900px; margin: 0 auto; text-align: center; padding-top: 58px; }
.h2 { font-size: clamp(24px, 4vw, 38px); margin-bottom: 6px; }
.lead { font-size: clamp(16px, 2.4vw, 22px); color: #3c6a48; margin: 0 0 16px; }

.how-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 18px; }
.how-card {
  background: var(--panel); border-radius: var(--radius); padding: 14px 8px;
  display: flex; flex-direction: column; gap: 6px; align-items: center;
  font-weight: 700; font-size: 18px; box-shadow: 0 5px 0 #d7e6d4;
}
.how-icon { font-size: 40px; }

.demo-wrap { background: var(--panel); border-radius: 28px; padding: 18px; box-shadow: 0 8px 0 #d7e6d4; }
.demo-seq { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin-bottom: 14px; }
.demo-chip {
  background: var(--green-soft); border: 2px solid var(--green); color: var(--green-dark);
  border-radius: 14px; padding: 8px 12px; font-weight: 700; font-size: 16px; transition: .2s;
}
.demo-chip.on { background: var(--yellow); border-color: #d9ab00; color: #5a4300; transform: scale(1.08); }
.demo-arrow { font-size: 20px; color: #7fa88a; }
.demo-board { width: min(340px, 80vw); margin: 0 auto 14px; }
.demo-actions { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.demo-done { display: flex; flex-direction: column; gap: 10px; align-items: center; font-size: 20px; animation: screenIn .3s ease; }

/* ---------- выбор уровня ---------- */
.levels-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.level-card {
  background: var(--panel); border: none; cursor: pointer; font-family: inherit;
  border-radius: 24px; padding: 16px 10px; box-shadow: 0 6px 0 #d7e6d4;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 18px; font-weight: 700; color: var(--ink); transition: transform .12s;
}
.level-card:hover { transform: translateY(-3px); }
.level-card .lvl-frog { font-size: 40px; }
.level-card .lvl-stars { font-size: 18px; letter-spacing: 2px; min-height: 22px; }
.level-card .lvl-name { font-size: 18px; color: var(--ink); font-weight: 800; }
.level-card .lvl-sub { font-size: 13px; color: #5c8468; font-weight: 600; }
.level-card.locked { opacity: .55; cursor: not-allowed; filter: grayscale(1); }
.level-card.done { outline: 3px solid var(--green); }

/* ---------- игровой экран ---------- */
.game-top {
  display: flex; align-items: center; gap: 14px; max-width: 1180px; margin: 0 auto 14px;
  background: var(--panel); border-radius: 22px; padding: 10px 14px 10px 74px;
  box-shadow: 0 6px 0 #d7e6d4;
}
.progress-wrap { flex: 1; }
.progress-text { font-weight: 700; font-size: 17px; margin-bottom: 6px; }
.progress-bar { height: 16px; background: #e4efe1; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--yellow)); border-radius: 999px; transition: width .5s ease; }
.top-right { display: flex; align-items: center; gap: 10px; }
.top-stars { font-size: 20px; letter-spacing: 2px; }

.game-main {
  display: flex; gap: 18px; max-width: 1180px; margin: 0 auto; align-items: flex-start;
}
.board-area { flex: 1 1 55%; min-width: 0; }
.board {
  position: relative; display: grid; gap: 4px; width: 100%;
  max-width: 560px; aspect-ratio: 1; margin: 0 auto;
  background: #b9e6a6; border-radius: 26px; padding: 8px; box-shadow: 0 8px 0 #96cc86;
}
.cell {
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: clamp(14px, 3.4vw, 26px); background: #a9e28f; user-select: none; position: relative;
}
.cell.alt { background: #bcec9f; }

/* Камень-препятствие: рисуем CSS-ом, чтобы не зависеть от эмодзи-шрифта */
.cell.wall { background: #cde8bd; }
.cell.wall .rock {
  display: block; width: 74%; height: 66%;
  background: linear-gradient(160deg, #c9c2ba 0%, #a49b90 55%, #867c71 100%);
  border-radius: 48% 52% 46% 54% / 62% 58% 42% 38%;
  box-shadow: 0 4px 0 rgba(70, 60, 50, .35), inset -4px -5px 0 rgba(0, 0, 0, .12);
  position: relative;
}
.cell.wall .rock::before {
  content: ""; position: absolute; left: 18%; top: 16%;
  width: 30%; height: 24%; border-radius: 50%;
  background: rgba(255, 255, 255, .5);
}
.cell.wall .rock::after {
  content: ""; position: absolute; right: 14%; bottom: 20%;
  width: 34%; height: 22%; border-radius: 50%;
  background: rgba(0, 0, 0, .16);
}

/* Цель — кувшинка на воде: лист-подушка и цветок (чистый CSS) */
.cell.goal {
  background: linear-gradient(180deg, #7fd0ff, #59b8f7);
  box-shadow: inset 0 0 0 3px #3f9ee8;
  animation: goalPulse 1.6s ease-in-out infinite;
}
.cell.goal .lily {
  display: block; position: relative;
  width: 76%; height: 58%;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #b8f08a, #58b93c 70%, #3d9429);
  box-shadow: inset -3px -4px 0 rgba(0, 0, 0, .14), 0 2px 0 rgba(255, 255, 255, .5);
  transform: rotate(-8deg);
}
.cell.goal .lily::after {
  content: ""; position: absolute; left: 50%; top: 44%;
  width: 46%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #ffd23f 0 26%, transparent 27%),
    radial-gradient(circle at 50% 18%, #ff9ec4 0 20%, transparent 21%),
    radial-gradient(circle at 82% 42%, #ff9ec4 0 20%, transparent 21%),
    radial-gradient(circle at 70% 84%, #ff9ec4 0 20%, transparent 21%),
    radial-gradient(circle at 30% 84%, #ff9ec4 0 20%, transparent 21%),
    radial-gradient(circle at 18% 42%, #ff9ec4 0 20%, transparent 21%);
}
.cell.goal .ring {
  position: absolute; inset: 8%;
  border: 3px dashed rgba(255, 255, 255, .85);
  border-radius: 50%;
  animation: ringSpin 9s linear infinite;
  pointer-events: none;
}
@keyframes ringSpin { to { transform: rotate(360deg); } }

/* ---------- вода и мост ---------- */
.cell.water { background: linear-gradient(180deg, #7fd0ff, #4fb4f5); box-shadow: inset 0 0 0 3px #3f9ee8; overflow: hidden; }
.cell.water .wave {
  position: absolute; left: -40%; width: 180%; height: 40%;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.65) 0 14px, transparent 14px 28px);
  border-radius: 50%;
  animation: waveMove 3s linear infinite;
}
.cell.water .w1 { top: 18%; }
.cell.water .w2 { top: 56%; animation-duration: 4.2s; animation-direction: reverse; }
@keyframes waveMove { to { transform: translateX(28px); } }

.cell.bridge {
  background: linear-gradient(180deg, #7fd0ff, #4fb4f5);
  box-shadow: inset 0 0 0 3px #3f9ee8;
}
.cell.bridge .plank, .cell.bridge .p2 {
  position: absolute; left: 6%; width: 88%; height: 34%;
  background: linear-gradient(180deg, #e0b275, #b9834b);
  border: 2px solid #8a5f30; border-radius: 7px;
  box-shadow: 0 2px 0 rgba(0,0,0,.18);
}
.cell.bridge .plank { top: 14%; }
.cell.bridge .p2 { top: 54%; }

/* ---------- звёздочки ---------- */
.cell.starcell { background: #fff6c9; box-shadow: inset 0 0 0 3px #ffd23f; }
.cell.starcell .star {
  display: block; font-size: 26px; line-height: 1;
  animation: starFloat 1.4s ease-in-out infinite;
  filter: drop-shadow(0 2px 2px rgba(180,130,0,.45));
}
.cell.starcell.taken { background: #e9f7e2; box-shadow: inset 0 0 0 3px #cfe9c4; }
.cell.starcell.taken .star { animation: none; opacity: .75; font-size: 20px; filter: none; }
@keyframes starFloat { 0%,100% { transform: translateY(0) rotate(-4deg);} 50% { transform: translateY(-14%) rotate(4deg);} }

/* ---------- счётчик звёздочек в шапке ---------- */
.star-count {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  background: #fff6c9; border: 3px solid #ffd23f; font-weight: 800; color: #8a6a00;
}
.star-count.got-all { background: #dff7cf; border-color: #7ed957; color: #2e7d17; }
.hidden { display: none !important; }
.dialog-stars-line { font-weight: 800; color: #2e7d17; }

/* ---------- итоговый экран ---------- */
.finale-stats { display: flex; flex-direction: column; gap: 8px; margin: 14px auto 6px; max-width: 380px; }
.finale-stat {
  background: #eef9e8; border: 3px solid #cbe9bd; border-radius: 16px;
  padding: 10px 14px; font-size: 18px; font-weight: 700; color: #3c6b3f;
}
.finale-stat b { color: var(--green-dark); font-size: 20px; }
.finale-awards { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 12px 0 4px; }
.award {
  padding: 10px 16px; border-radius: 999px; font-weight: 800; font-size: 17px;
  background: linear-gradient(145deg, #fff3b0, #ffe066); border: 3px solid #ffd23f; color: #7a5b00;
  animation: awardPop .5s ease both;
}
.award:nth-child(2) { animation-delay: .15s; }
.award:nth-child(3) { animation-delay: .3s; }
@keyframes awardPop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes goalPulse { 0%,100% { box-shadow: inset 0 0 0 3px #4aa8ff, 0 0 0 rgba(74,168,255,0); } 50% { box-shadow: inset 0 0 0 3px #4aa8ff, 0 0 18px rgba(74,168,255,.75); } }
.cell.error {
  background: #ffb3a7 !important; animation: cellError .45s ease 2;
}
@keyframes cellError { 0%,100% { transform: scale(1); } 50% { transform: scale(.86); } }

.hint-box {
  max-width: 560px; margin: 14px auto 0; background: #fff7d6; border: 2px dashed #e6c34a;
  border-radius: 18px; padding: 12px 16px; font-size: 17px; font-weight: 600; text-align: center;
  animation: screenIn .3s ease;
}

/* ---------- лягушонок ---------- */
.frog-pos {
  position: absolute; left: 8px; top: 8px; z-index: 6;
  width: calc((100% - 16px - 4px * var(--cols)) / var(--cols));
  height: calc((100% - 16px - 4px * var(--cols)) / var(--cols));
  display: flex; align-items: center; justify-content: center;
  transform: translate(calc(var(--fx) * (100% + 4px)), calc(var(--fy) * (100% + 4px))) rotate(var(--fr, 0deg));
  transition: transform .45s cubic-bezier(.34, 1.5, .64, 1);
  pointer-events: none;
}
.frog-sprite {
  position: relative; width: 84%; height: 84%;
  background: radial-gradient(circle at 34% 28%, #9bf07c, #4cc93f 62%, #2f9e2a);
  border-radius: 50% 50% 46% 46%;
  box-shadow: 0 4px 0 rgba(28, 110, 30, .55);
}
.frog-sprite.idle { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.frog-sprite .eye {
  position: absolute; top: -18%; width: 34%; height: 34%; background: #fff;
  border: 2px solid #2f9e2a; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.eye-l { left: 5%; } .eye-r { right: 5%; }
.frog-sprite .eye i { width: 46%; height: 46%; background: #1d3322; border-radius: 50%; }
.frog-sprite .mouth {
  position: absolute; left: 26%; top: 44%; width: 48%; height: 26%;
  border-bottom: 3px solid #25722a; border-radius: 0 0 60px 60px;
}
.frog-sprite .belly {
  position: absolute; left: 24%; bottom: 8%; width: 52%; height: 34%;
  background: rgba(255, 255, 255, .45); border-radius: 50%;
}
.frog-sprite .cheek { position: absolute; top: 42%; width: 16%; height: 12%; background: rgba(255, 120, 140, .55); border-radius: 50%; }
.cheek-l { left: 10%; } .cheek-r { right: 10%; }

.frog-sprite.hop { animation: hop .45s ease; }
@keyframes hop { 0% { transform: scale(1); } 40% { transform: translateY(-26%) scale(1.1); } 100% { transform: scale(1); } }
.frog-sprite.turn { animation: turnHop .4s ease; }
@keyframes turnHop { 0% { transform: scale(1); } 50% { transform: scale(.86) translateY(-10%); } 100% { transform: scale(1); } }
.frog-sprite.celebrate { animation: celebrate .5s ease 3; }
@keyframes celebrate { 0%,100% { transform: translateY(0) scale(1); } 45% { transform: translateY(-45%) scale(1.12) rotate(8deg); } }
.frog-sprite.sad { animation: sadShake .5s ease 2; filter: saturate(.6); }
@keyframes sadShake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8%) rotate(-6deg); } 75% { transform: translateX(8%) rotate(6deg); } }
.frog-sprite.sad .mouth { border-bottom: none; border-top: 3px solid #25722a; border-radius: 60px 60px 0 0; top: 56%; }

/* ---------- панель команд ---------- */
.panel { flex: 1 1 45%; min-width: 300px; display: flex; flex-direction: column; gap: 14px; }
.panel-block { background: var(--panel); border-radius: 24px; padding: 14px; box-shadow: 0 6px 0 #d7e6d4; }
.panel.locked { opacity: .78; pointer-events: none; }
.block-title { font-weight: 800; font-size: 18px; margin-bottom: 10px; color: var(--green-dark); }

.cmd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.cmd-btn {
  border: none; cursor: pointer; font-family: inherit; background: #f2fbef;
  border: 2px solid var(--green); border-radius: 18px; padding: 10px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-weight: 700; font-size: 15px; color: var(--ink); transition: transform .12s, background .12s;
}
.cmd-btn .cmd-ico { font-size: 30px; }
.cmd-btn:hover { background: var(--green-soft); transform: translateY(-2px); }
.cmd-btn:active { transform: scale(.94); }
.cmd-btn:disabled { opacity: .5; cursor: not-allowed; }
.cmd-btn.wiggle { animation: wiggle .4s ease; }
@keyframes wiggle { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.max-note { margin-top: 8px; font-size: 14px; color: #7a8f80; text-align: center; }
.max-note.over { color: #d0603f; font-weight: 700; }

/* ---------- программа ---------- */
.program-list {
  display: flex; flex-wrap: wrap; gap: 8px; min-height: 84px; align-items: flex-start;
  background: #f6fbf4; border-radius: 18px; padding: 10px;
}
.program-empty { color: #8aa393; font-size: 15px; text-align: center; width: 100%; align-self: center; }

.card {
  position: relative; background: var(--green); color: #fff; border-radius: 16px;
  padding: 8px 26px 8px 10px; min-width: 64px; text-align: center; font-weight: 800;
  box-shadow: 0 4px 0 var(--green-dark); animation: cardIn .22s ease;
}
@keyframes cardIn { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.card .card-ico { font-size: 26px; display: block; }
.card .card-label { font-size: 12px; }
.card-del {
  position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%;
  border: none; background: #ff6b5b; color: #fff; font-weight: 800; cursor: pointer; font-size: 14px;
  line-height: 1; box-shadow: 0 2px 0 #c94b3d;
}
.card.active { background: var(--yellow); color: #5a4300; box-shadow: 0 4px 0 #d9ab00; transform: translateY(-4px); }

.card-repeat {
  background: #7c6cff; box-shadow: 0 4px 0 #5748d1; min-width: 138px; padding-right: 26px;
}
.card-repeat.active { background: var(--yellow); color: #463800; box-shadow: 0 4px 0 #d9ab00; }
.rep-head { display: flex; align-items: center; gap: 4px; justify-content: center; font-size: 13px; flex-wrap: wrap; }
.rep-btn {
  border: none; background: rgba(255,255,255,.85); color: #463800; border-radius: 8px;
  width: 24px; height: 24px; font-weight: 900; cursor: pointer; font-size: 15px; line-height: 1;
}
.rep-count { font-size: 17px; min-width: 16px; }
.rep-inner {
  margin-top: 6px; width: 100%; border: 2px dashed rgba(255,255,255,.8);
  background: rgba(255,255,255,.16); color: #fff; border-radius: 10px; padding: 5px 6px;
  font-weight: 800; font-size: 14px; cursor: pointer;
}
.card-repeat.active .rep-inner, .card-repeat.active .rep-btn { color: #463800; }

.program-actions { display: flex; gap: 10px; margin-top: 12px; }
.program-actions .btn { flex: 1; }

/* ---------- оверлеи ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(30, 70, 40, .55); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 18px;
  animation: screenIn .25s ease;
}
.dialog {
  background: #fff; border-radius: 32px; padding: 26px 24px; max-width: 480px; width: 100%;
  text-align: center; box-shadow: 0 12px 0 rgba(0,0,0,.15); animation: popIn .35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes popIn { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.dialog-title { font-size: clamp(22px, 4vw, 30px); margin: 8px 0; }
.dialog-text { font-size: 18px; color: #4a6b54; margin: 6px 0; }
.dialog-count { font-size: 20px; font-weight: 800; }
.dialog-buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.stars { font-size: 44px; letter-spacing: 6px; animation: popIn .5s cubic-bezier(.34,1.56,.64,1); }
.stars .star.off { opacity: .25; filter: grayscale(1); }
.fail-face, .finale-frog { font-size: 46px; }

/* ---------- тост ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: #23422a; color: #fff; padding: 12px 20px; border-radius: 999px;
  font-weight: 700; z-index: 70; animation: screenIn .25s ease; max-width: 90vw; text-align: center;
}

/* ---------- адаптив ---------- */
@media (max-width: 900px) {
  .game-main { flex-direction: column; }
  .board-area, .panel { width: 100%; flex: none; }
  .board { max-width: min(92vw, 480px); }
  .panel { min-width: 0; }
  .game-top { flex-wrap: wrap; }
}
@media (max-width: 520px) {
  .btn-big { width: 100%; }
  .home-buttons { flex-direction: column; }
  .program-actions { flex-direction: column; }
}
