:root {
  --team-green: #397a43;
  --team-purple: #73508c;
  --last-accent: #b86432;
  --last-dark: #493f36;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

button,
input {
  font-family: inherit;
  font-synthesis: none;
}

#titlePage .home-banner {
  width: 100%;
  margin-left: 0;
}

.team-intro h1,
.team-intro > p,
.role-guide {
  text-align: center;
}

.team-intro ol {
  width: min(650px, 100%);
  margin: 0 auto;
}

.team-meta {
  justify-content: center;
  margin: 22px 0 28px;
}

.team-notices {
  width: min(700px, 100%);
  margin: 0 auto;
}

.role-guide {
  margin: 34px 0 16px;
  font-weight: 800;
}

.role-select {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

@media (min-width: 651px) {
  .role-select::after {
    content: "•••";
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 4;
    display: grid;
    width: 54px;
    aspect-ratio: 1;
    place-items: center;
    border: 4px solid #fff;
    border-radius: 50%;
    background: #d9a847;
    box-shadow: 0 4px 0 #805e27, 0 8px 18px #38281742;
    color: #5a421f;
    font-weight: 900;
    letter-spacing: 2px;
    transform: translate(-50%, -50%);
  }
}

.role-card {
  display: block;
  overflow: hidden;
  border: 4px solid transparent;
  border-radius: 20px;
  box-shadow: 0 8px 18px #40281424;
  transition: transform .2s, box-shadow .2s;
}

.role-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px #40281435;
}

.role-card:focus-visible {
  outline: 4px solid #d8b36d;
  outline-offset: 3px;
}

.role-a { border-color: var(--team-green); }
.role-b { border-color: var(--team-purple); }
.role-card img { display: block; width: 100%; height: auto; }

.side-page { min-height: 100vh; }
.side-a { background: #e7f3e8; }
.side-b { background: #f0e8f5; }

.side-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 4px;
  font-weight: 800;
}

.side-header a { color: inherit; }
.side-header span { color: var(--muted); font-size: 13px; letter-spacing: .12em; }
.side-card { text-align: center; }
.side-card h1 { margin: 0; font-size: clamp(36px, 8vw, 64px); }
.side-kicker { margin-bottom: 0; color: var(--muted); font-weight: 800; }
.side-character { display: block; width: min(220px, 58vw); margin: 18px auto; }

.nasu-placeholder {
  display: grid;
  width: min(200px, 52vw);
  aspect-ratio: 1;
  place-items: center;
  margin: 18px auto;
  border: 8px solid #513668;
  border-radius: 48% 52% 45% 55%;
  background: var(--team-purple);
  color: #fff;
  text-shadow: 0 2px 5px #000, 0 0 2px #000;
  font-size: clamp(34px, 10vw, 58px);
  font-weight: 900;
}

.waiting-message {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 999px;
  background: #efe1c8;
  font-weight: 800;
}

.team-game { width: min(760px, calc(100% - 24px)); }

.q1-card { overflow: hidden; }

.letter-grid {
  display: grid;
  position: relative;
  width: min(100%, 600px);
  grid-template-columns: repeat(6, 1fr);
  margin: 22px auto 28px;
  border-top: 1px solid #9a9a9a;
  border-left: 1px solid #9a9a9a;
}

.letter-grid::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 3;
  width: 1px;
  background: #fffaf2;
  box-shadow: -1px 0 #9a9a9a, 1px 0 #9a9a9a;
  pointer-events: none;
}

