:root {
  --bg: #090604;
  --panel: rgba(25, 15, 10, .94);
  --panel-2: rgba(39, 23, 14, .96);
  --line: rgba(255, 177, 70, .28);
  --line-strong: rgba(255, 185, 77, .62);
  --text: #fff8eb;
  --muted: #cfbda5;
  --amber: #ffb33f;
  --amber-2: #ff7a24;
  --gold: #ffd878;
  --green: #7ee0a1;
  --danger: #ff766d;
  --shadow: rgba(0, 0, 0, .48);
  --radius: 1.15rem;
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 18rem;
  min-height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 4%, rgba(255, 118, 29, .13), transparent 28rem),
    radial-gradient(circle at 86% 42%, rgba(255, 187, 70, .08), transparent 32rem),
    linear-gradient(160deg, #0d0805 0%, #070403 72%);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 3px solid rgba(255, 205, 111, .8);
  outline-offset: 3px;
}

.weave-light {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: .45;
  background-image:
    linear-gradient(90deg, transparent 49.7%, rgba(255, 171, 51, .045) 50%, transparent 50.3%),
    linear-gradient(0deg, transparent 49.7%, rgba(255, 171, 51, .04) 50%, transparent 50.3%);
  background-size: 4.8rem 4.8rem;
  animation: weave-drift 18s linear infinite;
}

.game-shell {
  width: min(100%, 70rem);
  min-height: calc(100dvh - var(--lexapyr-header-height));
  margin: 0 auto;
  padding: .65rem clamp(.55rem, 2.2vw, 1.4rem) 1.1rem;
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  gap: .6rem;
}

.mode-badge {
  width: fit-content;
  margin: 0 auto;
  padding: .35rem .8rem;
  border: 1px solid rgba(255, 206, 119, .42);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(55, 29, 13, .86);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.admin-test-panel {
  width: min(100%, 48rem);
  margin: 0 auto;
  padding: .75rem;
  display: grid;
  gap: .65rem;
  border: 1px solid rgba(126, 224, 161, .54);
  border-radius: 1rem;
  background:
    linear-gradient(145deg, rgba(126, 224, 161, .09), transparent 54%),
    rgba(14, 31, 21, .95);
  box-shadow: inset 0 1px rgba(255, 255, 255, .05);
}

.admin-test-panel[hidden] {
  display: none;
}

.admin-test-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
}

.admin-test-heading span {
  display: block;
  color: var(--green);
  font-size: .72rem;
  font-weight: 950;
  letter-spacing: .12em;
}

.admin-test-heading strong {
  display: block;
  margin-top: .15rem;
  font-size: 1.05rem;
}

.admin-current-state {
  padding: .5rem .7rem;
  border: 1px solid rgba(126, 224, 161, .38);
  border-radius: 999px;
  color: #d9ffe6;
  background: rgba(18, 63, 36, .72);
  font-weight: 900;
}

.admin-state-form {
  display: grid;
  grid-template-columns: minmax(9rem, .7fr) minmax(12rem, 1fr) auto;
  align-items: end;
  gap: .55rem;
}

.admin-state-form label {
  display: grid;
  gap: .28rem;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 850;
}

.admin-state-form select,
.admin-state-form input,
.admin-state-form button {
  min-height: 3.15rem;
  border: 1px solid rgba(126, 224, 161, .42);
  border-radius: .75rem;
  color: var(--text);
  background: rgba(8, 19, 13, .92);
}

.admin-state-form select,
.admin-state-form input {
  width: 100%;
  padding: .55rem .65rem;
}

