/* Dinger — scoped under .game-dinger. A bone-white handheld with a green field window. */

.game-dinger { --title: #1f4d37; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .game-dinger { --title: #6FC09A; }
}
:root[data-theme="dark"] .game-dinger { --title: #6FC09A; }

.game-dinger main { padding-block: 8px 48px; }
.game-dinger { --field-line: rgba(255,255,255,.18); --bone-dark: #CFC6B2; --led-off: #3a2222; }

.game-title { font-family: var(--font-display); font-size: clamp(30px, 6vw, 44px); color: var(--title); }
.game-lede { color: var(--ink-2); margin-top: 6px; }

.status { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: 10px 0 4px; font-weight: 600; }
.status .muted { color: var(--ink-2); font-weight: 500; }
.status b { font-family: var(--font-display); font-size: 22px; font-weight: 400; color: var(--title); }

/* The casing */
.handheld {
  width: min(100%, 420px);
  margin: 8px auto 0;
  padding: clamp(14px, 4vw, 22px);
  border-radius: var(--radius-toy);
  background: linear-gradient(160deg, #F7F3EA 0%, var(--bone) 45%, #E3DCCB 100%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.9), inset 0 -3px 0 var(--bone-dark), 0 24px 30px -18px rgba(29,35,51,.6), 0 2px 4px rgba(29,35,51,.25);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

/* Seven-segment style readout */
.readout {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr 1fr;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #101214;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.8);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-weight: 700;
  font-size: 15px;
  color: var(--signal);
  text-shadow: 0 0 6px rgba(255,58,45,.8);
  text-align: center;
  letter-spacing: .04em;
}
.seg-score { font-size: 20px; }

/* Field window */
.field {
  position: relative;
  aspect-ratio: 1 / 1.05;
  margin-top: 12px;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 30%, #1f4d37 0%, var(--field) 70%);
  box-shadow: inset 0 3px 10px rgba(0,0,0,.7), inset 0 0 0 2px rgba(0,0,0,.3);
  overflow: hidden;
}
.diamond {
  position: absolute;
  left: 50%; top: 46%;
  width: 46%; aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 2px solid var(--field-line);
  border-radius: 4px;
}
.base {
  position: absolute;
  width: 7%; aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--led-off);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.6);
  transition: background .12s ease, box-shadow .12s ease;
}
.base.on { background: var(--signal); box-shadow: 0 0 10px 3px rgba(255,58,45,.6), 0 0 22px 6px rgba(255,58,45,.25); }
.base-1 { left: 82.5%; top: 46%; }
.base-2 { left: 50%; top: 13.5%; }
.base-3 { left: 17.5%; top: 46%; }

/* Pitch lane: 7 rows x 3 columns of LEDs from the mound to the plate */
.lane {
  position: absolute;
  left: 50%; top: 36%;
  width: 22%; height: 56%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(7, 1fr);
  place-items: center;
}
.lane i {
  display: block;
  width: 60%; aspect-ratio: 1;
  border-radius: 50%;
  background: var(--led-off);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.6);
}
.lane i.on { background: var(--signal); box-shadow: 0 0 8px 2px rgba(255,58,45,.7), 0 0 16px 4px rgba(255,58,45,.3); }
.lane i.plate { outline: 2px solid var(--field-line); outline-offset: 2px; }

.call {
  position: absolute;
  left: 0; right: 0; bottom: 6px;
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(18px, 4.5vw, 24px);
  color: #FFE6C2;
  text-shadow: 0 2px 0 rgba(0,0,0,.5);
  max-width: none;
  min-height: 1.2em;
}

/* Two moulded buttons */
.buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.key {
  min-height: 64px;
  border: 0;
  border-radius: 18px;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: .02em;
  cursor: pointer;
  color: #fff;
  transform: translateY(0);
  transition: transform .06s ease, box-shadow .06s ease, filter .12s ease;
}
.key-pitch { background: linear-gradient(180deg, #3d6fe8, var(--brand)); box-shadow: 0 5px 0 var(--brand-ink), 0 8px 14px -6px rgba(40,81,227,.7); }
.key-swing { background: linear-gradient(180deg, #ff6a5a, var(--signal)); box-shadow: 0 5px 0 #a8241a, 0 8px 14px -6px rgba(255,58,45,.7); }
.key:active, .key.pressed { transform: translateY(5px); box-shadow: 0 0 0 transparent, 0 2px 6px -4px rgba(0,0,0,.5); }
.key:disabled { filter: saturate(.2) brightness(.85); cursor: default; }
.key:disabled:active { transform: none; }

.controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.hint { text-align: center; color: var(--ink-2); margin: 14px auto 0; min-height: 1.5em; }

.verdict { font-family: var(--font-display); font-size: 34px; color: var(--title); line-height: 1.05; }
.verdict.win { color: var(--ok); }

@media (max-width: 480px) {
  .readout { font-size: 13px; }
  .seg-score { font-size: 17px; }
  .key { min-height: 56px; font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .base.on, .lane i.on { box-shadow: 0 0 0 2px #fff; }
}