.letter-cell {
  display: grid;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1;
  place-items: center;
  padding: 0;
  border-right: 1px solid #9a9a9a;
  border-bottom: 1px solid #9a9a9a;
  border-radius: 0;
  background: #fff;
  color: #111;
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  font-size: clamp(22px, 6vw, 38px);
  font-style: normal;
  font-weight: 600;
  line-height: 1;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

.letter-cell:hover { background: #eee; }
.letter-cell.is-black,
.letter-cell.is-black:hover { border-color: #111; background: #111; color: #111; }
.letter-cell:focus-visible { position: relative; z-index: 2; outline: 4px solid #d8b36d; outline-offset: -4px; }
.letter-cell.is-black:focus-visible { outline-color: #111; }

.image-lane {
  position: relative;
  width: min(100%, 500px);
  height: clamp(92px, 20vw, 150px);
  margin: 0 auto;
  overflow: hidden;
  border: 3px solid #222;
  background: #fff;
}

.image-lane [data-runner="0"] { z-index: 4; }
.image-lane [data-runner="1"] { z-index: 3; }
.image-lane [data-runner="2"] { z-index: 2; }
.image-lane [data-runner="3"] { z-index: 1; }

.image-lane img {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: clamp(68px, 15vw, 112px);
  height: clamp(68px, 15vw, 112px);
  margin: auto 0;
  object-fit: contain;
  opacity: 0;
  transform: translateX(110%);
}

.image-lane img.q2-runner {
  left: 100%;
  opacity: 0;
  animation: q2-runner-pass 6s linear infinite;
  animation-delay: calc(var(--runner-index) * 1.5s);
}

@keyframes q2-runner-pass {
  0% { left: 100%; opacity: 1; transform: rotate(0deg); }
  49.9% { left: -28%; opacity: 1; transform: rotate(360deg); }
  50%, 100% { left: -28%; opacity: 0; transform: rotate(360deg); }
}

.round-timer.q2-round-timer {
  display: grid;
  width: min(100%, 600px);
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 4px;
  margin: -12px auto 18px;
  text-align: center;
}

.round-timer.q2-round-timer span { width: 100%; min-width: 0; text-align: center; }

.q1-instruction {
  margin: 18px 0 14px;
  text-align: center;
  color: #111;
  font-size: clamp(24px, 6vw, 38px);
  font-weight: 900;
  line-height: 1.4;
  letter-spacing: .06em;
}

.side-b .q1-instruction {
  color: #fff;
  font-weight: 700;
  -webkit-text-stroke: 1px #111;
  paint-order: stroke fill;
  text-shadow: none;
}


.lane-fullscreen-button,
.lane-fullscreen-close {
  display: none;
}

@media (hover: none) and (pointer: coarse) {
  .lane-fullscreen-button {
    display: block;
    margin: 10px auto 0;
    padding: 10px 22px;
    border: 2px solid #111;
    border-radius: 999px;
    background: #fff;
    color: #111;
    font-weight: 800;
  }

  .image-lane.is-mobile-expanded,
  .image-lane:fullscreen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    width: 100vw;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    border: 0;
    background: #fff;
  }

  @media (orientation: portrait) {
    .image-lane.is-mobile-expanded:not(:fullscreen) {
      top: 50%;
      left: 50%;
      inset: auto;
      width: 100vh;
      width: 100dvh;
      height: 100vw;
      transform: translate(-50%, -50%) rotate(90deg);
    }
  }

  .image-lane.is-mobile-expanded .lane-fullscreen-close,
  .image-lane:fullscreen .lane-fullscreen-close {
    display: grid;
    position: absolute;
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    z-index: 20;
    width: 46px;
    height: 46px;
    padding: 0;
    place-items: center;
    border: 2px solid #111;
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    color: #111;
    font-size: 30px;
    line-height: 1;
  }

  .image-lane.is-mobile-expanded img,
  .image-lane:fullscreen img {
    width: clamp(90px, 18vh, 160px);
    height: clamp(90px, 18vh, 160px);
  }

}

@media (prefers-reduced-motion: reduce) {
  .image-lane::after {
    content: "この謎では画像が動きます";
    position: absolute;
    inset: auto 0 0;
    padding: 2px 8px;
    background: #fff9;
    color: #555;
    font-size: 12px;
    text-align: center;
  }
}

.team-pager { margin: 18px 0; }
#questionSteps { display: flex; gap: 9px; }

.coop-maze-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.partner-maze-image {
  display: block;
  width: 100%;
  height: auto;
  border: 0;
}

.zoom-image-button {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: zoom-in;
}

.maze-controller {
  display: grid;
  width: min(320px, 92vw);
  aspect-ratio: 1;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  place-items: center;
  margin: 0 auto;
  border: 6px solid var(--team-green);
  background: #fff;
}

.maze-controller button {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #111;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.direction-triangle {
  display: block;
  width: 0;
  height: 0;
  border-right: clamp(30px, 9vw, 42px) solid transparent;
  border-bottom: clamp(46px, 13vw, 62px) solid #111;
  border-left: clamp(30px, 9vw, 42px) solid transparent;
  transform-origin: 50% 60%;
  pointer-events: none;
  transition: border-bottom-color 80ms ease;
}

.maze-controller button:active .direction-triangle {
  border-bottom-color: #b8b8b8;
}

.maze-controller [data-move="right"] .direction-triangle { transform: rotate(90deg); }
.maze-controller [data-move="down"] .direction-triangle { transform: rotate(180deg); }
.maze-controller [data-move="left"] .direction-triangle { transform: rotate(-90deg); }

.maze-controller [data-move="up"] { grid-column: 2; grid-row: 1; }
.maze-controller [data-move="left"] { grid-column: 1; grid-row: 2; }
.controller-player { grid-column: 2; grid-row: 2; width: clamp(44px, 12vw, 58px); aspect-ratio: 1; object-fit: contain; }
.maze-controller [data-move="right"] { grid-column: 3; grid-row: 2; }
.maze-controller [data-move="down"] { grid-column: 2; grid-row: 3; }

.route-guide {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(4px, 1.5vw, 12px);
  width: min(100%, 680px);
  margin: 28px auto 14px;
}

.route-node {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: zoom-in;
}

.route-node:not(:last-child)::after {
  content: "→";
  position: absolute;
  left: calc(100% + 1px);
  top: 50%;
  transform: translateY(-50%);
  color: #333;
  font-size: clamp(18px, 4vw, 28px);
  font-weight: 900;
}

.route-node img { display: block; width: 100%; height: 100%; object-fit: contain; }

.route-text {
  min-height: 62px;
  padding: 8px 14px;
  border: 3px solid var(--team-green);
  background: #fff;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: .15em;
  text-align: center;
  word-break: break-all;
}

.q2-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.q2-actions #mazeResetButton { background: #e3e3e3; color: #333; }
.q2-actions #mazeAnswerButton { background: #9dcc65; }

.side-b .maze-controller,
.side-b .route-text {
  border-color: var(--team-purple);
}

.side-b .q2-actions #mazeAnswerButton {
  background: var(--team-purple);
  color: #fff;
}

.side-b #q2AnswerCard .answerrow input {
  border-color: var(--team-purple);
}

.side-b #q2AnswerCard .answerrow button {
  background: var(--team-purple);
  color: #fff;
}

@media (max-width: 700px) {
  .coop-maze-layout { grid-template-columns: 1fr; }
  .partner-maze-image { width: min(100%, 430px); margin: 0 auto; }
  .maze-controller { border-width: 3px; }
  .route-text { border-width: 2px; }
}

@media (hover: none) and (pointer: coarse) {
  .viewer.is-mobile-expanded,
  .viewer:fullscreen {
    position: fixed;
    inset: 0;
    z-index: 1600;
    display: flex;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    overflow: auto;
    align-items: center;
    justify-content: center;
    background: #111;
    box-sizing: border-box;
  }

  .viewer.is-mobile-expanded img,
  .viewer:fullscreen img {
    display: block;
    width: auto;
    max-width: calc(100% - 20px);
    height: auto;
    max-height: calc(100% - 20px);
    margin: auto;
    object-fit: contain;
  }

  .viewer.is-mobile-expanded .close,
  .viewer:fullscreen .close {
    position: absolute;
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    z-index: 2;
  }

  @media (orientation: portrait) {
    .viewer.is-mobile-expanded:not(:fullscreen) {
      top: 50%;
      left: 50%;
      inset: auto;
      width: 100vh;
      width: 100dvh;
      height: 100vw;
      transform: translate(-50%, -50%) rotate(90deg);
    }
  }
}

.zodiac-stage {
  position: relative;
  width: 100%;
  height: clamp(320px, 58vw, 460px);
  margin-top: 18px;
  overflow: hidden;
  border: 4px solid var(--last-accent);
  background: #fff1cf;
}

.zodiac-sprite {
  position: absolute;
  top: 0;
  left: 0;
  height: auto;
  pointer-events: none;
  user-select: none;
  will-change: transform;
}

.q1-moving-sprite {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  user-select: none;
  will-change: transform;
}

.q1-emoji-sprite {
  line-height: 1;
  filter: drop-shadow(0 2px 1px #fff) drop-shadow(0 0 2px #fff);
}

.q1-stage-prompt {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 1;
  width: max-content;
  max-width: calc(100% - 100px);
  margin: 0;
  padding: 0;
  transform: translateX(-50%);
  border: 0;
  background: transparent;
  color: #241e19;
  font-size: clamp(1.25rem, 5vw, 2rem);
  font-weight: 900;
  text-align: center;
}

.q1-stage-status {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  background: #332b25;
  color: #fff;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.q1-stage-meta {
  display: flex;
  justify-content: flex-end;
  margin: 6px 0 -10px;
}

.q1-stage-answer { margin-top: 18px; }
.q1-stage-answer .resetarea { margin-top: 16px; }
.q1-stage-answer .ng.is-correct { color: #28743b; }

.final-puzzle-card {
  overflow: hidden;
}

.spot-difference-label {
  margin: 4px 0 18px;
  font-size: clamp(2rem, 7vw, 3.5rem);
  font-weight: 900;
  letter-spacing: .2em;
  text-align: center;
}

.spot-difference-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  width: var(--snapped-grid-width, min(100%, 680px));
  margin: 0 auto;
  padding: 1px;
  background: #000;
}

.spot-difference-view {
  position: relative;
}

.spot-fullscreen-button {
  display: block;
  margin: 14px auto 0;
  padding: 10px 24px;
  border: 2px solid #111;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-weight: 800;
}

.final-length-hint {
  min-height: 1.5em;
  margin: 14px 0 0;
  color: #332b25;
  font-size: clamp(1.15rem, 4vw, 1.45rem);
  font-weight: 900;
  letter-spacing: .08em;
  text-align: center;
}

.spot-fullscreen-close {
  display: none;
}

.spot-difference-view.is-expanded,
.spot-difference-view:fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: max(48px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  place-items: center;
  box-sizing: border-box;
  background: #111;
}

@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
  .spot-difference-view.is-expanded:not(:fullscreen) {
    top: 50%;
    left: 50%;
    inset: auto;
    width: 100vh;
    width: 100dvh;
    height: 100vw;
    transform: translate(-50%, -50%) rotate(90deg);
  }
}

.spot-difference-view.is-expanded .spot-difference-grid,
.spot-difference-view:fullscreen .spot-difference-grid {
  width: min(calc(100vw - 24px), calc((100vh - 60px) * 4 / 3));
  max-width: none;
}

.spot-difference-view.is-expanded .spot-fullscreen-close,
.spot-difference-view:fullscreen .spot-fullscreen-close {
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  right: max(8px, env(safe-area-inset-right));
  z-index: 2;
  display: grid;
  width: 40px;
  height: 40px;
  min-height: 0;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  place-items: center;
  background: #111;
  color: #fff;
  font-size: 25px;
  line-height: 1;
}

.spot-tile {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
}

.spot-tile::after {
  content: none;
}

.spot-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flip-card-grid {
  gap: 1px;
}

.flip-card {
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  perspective: 800px;
  cursor: pointer;
}

.flip-card-inner {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: 0;
  transform-style: preserve-3d;
  transition: transform .46s cubic-bezier(.2, .72, .2, 1);
}

.flip-card.is-flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-face {
  position: absolute;
  inset: 0;
  display: grid;
  overflow: hidden;
  border-radius: 0;
  place-items: center;
  backface-visibility: hidden;
}

.flip-card-front {
  background: #fffaf2;
}

.flip-card-back {
  border: 0;
  background: #fffaf2;
  color: #111;
  font-size: clamp(2rem, 9vw, 4.5rem);
  font-weight: 900;
  text-shadow: none;
  transform: rotateY(180deg);
}

.flip-card:focus-visible {
  outline: 4px solid #f28c28;
  outline-offset: 3px;
}

.spot-difference-rows {
  display: grid;
  width: min(100%, 820px);
  margin: 0 auto;
}

.spot-code-row {
  display: grid;
  grid-template-columns: clamp(54px, 14vw, 96px) minmax(0, 1fr);
  align-items: center;
}

.spot-source-circle {
  display: block;
  width: auto;
  height: auto;
  margin: auto;
}

.spot-source-circle.source-q1 {
  width: clamp(58px, 9vw, 68px);
}

.spot-source-circle.source-q2 {
  width: clamp(38px, 6vw, 44px);
}

.spot-source-circle.source-q3 {
  width: clamp(30px, 5vw, 36px);
}

.spot-code-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  padding: 1px 1px 0;
  background: #000;
  width: var(--snapped-grid-width, 100%);
  box-sizing: border-box;
  justify-self: center;
}

