:root {
  color-scheme: dark;
  font-family:
    Inter,
    "Noto Sans JP",
    "Yu Gothic UI",
    system-ui,
    -apple-system,
    sans-serif;
  color: #edf4f6;
  background: #11171c;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #edf4f6;
  --muted: #8f9da5;
  --line: rgb(226 238 242 / 13%);
  --panel: #182127;
  --panel-2: #1d282f;
  --paper: #f2eee3;
  --cyan: #51d2d8;
  --yellow: #f3c55a;
  --coral: #f27d63;
  --green: #73d19c;
  --shadow: 0 1.6rem 4rem rgb(0 0 0 / 28%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 82% 0%, rgb(71 163 173 / 16%), transparent 24rem),
    repeating-linear-gradient(90deg, transparent 0 31px, rgb(255 255 255 / 1.7%) 32px), #11171c;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 20;
  padding: 0.7rem 1rem;
  color: #101619;
  background: var(--yellow);
  transform: translateY(-110%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
footer,
main {
  width: min(90rem, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header,
footer,
.site-header nav,
.board-heading,
.board-title,
.board-legend,
.panel-label,
.panel-label > div,
.stage-toolbar,
.status-label,
.sort-controls,
.decision-dock {
  display: flex;
  align-items: center;
}

.site-header {
  min-height: 3.8rem;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.site-header nav,
footer nav {
  gap: 1.15rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.site-header nav a,
footer a {
  text-decoration: none;
}

.site-header nav a:hover,
footer a:hover {
  color: var(--ink);
}

.brand {
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.board-shell {
  position: relative;
  padding-block: 1.5rem 5rem;
}

.board-heading {
  min-height: 5rem;
  padding: 0.3rem 0.2rem 1.1rem;
  justify-content: space-between;
  gap: 1.5rem;
}

.board-title {
  gap: 0.9rem;
}

.board-title p,
.board-title h1 {
  margin: 0;
}

.board-title p {
  margin-bottom: 0.22rem;
  color: var(--cyan);
  font-size: 0.56rem;
  font-weight: 850;
  letter-spacing: 0.16em;
}

.board-title h1 {
  font-size: clamp(1rem, 1.5vw, 1.24rem);
  letter-spacing: -0.025em;
}

.stack-mark {
  display: grid;
  width: 2.55rem;
  height: 2.55rem;
  place-items: center;
}

.stack-mark i {
  display: block;
  width: 1.65rem;
  height: 1.12rem;
  background: #24333a;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 0.24rem;
  box-shadow: 0 0.32rem 0 #11171c;
  grid-area: 1 / 1;
}

.stack-mark i:nth-child(1) {
  transform: translate(-0.34rem, -0.36rem) rotate(-7deg);
}

.stack-mark i:nth-child(2) {
  background: #31535a;
  transform: translate(0.24rem, -0.03rem) rotate(3deg);
}

.stack-mark i:nth-child(3) {
  background: var(--coral);
  transform: translate(-0.05rem, 0.4rem) rotate(-2deg);
}

.board-legend {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.85rem;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 750;
}

.board-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.legend-dot {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
}

.price-dot {
  background: var(--yellow);
}

.review-dot {
  background: var(--coral);
}

.device-dot {
  background: var(--cyan);
}

.choice-board {
  display: grid;
  overflow: hidden;
  min-height: 41rem;
  background: #161f24;
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  grid-template-columns: 18.5rem minmax(0, 1fr);
}

.candidate-tray {
  display: flex;
  min-width: 0;
  padding: 1.15rem;
  gap: 1rem;
  flex-direction: column;
  background:
    repeating-linear-gradient(0deg, transparent 0 27px, rgb(255 255 255 / 2.5%) 28px), #1a242a;
  border-right: 1px solid var(--line);
}

.panel-label {
  min-height: 2.3rem;
  justify-content: space-between;
}

.panel-label > div {
  gap: 0.55rem;
}

.panel-label span {
  font-size: 0.75rem;
  font-weight: 850;
}

.panel-label strong {
  padding: 0.22rem 0.42rem;
  color: #aab7bd;
  background: #11181c;
  border-radius: 0.26rem;
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 0.58rem;
}

.quiet-button,
.candidate-input button,
.add-button,
.sort-controls button,
.reset-decision {
  color: inherit;
  background: transparent;
  border: 0;
}

.quiet-button {
  color: var(--cyan);
  font-size: 0.66rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 0.18rem;
}

.candidate-inputs {
  display: grid;
  gap: 0.55rem;
}

.candidate-input {
  display: grid;
  min-height: 3.2rem;
  padding: 0.32rem 0.4rem 0.32rem 0.55rem;
  align-items: center;
  background: #11181c;
  border: 1px solid rgb(228 241 245 / 14%);
  border-radius: 0.58rem;
  grid-template-columns: 1.45rem minmax(0, 1fr) 1.65rem;
  transition:
    border-color 140ms ease,
    transform 140ms ease;
}

.candidate-input:focus-within {
  border-color: var(--cyan);
  transform: translateX(0.12rem);
}

.candidate-input > span {
  color: #58666d;
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 0.68rem;
  font-weight: 850;
}

.candidate-input input {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 0.73rem;
}

.candidate-input input::placeholder {
  color: #5f6c72;
}

.candidate-input button {
  width: 1.65rem;
  height: 1.65rem;
  color: #66747b;
  border-radius: 50%;
  font-size: 0.9rem;
}

.candidate-input button:hover {
  color: var(--ink);
  background: #2a373d;
}

.add-button {
  align-self: flex-start;
  padding: 0.25rem 0;
  color: #97a5ab;
  font-size: 0.68rem;
  font-weight: 800;
}

.add-button span {
  display: inline-grid;
  width: 1.4rem;
  height: 1.4rem;
  margin-right: 0.28rem;
  place-items: center;
  color: #101619;
  background: var(--cyan);
  border-radius: 0.28rem;
}

.form-error {
  min-height: 2rem;
  margin: auto 0 0;
  color: #ff9b86;
  font-size: 0.67rem;
  line-height: 1.55;
}

.compare-button {
  display: flex;
  min-height: 3.25rem;
  padding: 0.65rem 0.8rem;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  color: #12191d;
  background: var(--yellow);
  border: 0;
  border-radius: 0.62rem;
  box-shadow: 0 0.3rem 0 #9e7730;
  font-size: 0.76rem;
  font-weight: 900;
}

.compare-button:active {
  box-shadow: 0 0.1rem 0 #9e7730;
  transform: translateY(0.18rem);
}

.compare-icon {
  font-size: 1.15rem;
}

.tray-note {
  margin: 0;
  color: #748188;
  font-size: 0.57rem;
  line-height: 1.55;
}

.comparison-stage {
  display: flex;
  min-width: 0;
  padding: 1.15rem;
  gap: 1rem;
  flex-direction: column;
  background:
    linear-gradient(rgb(15 21 25 / 15%), rgb(15 21 25 / 15%)),
    repeating-linear-gradient(135deg, transparent 0 11px, rgb(255 255 255 / 1.4%) 12px), #202b31;
}

.stage-toolbar {
  min-height: 2.3rem;
  justify-content: space-between;
  gap: 1rem;
}

.status-label {
  gap: 0.45rem;
}

.status-label strong {
  font-size: 0.73rem;
}

.status-light {
  width: 0.48rem;
  height: 0.48rem;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0.75rem rgb(115 209 156 / 72%);
}

.sort-controls {
  margin-left: auto;
  gap: 0.28rem;
}

.sort-controls > span,
.stage-toolbar time {
  color: #7e8c93;
  font-size: 0.56rem;
}

.sort-controls button {
  min-height: 1.8rem;
  padding-inline: 0.56rem;
  color: #8e9ba1;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 800;
}

.sort-controls button[aria-pressed="true"] {
  color: var(--ink);
  background: #131a1e;
  border-color: var(--line);
}

.empty-cards,
.game-grid {
  display: grid;
  align-items: start;
  grid-template-columns: repeat(3, minmax(12rem, 1fr));
  gap: 0.8rem;
}

.empty-cards {
  flex: 1;
  padding-top: 0.8rem;
  opacity: 0.68;
}

.empty-card {
  overflow: hidden;
  min-height: 25rem;
  background: #172126;
  border: 1px dashed rgb(211 230 235 / 18%);
  border-radius: 0.75rem;
}

.empty-cover {
  display: grid;
  height: 8rem;
  place-items: center;
  background:
    linear-gradient(120deg, rgb(81 210 216 / 8%), transparent),
    repeating-linear-gradient(45deg, #202c32 0 10px, #1c272d 10px 20px);
}

.empty-cover span {
  display: grid;
  width: 2.7rem;
  height: 2.7rem;
  place-items: center;
  color: #738189;
  border: 1px solid #526068;
  border-radius: 50%;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
}

.empty-lines {
  display: grid;
  padding: 1rem;
  gap: 0.6rem;
}

.empty-lines i {
  display: block;
  width: 72%;
  height: 0.46rem;
  background: #29363c;
  border-radius: 999px;
}

.empty-lines i:nth-child(2) {
  width: 46%;
}

.empty-lines i:nth-child(3) {
  width: 88%;
}

.empty-meter {
  margin: 0.5rem 1rem;
  padding: 0.55rem;
  background: #1d292e;
  border-radius: 0.4rem;
}

.empty-meter i {
  display: block;
  width: 64%;
  height: 0.4rem;
  background: #34444b;
  border-radius: 999px;
}

.loading-state {
  display: grid;
  flex: 1;
  place-items: center;
  align-content: center;
  gap: 1rem;
  color: #97a5ab;
  font-size: 0.72rem;
}

.loading-stack {
  display: grid;
  width: 5rem;
  height: 4rem;
  place-items: center;
}

.loading-stack i {
  width: 3.5rem;
  height: 2.2rem;
  background: #2c3d44;
  border: 1px solid #455960;
  border-radius: 0.35rem;
  animation: shuffle 1.2s ease-in-out infinite;
  grid-area: 1 / 1;
}

.loading-stack i:nth-child(2) {
  animation-delay: -0.4s;
}

.loading-stack i:nth-child(3) {
  animation-delay: -0.8s;
}

@keyframes shuffle {
  0%,
  100% {
    transform: translate(-0.6rem, -0.2rem) rotate(-6deg);
  }
  50% {
    transform: translate(0.7rem, 0.3rem) rotate(5deg);
  }
}

.game-grid {
  overflow-x: auto;
  padding: 0.8rem 0.1rem 1rem;
  scroll-snap-type: x mandatory;
}

.game-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  color: #243037;
  background: var(--paper);
  border: 2px solid transparent;
  border-radius: 0.78rem;
  box-shadow: 0 0.9rem 2rem rgb(0 0 0 / 18%);
  scroll-snap-align: start;
  transition:
    border-color 160ms ease,
    opacity 160ms ease,
    transform 160ms ease;
}

.game-card.is-chosen {
  border-color: var(--yellow);
  transform: translateY(-0.5rem);
}

.game-card.is-not-chosen {
  opacity: 0.58;
}

.chosen-ribbon {
  position: absolute;
  z-index: 2;
  inset: 0.55rem 0.55rem auto auto;
  padding: 0.32rem 0.5rem;
  color: #171b1d;
  background: var(--yellow);
  border-radius: 0.32rem;
  font-size: 0.58rem;
  font-weight: 900;
}

.game-cover {
  position: relative;
  overflow: hidden;
  aspect-ratio: 460 / 215;
  background: #142026;
}

.game-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.discount-flag {
  position: absolute;
  inset: auto auto 0.55rem 0.55rem;
  padding: 0.28rem 0.42rem;
  color: #102018;
  background: var(--green);
  border-radius: 0.28rem;
  font-family: ui-monospace, monospace;
  font-size: 0.7rem;
  font-weight: 900;
}

.game-body {
  padding: 0.82rem;
}

.game-name {
  min-height: 2.4rem;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  letter-spacing: -0.02em;
}

.tag-row {
  display: flex;
  min-height: 1.7rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.tag {
  display: inline-flex;
  min-height: 1.35rem;
  padding-inline: 0.4rem;
  align-items: center;
  color: #526068;
  background: #dfded7;
  border-radius: 999px;
  font-size: 0.48rem;
  font-weight: 800;
}

.tag.jp {
  color: #135257;
  background: #ccebed;
}

.tag.no-jp {
  color: #8b463b;
  background: #f5d8d0;
}

.price-row {
  display: flex;
  min-height: 3rem;
  margin-top: 0.5rem;
  align-items: baseline;
  gap: 0.45rem;
}

.price-row strong {
  font-size: 1.25rem;
  letter-spacing: -0.045em;
}

.price-row del {
  color: #7b817f;
  font-size: 0.58rem;
}

.review-block {
  padding: 0.7rem;
  background: #e7e4da;
  border-radius: 0.55rem;
}

.review-heading,
.review-numbers {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.review-heading span {
  color: #6b716e;
  font-size: 0.5rem;
  font-weight: 850;
}

.review-heading strong {
  color: #3d494e;
  font-size: 0.62rem;
}

.review-meter {
  overflow: hidden;
  height: 0.48rem;
  margin: 0.48rem 0;
  background: #cbc9c0;
  border-radius: 999px;
}

.review-meter i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--coral), #efad5f);
  border-radius: inherit;
}

.review-numbers strong {
  font-size: 0.72rem;
}

.review-numbers span {
  color: #777d7a;
  font-size: 0.48rem;
}

.game-meta {
  display: grid;
  margin-block: 0.6rem;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.game-meta div {
  min-width: 0;
}

.game-meta span,
.game-meta strong {
  display: block;
}

.game-meta span {
  margin-bottom: 0.12rem;
  color: #7d837f;
  font-size: 0.46rem;
  font-weight: 800;
}

.game-meta strong {
  overflow: hidden;
  font-size: 0.58rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.choose-button {
  width: 100%;
  min-height: 2.55rem;
  color: #f5f7f5;
  background: #26353a;
  border: 0;
  border-radius: 0.52rem;
  font-size: 0.65rem;
  font-weight: 900;
}

.game-card.is-chosen .choose-button {
  color: #151a1c;
  background: var(--yellow);
}

.stage-note {
  margin: auto 0 0;
  color: #6f7e85;
  font-size: 0.54rem;
  line-height: 1.5;
}

.decision-dock {
  position: sticky;
  z-index: 5;
  width: min(42rem, calc(100% - 1rem));
  min-height: 4rem;
  margin: -2.1rem auto 0;
  padding: 0.65rem 0.7rem 0.65rem 1rem;
  justify-content: space-between;
  gap: 0.8rem;
  color: #171c1f;
  background: #f4efe2;
  border: 1px solid rgb(255 255 255 / 46%);
  border-radius: 0.75rem;
  box-shadow: 0 1rem 2.5rem rgb(0 0 0 / 38%);
  bottom: 0.75rem;
}

.decision-dock > div {
  min-width: 0;
}

.decision-dock span,
.decision-dock strong {
  display: block;
}

.decision-dock > div span {
  margin-bottom: 0.1rem;
  color: #717873;
  font-size: 0.48rem;
  font-weight: 900;
}

.decision-dock strong {
  overflow: hidden;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reset-decision {
  margin-left: auto;
  color: #6b726f;
  font-size: 0.58rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 0.18rem;
}

.steam-button {
  display: inline-flex;
  min-height: 2.65rem;
  padding-inline: 0.85rem;
  align-items: center;
  gap: 0.45rem;
  color: #f5f7f7;
  background: #1b2838;
  border-radius: 0.52rem;
  font-size: 0.66rem;
  font-weight: 900;
  text-decoration: none;
}

.prose {
  max-width: 48rem;
  margin: 2rem auto 5rem;
  padding: clamp(1.4rem, 4vw, 2.8rem);
  color: #263137;
  background: var(--paper);
  border-radius: 0.9rem;
  box-shadow: var(--shadow);
}

.prose h1 {
  margin: 0 0 1.8rem;
  font-size: 1.35rem;
}

.prose h2 {
  font-size: 0.88rem;
}

.prose section + section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgb(38 49 55 / 13%);
}

.prose p {
  color: #566167;
  font-size: 0.8rem;
  line-height: 1.85;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: #b95242 !important;
  font-size: 0.58rem !important;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.text-link {
  color: #12656c;
  font-weight: 850;
}

footer {
  min-height: 5rem;
  justify-content: space-between;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.7rem;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

@media (max-width: 72rem) {
  .empty-cards,
  .game-grid {
    grid-template-columns: repeat(3, minmax(13rem, 1fr));
  }

  .game-grid {
    padding-bottom: 1rem;
  }
}

@media (max-width: 52rem) {
  .board-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.8rem;
  }

  .board-legend {
    justify-content: flex-start;
  }

  .choice-board {
    grid-template-columns: 1fr;
  }

  .candidate-tray {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .candidate-inputs {
    grid-template-columns: 1fr 1fr;
  }

  .form-error {
    margin-top: 0;
  }

  .comparison-stage {
    min-height: 34rem;
  }
}

@media (max-width: 38rem) {
  .site-header,
  footer,
  main {
    width: min(100% - 0.8rem, 90rem);
  }

  .site-header nav a:first-child {
    display: none;
  }

  .candidate-inputs {
    grid-template-columns: 1fr;
  }

  .stage-toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .sort-controls {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .empty-cards,
  .game-grid {
    grid-template-columns: repeat(3, 78vw);
  }

  .empty-cards {
    overflow: hidden;
  }

  .decision-dock {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .reset-decision {
    grid-column: 2;
    grid-row: 1;
  }

  .steam-button {
    grid-column: 1 / -1;
    justify-content: center;
  }

  footer {
    padding-block: 1.3rem;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
