:root {
  --bg: #061827;
  --panel: rgba(7, 28, 45, 0.86);
  --panel-strong: rgba(4, 20, 34, 0.94);
  --panel-soft: rgba(230, 249, 255, 0.94);
  --text: #f4fbff;
  --ink: #061827;
  --muted: #9fc2cf;
  --line: rgba(107, 190, 226, 0.45);
  --line-strong: #58c9f2;
  --lime: #d7f51d;
  --lime-dark: #91b915;
  --blue: #1f92cc;
  --teal: #2dd4bf;
  --red: #e45428;
  --gold: #f2c85b;
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.7;
  background:
    radial-gradient(circle at 15% 8%, rgba(45, 212, 191, 0.16), transparent 28%),
    radial-gradient(circle at 86% 18%, rgba(228, 84, 40, 0.16), transparent 20%),
    linear-gradient(180deg, #020912 0%, #071b2a 52%, #061827 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(88, 201, 242, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 201, 242, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 82%);
}

button {
  font: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.app-shell {
  width: min(100%, 500px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 12px;
  display: grid;
  place-items: center;
}

.screen {
  position: relative;
  width: 100%;
  min-height: calc(100svh - 24px);
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.screen::after {
  position: absolute;
  inset: 10px;
  z-index: 0;
  pointer-events: none;
  content: "";
  border: 1px solid rgba(88, 201, 242, 0.22);
  border-radius: 20px;
}

.is-hidden {
  display: none;
}

.screen.is-hidden {
  display: none;
}

.top-screen {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(2, 9, 18, 0.52) 0%, rgba(2, 9, 18, 0.12) 33%, rgba(2, 9, 18, 0.62) 62%, rgba(2, 9, 18, 0.98) 100%),
    url("images/hero-hiyayakko.png") center / cover;
}

.top-screen > * {
  position: relative;
  z-index: 1;
}

.status-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  padding: 8px;
  background: linear-gradient(135deg, rgba(4, 22, 36, 0.86), rgba(11, 45, 69, 0.72));
  border: 1px solid rgba(88, 201, 242, 0.34);
  border-radius: 16px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.screen-topbar {
  background:
    linear-gradient(135deg, rgba(9, 43, 68, 0.92), rgba(3, 18, 31, 0.9));
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 8px 18px rgba(0, 0, 0, 0.22);
}

.status-chip {
  min-height: 70px;
  padding: 9px 8px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(232, 249, 255, 0.1), transparent 42%),
    rgba(3, 18, 31, 0.64);
  border: 1px solid rgba(88, 201, 242, 0.3);
  border-radius: 12px;
}

.status-chip span,
.status-chip small,
.screen-topbar span {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.25;
}

.status-chip strong {
  display: inline-block;
  margin-top: 4px;
  color: var(--lime);
  font-size: clamp(1.1rem, 5.2vw, 1.55rem);
  line-height: 1.05;
  text-shadow: 0 0 18px rgba(215, 245, 29, 0.35);
}

.hero-copy {
  margin: clamp(28px, 7svh, 68px) 0 20px;
}

.eyebrow {
  width: fit-content;
  margin: 0 0 10px;
  padding: 4px 10px;
  color: var(--lime);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  background: rgba(6, 24, 39, 0.74);
  border: 1px solid rgba(215, 245, 29, 0.36);
  border-radius: 999px;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(2.45rem, 13vw, 4.4rem);
  line-height: 1.03;
  letter-spacing: 0;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}

h1 span {
  display: block;
  color: var(--lime);
}

h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.55rem, 6vw, 2.25rem);
  line-height: 1.32;
  letter-spacing: 0;
}

.result-screen h2 {
  font-size: clamp(1.35rem, 5vw, 1.8rem);
}

.lead,
.result-caption {
  max-width: 34em;
  color: #d8edf4;
  font-size: 0.98rem;
  font-weight: 700;
}

.mission-console {
  margin-top: auto;
  padding: 12px;
  background: linear-gradient(180deg, rgba(6, 32, 52, 0.95), rgba(2, 13, 23, 0.96));
  border: 1px solid rgba(88, 201, 242, 0.56);
  border-radius: 8px;
  box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.34);
}