.spot-code-row:last-child .spot-code-grid {
  padding-bottom: 1px;
}

.spot-difference-view.is-expanded .spot-difference-rows,
.spot-difference-view:fullscreen .spot-difference-rows {
  width: min(calc(100vw - 24px), calc((100vh - 60px) * 4 / 3));
  max-width: none;
}

.spot-difference-view.is-expanded .spot-code-row,
.spot-difference-view:fullscreen .spot-code-row {
  grid-template-columns: minmax(0, 1fr);
}

.spot-difference-view.is-expanded .spot-source-circle,
.spot-difference-view:fullscreen .spot-source-circle {
  display: none;
}

.round-timer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin: 10px 0 22px;
  font-weight: 900;
  color: var(--last-accent);
}

.round-timer progress {
  width: 100%;
  height: 22px;
  accent-color: var(--last-accent);
}

.round-timer span { min-width: 82px; font-variant-numeric: tabular-nums; }

.kana-key {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  overflow: hidden;
  border: 3px solid var(--last-dark);
  background: #fff;
}

.kana-pair {
  display: grid;
  grid-template-rows: repeat(2, minmax(42px, auto));
  min-width: 0;
  border-right: 1px solid #aaa;
}

.kana-pair:last-child { border-right: 0; }
.kana-key span {
  display: grid;
  min-width: 0;
  min-height: 42px;
  place-items: center;
  font-size: clamp(12px, 2.8vw, 18px);
  font-weight: 900;
}
.kana-pair span:first-child { border-bottom: 2px solid #333; }

.last-targets {
  display: flex;
  justify-content: center;
  gap: clamp(24px, 8vw, 70px);
  margin: 26px 0 22px;
}

.last-target {
  position: relative;
  display: grid;
  width: clamp(110px, 25vw, 170px);
  aspect-ratio: 1;
  place-items: center;
  border: 4px solid var(--last-accent);
  border-radius: 18px;
  background: #fff;
}

.last-target img { width: 88%; height: 88%; object-fit: contain; }
.last-target span {
  position: absolute;
  top: -14px;
  left: -14px;
  z-index: 2;
  display: grid;
  width: 40px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: var(--last-accent);
  color: #fff;
  font-weight: 900;
}

@media (max-width: 560px) {
  .zodiac-stage { height: 390px; }
  .kana-key {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(6, auto);
    grid-auto-flow: column;
  }
  .kana-pair {
    grid-template-columns: 52px minmax(0, 1fr);
    grid-template-rows: 1fr;
    border-right: 1px solid #aaa;
    border-bottom: 1px solid #aaa;
  }
  .kana-pair:nth-child(6),
  .kana-pair:nth-child(12) { border-bottom: 0; }
  .kana-pair:nth-child(n + 7) { border-right: 0; }
  .kana-pair span:first-child {
    border-right: 2px solid #333;
    border-bottom: 0;
  }
}

@media (max-width: 650px) {
  .role-select { grid-template-columns: 1fr; }
  .side-header { align-items: flex-start; flex-direction: column; }
}

/* ===== TEAM1 WORLD DESIGN ===== */
.team-title-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 15%, #d8f26e 0 3px, transparent 4px),
    radial-gradient(circle at 88% 18%, #dda9f4 0 4px, transparent 5px),
    linear-gradient(110deg, #e8f6c8 0 44%, #fff8e9 44% 56%, #f0dbf5 56% 100%);
  background-size: 46px 46px, 58px 58px, auto;
  color: #29251f;
}

.team-title-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 47%, #fff9 50%, transparent 53%);
}

#titlePage { position: relative; }

#titlePage .home-banner {
  border-bottom: 3px solid #f4c642;
  background: linear-gradient(90deg, var(--team-green), #65a72f 48%, var(--team-purple));
  box-shadow: 0 8px 24px #553d6a3d;
  letter-spacing: .08em;
}

#titlePage .hero-card {
  border: 5px solid #fff;
  border-radius: 24px;
  box-shadow: 0 18px 38px #5a3f6a42, 0 0 0 3px #e3bd3d;
}