.admin-state-form button {
  padding: .55rem .85rem;
  color: #092013;
  background: linear-gradient(145deg, #a4f3be, #58ca82);
  font-weight: 950;
}

.admin-state-feedback {
  min-height: 1.3em;
  margin: 0;
  color: #b9d9c4;
  font-size: .78rem;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .38rem;
}

.status-strip > div {
  min-height: clamp(3.8rem, 8dvh, 5.15rem);
  padding: .5rem .35rem;
  display: grid;
  place-content: center;
  gap: .15rem;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: .9rem;
  background:
    linear-gradient(150deg, rgba(255, 190, 82, .08), transparent 48%),
    rgba(22, 13, 9, .92);
  box-shadow: inset 0 1px rgba(255, 255, 255, .04);
}

.status-strip span {
  color: var(--muted);
  font-size: clamp(.67rem, 2.7vw, .8rem);
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.status-strip strong {
  color: var(--gold);
  font-size: clamp(1.18rem, 5.6vw, 1.75rem);
  line-height: 1;
}

.loom {
  position: relative;
  min-height: 0;
  padding: clamp(3.4rem, 8dvh, 4.8rem) clamp(.45rem, 2vw, 1rem) .8rem;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  gap: .55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 162, 43, .11), transparent 42%),
    linear-gradient(155deg, rgba(43, 25, 15, .96), rgba(15, 9, 6, .98));
  box-shadow:
    0 1.1rem 3rem var(--shadow),
    inset 0 1px rgba(255, 255, 255, .055);
  overflow: visible;
}

.loom::before {
  position: absolute;
  inset: .5rem;
  content: "";
  pointer-events: none;
  border: 1px solid rgba(255, 202, 106, .06);
  border-radius: calc(var(--radius) - .4rem);
}

.board-tools {
  position: absolute;
  z-index: 5;
  top: .65rem;
  left: .65rem;
  right: .65rem;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.board-tool {
  min-height: 3.25rem;
  padding: .65rem 1rem;
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  border: 1px solid var(--line-strong);
  border-radius: .85rem;
  color: var(--text);
  background: rgba(20, 11, 7, .92);
  box-shadow: 0 .4rem 1rem rgba(0, 0, 0, .3);
  font-size: 1.05rem;
  font-weight: 900;
  pointer-events: auto;
}

.board-tool-help {
  width: 3.25rem;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.4rem;
}

.weave-board {
  --size: 4;
  --gap: clamp(.14rem, .9vw, .35rem);
  width: min(100%, 58dvh, 35rem);
  min-width: 0;
  aspect-ratio: 1;
  padding: clamp(.35rem, 1.7vw, .75rem);
  display: grid;
  grid-template-columns: repeat(var(--size), minmax(0, 1fr));
  gap: var(--gap);
  touch-action: none;
  overscroll-behavior: contain;
  user-select: none;
  border: 1px solid rgba(255, 190, 82, .38);
  border-radius: 1.1rem;
  background:
    linear-gradient(rgba(255, 255, 255, .025), rgba(255, 255, 255, 0)),
    rgba(8, 5, 3, .82);
  box-shadow:
    inset 0 0 1.8rem rgba(0, 0, 0, .54),
    0 .8rem 2rem rgba(0, 0, 0, .3);
  overflow: hidden;
}

.weave-column {
  min-width: 0;
  padding: 0;
  display: grid;
  grid-template-rows: repeat(var(--size), minmax(0, 1fr));
  gap: var(--gap);
  border: 0;
  border-radius: .68rem;
  background: transparent;
  cursor: grab;
  touch-action: none;
  transition: transform .16s ease, filter .16s ease;
}

.weave-column:active {
  cursor: grabbing;
}

.weave-column.selected {
  filter: drop-shadow(0 0 .55rem rgba(255, 182, 63, .55));
}

.weave-column.dragging {
  z-index: 2;
  cursor: grabbing;
  filter: drop-shadow(0 0 .9rem rgba(255, 190, 75, .82));
  transform: scale(1.025);
}

.weave-column:disabled {
  cursor: default;
  opacity: 1;
}

.weave-board.controls-disabled {
  cursor: wait;
}

.letter-cell {
  min-width: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 193, 89, .3);
  border-radius: clamp(.34rem, 1.5vw, .62rem);
  color: #fffaf0;
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 221, 147, .15), transparent 36%),
    linear-gradient(150deg, rgba(94, 49, 21, .96), rgba(38, 20, 12, .98));
  box-shadow:
    inset 0 1px rgba(255, 255, 255, .08),
    0 .2rem .45rem rgba(0, 0, 0, .32);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(.92rem, calc(10vw / var(--size) * 2.25), 2rem);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.weave-column.selected .letter-cell {
  border-color: rgba(255, 207, 112, .72);
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 235, 176, .22), transparent 38%),
    linear-gradient(150deg, rgba(123, 65, 25, .98), rgba(49, 24, 12, .98));
}

