:root{
  --panel: rgba(15,16,20,.72);
  --panel2: rgba(255,255,255,.12);
  --board: rgba(20,22,28,.78);
  --board2: rgba(10,12,16,.58);
  --shadow: 0 18px 44px rgba(0,0,0,.55);
  --shadow2: 0 10px 18px rgba(0,0,0,.45);
  --radius: 22px;
  --text:#f5f5f5;
  --muted:#d8d8d8;
  --btn1:#0f1116;
  --btn2:#2b2e3a;
  --gold1:#ffcc4d;
  --gold2:#ff7a00;
}

*{ box-sizing:border-box; }

html, body{
  height:100%;
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  overflow:hidden;
  touch-action:none;
  background:#050506;
}

img{ user-select:none; -webkit-user-drag:none; }
button{ font-family:inherit; }

.app-bg{
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.24), rgba(0,0,0,.52)),
    url("./Imagens/fundoMenu.png") center / cover no-repeat,
    #08090b;
  transition: opacity .18s ease, filter .18s ease;
}

.screen{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  z-index: 1;
}
.hidden{ display:none !important; }

.top-controls{
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  right: calc(10px + env(safe-area-inset-right));
  display:flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.icon-btn{
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(10,10,12,.68);
  box-shadow: 0 10px 16px rgba(0,0,0,.28);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  color: #fff;
  backdrop-filter: blur(8px);
}
.icon-btn:active{ transform: translateY(1px); filter: brightness(.95); }
.icon-btn svg{ width: 20px; height: 20px; }
.icon-btn:focus{ outline: none; }

.splash .splash-inner{
  width:min(520px, 92vw);
  padding:28px;
  border-radius: var(--radius);
  background: rgba(10,10,12,.50);
  box-shadow: var(--shadow);
  display:flex;
  align-items:center;
  justify-content:center;
  backdrop-filter: blur(8px);
}

.logo{
  width:min(420px, 82vw);
  height:auto;
  filter: drop-shadow(0 16px 18px rgba(0,0,0,.38));
}
.logo-small{ width:min(360px, 78vw); }
.logo-tiny{ width: 160px; max-width: 54vw; height:auto; }

.menu{
  flex-direction:column;
  gap:16px;
}
.menu .top{
  display:flex;
  align-items:center;
  justify-content:center;
}
.menu-card{
  width:min(520px, 92vw);
  padding:18px;
  border-radius: var(--radius);
  background: rgba(10,10,12,.46);
  box-shadow: var(--shadow);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:12px;
  backdrop-filter: blur(8px);
}

.img-btn{
  width:min(360px, 88vw);
  border:0;
  padding:0;
  margin:0;
  background:transparent;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 14px 18px rgba(0,0,0,.36));
  transition: transform .08s ease, filter .12s ease;
}
.img-btn img{ width:100%; height:auto; display:block; }
.img-btn:active{ transform: translateY(2px) scale(.99); filter: brightness(.94) drop-shadow(0 8px 12px rgba(0,0,0,.34)); }
.img-btn:focus{ outline:none; }

.stars-pill{
  min-width: 126px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:12px 16px;
  border-radius:16px;
  background: rgba(10,10,12,.68);
  box-shadow: var(--shadow2);
  border:1px solid rgba(255,255,255,.14);
}
.star-ico{
  width: 26px;
  height: 26px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  filter: drop-shadow(0 8px 10px rgba(0,0,0,.18));
}
.star-ico svg{ width: 26px; height: 26px; }
.stars-count{ font-weight:950; font-size:22px; letter-spacing:.2px; }

.footer-note{
  opacity:.86;
  font-size:13px;
  color: var(--muted);
  text-shadow:0 2px 5px rgba(0,0,0,.55);
}

.btn{
  width:100%;
  border:0;
  border-radius: 18px;
  padding:14px 16px;
  font-weight:900;
  font-size:16px;
  letter-spacing:.3px;
  color:#fff;
  background: linear-gradient(180deg, var(--btn2), var(--btn1));
  box-shadow: 0 14px 22px rgba(0,0,0,.24);
  transform: translateY(0);
  transition: transform .08s ease, filter .12s ease;
  cursor:pointer;
}
.btn:active{ transform: translateY(2px); filter: brightness(.95); }
.btn-primary{ background: linear-gradient(180deg, var(--gold1), var(--gold2)); color:#111; }

.game{
  align-items:stretch;
  justify-content:flex-start;
  flex-direction:column;
  gap:12px;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}
.game-header{
  width:min(680px, 96vw);
  margin:0 auto;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
}
.scorebar{
  width: min(520px, 92vw);
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}
.scorebox{
  width:100%;
  padding:10px 12px;
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow2);
  text-align:center;
  border:1px solid rgba(255,255,255,.10);
}
.scorebox-label{ font-size:12px; font-weight:800; opacity:.9; color: var(--muted); }
.scorebox-value{ font-size:22px; font-weight:950; color: var(--text); }
@media (max-width: 340px){ .scorebar{ grid-template-columns: 1fr; } }

