/* Læg vægten — UX-pass 06, site tokens */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.game-page-header {
  max-width: 480px;
}

.game-page-header h1 {
  color: var(--primary-900);
}

.game-col {
  width: min(100% - var(--page-pad) * 2, 480px);
  margin-inline: auto;
}

.how-to {
  background: var(--primary-100);
  padding: 16px 0;
}

.how-to__list {
  margin: 0;
  padding-left: 1.2em;
  color: var(--neutral-700);
  display: grid;
  gap: 8px;
}

.section .game-col {
  display: grid;
  gap: 16px;
}

.game {
  width: 100%;
  background: var(--neutral-0);
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 16px;
  display: grid;
  gap: 16px;
}

.game.is-miss {
  animation: game-shake 0.42s var(--ease);
}

.game-hud {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr;
  gap: 8px;
}

.game-stat {
  display: grid;
  gap: 2px;
  text-align: center;
  background: var(--neutral-100);
  border-radius: var(--radius-md);
  padding: 10px 6px;
  min-height: 64px;
  align-content: center;
}

.game-stat__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--neutral-700);
}

.game-stat__value {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary-900);
  font-variant-numeric: tabular-nums;
}

.game-stat--target .game-stat__value {
  font-size: 1.5rem;
  color: var(--primary-700);
}

.game-stat__value.is-low {
  color: var(--error);
}

.barbell-wrap {
  overflow-x: auto;
}

.barbell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 104px;
  min-width: 280px;
}

.barbell__plates {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 56px;
  min-height: 96px;
}

.barbell__plates--left {
  justify-content: flex-end;
}

.barbell__plates--right {
  justify-content: flex-start;
}

.barbell__shaft {
  flex: 1;
  min-width: 56px;
  max-width: 160px;
  height: 12px;
  background: var(--neutral-700);
  border-radius: 3px;
}

.barbell__collar {
  width: 8px;
  height: 26px;
  background: var(--neutral-700);
  border-radius: 2px;
  flex-shrink: 0;
}

.plate-disc {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 3px;
  padding: 0;
  cursor: pointer;
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  flex-shrink: 0;
}

.plate-disc:disabled {
  cursor: default;
}

.plate-disc:focus-visible,
.plate-chip:focus-visible,
.game .btn:focus-visible,
.game-cta a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.plate-disc[data-tone="700"] {
  background: var(--primary-700);
  color: #fff;
}

.plate-disc[data-tone="500"] {
  background: var(--primary-500);
  color: var(--primary-900);
}

.plate-disc[data-kg="20"] {
  width: 16px;
  height: 96px;
}

.plate-disc[data-kg="15"] {
  width: 15px;
  height: 86px;
}

.plate-disc[data-kg="10"] {
  width: 14px;
  height: 74px;
}

.plate-disc[data-kg="5"] {
  width: 12px;
  height: 62px;
}

.plate-disc[data-kg="2.5"] {
  width: 11px;
  height: 50px;
}

.plate-disc[data-kg="1.25"] {
  width: 10px;
  height: 40px;
}

.barbell-caption {
  margin: 8px 0 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--neutral-700);
}

.game-sum {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  background: var(--neutral-100);
  border-radius: var(--radius-md);
}

.game-sum__label {
  font-weight: 600;
  color: var(--neutral-700);
}

.game-sum__value {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-900);
  font-variant-numeric: tabular-nums;
}

.game-result {
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-weight: 600;
  margin: 0;
}

.game-result[hidden] {
  display: none;
}

.game-result.is-hit {
  background: var(--primary-100);
  color: var(--primary-700);
}

.game-result.is-miss,
.game-result.is-timeout {
  background: var(--error-bg);
  color: var(--error);
}

.plate-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.plate-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--neutral-300);
  background: var(--neutral-0);
  color: var(--primary-900);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.plate-chip.is-on {
  background: var(--primary-300);
  border-color: var(--primary-300);
  color: var(--primary-900);
}

.plate-chip:hover:not(:disabled) {
  border-color: var(--primary-700);
}

.plate-chip:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.game-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-ghost-outline {
  border-color: var(--primary-700);
  color: var(--primary-700);
  background: transparent;
}

.btn-ghost-outline:hover:not(:disabled) {
  background: var(--primary-100);
}

.game[data-state="hit"] #play-actions,
.game[data-state="timeout"] #play-actions,
.game[data-state="hit"] .plate-chips,
.game[data-state="timeout"] .plate-chips {
  display: none;
}

.game[data-state="hit"] #btn-retry,
.game[data-state="timeout"] #btn-next,
.game[data-state="playing"] #result-actions {
  display: none;
}

.game-actions[hidden] {
  display: none;
}

.game[data-state="timeout"] #result-actions,
.game[data-state="hit"] #result-actions {
  display: grid;
  grid-template-columns: 1fr;
}

.game-cta {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
  padding-top: 8px;
}

.game-cta p {
  margin: 0;
  color: var(--neutral-700);
}

.game-cta[hidden] {
  display: none;
}

@keyframes game-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-10px);
  }
  40% {
    transform: translateX(10px);
  }
  60% {
    transform: translateX(-6px);
  }
  80% {
    transform: translateX(6px);
  }
}

@media (min-width: 768px) {
  .game {
    padding: 24px;
  }

  .game-stat--target .game-stat__value {
    font-size: 1.75rem;
  }

  .how-to {
    padding: 24px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .game.is-miss {
    animation: none;
  }
}