.weave-board.solved .letter-cell {
  border-color: rgba(126, 224, 161, .62);
  background:
    radial-gradient(circle at 30% 20%, rgba(220, 255, 231, .2), transparent 40%),
    linear-gradient(150deg, rgba(34, 99, 58, .95), rgba(15, 54, 31, .98));
  animation: solved-pulse .55s ease both;
}

.feedback {
  min-height: 1.45em;
  margin: .05rem 0;
  color: var(--muted);
  font-size: clamp(.86rem, 3.2vw, 1rem);
  font-weight: 700;
  text-align: center;
}

.feedback.warn {
  color: var(--danger);
}

.feedback.good {
  color: var(--green);
}

.column-shifters {
  width: min(100%, 35rem);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .45rem;
}

.column-shifters button,
.game-actions button,
.primary-button,
.secondary-button {
  min-height: 3.2rem;
  padding: .65rem .7rem;
  border: 1px solid var(--line-strong);
  border-radius: .82rem;
  color: var(--text);
  background:
    linear-gradient(160deg, rgba(255, 182, 62, .16), transparent 48%),
    rgba(38, 21, 12, .96);
  box-shadow: inset 0 1px rgba(255, 255, 255, .06);
  font-weight: 850;
}

.column-shifters button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  font-size: 1.2rem;
  font-weight: 950;
}

.shift-arrow {
  color: var(--gold);
  font-size: 1.45em;
  line-height: 1;
}

.column-shifters button:active,
.game-actions button:active,
.primary-button:active,
.secondary-button:active {
  transform: translateY(1px);
}

.column-shifters > span {
  min-width: 5.4rem;
  color: var(--gold);
  font-size: .82rem;
  font-weight: 900;
  text-align: center;
}

.game-actions {
  width: min(100%, 35rem);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .45rem;
}

.game-actions button {
  min-width: 0;
  font-size: clamp(.76rem, 3vw, .92rem);
}

button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.modal {
  width: min(calc(100% - 1rem), 36rem);
  max-height: calc(100dvh - 1rem);
  padding: clamp(.85rem, 3.4vw, 1.3rem);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 1.2rem;
  background:
    radial-gradient(circle at 16% 0, rgba(255, 164, 43, .13), transparent 19rem),
    #150d08;
  box-shadow: 0 1.4rem 4rem rgba(0, 0, 0, .72);
  overflow: auto;
}

.modal::backdrop {
  background: rgba(3, 2, 1, .78);
  backdrop-filter: blur(6px);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.modal h2 {
  margin: .1rem 0 .85rem;
  font-size: clamp(1.35rem, 6vw, 2rem);
}

#tiersDialog {
  width: min(calc(100% - 1rem), 58rem);
}

#helpDialog {
  width: min(calc(100% - 1rem), 58rem);
}

.tier-modal-header {
  margin-bottom: 1rem;
}

.tier-modal-header h2 {
  margin-bottom: .55rem;
}