.mission-title {
  margin: 0 0 10px;
  padding: 8px 12px;
  color: var(--ink);
  font-size: clamp(0.98rem, 4.2vw, 1.15rem);
  font-weight: 900;
  text-align: center;
  background: linear-gradient(90deg, #f8ffff, #e9f7fb);
  border: 1px solid rgba(88, 201, 242, 0.5);
  border-radius: 999px;
}

.primary-button,
.secondary-button,
.answer-button,
.instant-button {
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.primary-button {
  width: 100%;
  padding: 15px 22px;
  color: #061827;
  font-size: 1.08rem;
  font-weight: 900;
  background: linear-gradient(180deg, #efff34 0%, var(--lime) 48%, #a9d712 100%);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: 0 14px 28px rgba(142, 190, 15, 0.28), inset 0 -4px 0 rgba(8, 42, 20, 0.2);
}

.secondary-button {
  padding: 14px 16px;
  color: #e7fbff;
  font-weight: 800;
  background: rgba(7, 42, 67, 0.9);
  border: 1px solid var(--line);
}

.instant-button {
  position: relative;
  width: 100%;
  margin-top: 12px;
  padding: 14px 18px 15px;
  overflow: hidden;
  color: #fff7ec;
  font-size: 1.04rem;
  font-weight: 900;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 34%),
    linear-gradient(180deg, #ef5b27 0%, #c73316 100%);
  border: 1px solid rgba(255, 213, 121, 0.78);
  box-shadow: 0 14px 30px rgba(210, 51, 22, 0.34), inset 0 -4px 0 rgba(70, 10, 4, 0.24);
}

.instant-button::after {
  position: absolute;
  top: 0;
  left: -42%;
  width: 32%;
  height: 100%;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.38), transparent);
  transform: skewX(-18deg);
}

.instant-button:hover::after {
  left: 118%;
  transition: left 0.42s ease;
}

.instant-button span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-right: 8px;
  padding: 2px 8px;
  color: #411004;
  font-size: 0.72rem;
  font-weight: 900;
  vertical-align: 0.12em;
  background: var(--gold);
  border-radius: 999px;
}

.primary-button:hover,
.secondary-button:hover,
.answer-button:hover,
.instant-button:hover {
  transform: translateY(-2px);
}

.primary-button:active,
.secondary-button:active,
.answer-button:active,
.instant-button:active,
.primary-button.is-pressing,
.secondary-button.is-pressing,
.answer-button.is-pressing,
.instant-button.is-pressing {
  transform: translateY(2px) scale(0.985);
  filter: brightness(1.08) saturate(1.1);
}

.answer-button.is-pressing {
  border-color: rgba(215, 245, 29, 0.86);
  box-shadow:
    inset 5px 0 0 var(--lime),
    0 0 0 2px rgba(215, 245, 29, 0.18),
    0 0 24px rgba(215, 245, 29, 0.2);
}

.primary-button.is-pressing,
.instant-button.is-pressing {
  box-shadow:
    0 8px 18px rgba(215, 245, 29, 0.24),
    inset 0 4px 10px rgba(0, 0, 0, 0.18);
}

.question-screen,
.result-screen {
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(9, 32, 51, 0.96), rgba(3, 14, 24, 0.98)),
    radial-gradient(circle at 20% 0%, rgba(45, 212, 191, 0.16), transparent 30%);
}

.question-screen > *,
.result-screen > * {
  position: relative;
  z-index: 1;
}

.screen-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  padding: 10px 12px;
  border-radius: 8px;
}

.screen-topbar strong {
  color: var(--lime);
  font-size: 0.8rem;
}

.progress-area {
  margin-bottom: 22px;
}

.question-count {
  margin: 0 0 8px;
  color: var(--lime);
  font-weight: 900;
}

.progress-bar {
  width: 100%;
  height: 12px;
  overflow: hidden;
  background: rgba(2, 12, 21, 0.82);
  border: 1px solid rgba(88, 201, 242, 0.35);
  border-radius: 999px;
}

.progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--lime), var(--teal));
  border-radius: inherit;
  box-shadow: 0 0 16px rgba(215, 245, 29, 0.38);
  transition: width 0.25s ease;
}

.answer-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.answer-button {
  width: 100%;
  padding: 15px 16px;
  color: #effbff;
  text-align: left;
  background: linear-gradient(135deg, rgba(9, 43, 68, 0.98), rgba(4, 19, 32, 0.96));
  border: 1px solid rgba(88, 201, 242, 0.42);
  box-shadow: inset 4px 0 0 rgba(215, 245, 29, 0.45);
}

.answer-button strong {
  display: block;
  font-size: 1.03rem;
  line-height: 1.4;
}

.answer-button span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
}

