.gary-game {
  --gg-ink: #252c27;
  --gg-cream: #ede8db;
  --gg-yellow: #d6b566;
  --gg-orange: #bc5432;
  --gg-moss: #38443b;
  color: var(--gg-cream);
  background: var(--gg-moss);
  border: 2px solid var(--gg-ink);
  box-shadow: 5px 5px 0 rgba(37, 44, 39, .18);
  font-family: "Courier New", monospace;
  text-align: left;
}

.gary-game *, .gary-game *::before, .gary-game *::after { box-sizing: border-box; }
.gary-game button, .gary-game input { font: inherit; }
.gary-game button { cursor: pointer; border-radius: 0; }
.gary-game button:focus-visible, .gary-game input:focus-visible,
.gary-game canvas:focus-visible { outline: 3px solid var(--gg-yellow); outline-offset: 4px; }
.gary-game .gg-chrome {
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  padding: 12px 18px; border-bottom: 2px solid var(--gg-ink);
  font-size: 11px; letter-spacing: .075em; font-weight: 700;
}
.gary-game .gg-program { display: flex; gap: 10px; align-items: center; }
.gary-game .gg-program::before { content: ''; width: 8px; height: 8px; background: var(--gg-yellow); }
.gary-game .gg-build { opacity: .6; }
.gary-game .gg-hud {
  display: grid; grid-template-columns: 1fr 1fr 1fr auto; align-items: center;
  gap: 16px; padding: 15px 20px; background: var(--gg-ink);
}
.gary-game .gg-counter { margin: 0; display: flex; gap: 10px; align-items: baseline; }
.gary-game .gg-counter dt { font-size: 10px; color: #c0c6b9; white-space: nowrap; letter-spacing: .04em; }
.gary-game .gg-counter dd { margin: 0; font-size: 21px; line-height: 1; color: var(--gg-yellow); font-weight: 700; font-variant-numeric: tabular-nums; }
.gary-game .gg-counter small { font-size: 10px; color: #c0c6b9; font-weight: 400; }
.gary-game .gg-tax-counter { position: relative; }
.gary-game .gg-combo { display: inline-block; margin-left: 4px; padding: 2px 3px; color: #ddd0ac; border: 1px solid #717865; font-size: 9px; }
.gary-game .gg-combo.is-active { color: #272f26; background: #dac47f; border-color: #dac47f; }
.gary-game.has-tax-pulse .gg-tax-counter dd { color: #fff5cd; text-shadow: 2px 2px 0 #946b35; }
.gary-game .gg-route { display: flex; align-items: center; gap: 15px; min-height: 35px; padding: 9px 19px; color: #eee5c9; background: #4b5845; border-top: 1px solid #69785d; border-bottom: 2px solid #263326; font-size: 9px; letter-spacing: .035em; }
.gary-game[data-zone="workshop"] .gg-route { background: #535a4b; }
.gary-game[data-zone="scrapyard"] .gg-route { background: #655743; }
.gary-game .gg-zone { white-space: nowrap; font-weight: 700; min-width: 153px; }
.gary-game .gg-zone-distance { white-space: nowrap; color: #ded4b6; }
.gary-game .gg-route-track { display: block; height: 5px; background: #303c2d; flex: 1; min-width: 15px; }
.gary-game .gg-route-track i { display: block; height: 100%; background: #c7b16e; transform: scaleX(0); transform-origin: left; }
.gary-game .gg-pause { color: var(--gg-cream); border: 1px solid #777e70; background: transparent; min-height: 33px; padding: 4px 10px; font-size: 10px; }
.gary-game .gg-pause:disabled { opacity: .35; cursor: default; }
.gary-game .gg-stage { position: relative; background: #a9ac92; isolation: isolate; }
.gary-game .gg-canvas { display: block; width: 100%; aspect-ratio: 8 / 3; image-rendering: pixelated; touch-action: pan-y; outline-offset: -5px !important; }
.gary-game .gg-overlay {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: linear-gradient(90deg, rgba(37, 44, 39, .12), rgba(37, 44, 39, .36));
  padding: 16px; pointer-events: none;
}
.gary-game .gg-overlay[hidden] { display: none; }
.gary-game .gg-card {
  max-width: 400px; margin-left: 15%; background: var(--gg-cream); color: var(--gg-ink);
  padding: 22px 30px 23px; text-align: center; border: 2px solid var(--gg-ink);
  box-shadow: 5px 5px 0 rgba(37, 44, 39, .6); pointer-events: auto;
}
.gary-game .gg-card-tag { display: block; font-size: 10px; letter-spacing: .15em; margin-bottom: 8px; color: #685844; }
.gary-game .gg-card h3 { margin: 0 0 10px; font-size: clamp(18px, 2.3vw, 27px); line-height: 1.06; font-weight: 400; letter-spacing: .01em; }
.gary-game .gg-card p { max-width: 300px; margin: 0 auto 18px; font-size: 12px; line-height: 1.5; }
.gary-game .gg-start {
  min-height: 44px; padding: 10px 25px; background: var(--gg-orange); color: var(--gg-cream);
  border: 2px solid var(--gg-ink); box-shadow: 3px 3px 0 var(--gg-ink); font-size: 12px; font-weight: 700;
}
.gary-game .gg-start:hover { background: #a64229; }
.gary-game .gg-start:active { box-shadow: 1px 1px 0 var(--gg-ink); transform: translate(2px, 2px); }
.gary-game .gg-instructions { display: flex; gap: 10px 20px; flex-wrap: wrap; padding: 13px 19px; font-size: 11px; line-height: 1.55; border-top: 2px solid var(--gg-ink); }
.gary-game .gg-instructions span:last-child { color: var(--gg-yellow); margin-left: auto; }
.gary-game .gg-field-guide { border-top: 1px solid #64705d; padding: 0 19px; font-size: 10px; }
.gary-game .gg-field-guide summary { display: flex; align-items: center; justify-content: space-between; min-height: 38px; gap: 10px; cursor: pointer; list-style: none; color: #ded9c4; }
.gary-game .gg-field-guide summary::-webkit-details-marker { display: none; }
.gary-game .gg-field-guide summary:focus-visible { outline: 2px solid var(--gg-yellow); outline-offset: 3px; }
.gary-game .gg-field-guide summary span { font-size: 9px; color: #c6bc98; white-space: nowrap; }
.gary-game .gg-guide-items { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; padding: 4px 0 8px; }
.gary-game .gg-guide-items span { padding: 8px; background: #2d392f; color: var(--gg-yellow); white-space: nowrap; }
.gary-game .gg-guide-items b { font-size: 9px; color: var(--gg-cream); }
.gary-game .gg-field-guide p { max-width: 670px; color: #d3d5c4; font-size: 11px; line-height: 1.6; margin: 0 0 13px; }
.gary-game kbd { padding: 2px 5px; font: inherit; border: 1px solid #939b87; color: var(--gg-cream); }
.gary-game .gg-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 19px; border-top: 1px solid #64705d; font-size: 10px; }
.gary-game .gg-mode { display: inline-flex; gap: 9px; align-items: center; cursor: pointer; letter-spacing: .035em; min-height: 28px; }
.gary-game .gg-mode input { accent-color: var(--gg-yellow); margin: 0; width: 15px; height: 15px; }
.gary-game .gg-mode:has(input:disabled) { opacity: .6; }
.gary-game .gg-sound { color: var(--gg-cream); padding: 7px 9px; border: 1px solid #7b8572; background: transparent; font-size: 10px; min-height: 32px; }
.gary-game .gg-note { color: #b9c0ad; margin-left: auto; }
.gary-game .gg-touch { display: none; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px 14px; }
.gary-game .gg-touch button { min-height: 48px; background: #ede8db; color: var(--gg-ink); border: 2px solid var(--gg-ink); font-size: 12px; font-weight: 700; touch-action: none; user-select: none; -webkit-user-select: none; }
.gary-game .gg-touch button:active, .gary-game .gg-touch button.is-held { background: var(--gg-yellow); }
.gary-game .gg-touch button:disabled { opacity: .45; cursor: default; }
.gary-game .gg-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 760px) {
  .gary-game .gg-hud { gap: 10px; padding: 13px 12px; }
  .gary-game .gg-counter { display: block; }
  .gary-game .gg-counter dt { font-size: 9px; margin-bottom: 5px; }
  .gary-game .gg-counter dd { font-size: 19px; }
  .gary-game .gg-chrome { padding: 11px 12px; font-size: 9px; }
  .gary-game .gg-instructions { font-size: 10px; padding: 12px; gap: 8px 12px; }
  .gary-game .gg-footer { padding: 10px 12px; }
  .gary-game .gg-route { padding: 9px 12px; gap: 10px; }
  .gary-game .gg-zone { min-width: 132px; }
  .gary-game .gg-field-guide { padding: 0 12px; }
  .gary-game .gg-note { display: none; }
}
@media (max-width: 599px) {
  .gary-game .gg-hud { gap: 8px; }
  .gary-game .gg-combo { margin-left: 1px; font-size: 8px; padding: 1px 2px; }
  .gary-game .gg-route { flex-wrap: wrap; gap: 6px 10px; font-size: 8px; }
  .gary-game .gg-zone { min-width: 0; }
  .gary-game .gg-zone-distance { margin-left: auto; font-size: 7px; }
  .gary-game .gg-route-track { order: 3; flex-basis: 100%; height: 3px; }
  .gary-game .gg-guide-items { grid-template-columns: repeat(2, 1fr); }
  .gary-game .gg-field-guide summary { font-size: 8px; }
  .gary-game .gg-field-guide summary span { font-size: 8px; }
  .gary-game .gg-counter dd { font-size: 18px; white-space: nowrap; }
  .gary-game .gg-counter small { font-size: 8px; }
  .gary-game .gg-counter dt { font-size: 8px; letter-spacing: 0; }
  .gary-game .gg-pause { font-size: 9px; padding: 4px 6px; }
  .gary-game .gg-canvas { aspect-ratio: 5 / 3; }
  .gary-game .gg-overlay { padding: 10px; }
  .gary-game .gg-card { padding: 11px 14px 12px; margin-left: 0; max-width: 285px; }
  .gary-game .gg-card h3 { font-size: 19px; margin-bottom: 7px; }
  .gary-game .gg-card p { font-size: 10px; line-height: 1.35; margin-bottom: 9px; }
  .gary-game .gg-card-tag { font-size: 8px; margin-bottom: 6px; }
  .gary-game .gg-start { min-height: 40px; padding: 8px 20px; }
  .gary-game .gg-instructions span:last-child { margin-left: 0; }
  .gary-game .gg-build { display: none; }
  .gary-game .gg-touch { display: grid; padding: 0 12px 12px; }
}
@media (pointer: coarse) { .gary-game .gg-touch { display: grid; } }
@media (max-width: 340px) {
  .gary-game .gg-overlay { padding: 4px 8px; }
  .gary-game .gg-card { padding: 8px 12px 9px; }
  .gary-game .gg-card p { font-size: 9.5px; }
}
@media (prefers-reduced-motion: reduce) { .gary-game *, .gary-game *::before, .gary-game *::after { scroll-behavior: auto; animation: none; transition: none; } }