.tier-overall {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.tier-overall > span:first-child {
  flex-basis: 100%;
  font-size: .78rem;
  font-weight: 850;
}

.tier-overall strong {
  color: var(--amber-2);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  line-height: .9;
}

.tier-overall > span:last-child {
  font-size: 1.05rem;
}

.eyebrow {
  color: var(--amber);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.close-button {
  width: 2.8rem;
  height: 2.8rem;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: rgba(34, 19, 11, .96);
  font-size: 1.55rem;
}

.tier-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
}

.tier-card {
  position: relative;
  width: 100%;
  min-height: 15rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .65rem;
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  color: var(--text);
  text-align: left;
  background:
    linear-gradient(145deg, rgba(255, 183, 67, .09), transparent 44%),
    rgba(35, 20, 12, .94);
  overflow: hidden;
}

.tier-card.current {
  border-color: var(--line-strong);
  box-shadow:
    inset 0 0 0 1px rgba(255, 190, 79, .14),
    0 0 1.1rem rgba(255, 160, 42, .11);
}

.tier-card:disabled {
  opacity: .68;
}

.tier-card::after {
  position: absolute;
  right: -2rem;
  bottom: -2.2rem;
  width: 8.5rem;
  height: 8.5rem;
  content: "";
  pointer-events: none;
  border: 1px solid rgba(255, 190, 79, .12);
  transform: rotate(8deg);
  background-image:
    linear-gradient(90deg, transparent 24%, rgba(255, 190, 79, .08) 25%, transparent 26%, transparent 49%, rgba(255, 190, 79, .08) 50%, transparent 51%, transparent 74%, rgba(255, 190, 79, .08) 75%, transparent 76%),
    linear-gradient(transparent 24%, rgba(255, 190, 79, .08) 25%, transparent 26%, transparent 49%, rgba(255, 190, 79, .08) 50%, transparent 51%, transparent 74%, rgba(255, 190, 79, .08) 75%, transparent 76%);
}

.tier-lock {
  position: absolute;
  z-index: 1;
  top: .8rem;
  right: .8rem;
  width: 1.3rem;
  height: 1.1rem;
  border: 2px solid #c99b29;
  border-radius: .22rem;
  background: rgba(201, 155, 41, .18);
}

.tier-lock::before {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 1px);
  width: .68rem;
  height: .62rem;
  content: "";
  border: 2px solid #c99b29;
  border-bottom: 0;
  border-radius: .5rem .5rem 0 0;
  transform: translateX(-50%);
}

.tier-card:not(.locked) .tier-lock {
  display: none;
}

.tier-size {
  color: var(--amber-2);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 8vw, 4.4rem);
  font-weight: 800;
  line-height: 1;
}

.tier-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.tier-copy strong,
.tier-copy small {
  display: block;
}

.tier-copy small {
  margin-top: .35rem;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.45;
}

.tier-copy strong {
  font-size: 1.15rem;
}

.tier-progress {
  position: relative;
  z-index: 1;
  margin-top: auto;
  display: grid;
  gap: .5rem;
  color: var(--green);
  font-size: .82rem;
  font-weight: 850;
  line-height: 1.35;
}

.tier-card.locked .tier-progress {
  color: var(--muted);
}

.tier-progress-track {
  height: .55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
}

.tier-progress-fill {
  width: var(--progress);
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber-2), var(--gold));
}

.help-content {
  display: grid;
  gap: .85rem;
}

.rule-row {
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  gap: .6rem;
  align-items: start;
}

.rule-row > span {
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #281407;
  background: var(--amber);
  font-weight: 950;
}

.rule-row p {
  margin: .25rem 0 0;
  color: #eadcc8;
  font-size: 1.08rem;
  line-height: 1.55;
}

.primary-button {
  color: #261205;
  border-color: #ffd583;
  background: linear-gradient(145deg, #ffd16d, #ff9a2d);
}

.complete-modal {
  text-align: center;
}

.completion-mark {
  width: 4rem;
  height: 4rem;
  margin: 0 auto .5rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 214, 125, .6);
  border-radius: 50%;
  color: var(--gold);
  background: rgba(81, 42, 16, .72);
  box-shadow: 0 0 1.4rem rgba(255, 171, 52, .28);
  font-size: 2rem;
}

.earned-stars {
  margin: .1rem 0 .75rem;
  color: var(--gold);
  font-size: clamp(1.75rem, 9vw, 2.7rem);
  letter-spacing: .14em;
}

.complete-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
}

