:root {
  --shell-paper: oklch(94% 0.025 82);
  --shell-paper-deep: oklch(88% 0.04 82);
  --shell-surface: oklch(98% 0.012 82);
  --shell-ink: oklch(23% 0.035 38);
  --shell-ink-soft: oklch(42% 0.03 50);
  --shell-orange: oklch(64% 0.19 42);
  --shell-orange-dark: oklch(47% 0.16 38);
  --shell-yellow: oklch(86% 0.16 90);
  --shell-green: oklch(53% 0.105 155);
  --shell-blue: oklch(52% 0.11 235);
  --shell-line: oklch(31% 0.035 42);
  --shell-display: "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
  --shell-body: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  --shell-content: 96rem;
  --shell-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 20rem;
  background: var(--shell-paper);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--shell-ink);
  background:
    linear-gradient(oklch(47% 0.02 80 / 0.06) 1px, transparent 1px),
    linear-gradient(90deg, oklch(47% 0.02 80 / 0.045) 1px, transparent 1px),
    var(--shell-paper);
  background-size: 1.5rem 1.5rem;
  font-family: var(--shell-body);
  font-size: 1rem;
  line-height: 1.5;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
  font: inherit;
  cursor: pointer;
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--shell-blue);
  outline-offset: 3px;
}

::selection {
  color: var(--shell-ink);
  background: var(--shell-yellow);
}

.shell-skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--shell-surface);
  background: var(--shell-ink);
  transform: translateY(-160%);
  transition: transform 180ms var(--shell-ease);
}

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

.shell-header {
  position: sticky;
  z-index: 30;
  top: 0;
  border-bottom: 2px solid var(--shell-line);
  background: var(--shell-paper);
}

.shell-header-inner {
  display: grid;
  width: min(100% - 1rem, var(--shell-content));
  min-height: 4.5rem;
  margin-inline: auto;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding-block: 0.5rem;
}

.shell-brand {
  display: inline-flex;
  min-width: 0;
  min-height: 3rem;
  align-items: center;
  gap: 0.65rem;
}

.shell-brand-mark {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  padding: 0.34rem;
  border: 2px solid var(--shell-ink);
  background: var(--shell-orange);
  transform: rotate(-3deg);
}

.shell-brand-mark i {
  background: var(--shell-paper);
}

.shell-brand > span:last-child {
  display: grid;
  min-width: 0;
  line-height: 1;
}