.mascot-stage {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 22px;
  padding: 13px;
  background:
    linear-gradient(135deg, rgba(215, 245, 29, 0.08), transparent 36%),
    rgba(2, 13, 23, 0.72);
  border: 1px solid rgba(88, 201, 242, 0.38);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.mascot-squad {
  position: relative;
  width: 118px;
  min-height: 72px;
}

.tofu-mascot {
  position: absolute;
  display: block;
  background: linear-gradient(145deg, #fffdf1 0%, #dff7ff 100%);
  border: 2px solid #072134;
  border-radius: 12px;
  box-shadow:
    0 8px 0 rgba(4, 18, 30, 0.78),
    0 0 0 2px rgba(88, 201, 242, 0.28);
}

.tofu-mascot::before,
.tofu-mascot::after {
  position: absolute;
  bottom: -10px;
  width: 12px;
  height: 10px;
  content: "";
  background: #d7f51d;
  border: 2px solid #072134;
  border-radius: 4px 4px 8px 8px;
}

.tofu-mascot::before {
  left: 10px;
}

.tofu-mascot::after {
  right: 10px;
}

.tofu-mascot-main {
  left: 24px;
  bottom: 9px;
  z-index: 2;
  width: 58px;
  height: 54px;
}

.tofu-mascot-dot {
  left: 0;
  bottom: 4px;
  width: 40px;
  height: 39px;
  border-radius: 4px;
  image-rendering: pixelated;
  transform: rotate(-8deg);
}

.tofu-mascot-mini {
  right: 0;
  bottom: 2px;
  width: 38px;
  height: 36px;
  transform: rotate(8deg);
}

.face {
  position: absolute;
  inset: 0;
}

.face::before {
  position: absolute;
  top: 18px;
  left: 13px;
  width: 8px;
  height: 8px;
  content: "";
  background: #071827;
  border-radius: 50%;
  box-shadow: 24px 0 0 #071827;
}

.face::after {
  position: absolute;
  left: 50%;
  bottom: 15px;
  width: 17px;
  height: 9px;
  content: "";
  border-bottom: 3px solid #e45428;
  border-radius: 0 0 999px 999px;
  transform: translateX(-50%);
}

.tofu-mascot-dot .face::before {
  top: 13px;
  left: 9px;
  width: 6px;
  height: 6px;
  border-radius: 0;
  box-shadow: 16px 0 0 #071827;
}

.tofu-mascot-dot .face::after {
  bottom: 10px;
  width: 12px;
  height: 5px;
  border-bottom-width: 3px;
}

.tofu-mascot-mini .face::before {
  top: 12px;
  left: 9px;
  width: 6px;
  height: 6px;
  box-shadow: 15px 0 0 #071827;
}

.tofu-mascot-mini .face::after {
  bottom: 10px;
  width: 12px;
}

.mascot-stage p {
  position: relative;
  margin: 0;
  padding: 11px 13px;
  color: #071827;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.55;
  background: #e8faff;
  border: 1px solid rgba(215, 245, 29, 0.62);
  border-radius: 8px;
}

.mascot-stage p::before {
  position: absolute;
  top: 22px;
  left: -8px;
  width: 14px;
  height: 14px;
  content: "";
  background: #e8faff;
  border-bottom: 1px solid rgba(215, 245, 29, 0.62);
  border-left: 1px solid rgba(215, 245, 29, 0.62);
  transform: rotate(45deg);
}

.result-list {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.recipe-card {
  color: #f5fbff;
  background: linear-gradient(180deg, rgba(12, 45, 69, 0.96), rgba(4, 19, 31, 0.98));
  border: 1px solid rgba(88, 201, 242, 0.45);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.24);
}

.rank-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 30px;
  padding: 4px 10px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 900;
  background: linear-gradient(180deg, #ffe482, var(--gold));
  border-radius: 999px;
}

.recipe-card h3 {
  margin: 12px 0 4px;
  color: #fff;
  font-size: 1.32rem;
  line-height: 1.35;
  letter-spacing: 0;
}

.recipe-catch {
  margin: 0 0 14px;
  color: #c8e7f0;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.meta-item {
  min-height: 64px;
  padding: 8px;
  background: rgba(229, 248, 255, 0.95);
  border-radius: 8px;
}

.meta-item span {
  display: block;
  color: #4a6a76;
  font-size: 0.76rem;
  font-weight: 800;
}

.meta-item strong {
  display: block;
  color: var(--ink);
  font-size: 0.95rem;
}

.recipe-section {
  margin-top: 12px;
}

.recipe-section h4 {
  margin: 0 0 4px;
  color: var(--lime);
  font-size: 0.9rem;
}

.recipe-section p,
.recipe-section ol {
  margin: 0;
  color: #eaf8fb;
}

.recipe-section ol {
  padding-left: 1.3em;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag-row span {
  padding: 3px 8px;
  color: #071827;
  font-size: 0.76rem;
  font-weight: 800;
  background: #dff7ff;
  border-radius: 999px;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}

@media (max-width: 420px) {
  .app-shell {
    padding: 0;
  }

  .screen {
    min-height: 100svh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .screen::after {
    inset: 8px;
    border-radius: 0;
  }

  .top-screen,
  .question-screen,
  .result-screen {
    padding: 14px;
  }

  .status-row {
    gap: 6px;
  }

  .status-chip {
    min-height: 66px;
    padding: 7px;
  }

  .mascot-stage {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mascot-squad {
    width: 126px;
    margin: 0 auto;
  }

  .mascot-stage p::before {
    top: -7px;
    left: 50%;
    transform: translateX(-50%) rotate(135deg);
  }

  .result-actions {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 760px) {
  .app-shell {
    width: min(100%, 560px);
    padding: 24px;
  }

  .screen {
    min-height: min(920px, calc(100vh - 48px));
  }
}
