﻿
:root{
  --bg1:#57c9ff;
  --bg2:#2e97ef;
  --wood1:#8a531d;
  --wood2:#6f3e14;
  --wood3:#b8742f;
  --cream:#fff6df;
  --cream2:#f7ebca;
  --shadow:rgba(40,18,4,.28);
  --dark:#4a2a12;
  --green1:#83e120;
  --green2:#43a800;
  --blue1:#30b8ff;
  --blue2:#1179e6;
  --orange1:#ffc62f;
  --orange2:#ea8a00;
  --purple1:#a356ff;
  --purple2:#6f2fe5;
  --red:#ef4444;
  --good:#20c45a;
  --ui-shadow:0 14px 30px rgba(34,24,14,.20);
}
*{box-sizing:border-box}
html,body{min-height:100%}
html{
  background:linear-gradient(180deg, #70d7ff 0%, #43b2f8 56%, #2d8ddf 100%);
}
body{
  margin:0;
  position:relative;
  font-family: "Trebuchet MS", Inter, Arial, sans-serif;
  color:#fff;
  background:
    radial-gradient(circle at top center, rgba(255,255,255,.42), transparent 32%),
    linear-gradient(180deg, #70d7ff 0%, #43b2f8 56%, #2d8ddf 100%);
  overflow:hidden;
}
body.game-mode{
  height:auto;
  min-height:100vh;
  overflow-y:auto;
  overflow-x:hidden;
}
body.game-mode::before{
  position:fixed;
  inset:0;
  height:auto;
}
body::before{
  content:"";
  position:fixed;
  inset:0;
  background:
    radial-gradient(140% 52% at 50% 118%, rgba(123,229,111,.52), rgba(123,229,111,0) 62%),
    radial-gradient(52% 36% at 8% 100%, rgba(150,255,120,.26), transparent 74%),
    radial-gradient(52% 36% at 92% 100%, rgba(150,255,120,.24), transparent 74%);
  pointer-events:none;
}
.app-shell{
  position:relative;
  width:min(1440px, calc(100% - 20px));
  height:min(920px, calc(100vh - 20px));
  margin:0px auto;
  border-radius:28px;
  overflow:hidden;
}
.app-shell.game-mode{
  height:auto;
  min-height:calc(100vh - 20px);
  overflow:visible;
}
.app-shell.game-mode .game-screen{
  position:relative;
  inset:auto;
  grid-template-rows:auto auto;
  align-content:start;
}
.app-shell.game-mode .board-panel{
  min-height:auto;
}
.app-shell.game-mode .board-grid{
  overflow:visible;
  min-height:auto;
  padding-right:0;
}
.app-shell.game-mode .scroll-tools{
  display:none;
}
.screen{
  position:absolute;
  inset:0;
  display:none;
}
.screen.active{
  display:grid;
}
.menu-screen{
  grid-template-columns:minmax(360px, 440px) minmax(0, 1fr);
  gap:20px;
  padding:22px 24px;
  align-items:start;
  overflow:auto;
  scrollbar-width:none;
  -ms-overflow-style:none;
}
.menu-screen::-webkit-scrollbar{
  width:0;
  height:0;
  display:none;
}
.levels-screen{
  grid-template-columns:1fr;
  padding:22px 24px;
  align-items:start;
  overflow:auto;
  scrollbar-width:none;
  -ms-overflow-style:none;
}
.levels-screen::-webkit-scrollbar{
  width:0;
  height:0;
  display:none;
}
.levels-panel{
  width:min(920px, 100%);
  margin:0 auto;
  background:linear-gradient(180deg, var(--wood3), var(--wood1) 12%, var(--wood2));
  border:5px solid #c68942;
  border-radius:28px;
  padding:18px;
  box-shadow:var(--ui-shadow);
}
.levels-top{
  display:grid;
  grid-template-columns:72px 1fr auto;
  gap:14px;
  align-items:center;
}
.levels-heading h2{
  margin:0;
  font-size:46px;
  color:#ffe18b;
  text-shadow:0 2px 0 rgba(88,36,5,.45);
}
.levels-heading p{
  margin:6px 0 0;
  color:#fff3d7;
  font-size:21px;
  font-weight:900;
}
.levels-progress{
  align-self:stretch;
  min-width:180px;
  display:grid;
  place-items:center;
  border-radius:16px;
  background:rgba(0,0,0,.18);
  border:3px solid rgba(255,231,173,.28);
  color:#ffe5ae;
  font-size:20px;
  font-weight:900;
  padding:8px 14px;
}
.levels-progress b{
  color:#fff;
  margin-left:4px;
}
.levels-grid{
  margin-top:16px;
  display:grid;
  grid-template-columns:repeat(5, minmax(0, 1fr));
  gap:12px;
}
.level-tile{
  border:none;
  min-height:130px;
  border-radius:20px;
  padding:12px 10px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:8px;
  cursor:pointer;
  color:#fff;
  background:linear-gradient(180deg, #ffcd54, #e4961e);
  border:4px solid rgba(123,70,13,.48);
  box-shadow:var(--ui-shadow);
  text-shadow:0 2px 0 rgba(83,43,4,.26);
  transition:transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
.level-tile:hover:not(:disabled){
  transform:translateY(-2px) scale(1.015);
  filter:brightness(1.03);
}
.level-tile__num{
  font-size:42px;
  font-weight:900;
  line-height:1;
}
.level-tile__state{
  font-size:16px;
  font-weight:900;
  line-height:1;
}
.level-tile.done{
  background:linear-gradient(180deg, #93ea3f, #58bd14);
  color:#143207;
  border-color:rgba(45,117,12,.55);
  box-shadow:0 0 0 4px rgba(174,255,77,.2), var(--ui-shadow);
  text-shadow:none;
}
.level-tile.done .level-tile__state::before{
  content:"\2713 ";
}
.level-tile.locked{
  background:linear-gradient(180deg, #8f8f8f, #696969);
  border-color:rgba(35,35,35,.55);
  color:#ececec;
  filter:saturate(.6);
}
.level-tile:disabled{
  cursor:not-allowed;
  transform:none !important;
  filter:saturate(.56) brightness(.9);
}
.sky-glow{
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at 50% 5%, rgba(255,255,255,.5), transparent 18%),
    radial-gradient(circle at 85% 20%, rgba(255,255,255,.24), transparent 12%),
    radial-gradient(circle at 18% 18%, rgba(255,255,255,.24), transparent 12%);
  pointer-events:none;
}
.menu-left,.menu-right,.board-panel,.top-woodbar{
  position:relative;
  z-index:1;
}
.game-logo{
  display:block;
  width:min(100%, 520px);
  height:auto;
  margin:0;
  filter:drop-shadow(0 8px 14px rgba(0,0,0,.28));
}
.wood-sign{
  display:inline-block;
  margin-top:10px;
  padding:10px 14px;
  border-radius:16px;
  background:linear-gradient(180deg, #966233, #71421d);
  color:#fff4d1;
  font-weight:900;
  font-size:clamp(18px, 1.8vw, 25px);
  line-height:1.15;
  text-align:center;
  box-shadow:var(--ui-shadow);
  border:3px solid #bb7b3a;
}
.menu-buttons{
  margin-top:16px;
  display:flex;
  flex-direction:column;
  gap:12px;
}
.big-btn{
  border:none;
  border-radius:20px;
  min-height:82px;
  padding:10px 14px;
  display:flex;
  align-items:center;
  gap:12px;
  cursor:pointer;
  color:white;
  box-shadow:var(--ui-shadow);
  border:4px solid rgba(95,49,13,.55);
  text-shadow:0 2px 0 rgba(88,36,5,.55);
  transition:transform .18s ease, filter .18s ease;
}
.big-btn:hover{ transform:translateY(-2px) scale(1.01); filter:brightness(1.03); }
.big-btn.play{ background:linear-gradient(180deg, var(--green1), var(--green2)); }
.big-btn.blue{ background:linear-gradient(180deg, var(--blue1), var(--blue2)); }
.big-btn.orange{ background:linear-gradient(180deg, var(--orange1), var(--orange2)); }
.big-btn.purple{ background:linear-gradient(180deg, var(--purple1), var(--purple2)); }
.mode-select-card{
  cursor:default;
  align-items:flex-start;
}
.mode-select-card:hover{
  transform:none;
  filter:none;
}
.mode-select-card__text{
  width:100%;
}
.mode-subtitle{
  margin-top:9px;
  display:block;
  font-size:14px;
  font-weight:900;
  opacity:.95;
}
.mode-toggle{
  margin-top:10px;
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:8px;
  width:100%;
}
.mode-toggle--play{
  margin-top:8px;
}
.mode-toggle__btn{
  border:3px solid rgba(255,255,255,.36);
  border-radius:13px;
  padding:10px 9px;
  background:linear-gradient(180deg, rgba(9,42,91,.34), rgba(5,24,60,.42));
  color:#f3f9ff;
  font-size:16px;
  font-weight:900;
  line-height:1.1;
  text-shadow:none;
  cursor:pointer;
  transition:transform .14s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease;
}
.mode-toggle__btn:hover{
  transform:translateY(-1px);
}
.mode-toggle__btn.active{
  border-color:#d7ff76;
  background:linear-gradient(180deg, #8ae63d, #5aba14);
  color:#153007;
  box-shadow:0 0 0 4px rgba(174,255,77,.26), inset 0 1px 0 rgba(255,255,255,.72);
}
.big-btn__icon{
  width:64px;
  height:48px;
  flex:0 0 auto;
  display:grid;
  place-items:center;
  border-radius:14px;
  background:rgba(255,255,255,.18);
  font-size:30px;
  font-weight:900;
  box-shadow: inset 0 2px 4px rgba(255,255,255,.25), inset 0 -3px 6px rgba(0,0,0,.18);
}
.big-btn__text{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
}
.big-btn__text b{
  font-size:30px;
  line-height:1;
}
.big-btn__text small{
  margin-top:3px;
  font-size:17px;
  opacity:.96;
}
.menu-bottom-stats{
  margin-top:14px;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.stat-box{
  background:linear-gradient(180deg, #72421d, #532d11);
  border:4px solid #ba7a39;
  border-radius:16px;
  padding:12px;
  box-shadow:var(--ui-shadow);
}
.stat-box__label{
  display:block;
  color:#ffd990;
  font-size:17px;
  font-weight:900;
}
.stat-box__value{
  display:block;
  margin-top:4px;
  font-size:30px;
  font-weight:900;
}
.menu-right{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  gap:12px;
}
.menu-bottom-stats-right{
  width:min(760px, 100%);
  margin-top:0;
}
.preview-photo{
  width:min(760px, 100%);
}
.preview-photo__img{
  display:block;
  width:100%;
  max-height:560px;
  object-fit:cover;
  border-radius:0;
  border:none;
  box-shadow:none;
}
.board-frame{
  position:relative;
  width:min(760px, 100%);
  padding:16px;
  border-radius:24px;
  display:flex;
  flex-direction:column;
  background:linear-gradient(180deg, var(--wood3), var(--wood1) 16%, var(--wood2));
  border:5px solid #c68942;
  box-shadow:0 18px 36px rgba(74,42,12,.28);
}
.preview-overlay{
  position:static;
  order:2;
  align-self:center;
  margin-top:10px;
  padding:6px 12px;
  border-radius:999px;
  background:rgba(255,255,255,.18);
  font-size:14px;
  font-weight:900;
  letter-spacing:.8px;
  text-align:center;
}
.preview-grid,.board-grid{
  display:grid;
  grid-template-columns: repeat(9, 1fr);
  gap:8px;
}
.preview-grid{
  order:1;
  margin-top:0;
}
.preview-cell,.cell{
  position:relative;
  aspect-ratio:1/1;
  display:grid;
  place-items:center;
  border-radius:16px;
  background:linear-gradient(180deg, var(--cream), var(--cream2));
  border:3px solid #c09359;
  color:#392012;
  font-size:clamp(24px, 2vw, 40px);
  font-weight:900;
  box-shadow:0 4px 0 #b1793b, inset 0 1px 0 rgba(255,255,255,.85);
}
.preview-cell.selected,.cell.selected{
  outline:5px solid #88d843;
  box-shadow:0 0 0 8px rgba(136,216,67,.20), 0 4px 0 #b1793b;
}
.preview-cell.crossed::after,.cell.removed::after{
  content:"";
  position:absolute;
  width:90%;
  height:8px;
  background:#ff3e2f;
  border-radius:999px;
  transform:rotate(-45deg);
  box-shadow:0 2px 0 rgba(140,0,0,.25);
}
.preview-cell.crossed{
  background:linear-gradient(180deg, #f0ece3, #ddd6c9);
  color:#734631;
}
.preview-cell.pair-red{
  outline:5px solid #ff5a4a;
}
.preview-cell.pair-green{
  outline:5px solid #4ecf4c;
}
.preview-actions{
  order:3;
  display:flex;
  gap:12px;
  margin-top:12px;
  justify-content:center;
  flex-wrap:wrap;
}
.mini-btn,.action-btn{
  border:none;
  cursor:pointer;
  color:white;
  font-weight:900;
  text-shadow:0 2px 0 rgba(83,43,4,.28);
  box-shadow:var(--ui-shadow);
}
.mini-btn{
  padding:14px 18px;
  border-radius:18px;
  background:linear-gradient(180deg, #996134, #6b3f1a);
  border:3px solid #bf8440;
  font-size:20px;
  min-width:150px;
}
.mini-btn.accent{ background:linear-gradient(180deg, var(--purple1), var(--purple2)); }
.mini-btn.green{ background:linear-gradient(180deg, var(--green1), var(--green2)); }

.game-screen{
  padding:22px;
  grid-template-rows: auto 1fr;
  gap:18px;
}
.top-woodbar{
  display:grid;
  grid-template-columns:82px repeat(4, 1fr) 82px;
  gap:14px;
  align-items:center;
  background:linear-gradient(180deg, var(--wood1), var(--wood2));
  border:4px solid #bd7c3e;
  border-radius:26px;
  padding:14px;
  box-shadow:var(--ui-shadow);
}
.circle-btn{
  width:64px;
  height:64px;
  border:none;
  border-radius:20px;
  background:linear-gradient(180deg, var(--orange1), var(--orange2));
  color:#fff;
  font-size:30px;
  font-weight:900;
  cursor:pointer;
  box-shadow:var(--ui-shadow);
}
.top-metric{
  text-align:center;
  background:rgba(0,0,0,.12);
  border-radius:18px;
  padding:10px;
}
.top-metric span{
  display:block;
  color:#ffe0aa;
  font-size:20px;
  font-weight:900;
}
.top-metric strong{
  display:block;
  font-size:44px;
  line-height:1.05;
}
.board-panel{
  background:linear-gradient(180deg, var(--wood3), var(--wood1) 12%, var(--wood2));
  border:5px solid #c68942;
  border-radius:28px;
  padding:18px;
  box-shadow:var(--ui-shadow);
  display:flex;
  flex-direction:column;
  min-height:0;
}
.board-title{
  display:flex;
  justify-content:space-between;
  gap:16px;
  margin-bottom:14px;
  background:rgba(0,0,0,.13);
  border-radius:18px;
  padding:14px 18px;
  font-size:24px;
  font-weight:900;
  color:#fff1d6;
}
.board-title__right b{ color:#fff; }
.board-grid{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overscroll-behavior:contain;
  padding-right:6px;
  align-content:start;
  scrollbar-width:thin;
}
.board-grid::-webkit-scrollbar{ width:14px; }
.board-grid::-webkit-scrollbar-track{
  background:rgba(38,19,6,.35);
  border-radius:999px;
}
.board-grid::-webkit-scrollbar-thumb{
  background:linear-gradient(180deg, #f6c15e, #d8892a);
  border-radius:999px;
  border:3px solid rgba(53,24,4,.35);
}
.scroll-tools{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:10px;
}
.scroll-btn{
  border:none;
  border-radius:14px;
  padding:10px 14px;
  background:linear-gradient(180deg, #996134, #6b3f1a);
  border:3px solid #bf8440;
  color:#fff6de;
  font-size:18px;
  font-weight:900;
  cursor:pointer;
  box-shadow:var(--ui-shadow);
  text-shadow:0 2px 0 rgba(55,25,5,.28);
}
.scroll-btn:hover:not(:disabled){ transform:translateY(-1px); }
.scroll-btn:disabled{
  opacity:.45;
  cursor:default;
  filter:grayscale(.25);
}
.cell{
  cursor:pointer;
  transition:transform .14s ease, filter .14s ease;
}
.cell:hover{ transform:translateY(-2px) scale(1.02); filter:brightness(1.02); }
.board-grid.board-animating .cell{
  pointer-events:none;
}
.board-grid.board-animating .cell:hover{
  transform:none;
  filter:none;
}
.cell.row-removing{
  animation:rowRemove .26s ease forwards;
}
.cell.pair-disappearing{
  animation:pairDisappear .22s cubic-bezier(.2,.75,.35,1) forwards;
  animation-delay:var(--pair-disappear-delay, 0ms);
}
.cell.row-adding{
  animation:rowAdd .42s cubic-bezier(.2,.75,.3,1.15) both;
  animation-delay:var(--row-add-delay, 0ms);
}
.cell.row-adding.row-adding-bottom{
  animation:rowSpawnFromBottom .56s cubic-bezier(.16,.8,.26,1.12) both;
  animation-delay:var(--row-add-delay, 0ms);
}
.cell.row-shifting-up{
  transform:translateY(calc(-1 * var(--row-shift-up, 0px)));
  transition:transform .26s ease, opacity .26s ease;
}
.cell.empty{
  background:rgba(255,255,255,.10);
  border:2px dashed rgba(255,240,210,.14);
  box-shadow:none;
  color:transparent;
}
.cell.empty::after{ display:none !important; }
.cell.hint{
  animation:pulse .9s infinite;
}
.cell.invalid{
  animation:shake .22s linear 2;
}
.bottom-actions{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:16px;
  margin-top:18px;
}
.action-btn{
  min-height:78px;
  padding:14px 18px;
  border-radius:24px;
  font-size:32px;
  border:4px solid rgba(110,62,16,.5);
}
.action-btn.orange{ background:linear-gradient(180deg, var(--orange1), var(--orange2)); }
.action-btn.purple{ background:linear-gradient(180deg, var(--purple1), var(--purple2)); }
.action-btn.green{ background:linear-gradient(180deg, var(--green1), var(--green2)); }
.action-btn.wide{ width:100%; }
.bottom-help{
  margin-top:16px;
  text-align:center;
  font-size:26px;
  font-weight:900;
  color:#ffe6b4;
  background:rgba(0,0,0,.12);
  border-radius:18px;
  padding:14px;
}
.modal{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  background:rgba(8,16,31,.55);
  z-index:20;
}
.modal.hidden{ display:none; }
.modal-card{
  width:min(560px, calc(100% - 24px));
  background:linear-gradient(180deg, var(--wood3), var(--wood1), var(--wood2));
  border:5px solid #cb8a45;
  border-radius:28px;
  padding:24px;
  text-align:center;
  box-shadow:0 24px 48px rgba(0,0,0,.28);
}
.modal-card h2{
  margin:0 0 12px;
  font-size:46px;
  color:#ffe08f;
}
.modal-card p{
  margin:0 0 20px;
  font-size:28px;
  line-height:1.35;
  color:#fff6da;
}
.quick-play-modal-card{
  width:min(640px, calc(100% - 24px));
}
.quick-play-actions{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
  margin:0 0 16px;
}
.quick-play-actions .action-btn{
  min-height:70px;
  font-size:24px;
  border-radius:18px;
}
@keyframes pulse{
  0%{ box-shadow:0 0 0 0 rgba(255,212,0,.55), 0 4px 0 #b1793b; }
  70%{ box-shadow:0 0 0 16px rgba(255,212,0,0), 0 4px 0 #b1793b; }
  100%{ box-shadow:0 0 0 0 rgba(255,212,0,0), 0 4px 0 #b1793b; }
}
@keyframes shake{
  0%,100%{ transform:translateX(0);}
  25%{ transform:translateX(-4px);}
  75%{ transform:translateX(4px);}
}
@keyframes rowRemove{
  0%{ opacity:1; transform:scale(1); }
  100%{ opacity:0; transform:scale(.6); }
}
@keyframes pairDisappear{
  0%{ opacity:1; transform:scale(1); filter:brightness(1); }
  60%{ transform:scale(1.08); filter:brightness(1.12); }
  100%{ opacity:0; transform:scale(.45); filter:brightness(1.2); }
}
@keyframes rowAdd{
  0%{ opacity:0; transform:translateY(24px) scale(.86); }
  70%{ opacity:1; transform:translateY(-2px) scale(1.04); }
  100%{ opacity:1; transform:translateY(0) scale(1); }
}
@keyframes rowSpawnFromBottom{
  0%{
    opacity:0;
    transform:translateY(78px) scale(.82);
    filter:brightness(1.16);
  }
  64%{
    opacity:1;
    transform:translateY(-4px) scale(1.03);
    filter:brightness(1.04);
  }
  100%{
    opacity:1;
    transform:translateY(0) scale(1);
    filter:brightness(1);
  }
}
@media (max-width: 1180px){
  .menu-screen{
    grid-template-columns: 1fr;
    overflow:auto;
    padding:22px;
    gap:18px;
  }
  .levels-screen{
    padding:22px;
  }
  .levels-grid{
    grid-template-columns:repeat(4, minmax(0, 1fr));
  }
  .menu-right{
    justify-content:flex-start;
    align-items:flex-start;
  }
  .menu-bottom-stats-right{
    width:100%;
  }
  .game-screen{
    padding:16px;
    gap:12px;
  }
}
@media (max-width: 900px){
  body{ overflow:auto; }
  .app-shell{
    height:auto;
    min-height:100vh;
    width:100%;
    margin:0;
    border-radius:0;
  }
  .menu-screen{
    padding:14px;
    gap:14px;
  }
  .levels-screen{
    padding:14px;
    gap:14px;
  }
  .levels-panel{
    padding:12px;
    border-radius:20px;
  }
  .levels-top{
    grid-template-columns:52px 1fr;
    grid-template-areas:
      "back heading"
      "progress progress";
    gap:8px;
  }
  #levelsBackBtn{
    grid-area:back;
  }
  .levels-heading{
    grid-area:heading;
  }
  .levels-progress{
    grid-area:progress;
    min-width:0;
    width:100%;
    font-size:16px;
  }
  .levels-heading h2{
    font-size:32px;
  }
  .levels-heading p{
    font-size:15px;
    margin-top:4px;
  }
  .levels-grid{
    margin-top:12px;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:10px;
  }
  .level-tile{
    min-height:100px;
    border-radius:16px;
    padding:10px 8px;
  }
  .level-tile__num{
    font-size:34px;
  }
  .level-tile__state{
    font-size:13px;
  }
  .menu-buttons{
    margin-top:16px;
    gap:12px;
  }
  .big-btn{
    min-height:78px;
    padding:10px 14px;
    border-radius:18px;
    gap:12px;
  }
  .big-btn__icon{
    width:56px;
    height:46px;
    border-radius:12px;
    font-size:28px;
  }
  .menu-bottom-stats{
    margin-top:14px;
    gap:10px;
  }
  .stat-box{
    border-radius:16px;
    padding:12px;
  }
  .stat-box__label{
    font-size:16px;
  }
  .stat-box__value{
    margin-top:4px;
    font-size:28px;
  }
  .board-frame{
    padding:14px;
    border-radius:20px;
  }
  .preview-photo__img{
    max-height:480px;
    border-radius:14px;
  }
  .preview-actions{
    margin-top:12px;
    gap:8px;
  }
  .mini-btn{
    padding:10px 12px;
    border-radius:12px;
    font-size:16px;
  }
  .game-screen{
    padding:10px;
    gap:10px;
  }
  .top-woodbar{
    grid-template-columns:54px 1fr 1fr;
    grid-template-areas:
      "back level pause"
      "score moves hints";
    gap:8px;
    padding:8px;
    border-radius:16px;
  }
  .circle-btn{
    width:48px;
    height:48px;
    border-radius:14px;
    font-size:24px;
  }
  .top-metric{
    border-radius:12px;
    padding:6px 4px;
  }
  .top-metric span{
    font-size:14px;
  }
  .top-metric strong{
    font-size:30px;
  }
  .top-woodbar .circle-btn:first-child{ grid-area:back; }
  .top-woodbar .circle-btn:last-child{ grid-area:pause; justify-self:end; }
  .top-metric:nth-of-type(1){ grid-area:level; }
  .top-metric:nth-of-type(2){ grid-area:score; }
  .top-metric:nth-of-type(3){ grid-area:moves; }
  .top-metric:nth-of-type(4){ grid-area:hints; }
  .board-panel{
    padding:10px;
    border-radius:18px;
  }
  .board-title{
    margin-bottom:10px;
    border-radius:12px;
    padding:10px;
    font-size:17px;
  }
  .board-grid{
    gap:6px;
  }
  .preview-cell,.cell{
    border-radius:11px;
    border-width:2px;
    font-size:clamp(16px, 5.2vw, 24px);
  }
  .big-btn__text b{ font-size:23px; }
  .big-btn__text small{ font-size:14px; }
  .mode-subtitle{
    font-size:12px;
  }
  .mode-toggle{
    gap:7px;
  }
  .mode-toggle__btn{
    padding:8px 6px;
    font-size:14px;
    border-radius:11px;
  }
  .wood-sign{
    margin-top:10px;
    padding:10px 12px;
    border-radius:14px;
    font-size:17px;
  }
  .game-logo{
    width:min(100%, 440px);
  }
  .bottom-actions{ grid-template-columns:1fr; }
  .action-btn{
    min-height:58px;
    border-radius:16px;
    font-size:24px;
    padding:10px 12px;
  }
  .board-title{ flex-direction:column; }
  .bottom-help{
    margin-top:10px;
    border-radius:12px;
    padding:10px;
    font-size:16px;
  }
  .modal-card{
    border-radius:18px;
    padding:16px;
  }
  .quick-play-actions{
    grid-template-columns:1fr;
    gap:10px;
  }
  .quick-play-actions .action-btn{
    min-height:58px;
    font-size:20px;
  }
  .modal-card h2{
    font-size:32px;
  }
  .modal-card p{
    font-size:20px;
  }
  .scroll-tools{
    justify-content:stretch;
  }
  .scroll-btn{
    flex:1;
    text-align:center;
  }
}
@media (max-width: 720px){
  .menu-bottom-stats{
    grid-template-columns:1fr;
  }
  .preview-overlay{
    margin-top:8px;
    padding:6px 10px;
    font-size:12px;
  }
  .board-title__right{
    font-size:16px;
  }
}
@media (max-width: 480px){
  .menu-screen{
    padding:10px;
  }
  .levels-screen{
    padding:10px;
  }
  .levels-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:8px;
  }
  .level-tile{
    min-height:86px;
    border-radius:14px;
  }
  .level-tile__num{
    font-size:28px;
  }
  .big-btn{
    min-height:72px;
    padding:8px 10px;
    gap:10px;
  }
  .big-btn__icon{
    width:48px;
    height:42px;
    font-size:24px;
  }
  .big-btn__text b{
    font-size:20px;
  }
  .big-btn__text small{
    font-size:12px;
  }
  .mode-subtitle{
    font-size:11px;
  }
  .mode-toggle{
    grid-template-columns:1fr;
  }
  .preview-photo{
    width:100%;
  }
  .preview-photo__img{
    max-height:360px;
    border-radius:12px;
  }
  .top-woodbar{
    grid-template-columns:46px 1fr 1fr;
    gap:6px;
    padding:6px;
  }
  .circle-btn{
    width:42px;
    height:42px;
    font-size:20px;
  }
  .top-metric span{
    font-size:12px;
  }
  .top-metric strong{
    font-size:24px;
  }
  .board-panel{
    padding:8px;
  }
  .board-grid{
    gap:5px;
  }
  .preview-cell,.cell{
    border-radius:9px;
    font-size:clamp(14px, 5vw, 20px);
  }
  .action-btn{
    min-height:52px;
    font-size:20px;
  }
  .bottom-help{
    font-size:14px;
  }
  .modal-card h2{
    font-size:28px;
  }
  .modal-card p{
    font-size:18px;
  }
}
