:root {
  color-scheme: light;
  --ink: #181713;
  --muted: #68645d;
  --line: #dedede;
  --paper: #f7f7f7;
  --panel: #ffffff;
  --accent: #a9542b;
  --accent-ink: #fffaf5;
  --red: #b4453d;
  --gold: #c69518;
  --green: #28704e;
  --shadow: 0 22px 70px rgba(24, 23, 19, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  font-family:
    ui-serif, Georgia, "Times New Roman", "Songti SC", "Noto Serif CJK SC",
    serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), transparent 48%),
    #f2f3f2;
}

.privacy-page {
  overflow: auto;
}

.privacy-document {
  width: min(820px, calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0;
}

.privacy-document h1 {
  max-width: none;
  margin-bottom: 32px;
  font-size: clamp(2.5rem, 7vw, 5rem);
}

.privacy-document h2 {
  margin-top: 34px;
  font-size: clamp(1.35rem, 3vw, 2.1rem);
}

.privacy-document p {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.75;
}

button,
.eyebrow,
.paper-label,
.reel,
.direction-bubble,
.selected-direction {
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

button {
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

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

#confetti {
  position: fixed;
  inset: 0;
  z-index: 5;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  height: 100vh;
  margin: 0 auto;
  padding: 42px 0;
  position: relative;
}

.workspace,
.slot-section,
.game-section {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.view {
  position: absolute;
  inset: 42px 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(38px) scale(0.985);
  transition:
    opacity 420ms ease,
    transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.view.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

.view.leaving-left {
  transform: translateX(-38px) scale(0.985);
}

.view.leaving-right {
  transform: translateX(38px) scale(0.985);
}

.workspace {
  min-height: calc(100vh - 84px);
  display: grid;
  align-content: center;
  gap: 32px;
  padding: clamp(22px, 5vw, 58px);
}

.start-view {
  align-content: center;
}

.direction-view {
  align-content: stretch;
  padding: clamp(16px, 3vw, 34px);
}

.idea-view {
  align-content: center;
}

.intro {
  display: grid;
  max-width: 820px;
  align-items: center;
  gap: 30px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
  font-weight: 520;
}

h1 {
  max-width: 9em;
  font-size: clamp(2.6rem, 8vw, 6.7rem);
}

h2 {
  font-size: clamp(1.9rem, 4vw, 3.4rem);
}

.lead-text {
  max-width: 34rem;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.28rem);
  font-weight: 430;
  line-height: 1.6;
}

.privacy-consent {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.95rem;
  line-height: 1.5;
}

.privacy-consent input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.privacy-consent a {
  color: var(--accent);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.page-heading {
  display: grid;
  gap: 8px;
}

.selected-direction {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 650;
}

.bubble-field {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(
      circle at var(--mouse-x, 16%) var(--mouse-y, 20%),
      rgba(169, 84, 43, 0.14),
      transparent 28%
    ),
    radial-gradient(
      circle at calc(100% - var(--mouse-x, 16%)) calc(100% - var(--mouse-y, 20%)),
      rgba(24, 23, 19, 0.06),
      transparent 30%
    ),
    rgba(255, 255, 255, 0.58);
}

.direction-bubble {
  position: absolute;
  left: 0;
  top: 0;
  width: 166px;
  height: 166px;
  padding: 0 20px;
  border: 1px solid rgba(24, 23, 19, 0.13);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  box-shadow: 0 14px 28px rgba(24, 23, 19, 0.08);
  font-size: 1.18rem;
  font-weight: 740;
  line-height: 1.16;
  white-space: normal;
  transform: translate(var(--x, 0), var(--y, 0)) scale(var(--scale, 1));
  transform-origin: center;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
  will-change: transform;
  touch-action: manipulation;
  opacity: 0;
  filter: blur(18px);
}

.direction-bubble.entering {
  animation: bubble-materialize 720ms ease both;
  animation-delay: var(--enter-delay, 0ms);
}

.direction-bubble.entered {
  opacity: 1;
  filter: blur(0);
}

.direction-bubble::after {
  content: "Click again";
  position: absolute;
  right: 0;
  bottom: 22px;
  left: 0;
  color: rgba(255, 250, 245, 0.74);
  font-size: 0.72rem;
  font-weight: 720;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.direction-bubble:hover,
.direction-bubble:focus-visible {
  border-color: rgba(169, 84, 43, 0.44);
  background: #fffaf5;
  outline: none;
  box-shadow:
    0 18px 34px rgba(24, 23, 19, 0.11),
    0 0 0 4px rgba(169, 84, 43, 0.1);
}

.direction-bubble.selected {
  border-color: transparent;
  background:
    linear-gradient(145deg, rgba(169, 84, 43, 0.98), rgba(24, 23, 19, 0.92));
  color: #fffaf5;
  box-shadow:
    0 22px 42px rgba(24, 23, 19, 0.18),
    0 0 0 5px rgba(169, 84, 43, 0.13);
  animation: selected-bubble-pop 460ms cubic-bezier(0.16, 1, 0.3, 1);
}

.direction-bubble.deselecting {
  animation: deselect-bubble-settle 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.direction-bubble.selected::after {
  opacity: 1;
  transform: translateY(0);
}

.bubble-field .direction-bubble:hover,
.bubble-field .direction-bubble:focus-visible {
  transform: translate(var(--x, 0), var(--y, 0)) scale(var(--scale, 1));
}

@keyframes bubble-materialize {
  0% {
    opacity: 0;
    filter: blur(18px);
  }

  64% {
    opacity: 1;
    filter: blur(2px);
  }

  100% {
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes selected-bubble-pop {
  0% {
    transform: translate(var(--x, 0), var(--y, 0)) scale(1);
  }

  58% {
    transform: translate(var(--x, 0), var(--y, 0)) scale(1.34);
  }

  100% {
    transform: translate(var(--x, 0), var(--y, 0)) scale(var(--scale, 1.24));
  }
}

@keyframes deselect-bubble-settle {
  0% {
    transform: translate(var(--x, 0), var(--y, 0)) scale(1.24);
    filter: blur(0);
  }

  54% {
    transform: translate(var(--x, 0), var(--y, 0)) scale(0.96);
  }

  100% {
    transform: translate(var(--x, 0), var(--y, 0)) scale(var(--scale, 1));
    filter: blur(0);
  }
}

.generator-panel {
  display: grid;
  gap: 22px;
}

.paper-strip {
  min-height: 230px;
  display: grid;
  align-content: center;
  gap: 18px;
  padding: clamp(20px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.paper-label {
  width: max-content;
  padding: 7px 12px;
  border-radius: 8px;
  background: #ededec;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 760;
}

.idea-text {
  min-height: 112px;
  font-size: clamp(1.35rem, 3vw, 2.6rem);
  font-weight: 560;
  line-height: 1.35;
  word-break: break-word;
}

.idea-muted {
  color: #8a867d;
  font-weight: 430;
}

.idea-keyword {
  color: var(--ink);
  font-weight: 650;
}

.blur-char {
  display: inline-block;
  min-width: 0.22em;
  opacity: 0;
  filter: blur(9px);
  transform: translateY(0.38em);
  animation: clarify 560ms ease forwards;
}

@keyframes clarify {
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-button,
.secondary-button,
.accent-button {
  min-height: 50px;
  padding: 0 20px;
}

.primary-button {
  background: var(--ink);
  color: #fffaf5;
}

.secondary-button {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.accent-button {
  background: var(--accent);
  color: var(--accent-ink);
}

.slot-section,
.game-section {
  padding: clamp(22px, 4vw, 44px);
  min-height: calc(100vh - 84px);
  display: grid;
  align-content: center;
}

.slot-header,
.game-header {
  margin-bottom: 24px;
}

.game-board {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 360px;
  max-height: 560px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 23px, rgba(169, 84, 43, 0.1) 24px, transparent 25px),
    repeating-linear-gradient(#fff, #fff 35px, #efefed 36px);
  box-shadow: inset 0 -10px 0 rgba(24, 23, 19, 0.035);
  margin-bottom: 20px;
}

#researchGame {
  display: block;
  width: 100%;
  height: 100%;
}

.submitted-idea {
  max-width: 70rem;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.8vw, 1.24rem);
  font-weight: 430;
  line-height: 1.55;
}

.slot-machine {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.slot-machine.result-success .slot-window {
  border-color: var(--gold);
  box-shadow:
    inset 0 -10px 0 rgba(24, 23, 19, 0.035),
    0 0 0 7px rgba(198, 149, 24, 0.2),
    0 0 46px rgba(198, 149, 24, 0.38);
}

.slot-machine.result-fail .slot-window {
  border-color: var(--red);
  box-shadow:
    inset 0 -10px 0 rgba(24, 23, 19, 0.035),
    0 0 0 7px rgba(180, 69, 61, 0.18),
    0 0 42px rgba(180, 69, 61, 0.3);
}

.slot-machine.flash-success .slot-window {
  animation: flash-success-border 420ms ease 3;
}

.slot-machine.flash-fail .slot-window {
  animation: flash-fail-border 520ms ease 1;
}

.slot-window {
  min-height: 130px;
  height: 130px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 -10px 0 rgba(24, 23, 19, 0.035);
}

.slot-window::before,
.slot-window::after {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  z-index: 1;
  height: 32px;
  pointer-events: none;
}

.slot-window::before {
  top: 0;
  background: linear-gradient(rgba(255, 255, 255, 0.92), transparent);
}

.slot-window::after {
  bottom: 0;
  background: linear-gradient(transparent, rgba(255, 255, 255, 0.92));
}

.reel {
  width: 100%;
  transform: translateY(0);
  will-change: transform;
}

.reel-item {
  height: 130px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  text-align: center;
  color: var(--ink);
  font-size: clamp(1.4rem, 4vw, 3.2rem);
  font-weight: 760;
  line-height: 1;
  word-break: break-word;
}

.reel.settled {
  animation: settle-reel 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes settle-reel {
  0% {
    filter: blur(2px);
  }

  68% {
    filter: blur(0);
  }

  100% {
    transform: translateY(0);
  }
}

@keyframes flash-success-border {
  0%,
  100% {
    border-color: var(--gold);
    box-shadow:
      inset 0 -10px 0 rgba(24, 23, 19, 0.035),
      0 0 0 7px rgba(198, 149, 24, 0.2),
      0 0 46px rgba(198, 149, 24, 0.38);
  }

  50% {
    border-color: var(--gold);
    box-shadow:
      inset 0 -10px 0 rgba(24, 23, 19, 0.035),
      0 0 0 16px rgba(198, 149, 24, 0.1),
      0 0 86px rgba(198, 149, 24, 0.64);
  }
}

@keyframes flash-fail-border {
  0%,
  100% {
    border-color: var(--red);
    box-shadow:
      inset 0 -10px 0 rgba(24, 23, 19, 0.035),
      0 0 0 7px rgba(180, 69, 61, 0.18),
      0 0 42px rgba(180, 69, 61, 0.3);
  }

  50% {
    border-color: var(--red);
    box-shadow:
      inset 0 -10px 0 rgba(24, 23, 19, 0.035),
      0 0 0 16px rgba(180, 69, 61, 0.08),
      0 0 80px rgba(180, 69, 61, 0.5);
  }
}

.result-text {
  min-height: 58px;
  margin-bottom: 18px;
  font-size: clamp(1rem, 2vw, 1.45rem);
  font-weight: 500;
  line-height: 1.4;
}

.result-text.success {
  color: var(--green);
}

.result-text.top {
  color: var(--gold);
}

.result-text.fail {
  color: var(--red);
}

.hidden {
  display: none !important;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(24, 23, 19, 0.24);
  backdrop-filter: blur(8px);
}

.modal-panel {
  width: min(460px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.modal-copy {
  margin: 14px 0 20px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

@media (max-width: 720px) {
  body {
    overflow: auto;
  }

  .app-shell {
    width: min(100% - 20px, 1120px);
    min-height: 100vh;
    padding: 10px 0 24px;
  }

  .view {
    inset: 10px 0 24px;
  }

  .workspace {
    min-height: calc(100vh - 20px);
  }

  .start-view {
    align-content: center;
  }

  .direction-view {
    min-height: calc(100vh - 34px);
    padding: 10px;
  }

  .bubble-field {
    min-height: 100%;
  }

  .direction-bubble {
    width: 128px;
    height: 128px;
    padding: 0 14px;
    font-size: 0.98rem;
  }

  .slot-machine {
    gap: 8px;
  }

  .slot-window {
    height: 92px;
    min-height: 92px;
  }

  .reel-item {
    height: 92px;
  }

  .slot-section,
  .game-section {
    min-height: calc(100vh - 34px);
  }

  .game-board {
    min-height: 420px;
    aspect-ratio: 3 / 4;
  }

  .primary-button,
  .secondary-button,
  .accent-button {
    flex: 1 1 150px;
  }
}