.game-area{
  width:min(680px, 96vw);
  margin:0 auto;
  display:flex;
  flex-direction:column;
  gap:12px;
  align-items:center;
  justify-content:flex-start;
  flex:1;
}
.board-wrap{ width:100%; display:flex; justify-content:center; }
.board{
  width:min(520px, 92vw);
  aspect-ratio: 1 / 1;
  background: linear-gradient(180deg, var(--board), var(--board2));
  border-radius: 26px;
  padding:14px;
  box-shadow: var(--shadow);
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap:12px;
  border:1px solid rgba(255,255,255,.10);
}
.cell{
  border-radius: 18px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:950;
  font-size: clamp(20px, 6vw, 40px);
  line-height: 1;
  text-align:center;
  user-select:none;
  color:var(--text);
  position:relative;
  overflow:hidden;
}
.cell::after{
  content:"";
  position:absolute;
  inset:0;
  background: radial-gradient(600px 240px at 30% 20%, rgba(255,255,255,.32), transparent 55%);
  pointer-events:none;
  mix-blend-mode: screen;
}
.cell.empty{
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(0,0,0,.30));
  box-shadow: inset 0 8px 14px rgba(255,255,255,.06), inset 0 -10px 16px rgba(0,0,0,.40), 0 10px 16px rgba(0,0,0,.35);
  color: transparent;
}
.pop{ animation: pop .12s ease-out; }
@keyframes pop{ from{ transform: scale(.92); } to{ transform: scale(1); } }
.game-actions{ width:min(520px, 92vw); display:flex; gap:10px; }
.game-actions .btn{ font-size:16px; padding:14px 14px; }

.overlay{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.48);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  z-index: 10;
}
.overlay-card{
  width:min(520px, 92vw);
  border-radius: var(--radius);
  background: rgba(16,17,22,.86);
  box-shadow: var(--shadow);
  padding:18px;
  display:flex;
  flex-direction:column;
  gap:10px;
  border:1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(10px);
}
.overlay-title{ font-size:24px; font-weight:950; color: var(--text); }
.overlay-text{ opacity:.92; color: var(--muted); }
.overlay-actions{ display:flex; flex-direction:column; gap:10px; margin-top:8px; }
.record-big{ font-size:54px; font-weight:1000; text-align:center; padding:14px 0; color:#ffd24d; }

.shop{
  align-items:center;
  justify-content:center;
}
.shop-panel{
  width:min(920px, 96vw);
  max-height:92vh;
  overflow:auto;
  padding:16px;
  border-radius: var(--radius);
  background: rgba(12,13,18,.86);
  box-shadow: var(--shadow);
  border:1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(10px);
}
.shop-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.shop-title{ font-size:28px; font-weight:1000; }
.shop-subtitle{ color:var(--muted); font-size:13px; margin-top:2px; }
.shop-stars{
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  border-radius:16px;
  background:rgba(255,255,255,.10);
  font-weight:1000;
  font-size:20px;
  white-space:nowrap;
}
.shop-section-title{
  margin:14px 0 10px;
  font-size:18px;
  font-weight:950;
}
.shop-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap:10px;
}
.shop-item{
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.08);
  border-radius:18px;
  overflow:hidden;
  box-shadow:0 10px 20px rgba(0,0,0,.20);
}
.shop-thumb{
  width:100%;
  aspect-ratio:16/10;
  background:center / cover no-repeat;
  border-bottom:1px solid rgba(255,255,255,.10);
}
.shop-item-body{ padding:10px; display:flex; flex-direction:column; gap:8px; }
.shop-item-title{ font-weight:900; font-size:14px; }
.shop-item-status{ color:var(--muted); font-size:12px; min-height:16px; }
.shop-mini-actions{ display:grid; grid-template-columns:1fr; gap:7px; }
.shop-mini-actions.two{ grid-template-columns:1fr 1fr; }
.shop-mini-btn{
  border:0;
  border-radius:12px;
  padding:9px 8px;
  font-weight:900;
  cursor:pointer;
  color:#111;
  background:linear-gradient(180deg, var(--gold1), var(--gold2));
}
.shop-mini-btn.secondary{ color:#fff; background:linear-gradient(180deg, #424656, #171a22); }
.shop-mini-btn.selected{ color:#111; background:linear-gradient(180deg, #b7f7a6, #2ee26b); }
.shop-actions{ display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:16px; }
@media (max-width:480px){ .shop-actions{ grid-template-columns:1fr; } .shop-panel{ max-height:90vh; } }