.complete-stat {
  min-height: 4.8rem;
  padding: .55rem .35rem;
  display: grid;
  place-content: center;
  gap: .15rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: rgba(27, 15, 9, .86);
}

.complete-stat span {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.complete-stat strong {
  color: var(--gold);
  font-size: clamp(1.1rem, 5vw, 1.55rem);
}

.completion-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .55rem;
}

.site-footer {
  padding: .85rem 1rem max(.85rem, env(safe-area-inset-bottom));
  color: #9f8b72;
  font-size: .72rem;
  line-height: 1.4;
  text-align: center;
}

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

@keyframes weave-drift {
  to {
    background-position: 4.8rem 4.8rem, -4.8rem 4.8rem;
  }
}

@keyframes solved-pulse {
  50% {
    transform: scale(1.035);
    box-shadow: 0 0 1rem rgba(126, 224, 161, .3);
  }
}

@media (orientation: landscape) and (max-height: 38rem) {
  .game-shell {
    min-height: auto;
  }

  .status-strip > div {
    min-height: 3.35rem;
  }

  .loom {
    padding-top: 3.25rem;
  }

  .weave-board {
    width: min(100%, 72dvh, 32rem);
  }
}

@media (min-width: 48rem) {
  .game-shell {
    padding-top: 1rem;
  }

  .status-strip {
    width: min(100%, 44rem);
    align-self: center;
  }

  .loom {
    width: min(100%, 48rem);
    align-self: center;
  }

}

@media (max-width: 22rem) {
  .game-shell {
    padding-inline: .35rem;
  }

  .status-strip {
    gap: .25rem;
  }

  .status-strip > div {
    padding-inline: .15rem;
  }

  .loom {
    padding-inline: .3rem;
  }

  .game-actions,
  .column-shifters {
    gap: .3rem;
  }
}