#titlePage .hero-card::after {
  content: "ふたりで挑戦！";
  position: absolute;
  right: 14px;
  bottom: 12px;
  padding: 4px 10px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--team-green), var(--team-purple));
  color: #fff;
  font: 900 13px/1.4 system-ui, "Yu Gothic", sans-serif;
  letter-spacing: .08em;
}

#titlePage .hero-card { position: relative; }

#titlePage .team-intro {
  position: relative;
  overflow: hidden;
  border: 4px solid #fff;
  border-radius: 24px;
  background:
    linear-gradient(90deg, var(--team-green) 0 50%, var(--team-purple) 50%) top/100% 7px no-repeat,
    linear-gradient(#fffaf2f7, #f4ecdef7);
  box-shadow: 0 18px 42px #5a3f6a35, 0 0 0 2px #d7c7aa;
}

#titlePage .team-intro::after {
  content: "TEAM PLAY / 2 PLAYERS";
  position: absolute;
  top: 18px;
  right: 20px;
  color: #796c5c;
  font: 800 10px/1 ui-monospace, Consolas, monospace;
  letter-spacing: .14em;
}

.world-kicker {
  margin: 9px 0 4px;
  color: var(--team-purple);
  font: 800 12px/1.4 ui-monospace, Consolas, monospace;
  letter-spacing: .2em;
}