.shell-brand strong {
  overflow: hidden;
  font-family: var(--shell-display);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell-brand small {
  display: none;
  margin-top: 0.34rem;
  color: var(--shell-ink-soft);
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.shell-current-game {
  display: none;
}

.shell-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}

.shell-action {
  display: grid;
  width: 2.9rem;
  min-width: 2.9rem;
  min-height: 2.9rem;
  place-items: center;
  border: 2px solid var(--shell-ink);
  background: var(--shell-surface);
  transition: color 140ms, background 140ms, transform 140ms var(--shell-ease), box-shadow 140ms;
}

.shell-action svg {
  width: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 1.8;
}

.shell-action > span {
  display: none;
}

.shell-action-primary {
  background: var(--shell-yellow);
  box-shadow: 2px 2px 0 var(--shell-ink);
}

.shell-actions > .h5-feedback-widget {
  flex: 0 0 auto;
  line-height: 1;
}

.game-shell-page .shell-actions .h5fb-trigger {
  position: static;
  display: grid;
  width: 2.9rem;
  min-width: 2.9rem;
  min-height: 2.9rem;
  place-items: center;
  margin: 0;
  padding: 0;
  box-shadow: none;
  transform: none;
}

.game-shell-page .shell-actions .h5fb-trigger span {
  display: none;
}

.game-shell-page .shell-actions .h5fb-trigger:active {
  box-shadow: none;
  transform: translate(1px, 1px);
}

.shell-main {
  width: min(100% - 1rem, var(--shell-content));
  margin-inline: auto;
  padding-block: clamp(1.5rem, 4vw, 3.5rem) clamp(3rem, 7vw, 6rem);
}

.shell-layout {
  display: grid;
  gap: clamp(2.5rem, 6vw, 5rem);
}

.shell-stage {
  min-width: 0;
}

.shell-stage-heading {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.shell-stage-heading p {
  margin: 0;
}

.shell-stage-heading > div > p,
.recommendation-heading > p {
  color: var(--shell-orange-dark);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.shell-stage-heading h1,
.recommendation-heading h2 {
  margin: 0;
  font-family: var(--shell-display);
  font-weight: 900;
  line-height: 1.08;
}

.shell-stage-heading h1 {
  margin-top: 0.35rem;
  font-size: clamp(2rem, 7vw, 4.5rem);
  letter-spacing: -0.045em;
}

.shell-stage-heading > p {
  max-width: 42rem;
  color: var(--shell-ink-soft);
  font-size: 1rem;
}

.game-cabinet {
  position: relative;
  border: 2px solid var(--shell-line);
  background: var(--shell-ink);
  box-shadow: 6px 6px 0 var(--shell-orange);
}

.cabinet-top,
.cabinet-bottom {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-inline: 0.85rem;
  color: var(--shell-paper);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.cabinet-lights {
  display: inline-flex;
  gap: 0.32rem;
}

.cabinet-lights i {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--shell-orange);
}

.cabinet-lights i:nth-child(2) {
  background: var(--shell-yellow);
}

.cabinet-lights i:nth-child(3) {
  background: var(--shell-green);
}

.game-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-block: 2px solid var(--shell-line);
  background: oklch(16% 0.02 40);
  isolation: isolate;
}

.game-cabinet[data-device="mobile"] {
  width: min(100%, 30rem);
  margin-inline: auto;
}

.game-cabinet[data-device="mobile"] .game-viewport {
  aspect-ratio: 9 / 16;
  max-height: 78svh;
}

.game-viewport iframe {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: oklch(96% 0.01 82);
  opacity: 0;
  transform-origin: top left;
  transition: opacity 220ms var(--shell-ease);
}

.game-viewport.is-loaded iframe {
  opacity: 1;
}

.game-loading {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.85rem;
  color: var(--shell-paper);
  background: var(--shell-ink);
  transition: opacity 180ms cubic-bezier(0.7, 0, 0.84, 0), visibility 180ms;
}

.game-loading span {
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--shell-ink-soft);
  border-top-color: var(--shell-yellow);
  border-radius: 50%;
  animation: shell-spin 800ms linear infinite;
}

.game-loading strong {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.game-viewport.is-loaded .game-loading {
  visibility: hidden;
  opacity: 0;
}

.cabinet-bottom {
  min-height: 3.25rem;
  letter-spacing: 0.02em;
}

.cabinet-bottom > span {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.55rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cabinet-bottom i {
  width: 0.58rem;
  height: 0.58rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--shell-green);
  box-shadow: 0 0 0 3px oklch(53% 0.105 155 / 0.18);
}

.cabinet-bottom button {
  min-height: 2.35rem;
  flex: 0 0 auto;
  padding-inline: 0.8rem;
  border: 1px solid var(--shell-paper);
  color: var(--shell-paper);
  background: transparent;
  font-size: 0.72rem;
  font-weight: 900;
}

.shell-device-note {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 1.25rem 0 0;
  color: var(--shell-ink-soft);
  font-size: 0.82rem;
}

.shell-device-note > span:first-child {
  display: grid;
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: var(--shell-orange-dark);
  font-weight: 900;
}

.shell-recommendations {
  min-width: 0;
}

.recommendation-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.recommendation-heading p {
  margin: 0;
}

.recommendation-heading h2 {
  font-size: clamp(1.65rem, 5vw, 2.4rem);
  letter-spacing: -0.035em;
}

.recommendation-list {
  display: grid;
  grid-auto-columns: minmax(15rem, 78vw);
  grid-auto-flow: column;
  gap: 0.9rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 0.2rem 0.25rem 1rem;
  scroll-snap-type: inline mandatory;
  scrollbar-width: thin;
}

.recommendation-card {
  display: grid;
  min-height: 7.25rem;
  grid-template-columns: 5.25rem 1fr;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem;
  border-top: 2px solid var(--shell-line);
  border-bottom: 2px solid var(--shell-line);
  background: var(--shell-surface);
  scroll-snap-align: start;
  transition: color 140ms, background 140ms, transform 140ms var(--shell-ease);
}

.recommendation-card img {
  width: 5.25rem;
  height: 5.25rem;
  object-fit: cover;
  border: 2px solid var(--shell-line);
  background: var(--shell-paper-deep);
}

.recommendation-card span {
  display: block;
  color: var(--shell-orange-dark);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.recommendation-card strong {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--shell-display);
  font-size: 1.1rem;
  line-height: 1.15;
}

.recommendation-card small {
  display: -webkit-box;
  margin-top: 0.35rem;
  overflow: hidden;
  color: var(--shell-ink-soft);
  font-size: 0.76rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.browse-all {
  display: flex;
  min-height: 3.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.5rem;
  padding-inline: 1rem;
  border: 2px solid var(--shell-line);
  background: var(--shell-yellow);
  box-shadow: 3px 3px 0 var(--shell-line);
  font-size: 0.86rem;
  font-weight: 900;
}

.shell-footer {
  display: flex;
  width: min(100% - 2rem, var(--shell-content));
  min-height: 6.5rem;
  margin-inline: auto;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.85rem;
  padding-block: 1.5rem max(1.5rem, env(safe-area-inset-bottom));
  border-top: 2px solid var(--shell-line);
  font-size: 0.82rem;
}

.shell-footer p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin: 0;
  color: var(--shell-ink-soft);
}

.shell-footer strong {
  color: var(--shell-ink);
  font-family: var(--shell-display);
}

.shell-footer > a {
  min-height: 2.75rem;
  padding-block: 0.65rem;
  color: var(--shell-orange-dark);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.game-cabinet:fullscreen {
  display: grid;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  max-width: none;
  grid-template-rows: auto 1fr auto;
  border: 0;
  background: var(--shell-ink);
  box-shadow: none;
}

.game-cabinet:fullscreen .game-viewport {
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
}

@keyframes shell-spin {
  to { transform: rotate(1turn); }
}

@media (min-width: 42rem) {
  .shell-header-inner,
  .shell-main {
    width: min(100% - 2rem, var(--shell-content));
  }

  .shell-brand small {
    display: block;
  }

  .shell-stage-heading {
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 0.55fr);
    align-items: end;
  }

  .shell-stage-heading > p {
    padding-bottom: 0.4rem;
  }

  .shell-footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

@media (min-width: 62rem) {
  .shell-header-inner {
    grid-template-columns: minmax(12rem, 1fr) minmax(12rem, auto) minmax(22rem, 1fr);
  }

  .shell-current-game {
    display: grid;
    justify-items: center;
    line-height: 1.15;
  }

  .shell-current-game span {
    color: var(--shell-orange-dark);
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.1em;
  }

  .shell-current-game strong {
    max-width: 16rem;
    overflow: hidden;
    margin-top: 0.22rem;
    font-family: var(--shell-display);
    font-size: 0.95rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .shell-action {
    width: auto;
    grid-auto-flow: column;
    gap: 0.5rem;
    padding-inline: 0.8rem;
  }

  .shell-action > span {
    display: inline;
    font-size: 0.76rem;
    font-weight: 900;
  }

  .game-shell-page .shell-actions .h5fb-trigger {
    width: auto;
    grid-auto-flow: column;
    gap: 0.5rem;
    padding-inline: 0.8rem;
  }

  .game-shell-page .shell-actions .h5fb-trigger span {
    display: inline;
    font-size: 0.76rem;
    font-weight: 900;
  }
}

@media (min-width: 72rem) {
  .shell-layout {
    grid-template-columns: minmax(0, 1fr) 19rem;
    align-items: start;
    gap: 2.5rem;
  }

  .shell-recommendations {
    position: sticky;
    top: 6rem;
    padding-top: 1.35rem;
  }

  .recommendation-heading {
    display: block;
  }

  .recommendation-heading h2 {
    margin-top: 0.35rem;
  }

  .recommendation-list {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    gap: 0;
    overflow: visible;
    padding: 0;
  }

  .recommendation-card {
    min-height: 6.6rem;
    grid-template-columns: 4.5rem 1fr;
    border-top: 2px solid var(--shell-line);
    border-bottom: 0;
  }

  .recommendation-card:last-child {
    border-bottom: 2px solid var(--shell-line);
  }

  .recommendation-card img {
    width: 4.5rem;
    height: 4.5rem;
  }

  .recommendation-card small {
    -webkit-line-clamp: 1;
  }

  .browse-all {
    margin-top: 1rem;
  }
}

@media (hover: hover) and (pointer: fine) {
  .shell-action:hover,
  .recommendation-card:hover,
  .browse-all:hover {
    color: var(--shell-paper);
    background: var(--shell-ink);
    transform: translate(-2px, -2px);
  }

  .shell-action-primary:hover,
  .browse-all:hover {
    box-shadow: 5px 5px 0 var(--shell-orange);
  }

  .shell-brand:hover strong,
  .shell-footer > a:hover {
    color: var(--shell-orange-dark);
  }
}

@media (pointer: coarse) {
  .shell-action,
  .cabinet-bottom button,
  .browse-all,
  .shell-footer > a {
    min-height: 3rem;
  }
}

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