:root{
  --bg: #753898;
  --text: #ffffff;
  --muted: rgba(255,255,255,0.75);
  --panel: rgba(0,0,0,0.18);
  --panel2: rgba(255,255,255,0.10);
  --border: rgba(255,255,255,0.22);
  --shadow: 0 10px 25px rgba(0,0,0,0.25);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
}

#app{
  max-width: 920px;
  margin: 0 auto;
  padding: 16px 14px 22px;
}

.topbar{
  display:flex;
  gap: 12px;
  justify-content: space-between;
  align-items: stretch;
}

.stat{
  flex:1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.label{
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: lowercase;
}

.value{
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
}

.value .sec{
  font-size: 14px;
  opacity: .75;
  margin-left: 6px;
}

.targets{
  margin-top: 12px;
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.target{
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--panel2);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.chip{
  display:flex;
  align-items:center;
  justify-content:center;
  height: 54px;
  overflow: hidden;
}

/* Target shape SVG size */
.targets .chip svg{
  width: 44px;
  height: 44px;
}

.color-dot{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 3px solid rgba(255,255,255,0.85);
  background: #fff;
  box-shadow: 0 8px 18px rgba(0,0,0,0.25);
}

.num-big{
  font-size: 30px;
  font-weight: 900;
  text-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

.grid{
  margin-top: 14px;
  display:grid;
  grid-template-columns: repeat(3, 1fr); /* 3x4 on small */
  gap: 10px;
}

@media (min-width: 760px){
  .grid{ grid-template-columns: repeat(6, 1fr); } /* 12 cards -> 6x2 on desktop */
}

.card{
  position:relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.09);
  box-shadow: var(--shadow);
  padding: 0;
  cursor:pointer;
  touch-action: manipulation;
}

.card:active{ transform: scale(0.98); }

.card-inner{
  position:absolute;
  inset: 0;
  display:flex;
  align-items:center;
  justify-content:center;
}

.card svg{
  width: 62%;
  height: 62%;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.25));
}

.card .num{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 34px;
  font-weight: 900;
  color: rgba(255,255,255,0.95);
  text-shadow: 0 8px 20px rgba(0,0,0,0.5);
}

.footer{
  margin-top: 14px;
  text-align:center;
  color: rgba(255,255,255,0.75);
  font-size: 12px;
}

.overlay{
  position: fixed;
  inset: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 20px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  z-index: 999;
}

.hidden{ display:none; }

.panel{
  width: min(420px, 100%);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.12);
  box-shadow: var(--shadow);
  padding: 18px 16px 14px;
  text-align:center;
}

.gameover{
  font-size: 34px;
  font-weight: 900;
  margin: 6px 0 14px;
}

.btn{
  appearance:none;
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 800;
  color: #1a0f22;
  background: rgba(255,255,255,0.92);
  width: 100%;
  cursor:pointer;
}

.btn:active{ transform: scale(0.99); }

.hint{
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255,255,255,0.78);
}