@media (orientation: portrait), (max-width: 47.99rem) {
  .game-shell {
    width: 100%;
    min-height: auto;
    padding: .42rem .28rem max(.7rem, env(safe-area-inset-bottom));
    gap: .48rem;
  }

  .mode-badge {
    padding: .5rem 1rem;
    font-size: .92rem;
  }

  .admin-test-panel {
    width: 100%;
    padding: .7rem;
  }

  .admin-test-heading strong {
    font-size: 1.2rem;
  }

  .admin-current-state {
    font-size: 1rem;
  }

  .admin-state-form {
    grid-template-columns: 1fr;
  }

  .admin-state-form label {
    font-size: .95rem;
  }

  .admin-state-form select,
  .admin-state-form input,
  .admin-state-form button {
    min-height: 4rem;
    font-size: 1.08rem;
  }

  .admin-state-feedback {
    font-size: .92rem;
  }

  .status-strip {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .38rem;
  }

  .status-strip > div {
    min-height: clamp(5.2rem, 10.5dvh, 7rem);
    padding: .7rem .3rem;
    border-width: 1.5px;
  }

  .status-strip span {
    font-size: clamp(.9rem, 3.8vw, 1.18rem);
  }

  .status-strip strong {
    font-size: clamp(2rem, 8.4vw, 2.8rem);
  }

  .loom {
    width: 100%;
    min-height: 0;
    padding: 5.35rem .28rem .7rem;
    flex: 0 0 auto;
    gap: .62rem;
  }

  .board-tools {
    top: .55rem;
    left: .55rem;
    right: .55rem;
  }

  .board-tool {
    min-height: 4.35rem;
    padding: .8rem 1.2rem;
    border-width: 1.5px;
    font-size: clamp(1.22rem, 5vw, 1.5rem);
  }

  .board-tool-help {
    width: 4.35rem;
    padding: 0;
    font-size: clamp(1.75rem, 7vw, 2.15rem);
  }

  .weave-board {
    width: min(100%, 46rem);
    max-width: 100%;
    padding: clamp(.35rem, 1.4vw, .7rem);
  }

  .letter-cell {
    font-size: clamp(
      1rem,
      calc(15vw / var(--size) * 2.25),
      3rem
    );
  }

  .feedback {
    min-height: 2em;
    margin: .05rem .3rem;
    font-size: clamp(1.05rem, 4.35vw, 1.35rem);
  }

  .column-shifters {
    width: min(100%, 46rem);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
  }

  .column-shifters > span {
    grid-column: 1 / -1;
    grid-row: 1;
    min-width: 0;
    font-size: 1.08rem;
  }

  .column-shifters button,
  .game-actions button,
  .primary-button,
  .secondary-button {
    border-width: 1.5px;
  }

  .column-shifters button {
    min-height: clamp(6.5rem, 15dvh, 8.5rem);
    border-radius: 1.15rem;
    font-size: clamp(1.58rem, 6.4vw, 2.05rem);
    font-weight: 950;
  }

  .shift-arrow {
    font-size: clamp(2.55rem, 10vw, 3.6rem);
  }

  .game-actions {
    width: min(100%, 46rem);
    gap: .5rem;
  }

  .game-actions button {
    min-height: clamp(5.2rem, 10dvh, 6.4rem);
    border-radius: 1rem;
    font-size: clamp(1.08rem, 4.5vw, 1.4rem);
  }

  #tiersDialog {
    width: calc(100% - .35rem);
    max-width: none;
    min-height: calc(100dvh - .35rem);
    max-height: calc(100dvh - .35rem);
    padding:
      max(1rem, env(safe-area-inset-top))
      .75rem
      max(1rem, env(safe-area-inset-bottom));
    border-radius: 1.1rem;
  }

  #helpDialog {
    width: calc(100% - .35rem);
    max-width: none;
    max-height: calc(100dvh - .35rem);
    padding:
      max(1.1rem, env(safe-area-inset-top))
      .9rem
      max(1.1rem, env(safe-area-inset-bottom));
    border-radius: 1.1rem;
  }

  #helpDialog .modal-header {
    gap: .65rem;
  }

  #helpDialog .eyebrow {
    font-size: clamp(.9rem, 3.8vw, 1.08rem);
  }

  #helpDialog h2 {
    margin-top: .2rem;
    font-size: clamp(2rem, 8vw, 3rem);
    line-height: 1.05;
  }

  #helpDialog .close-button {
    width: 3.6rem;
    height: 3.6rem;
    font-size: 2rem;
  }

  #helpDialog .help-content {
    gap: 1rem;
  }

  #helpDialog .rule-row {
    grid-template-columns: 3rem 1fr;
    gap: .85rem;
  }

  #helpDialog .rule-row > span {
    width: 3rem;
    height: 3rem;
    font-size: 1.25rem;
  }

  #helpDialog .rule-row p {
    margin-top: .1rem;
    font-size: clamp(1.12rem, 4.6vw, 1.4rem);
    line-height: 1.55;
  }

  #helpDialog .primary-button {
    min-height: 4.6rem;
    font-size: clamp(1.18rem, 4.8vw, 1.45rem);
  }

  .tier-modal-header h2 {
    font-size: clamp(1.8rem, 7.4vw, 3.2rem);
    white-space: nowrap;
  }

  .tier-overall > span:first-child {
    font-size: .92rem;
  }

  .tier-overall strong {
    font-size: clamp(3rem, 14vw, 5.2rem);
  }

  .tier-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
  }

  .tier-card {
    min-height: clamp(15rem, 32dvh, 19rem);
    padding: .9rem;
  }

  .tier-size {
    font-size: clamp(3rem, 14vw, 5.2rem);
  }

  .tier-copy strong {
    font-size: clamp(1.12rem, 4.7vw, 1.45rem);
  }

  .tier-copy small {
    font-size: clamp(.88rem, 3.7vw, 1.1rem);
  }

  .tier-progress {
    font-size: clamp(.82rem, 3.35vw, 1rem);
  }

  .site-footer {
    display: none;
  }
}

@media (max-width: 22rem) {
  .tier-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