.team-intro h1 {
  max-width: 850px;
  margin: 8px auto 14px;
  font-size: clamp(27px, 5vw, 46px);
  line-height: 1.35;
  letter-spacing: .04em;
}

.mission-copy {
  width: min(760px, 100%);
  margin: 0 auto 22px;
  padding: 16px 18px;
  border: 2px dashed #c2ac85;
  border-radius: 14px;
  background: #fffdf7b8;
  font-weight: 700;
}

.team-intro h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
  font-size: 20px;
  letter-spacing: .14em;
}

.team-intro h2::before,
.team-intro h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #b8a98f;
}

.team-intro ol {
  counter-reset: mission-step;
  display: grid;
  gap: 10px;
  padding: 0;
  list-style: none;
}

.team-intro ol li {
  counter-increment: mission-step;
  position: relative;
  min-height: 46px;
  padding: 9px 14px 9px 58px;
  border: 1px solid #d6c6a9;
  border-radius: 12px;
  background: #fffdf8;
}

.team-intro ol li::before {
  content: counter(mission-step);
  position: absolute;
  top: 50%;
  left: 12px;
  display: grid;
  width: 32px;
  aspect-ratio: 1;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--team-green), var(--team-purple));
  box-shadow: 0 0 0 1px #bda77d;
  color: #fff;
  font-weight: 900;
  transform: translateY(-50%);
}

