:root {
  color-scheme: light;
  font-family:
    "Nunito",
    "PingFang SC",
    "Microsoft YaHei",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: #9fdcf4;
  color: #263238;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  display: grid;
  min-height: 100svh;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.88) 0 7%, transparent 7.5%),
    radial-gradient(circle at 78% 22%, rgba(255, 255, 255, 0.76) 0 5%, transparent 5.5%),
    linear-gradient(180deg, #8fd6f5 0%, #c9f2eb 62%, #a8df83 100%);
}

.game-shell {
  display: grid;
  width: 100%;
  height: 100svh;
  place-items: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(50px, calc(env(safe-area-inset-bottom) + 36px)) max(12px, env(safe-area-inset-left));
}

#game {
  display: block;
  width: min(100%, 760px);
  height: min(calc(100svh - 68px), 920px);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(30, 82, 108, 0.24);
  touch-action: manipulation;
  user-select: none;
}

.legal-links {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  left: max(12px, env(safe-area-inset-left));
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 10px;
  color: rgba(38, 50, 56, 0.72);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
}

.legal-links a {
  color: inherit;
  text-underline-offset: 3px;
}

.legal-links a:focus-visible {
  outline: 3px solid rgba(79, 149, 255, 0.58);
  outline-offset: 3px;
  border-radius: 4px;
}

body.info-page {
  display: block;
  min-height: 100svh;
  overflow: auto;
  padding: max(22px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}

.info-shell {
  width: min(100%, 860px);
  margin: 0 auto;
  padding: 18px 0 34px;
}

.info-header,
.info-section,
.info-footer {
  background: rgba(255, 255, 255, 0.86);
  border: 2px solid rgba(255, 255, 255, 0.94);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(30, 82, 108, 0.16);
}

.info-header {
  padding: 28px;
}

.info-header p,
.info-section p,
.info-section li,
.info-section td,
.info-section th {
  font-size: 17px;
  line-height: 1.75;
}

.info-eyebrow {
  margin: 0 0 8px;
  color: #4f6a73;
  font-weight: 900;
}

.info-header h1 {
  margin: 0 0 12px;
  color: #263238;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.15;
}

.info-header p {
  max-width: 680px;
  margin: 0;
  color: #40626c;
  font-weight: 750;
}

.info-section {
  margin-top: 16px;
  padding: 24px 28px;
}

.info-section h2 {
  margin: 0 0 12px;
  color: #263238;
  font-size: 24px;
}

.info-section p {
  margin: 0 0 12px;
}

.info-section ul {
  margin: 0;
  padding-left: 22px;
}

.info-section li + li {
  margin-top: 8px;
}

.info-table-wrap {
  overflow-x: auto;
}

.info-section table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

.info-section th,
.info-section td {
  padding: 12px;
  border-bottom: 1px solid rgba(38, 50, 56, 0.14);
  text-align: left;
  vertical-align: top;
}

.info-section th {
  color: #263238;
  font-weight: 900;
}

.info-section code {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(79, 149, 255, 0.12);
  color: #263238;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.94em;
}

.info-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  padding: 18px 28px;
}

.info-footer a {
  color: #263238;
  font-weight: 900;
  text-underline-offset: 3px;
}

@media (max-width: 540px) {
  .game-shell {
    padding: 8px 8px 46px;
  }

  #game {
    width: 100%;
    height: calc(100svh - 54px);
    border-radius: 0;
    box-shadow: none;
  }

  .legal-links {
    font-size: 13px;
  }

  body.info-page {
    padding-right: 12px;
    padding-left: 12px;
  }

  .info-header,
  .info-section,
  .info-footer {
    padding-right: 18px;
    padding-left: 18px;
  }
}
