:root {
  color-scheme: dark;
  --bg: #0d1529;
  --card: #19253e;
  --ink: #f5f7ff;
  --muted: #acb9d3;
  --mint: #88f2d0;
  --gold: #ffe19a;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(ellipse at 15% 10%, #203054 0, transparent 52%), var(--bg);
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  -webkit-text-size-adjust: 100%;
}
button,
a,
canvas {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
  color: inherit;
}
a {
  color: inherit;
}
button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
[hidden] {
  display: none !important;
}
.shell {
  max-width: 1140px;
  margin: auto;
  padding: 0 28px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid #ffffff14;
}
.back {
  font-size: 13px;
  text-decoration: none;
  color: #ccd8ed;
}
.brand {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #a6b8d3;
}
.icon-button {
  background: #ffffff0c;
  border: 1px solid #ffffff24;
  border-radius: 12px;
  min-height: 40px;
  min-width: 44px;
  padding: 8px 12px;
  font-size: 12px;
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 26px 0 24px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--mint);
  font-weight: 700;
  margin: 0 0 8px;
}
.heading h1 {
  font-size: 30px;
  letter-spacing: 0.03em;
  margin: 0;
  font-weight: 900;
}
.heading h1 span {
  color: var(--mint);
}
.pill {
  border: 1px solid #ffffff26;
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
  gap: 24px;
  align-items: start;
}
.stage {
  position: relative;
  isolation: isolate;
  border: 1px solid #819fbd45;
  border-radius: 24px;
  overflow: hidden;
  background: #152c4b;
  box-shadow: 0 25px 65px #0004;
  aspect-ratio: 600/680;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.intro {
  width: min(100%, 380px);
  text-align: center;
}
.mini-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  background: #0b213ab8;
  color: #bcf8e4;
  border: 1px solid #8df2d135;
  border-radius: 999px;
  padding: 7px 12px;
}
.intro h2 {
  font-size: clamp(28px, 3.6vw, 43px);
  line-height: 1.32;
  letter-spacing: 0.03em;
  margin: 18px 0 12px;
  text-shadow: 0 3px 16px #112944;
}
.intro h2 span {
  color: #fff0bc;
}
.intro > p {
  font-size: 13px;
  line-height: 1.9;
  color: #d6e6f4;
  margin: 0;
}
.hero-creature {
  position: relative;
  width: 112px;
  height: 83px;
  margin: 25px auto 22px;
  border-radius: 50% 50% 39% 39%;
  background: var(--creature, #8df2d1);
  box-shadow:
    inset -10px -12px 0 #12374c20,
    0 15px 30px #080e2733;
  transform: rotate(-7deg);
}
.hero-creature:before,
.hero-creature:after {
  content: "";
  position: absolute;
  width: 8px;
  height: 12px;
  border-radius: 50%;
  background: #18354b;
  top: 33px;
  left: 34px;
}
.hero-creature:after {
  left: 70px;
}
.hero-creature i {
  position: absolute;
  border: 3px solid #18354b;
  border-top: 0;
  width: 12px;
  height: 7px;
  border-radius: 0 0 12px 12px;
  left: 50px;
  top: 47px;
}
.hero-creature b,
.hero-creature em {
  position: absolute;
  background: #ff9ba790;
  width: 15px;
  height: 7px;
  border-radius: 50%;
  top: 46px;
  left: 18px;
}
.hero-creature em {
  left: 81px;
}
.mode-picker {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.mode-picker button {
  flex: 1;
  border: 1px solid #b7d8ec45;
  background: #0c203bc9;
  border-radius: 12px;
  padding: 10px 5px;
  font-size: 13px;
  font-weight: 700;
}
.mode-picker button.selected {
  background: #254d59;
  border-color: var(--mint);
  color: var(--mint);
}
.mode-picker small {
  display: block;
  font-size: 9px;
  margin-top: 4px;
  font-weight: 400;
  color: #cfdae9;
}
.primary {
  width: 100%;
  background: var(--mint);
  color: #102d35;
  border: 0;
  border-radius: 13px;
  box-shadow: 0 5px 0 #3b9788;
  padding: 15px 20px;
  font-weight: 900;
  font-size: 18px;
  transition:
    filter 0.15s,
    transform 0.15s;
}
.primary span {
  float: right;
}
.primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.primary:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #3b9788;
}
.intro .tiny {
  margin-top: 18px;
  font-size: 10px;
  line-height: 1.8;
  color: #c0d2e7;
}
.sidebar {
  display: grid;
  gap: 16px;
}
.info-card {
  padding: 23px;
  background: linear-gradient(140deg, #1d2c46, #17223a);
  border: 1px solid #ffffff12;
  border-radius: 20px;
}
.info-card h2 {
  font-size: 16px;
  margin: 0;
}
.instructions ol {
  list-style: none;
  padding: 0;
  margin: 20px 0;
  display: grid;
  gap: 19px;
}
.instructions li {
  display: flex;
  align-items: center;
  gap: 14px;
}
.step-icon {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  height: 42px;
  border-radius: 12px;
  background: #8af2d112;
  font-size: 25px;
  color: var(--mint);
}
.gold {
  color: var(--gold);
  background: #ffe19a12;
}
.instructions b {
  font-size: 13px;
}
.instructions li p {
  font-size: 11px;
  color: var(--muted);
  margin: 4px 0 0;
  line-height: 1.7;
}
.item-guide {
  border-top: 1px solid #ffffff12;
  padding-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 10px;
  color: #c5d4ea;
}
.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-heading > span {
  font-size: 11px;
  color: var(--mint);
}
.muted {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
}
.crew-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0;
}
.crew-button {
  position: relative;
  background: #0f1930;
  border: 1px solid #ffffff15;
  border-radius: 12px;
  padding: 12px 3px 8px;
  min-height: 77px;
  font-size: 10px;
}
.crew-button[aria-pressed="true"] {
  border-color: var(--mint);
  background: #203c43;
}
.crew-dot {
  display: block;
  position: relative;
  width: 34px;
  height: 27px;
  background: var(--c);
  border-radius: 50% 50% 40% 40%;
  margin: 0 auto 7px;
}
.crew-dot:after {
  content: "••";
  position: absolute;
  left: 9px;
  top: 4px;
  letter-spacing: 5px;
  font-size: 12px;
  color: #1a3046;
}
.crew-button:disabled .crew-dot {
  filter: grayscale(1);
  opacity: 0.4;
}
.collection-progress {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #ffffff12;
  padding-top: 14px;
  font-size: 11px;
  color: var(--muted);
}
.collection-progress b {
  color: var(--gold);
}
.tiny {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.8;
}
.collection .tiny {
  margin-bottom: 0;
}
.best {
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  font-size: 11px;
  color: var(--muted);
}
.best b {
  color: var(--gold);
  font-size: 18px;
}
.controls {
  display: flex;
  gap: 10px;
  max-width: calc((100% - 24px) * 0.63);
  margin-top: 15px;
}
.controls button {
  touch-action: none;
  user-select: none;
  border: 1px solid #ffffff25;
  background: #22304a;
  border-radius: 14px;
  min-height: 64px;
  flex: 1;
  font-size: 23px;
  line-height: 1;
  box-shadow: 0 4px 0 #070e1e;
}
.controls small {
  display: block;
  font-size: 10px;
  margin-top: 6px;
}
.controls #jump {
  position: relative;
  flex: 1.6;
  color: var(--mint);
  background: #1d3d45;
  border-color: #8af2d14a;
}
.controls button:active {
  transform: translateY(3px);
  box-shadow: none;
}
.controls span {
  position: absolute;
  right: 10px;
  top: 26px;
  font-size: 8px;
  opacity: 0.55;
}
.footnote {
  text-align: center;
  font-size: 10px;
  color: #92a4c2;
  line-height: 2;
  margin: 28px 0 20px;
}
.footnote a {
  text-decoration: none;
}
.hud {
  position: absolute;
  top: 20px;
  left: 22px;
  right: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  pointer-events: none;
}
.hud > div {
  display: grid;
  gap: 2px;
}
.hud small {
  font-size: 10px;
  color: #cee0f0;
}
.hud strong {
  font-size: 24px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.hud .time {
  margin-left: auto;
}
.hud .time strong {
  color: white;
  font-size: 20px;
}
.hud button {
  pointer-events: auto;
  background: #0c1c38aa;
}
.run-info {
  position: absolute;
  top: 88px;
  left: 22px;
  right: 22px;
  font-size: 11px;
  color: #d8e5f3;
}
.run-info #hearts {
  float: right;
  color: #ffa4b7;
  letter-spacing: 3px;
}
.progress {
  margin-top: 9px;
  height: 4px;
  background: #ffffff20;
  border-radius: 4px;
  overflow: hidden;
}
.progress > div {
  height: 100%;
  background: var(--mint);
  width: 0;
}
.combo {
  position: absolute;
  top: 142px;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--gold);
  font-size: 17px;
  font-weight: 900;
  pointer-events: none;
  text-shadow: 0 2px 8px #000;
}
.game-notice {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 17px;
  text-align: center;
  color: #fff2bc;
  text-shadow: 0 2px 5px #000;
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
}
.shade {
  background: #0b1729db;
  backdrop-filter: blur(8px);
}
.panel {
  width: min(100%, 370px);
  text-align: center;
}
.panel-symbol {
  font-size: 64px;
  color: var(--gold);
}
.panel h2 {
  font-size: 27px;
  margin: 12px 0;
}
.panel p {
  font-size: 12px;
  color: #c5d5e9;
  line-height: 1.8;
}
.secondary {
  display: block;
  width: 100%;
  border: 1px solid #ffffff30;
  background: #ffffff08;
  border-radius: 12px;
  padding: 12px;
  margin-top: 13px;
  font-size: 13px;
}
.result-score {
  font-size: 56px;
  font-weight: 900;
  color: var(--gold);
  margin: 8px 0;
}
.result-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0;
}
.result-details div {
  background: #ffffff09;
  border: 1px solid #ffffff12;
  border-radius: 12px;
  padding: 12px 5px;
  font-size: 11px;
  line-height: 1.8;
}
.result-details b {
  display: block;
  font-size: 20px;
  color: var(--mint);
}
.panel .unlock {
  color: var(--mint);
  min-height: 22px;
}
.panel .save-note {
  color: #ffdcaa;
  font-size: 10px;
}
.panel .tiny {
  font-size: 10px;
}
@media (min-width: 1000px) {
  .stage {
    max-height: 720px;
  }
}
@media (max-width: 960px) {
  .shell {
    padding: 0 14px;
  }
  .topbar {
    padding: 12px 0;
  }
  .brand {
    display: none;
  }
  .heading {
    padding: 20px 0 17px;
  }
  .heading h1 {
    font-size: 23px;
  }
  .heading .eyebrow {
    font-size: 9px;
  }
  .pill {
    font-size: 10px;
    padding: 7px 9px;
  }
  .stage {
    width: 100%;
    max-width: 600px;
    justify-self: center;
  }
  .sidebar {
    width: 100%;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .info-card {
    padding: 16px;
  }
  .info-card h2 {
    font-size: 14px;
  }
  .sidebar .best {
    grid-column: 1/-1;
  }
  .instructions ol {
    gap: 13px;
  }
  .instructions li {
    gap: 8px;
  }
  .step-icon {
    flex-basis: 31px;
    height: 35px;
    font-size: 20px;
  }
  .item-guide {
    font-size: 9px;
  }
  .crew-grid {
    gap: 5px;
  }
  .crew-button {
    font-size: 9px;
  }
  .collection-progress {
    gap: 5px;
    font-size: 10px;
  }
}
@media (max-width: 420px) {
  .overlay {
    padding: 16px;
  }
  .intro h2 {
    font-size: 29px;
    margin: 12px 0 8px;
  }
  .intro > p {
    font-size: 11px;
  }
  .hero-creature {
    width: 100px;
    height: 72px;
    margin: 17px auto;
  }
  .hero-creature:after {
    left: 64px;
  }
  .hero-creature i {
    left: 45px;
  }
  .hero-creature em {
    left: 73px;
  }
  .mini-label {
    font-size: 9px;
    padding: 5px 10px;
  }
  .mode-picker button {
    padding: 8px 3px;
    font-size: 12px;
  }
  .primary {
    padding: 13px;
    font-size: 16px;
  }
  .intro .tiny {
    margin-top: 13px;
    font-size: 9px;
  }
  .sidebar {
    grid-template-columns: 1fr;
  }
  .instructions ol {
    grid-template-columns: 1fr;
    gap: 13px;
  }
  .result-score {
    font-size: 43px;
  }
  .panel h2 {
    font-size: 23px;
  }
  .result-details {
    margin: 8px 0;
  }
  .result-details div {
    padding: 7px 3px;
  }
  .panel p {
    margin: 9px 0;
  }
  .hud {
    top: 14px;
    left: 16px;
    right: 16px;
  }
  .run-info {
    top: 73px;
    left: 16px;
    right: 16px;
  }
  .combo {
    top: 118px;
    font-size: 14px;
  }
  .game-notice {
    font-size: 12px;
  }
  .heading h1 {
    font-size: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* Keep controls next to the playfield in document and visual order. */
.game-layout {
  column-gap: 24px;
  row-gap: 15px;
}
.stage {
  grid-column: 1;
  grid-row: 1;
}
.controls {
  grid-column: 1;
  grid-row: 2;
  max-width: none;
  margin: 0;
  position: static;
  width: 100%;
}
.sidebar {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin: 0;
}
@media (max-width: 960px) {
  .game-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .stage {
    grid-column: 1;
    grid-row: 1;
  }
  .controls {
    position: static;
    grid-column: 1;
    grid-row: 2;
    margin: 0;
  }
  .sidebar {
    grid-column: 1;
    grid-row: 3;
    margin-top: 7px;
  }
}
@media (max-width: 420px) {
  .stage {
    min-height: 480px;
  }
  .overlay {
    padding: 18px;
  }
  .intro .tiny {
    margin-top: 15px;
  }
  .result-panel {
    padding: 4px 0;
  }
}

@media (min-width: 421px) and (max-width: 960px) {
  .stage {
    min-height: 560px;
  }
  .controls {
    max-width: 600px;
    justify-self: center;
  }
}
body{font-family:"Zen Maru Gothic","Hiragino Kaku Gothic ProN",Meiryo,sans-serif;line-height:1.7}