.team-notices {
  padding: 16px 18px 16px 40px;
  border: 2px solid #dfbd47;
  border-radius: 14px;
  background: #fff6c9;
}

.team-meta span {
  border: 2px solid #dfbd47;
  border-radius: 999px;
  background: #fff4bd;
  font-weight: 800;
}

.role-guide {
  padding-top: 22px;
  border-top: 1px dashed #b8a98f;
  letter-spacing: .06em;
}

.role-card {
  position: relative;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 12px 28px #241d1640;
}

.role-card::before {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 4px 9px;
  border-radius: 3px;
  color: #fff;
  font: 900 11px/1.4 ui-monospace, Consolas, monospace;
  letter-spacing: .16em;
}

.role-a::before { content: "SIDE A / NEGI"; background: var(--team-green); }
.role-b::before { content: "SIDE B / NASU"; background: var(--team-purple); }

.side-page {
  --side-accent: var(--team-green);
  --side-accent-rgb: 57, 122, 67;
  background:
    radial-gradient(circle at 18px 18px, rgba(var(--side-accent-rgb), .13) 0 4px, transparent 5px),
    linear-gradient(#ffffff80, #ffffff80),
    #e7f0e8;
  background-size: 52px 52px, auto, auto;
}

.side-page::before,
.side-page::after {
  content: "";
  position: fixed;
  z-index: -1;
  width: 150px;
  aspect-ratio: 1;
  border: 22px solid rgba(var(--side-accent-rgb), .10);
  pointer-events: none;
  transform: rotate(18deg);
}

.side-page::before { top: 12%; left: -72px; border-radius: 28px; }
.side-page::after { right: -78px; bottom: 8%; border-radius: 50%; }

.side-b {
  --side-accent: var(--team-purple);
  --side-accent-rgb: 115, 80, 140;
  background-color: #efe8f3;
}

.team-game { position: relative; }

.side-header {
  position: relative;
  margin: 0 0 18px;
  padding: 12px 16px 12px 20px;
  overflow: hidden;
  border: 3px solid #fff;
  border-radius: 18px;
  background: rgba(255, 250, 242, .94);
  box-shadow: 0 10px 24px rgba(var(--side-accent-rgb), .22);
  color: var(--side-accent);
}

.side-header::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: var(--side-accent);
}

