/* Target Number extras on top of ../assets/site.css */
.tn-board { position: relative; max-width: 480px; margin: 0 auto; }

/* the big target */
.target-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 12px 18px; margin-bottom: 18px;
  border-radius: 24px;
  background: var(--brand-grad); color: #fff;
  box-shadow: 0 14px 34px color-mix(in srgb, var(--brand) 45%, transparent), inset 0 1px 0 rgba(255,255,255,.35);
  transition: background .4s, box-shadow .4s;
}
.target-card::before {
  content: ""; position: absolute; inset: -40% -10% auto; height: 120%;
  background: radial-gradient(closest-side, rgba(255,255,255,.28), transparent 70%);
  pointer-events: none;
}
.target-lbl { position: relative; font-weight: 900; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; opacity: .9; }
.target-num {
  position: relative;
  font-size: clamp(56px, 16vw, 82px); font-weight: 900; line-height: 1; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 0 rgba(0,0,0,.15);
}
.target-card.hit { background: linear-gradient(135deg, #2fd27a, #13a866); box-shadow: 0 14px 34px rgba(34,209,139,.45); }
.target-card.hit .target-num { animation: target-pop .6s cubic-bezier(.2,1.6,.4,1); }
@keyframes target-pop { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* the six number tiles */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tile {
  position: relative;
  height: 74px; border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card); color: var(--ink);
  font: inherit; font-size: 32px; font-weight: 900; font-variant-numeric: tabular-nums;
  box-shadow: 0 5px 0 var(--line), var(--shadow-sm);
  cursor: pointer; touch-action: manipulation;
  transition: transform .12s, box-shadow .12s, background .15s, color .15s;
}
.tile:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--brand); }
.tile:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--line); }
.tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.tile.big::after {                         /* little gold dot on the big numbers */
  content: ""; position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}
.tile.made { border-color: color-mix(in srgb, var(--good) 70%, var(--line)); box-shadow: 0 5px 0 color-mix(in srgb, var(--good) 45%, var(--line)), var(--shadow-sm); }
.tile.sel {
  background: var(--brand-grad); color: #fff; border-color: transparent;
  transform: translateY(-4px);
  box-shadow: 0 8px 0 var(--brand-2), 0 12px 24px color-mix(in srgb, var(--brand) 45%, transparent);
}
.tile.hint { animation: hint-glow 1s ease-in-out 3; }
@keyframes hint-glow { 50% { box-shadow: 0 5px 0 var(--accent), 0 0 0 5px color-mix(in srgb, var(--accent) 55%, transparent); } }
.tile.gone {
  background: transparent; border: 2px dashed var(--line); box-shadow: none; color: transparent; cursor: default;
}
.tile.pop { animation: tile-pop .35s cubic-bezier(.2,1.6,.4,1); }
@keyframes tile-pop { 0% { transform: scale(.6); } 100% { transform: scale(1); } }
.tile.shake { animation: shake .3s ease; }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.tile.win { background: linear-gradient(135deg, #2fd27a, #13a866); color: #fff; border-color: transparent; box-shadow: 0 5px 0 #0e8a53; }

/* operations */
.ops { display: grid; grid-template-columns: repeat(4, minmax(0, 72px)); justify-content: center; gap: 16px; margin: 20px auto 0; }
.op {
  aspect-ratio: 1 / 1; border: 0; border-radius: 50%;
  font: inherit; font-size: 34px; font-weight: 900; color: #fff; line-height: 1;
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,.55) 0 12%, rgba(255,255,255,0) 42%),
    var(--c);
  box-shadow: 0 5px 0 var(--d), 0 10px 18px color-mix(in srgb, var(--c) 40%, transparent);
  text-shadow: 0 2px 0 rgba(0,0,0,.18);
  cursor: pointer; touch-action: manipulation;
  transition: transform .1s, box-shadow .1s, opacity .2s;
}
.op-add { --c: #2fd27a; --d: #1d9a57; }
.op-sub { --c: #3a8bff; --d: #2459c4; }
.op-mul { --c: #ff5d73; --d: #c8324f; }
.op-div { --c: #a160f2; --d: #7339c4; }
.op:hover:not(:disabled) { transform: translateY(-2px); }
.op:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--d); }
.op:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.op.on { transform: translateY(4px); box-shadow: 0 1px 0 var(--d), 0 0 0 4px var(--card), 0 0 0 7px var(--c); }
.op:disabled { opacity: .4; cursor: default; }
.op.hint { animation: hint-ring 1s ease-in-out 3; }
@keyframes hint-ring { 50% { box-shadow: 0 5px 0 var(--d), 0 0 0 4px var(--card), 0 0 0 8px var(--accent); } }

/* step list */
.log { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 34px; }
.log li {
  padding: 6px 12px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums;
  animation: tile-pop .3s ease;
}
.log li b { color: var(--brand); }
.log li.win { background: var(--good); color: #fff; border-color: transparent; }
.log li.win b { color: #fff; }
.log .empty { background: none; border: 0; box-shadow: none; color: var(--muted); font-weight: 600; animation: none; }

#closest.hit { color: var(--good); }

@media (max-width: 380px) {
  .tile { height: 64px; font-size: 28px; }
  .ops { gap: 10px; }
  .op { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .tile.pop, .tile.shake, .tile.hint, .op.hint, .target-card.hit .target-num, .log li { animation: none; }
}