.side-header span { color: var(--side-accent); font-family: ui-monospace, Consolas, monospace; }

.game-question,
.team-game > .answer {
  border: 3px solid #fff;
  border-top: 8px solid var(--side-accent);
  border-radius: 22px;
  background:
    radial-gradient(circle at 14px 14px, #d5c8b5 0 3px, transparent 4px),
    radial-gradient(circle at calc(100% - 14px) 14px, #d5c8b5 0 3px, transparent 4px),
    radial-gradient(circle at 14px calc(100% - 14px), #d5c8b5 0 3px, transparent 4px),
    radial-gradient(circle at calc(100% - 14px) calc(100% - 14px), #d5c8b5 0 3px, transparent 4px),
    #fffaf2f7;
  box-shadow: 0 14px 32px rgba(var(--side-accent-rgb), .20), 0 0 0 1px #cfc4b3;
}

.question-header {
  min-height: 54px;
  margin: -8px -6px 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #cfc4b3;
}

.question-header::before {
  content: "PUZZLE START!";
  position: absolute;
  left: 0;
  bottom: -7px;
  padding-right: 8px;
  background: #fffaf2;
  color: #8c7d6a;
  font: 800 9px/1.4 ui-monospace, Consolas, monospace;
  letter-spacing: .16em;
}

.question-header .qlabel {
  color: var(--side-accent);
  font-size: clamp(30px, 7vw, 44px);
  line-height: 1;
  letter-spacing: .08em;
}

.question-number-image {
  display: block;
  width: auto;
  object-fit: contain;
}

.side-a #question1 .question-number-image {
  height: clamp(38px, 6vw, 44px);
}

.side-a #question2 .question-number-image {
  height: clamp(30px, 5vw, 36px);
}

.side-a #questionLast .question-number-image {
  height: clamp(58px, 9vw, 68px);
}

.last-card .question-header .qlabel { color: var(--side-accent); }

.notice-link {
  border: 1px solid #a89b88;
  border-radius: 999px;
  background: transparent;
  color: #5f5548;
  font-weight: 800;
}

.thinking-image {
  display: block;
  width: min(260px, 72vw);
  height: auto;
  margin: 18px auto;
  border: 5px solid #fff;
  border-radius: 20px;
  box-shadow: 0 8px 20px rgba(var(--side-accent-rgb), .35), 0 0 0 3px #f2c94c;
  object-fit: contain;
}

.letter-grid,
.image-lane,
.maze-controller,
.route-text,
.zodiac-stage,
.kana-key {
  box-shadow: 0 8px 20px #35291d1d, inset 0 0 0 1px #ffffff80;
}

.team-pager {
  width: fit-content;
  margin: 22px auto;
  padding: 8px 12px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: rgba(255, 250, 242, .94);
  box-shadow: 0 8px 22px rgba(var(--side-accent-rgb), .22);
}

.team-pager button { min-height: 38px; }

#questionSteps .dot {
  border-color: var(--side-accent);
  background: #fff;
  box-shadow: inset 0 -3px 0 #0002;
}

#questionSteps .dot.current {
  background: var(--side-accent);
  box-shadow: 0 0 0 3px #fff, 0 0 14px rgba(var(--side-accent-rgb), .75);
}

.team-game > .answer h2 {
  margin-top: 0;
  color: var(--side-accent);
  font-size: 20px;
  letter-spacing: .18em;
}

#lastAnswerCard h2 { color: var(--side-accent); }

.team-game > .answer .answerrow input {
  border-width: 2px;
  border-color: var(--side-accent);
  background: #fffefb;
}

.team-game > .answer .answerrow button {
  background: var(--side-accent);
  color: #fff;
}

#lastAnswerCard .answerrow input { border-color: var(--side-accent); }
#lastAnswerCard .answerrow button { background: var(--side-accent); }

.submitted {
  border: 1px solid #c7b99e;
  border-radius: 4px;
  background: #eee3d0;
}

.modalbox:has(.clear) {
  overflow: hidden;
  border: 5px solid #fff;
  background:
    radial-gradient(circle at 12px 12px, #ffd64a 0 3px, transparent 4px) 0 0/38px 38px,
    linear-gradient(110deg, #e8f6c8 0 47%, #fff8e9 47% 53%, #f0dbf5 53%);
  box-shadow: 0 0 0 3px #e3bd3d, 0 24px 70px #0009;
}

.start-confirm-dialog {
  width: min(calc(100% - 32px), 480px);
  padding: clamp(24px, 6vw, 38px);
  border: 3px solid #2b241c;
  border-radius: 18px;
  box-sizing: border-box;
  background: #fffaf2;
  color: #2b241c;
  text-align: center;
  box-shadow: 0 18px 55px rgba(24, 18, 10, .35);
}

.start-confirm-dialog::backdrop {
  background: rgba(20, 17, 13, .68);
  backdrop-filter: blur(3px);
}

.start-confirm-dialog h2 {
  margin-top: 0;
}

.start-confirm-character {
  display: block;
  width: clamp(130px, 38vw, 180px);
  aspect-ratio: 1;
  margin: 0 auto 14px;
  object-fit: contain;
}

.start-confirm-dialog p {
  white-space: pre-line;
}

.start-confirm-dialog .start-confirm-note {
  color: #675c4b;
  font-size: .92rem;
}

.start-confirm-dialog .modalactions {
  justify-content: center;
}

.clear h1 {
  margin: 0;
  color: #f2ad18;
  font-size: clamp(48px, 12vw, 82px);
  line-height: 1;
  letter-spacing: .08em;
  -webkit-text-stroke: 2px #4a2c12;
  paint-order: stroke fill;
  text-shadow: 0 5px 0 #7d4514, 0 9px 18px #3e281b42;
}

.clear h2 {
  margin: 12px 0 18px;
  color: var(--team-purple);
  font-size: clamp(26px, 7vw, 40px);
  text-shadow: 2px 2px 0 #fff;
}

.clearimg {
  border: 5px solid #fff;
  border-radius: 20px;
  box-shadow: 0 12px 28px #4c35524a, 0 0 0 2px #e3bd3d;
}

.clear .tweet {
  background: linear-gradient(90deg, var(--team-green), var(--team-purple));
  box-shadow: 0 6px 14px #553d6a42;
}

@media (max-width: 650px) {
  #titlePage .team-intro::after { display: none; }
  .world-kicker { font-size: 10px; letter-spacing: .12em; }
  .team-intro h1 { font-size: 28px; }
  .side-header { align-items: stretch; }
  .side-header span { text-align: right; }
  .game-question,
  .team-game > .answer { padding: 18px 14px; }
  .question-header { margin-inline: 0; }
  .team-game { width: calc(100% - 12px); }
  .team-pager { max-width: calc(100vw - 16px); }
  .answerrow input { min-width: 0; font-size: 16px; }
  .answerrow button,
  .notice-link,
  .progress-reset-button { min-height: 44px; }
  .route-guide { gap: 5px; }
  .route-node { border-radius: 3px; }
  .route-node:not(:last-child)::after { left: calc(100% - 1px); font-size: 17px; }
  .modalbox { padding: 24px 18px; }
  .question-header .qlabel { font-weight: 800; font-synthesis: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .game-question:not(.hidden),
  .team-game > .answer:not(.hidden) {
    animation: panel-enter .28s ease-out both;
  }

  #questionSteps .dot.current { animation: lamp-pulse 1.8s ease-in-out infinite; }
}

@keyframes panel-enter {
  from { opacity: 0; transform: translateY(8px) scale(.995); }
  to { opacity: 1; transform: none; }
}

@keyframes lamp-pulse {
  50% { box-shadow: 0 0 0 3px #fff, 0 0 22px rgba(var(--side-accent-rgb), .95); }
}
