:root {
  --ink: #111318;
  --ink-soft: #2b2e38;
  --paper: #f4f0e7;
  --paper-deep: #e9e3d6;
  --white: #fffdf8;
  --lime: #dfff48;
  --lime-deep: #a9cf1b;
  --coral: #ff624b;
  --blue: #5865ff;
  --sky: #72d8ff;
  --pink: #ff8fc7;
  --green: #26c96f;
  --red: #ff4d58;
  --muted: #696b73;
  --line: 2px solid var(--ink);
  --radius-lg: 28px;
  --radius-md: 19px;
  --shadow: 6px 7px 0 var(--ink);
  --letter-progress: 0;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--paper);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family:
    Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", system-ui,
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  word-break: keep-all;
  background: var(--paper);
  transition: background-color 240ms ease;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

button,
label {
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 999;
  padding: 11px 15px;
  color: var(--white);
  font-weight: 900;
  text-decoration: none;
  background: var(--ink);
  border-radius: 10px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.ambient-grid {
  position: absolute;
  inset: 0;
  opacity: 0.24;
  background-image:
    linear-gradient(rgba(17, 19, 24, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 19, 24, 0.1) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
}

.ambient-blob {
  position: absolute;
  width: 260px;
  height: 260px;
  border: var(--line);
  border-radius: 45% 55% 63% 37%;
  filter: blur(1px);
}

.ambient-blob-one {
  top: -170px;
  right: -110px;
  background: var(--lime);
  transform: rotate(24deg);
}

.ambient-blob-two {
  bottom: -210px;
  left: -140px;
  width: 330px;
  height: 330px;
  background: var(--pink);
  transform: rotate(-18deg);
}

.app-shell {
  width: min(100% - 28px, 560px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 16px 0 calc(28px + env(safe-area-inset-bottom));
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  margin-bottom: 25px;
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 0;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.brand-mark {
  display: grid;
  width: 41px;
  height: 41px;
  place-items: center;
  font-size: 24px;
  font-weight: 950;
  background: var(--lime);
  border: var(--line);
  border-radius: 12px;
  box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-4deg);
}

.brand-copy {
  display: grid;
  font-size: 19px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.06em;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.header-status {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  background: rgba(255, 253, 248, 0.72);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
}

.header-status i {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(38, 201, 111, 0.17);
  animation: status-pulse 1.8s ease-in-out infinite;
}

.screen {
  display: none;
}

.screen.is-active {
  display: block;
  animation: screen-in 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.market-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.market-kicker span {
  display: inline-flex;
  align-items: center;
  min-height: 29px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.02em;
  background: var(--lime);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
}

.market-kicker span:nth-child(2) {
  background: var(--white);
  transform: rotate(1deg);
}

.hero-copy-block h1 {
  max-width: 520px;
  margin: 0 0 17px;
  font-size: clamp(49px, 15.4vw, 78px);
  font-weight: 950;
  line-height: 0.92;
  letter-spacing: -0.085em;
}

.hero-copy-block h1 em {
  position: relative;
  z-index: 0;
  display: inline-block;
  margin-top: 7px;
  font-style: normal;
}

.hero-copy-block h1 em::after {
  position: absolute;
  right: -7px;
  bottom: 2px;
  left: -5px;
  z-index: -1;
  height: 27%;
  content: "";
  background: var(--lime);
  transform: rotate(-1.2deg);
}

.hero-copy {
  margin: 0 0 27px;
  color: #555861;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.65;
  letter-spacing: -0.025em;
}

.challenge-invite {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0 0 18px;
  padding: 13px 14px;
  background: var(--ink);
  border: var(--line);
  border-radius: 16px;
  box-shadow: 4px 4px 0 var(--lime);
}

.challenge-invite[hidden] {
  display: none;
}

.challenge-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 39px;
  height: 39px;
  place-items: center;
  background: var(--lime);
  border-radius: 11px;
}

.challenge-invite div {
  display: grid;
  gap: 3px;
  color: var(--white);
}

.challenge-invite strong {
  font-size: 13px;
  font-weight: 950;
}

.challenge-invite div span {
  color: #c9cbd2;
  font-size: 11px;
  font-weight: 700;
}

.setup-card {
  padding: 19px;
  background: rgba(255, 253, 248, 0.96);
  border: var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.field-block {
  margin-bottom: 22px;
}

.field-label,
.goal-fieldset legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 10px;
  padding: 0 2px;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

.field-label small,
.goal-fieldset legend small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.name-field {
  position: relative;
}

.name-field input {
  width: 100%;
  height: 58px;
  padding: 0 118px 0 16px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  background: var(--paper);
  border: var(--line);
  border-radius: 15px;
  outline: 0;
}

.name-field input::placeholder {
  color: #9b9b9f;
  font-weight: 750;
}

.name-field input[aria-invalid="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 77, 88, 0.15);
}

.name-field > span {
  position: absolute;
  top: 50%;
  right: 11px;
  padding: 6px 8px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  background: var(--white);
  border: 1px solid #a6a5a2;
  border-radius: 8px;
  transform: translateY(-50%) rotate(1deg);
}

.field-error {
  min-height: 17px;
  margin: 6px 2px 0;
  color: #bd2230;
  font-size: 11px;
  font-weight: 850;
}

.goal-fieldset {
  min-width: 0;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.goal-grid {
  display: grid;
  gap: 9px;
}

.goal-option {
  display: block;
  cursor: pointer;
}

.goal-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.goal-card {
  display: grid;
  gap: 7px;
  min-height: 101px;
  padding: 12px 13px;
  background: var(--paper);
  border: 1.5px solid #77786f;
  border-radius: 15px;
  transition:
    transform 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease;
}

.goal-option input:focus-visible + .goal-card {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.goal-option input:checked + .goal-card {
  background: var(--lime);
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  transform: translate(-2px, -2px);
}

.goal-topline,
.goal-bottom {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.goal-topline b {
  color: var(--muted);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.12em;
}

.goal-topline i {
  padding: 4px 7px;
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 850;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(17, 19, 24, 0.4);
  border-radius: 999px;
}

.goal-card > strong {
  font-size: 16px;
  font-weight: 950;
  line-height: 1.2;
  letter-spacing: -0.045em;
}

.goal-bottom small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goal-bottom b {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.primary-button,
.secondary-button,
.text-button,
.sell-button {
  border: 0;
  cursor: pointer;
}

.primary-button {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  width: 100%;
  min-height: 66px;
  padding: 12px 15px 12px 18px;
  color: var(--white);
  text-align: left;
  background: var(--ink);
  border: var(--line);
  border-radius: 16px;
  box-shadow: 4px 4px 0 var(--lime-deep);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.primary-button > span {
  align-self: end;
  font-size: 16px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.primary-button small {
  align-self: start;
  color: #bfc1c8;
  font-size: 9px;
  font-weight: 750;
}

.primary-button i {
  grid-row: 1 / span 2;
  grid-column: 2;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--ink);
  font-size: 20px;
  font-style: normal;
  font-weight: 950;
  background: var(--lime);
  border-radius: 11px;
}

.primary-button:active {
  box-shadow: 1px 1px 0 var(--lime-deep);
  transform: translate(3px, 3px);
}

.simulation-note {
  margin: 13px 4px 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

.how-strip {
  margin-top: 39px;
}

.how-strip h2 {
  margin: 0 0 13px;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: -0.05em;
}

.how-strip ol {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.how-strip li {
  display: grid;
  gap: 14px;
  min-height: 113px;
  padding: 12px;
  background: rgba(255, 253, 248, 0.8);
  border: 1.5px solid var(--ink);
  border-radius: 15px;
}

.how-strip li b {
  color: var(--blue);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.how-strip li span {
  align-self: end;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.45;
  letter-spacing: -0.03em;
}

.site-footer {
  display: grid;
  gap: 13px;
  margin-top: 48px;
  padding: 22px 3px 0;
  color: var(--muted);
  border-top: 1px solid rgba(17, 19, 24, 0.25);
}

.site-footer p {
  margin: 0;
  font-size: 10px;
  line-height: 1.55;
}

.site-footer strong {
  color: var(--ink);
}

.site-footer nav {
  display: flex;
  gap: 15px;
}

.site-footer a {
  font-size: 10px;
  font-weight: 800;
  text-underline-offset: 3px;
}

/* Game */
body[data-screen="game"] {
  color: var(--white);
  background: #0e1015;
}

body[data-screen="game"] .ambient-grid {
  opacity: 0.15;
  background-image:
    linear-gradient(rgba(223, 255, 72, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(223, 255, 72, 0.16) 1px, transparent 1px);
}

body[data-screen="game"] .ambient-blob {
  opacity: 0.13;
}

body[data-screen="game"] .site-header {
  display: none;
}

body[data-screen="game"] .brand-copy {
  color: var(--white);
}

body[data-screen="game"] .brand-copy small {
  color: #9c9fa9;
}

body[data-screen="game"] .header-status {
  color: #b9bbc3;
  background: #191c23;
  border-color: #454955;
}

body[data-screen="game"] .site-footer,
body[data-screen="result"] .site-footer {
  display: none;
}

.game-screen {
  padding-top: 4px;
  padding-bottom: calc(142px + env(safe-area-inset-bottom));
}

.game-header {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 9px;
}

.game-header > div:first-child {
  min-width: 0;
}

.game-label {
  display: block;
  margin-bottom: 3px;
  color: #9fa2ac;
  font-size: 10px;
  font-weight: 850;
}

.game-header h1 {
  margin: 0 0 5px;
  overflow: hidden;
  font-size: clamp(34px, 10.5vw, 46px);
  font-variant-numeric: tabular-nums;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.065em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.return-pill {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 4px 8px;
  color: #0b3920;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 950;
  background: var(--green);
  border-radius: 999px;
}

.return-pill.is-negative {
  color: var(--white);
  background: var(--red);
}

.timer-block {
  display: grid;
  flex: 0 0 92px;
  justify-items: center;
  padding: 7px 8px 6px;
  color: var(--ink);
  background: var(--lime);
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  box-shadow: 3px 3px 0 #65741b;
}

.timer-block span,
.timer-block small {
  color: #343a10;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.05em;
}

.timer-block strong {
  margin: 0;
  color: var(--ink);
  font-size: 34px;
  font-variant-numeric: tabular-nums;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.05em;
}

.timer-block.is-urgent strong {
  color: var(--coral);
  animation: timer-urgent 520ms ease-in-out infinite alternate;
}

.round-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 9px;
  padding: 0;
  list-style: none;
}

.round-flow li {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
  min-height: 39px;
  padding: 6px 7px;
  color: #7e828d;
  background: #191c23;
  border: 1px solid #343842;
  border-radius: 11px;
}

.round-flow b {
  display: grid;
  flex: 0 0 23px;
  width: 23px;
  height: 23px;
  place-items: center;
  color: #979aa3;
  font-size: 10px;
  background: #2b2f38;
  border-radius: 50%;
}

.round-flow span {
  overflow: hidden;
  font-size: 10px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.round-flow li.is-active {
  color: var(--ink);
  background: var(--white);
  border-color: var(--lime);
  box-shadow: inset 0 -3px 0 rgba(223, 255, 72, 0.7);
}

.round-flow li.is-active b,
.round-flow li.is-done b {
  color: var(--ink);
  background: var(--lime);
}

.round-flow li.is-done {
  color: #d7d9df;
  border-color: #5a6530;
}

.round-flow li.is-done b::after {
  position: absolute;
  content: "✓";
}

.round-flow li.is-done b {
  position: relative;
  color: transparent;
}

.goal-progress-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #aeb1ba;
  font-size: 10px;
  font-weight: 850;
}

.goal-progress-row span:first-child {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  color: var(--white);
  letter-spacing: 0.08em;
}

.goal-progress-row i {
  width: 7px;
  height: 7px;
  background: var(--lime);
  border-radius: 50%;
}

.breaking-news {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 52px;
  margin-bottom: 9px;
  padding: 8px 10px;
  overflow: hidden;
  background: #1b1e25;
  border: 1px solid #40434c;
  border-radius: 12px;
}

.news-tag {
  min-width: 45px;
  padding: 6px 7px;
  text-align: center;
  color: var(--ink);
  font-size: 9px;
  font-weight: 950;
  background: var(--lime);
  border-radius: 6px;
}

.breaking-news strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breaking-news em {
  color: var(--sky);
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.breaking-news.is-down em {
  color: #ff7c86;
}

.breaking-news.is-event {
  animation: news-pop 420ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.chart-card {
  position: relative;
  height: clamp(222px, 29dvh, 268px);
  margin-bottom: 8px;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    #14171d;
  background-size: 100% 25%, 16.666% 100%, auto;
  border: 2px solid #3c404a;
  border-radius: 17px;
}

.chart-card.is-prebuy .chart-target {
  opacity: 0;
}

#price-chart,
#result-chart {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-target {
  position: absolute;
  top: var(--target-y, 16.4%);
  right: 0;
  left: 0;
  z-index: 2;
  border-top: 1px dashed rgba(223, 255, 72, 0.85);
  pointer-events: none;
}

.chart-target span {
  position: absolute;
  top: -9px;
  right: 8px;
  padding: 2px 5px;
  color: var(--ink);
  font-size: 9px;
  font-weight: 950;
  background: var(--lime);
  border-radius: 4px;
}

.chart-watermark {
  position: absolute;
  right: 12px;
  bottom: 7px;
  color: rgba(255, 255, 255, 0.08);
  font-size: 24px;
  font-weight: 950;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.event-effect {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 5;
  display: none;
  padding: 8px 11px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
  background: var(--lime);
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  box-shadow: 3px 3px 0 var(--ink);
  transform: translateX(-50%) rotate(-1deg);
}

.event-effect.is-visible {
  display: block;
  animation: effect-float 1.15s ease-out both;
}

.event-effect.is-down {
  color: var(--white);
  background: var(--coral);
}

.office-stage {
  position: relative;
  height: clamp(116px, 15.2dvh, 132px);
  margin-bottom: 10px;
  overflow: hidden;
  background: #dad3c4;
  border: 2px solid var(--ink);
  border-radius: 16px;
}

.office-stage::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0.4;
  background:
    linear-gradient(90deg, transparent 49%, rgba(17, 19, 24, 0.12) 50%, transparent 51%) 0 0 / 42px 100%,
    linear-gradient(rgba(17, 19, 24, 0.05) 1px, transparent 1px) 0 0 / 100% 22px;
}

.boss-desk {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 2;
  width: 96px;
  height: 76px;
  background: #886142;
  border: 2px solid var(--ink);
  border-radius: 9px 9px 14px 14px;
  box-shadow: 0 5px 0 #5f412e;
}

.boss-desk strong {
  position: absolute;
  right: 5px;
  bottom: -29px;
  padding: 3px 6px;
  color: var(--white);
  font-size: 7px;
  background: var(--ink);
  border-radius: 999px;
}

.monitor {
  position: absolute;
  top: 9px;
  left: 7px;
  display: grid;
  width: 46px;
  height: 33px;
  place-items: center;
  color: var(--lime);
  font-size: 7px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  background: #20242d;
  border: 2px solid var(--ink);
  border-radius: 4px;
}

.monitor::after {
  position: absolute;
  bottom: -9px;
  left: 17px;
  width: 10px;
  height: 9px;
  content: "";
  background: var(--ink);
}

.boss-head {
  position: absolute;
  top: -7px;
  right: 7px;
  width: 22px;
  height: 26px;
  background: #e7a77e;
  border: 2px solid var(--ink);
  border-radius: 50% 50% 42% 42%;
}

.boss-head::before {
  position: absolute;
  top: -3px;
  right: -2px;
  left: -2px;
  height: 9px;
  content: "";
  background: #29231f;
  border-radius: 50% 50% 20% 20%;
}

.office-track {
  position: absolute;
  right: 100px;
  bottom: 16px;
  left: 14px;
  height: 27px;
}

.track-line {
  position: absolute;
  top: 11px;
  right: 0;
  left: 0;
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 7px, transparent 7px 12px);
}

.track-start,
.track-end {
  position: absolute;
  bottom: -3px;
  color: #57534d;
  font-size: 7px;
  font-weight: 900;
}

.track-start {
  left: 0;
}

.track-end {
  right: 0;
}

.resignation-wrap {
  position: absolute;
  bottom: 27px;
  left: calc(17px + (100% - 153px) * var(--letter-progress));
  z-index: 4;
  width: 72px;
  height: 61px;
  transition: left 120ms linear;
  will-change: left;
}

.resignation-letter {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  width: 52px;
  height: 64px;
  place-items: center;
  background: var(--white);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  box-shadow: 2px 2px 0 rgba(17, 19, 24, 0.3);
  transform: rotate(-5deg);
}

.resignation-letter::before,
.resignation-letter::after {
  position: absolute;
  right: 8px;
  left: 8px;
  height: 1px;
  content: "";
  background: #aaa7a0;
}

.resignation-letter::before {
  top: 38px;
}

.resignation-letter::after {
  top: 44px;
}

.resignation-letter b {
  margin-top: 5px;
  font-size: 11px;
  font-weight: 950;
}

.resignation-letter i {
  position: absolute;
  right: 5px;
  bottom: 5px;
  color: var(--coral);
  font-size: 6px;
  font-style: normal;
  font-weight: 900;
}

.hand {
  position: absolute;
  bottom: -8px;
  left: 1px;
  width: 43px;
  height: 25px;
  background: #e8a47b;
  border: 1.5px solid var(--ink);
  border-radius: 16px 14px 7px 12px;
  transform: rotate(-13deg);
}

.hand::after {
  position: absolute;
  bottom: -11px;
  left: -15px;
  width: 32px;
  height: 23px;
  content: "";
  background: #5964d8;
  border: 1.5px solid var(--ink);
  border-radius: 5px;
}

.distance-copy {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 3;
  display: grid;
  gap: 1px;
}

.distance-copy span {
  color: #666158;
  font-size: 8px;
  font-weight: 850;
}

.distance-copy strong {
  color: var(--ink);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  font-weight: 950;
}

.decision-mark {
  position: absolute;
  top: 10px;
  right: 112px;
  z-index: 4;
  display: flex;
  gap: 4px;
}

.decision-mark span {
  display: grid;
  min-width: 32px;
  height: 23px;
  place-items: center;
  color: #79756d;
  font-size: 7px;
  font-weight: 950;
  background: rgba(255, 253, 248, 0.75);
  border: 1px solid rgba(17, 19, 24, 0.35);
  border-radius: 5px;
  transform: rotate(-2deg);
}

body[data-phase="waiting-news"] .decision-mark span:first-child,
body[data-phase="reading-news"] .decision-mark span:first-child,
body[data-phase="waiting-sell"] .decision-mark span:first-child,
body[data-phase="waiting-sell"] .decision-mark span:nth-child(2),
body[data-phase="finished"] .decision-mark span {
  color: var(--ink);
  background: var(--lime);
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}

.office-stage.is-goal {
  background: #deed9e;
  box-shadow: inset 0 0 0 2px var(--lime);
}

.office-stage.is-goal .resignation-letter {
  animation: letter-ready 360ms ease-in-out infinite alternate;
}

.office-stage.is-success .resignation-wrap {
  animation: letter-submit 620ms cubic-bezier(0.15, 0.7, 0.2, 1) forwards;
}

.office-stage.is-failure .resignation-wrap {
  animation: letter-fail 540ms ease both;
}

.trade-dock {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  padding: 12px max(14px, calc((100vw - 532px) / 2)) calc(11px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(14, 16, 21, 0), #0e1015 13%, #0e1015 100%);
}

.chance-copy {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  padding: 0 2px;
  color: #a5a7af;
  font-size: 10px;
  font-weight: 800;
}

.chance-copy strong {
  color: var(--white);
  font-weight: 950;
}

.sell-button {
  display: grid;
  justify-items: center;
  width: 100%;
  min-height: 78px;
  padding: 11px 14px;
  color: var(--white);
  background: var(--coral);
  border: 2px solid var(--white);
  border-radius: 17px;
  box-shadow: 0 5px 0 #9b2d20;
  transition:
    background-color 80ms linear,
    box-shadow 80ms linear,
    transform 80ms linear;
}

.sell-button span {
  font-size: 24px;
  font-weight: 950;
  line-height: 1.1;
  letter-spacing: -0.05em;
}

.sell-button small {
  color: rgba(255, 255, 255, 0.8);
  font-size: 10px;
  font-weight: 750;
}

.sell-button[hidden],
.news-actions[hidden] {
  display: none !important;
}

.news-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.news-choice {
  display: grid;
  gap: 3px;
  min-height: 80px;
  place-items: center;
  padding: 10px 8px;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 15px;
  box-shadow: 0 5px 0 #101217;
  cursor: pointer;
}

.news-choice span {
  font-size: 18px;
  font-weight: 950;
  letter-spacing: -0.05em;
}

.news-choice small {
  font-size: 8px;
  font-weight: 850;
}

.news-choice.is-bull {
  background: var(--lime);
}

.news-choice.is-trap {
  background: var(--coral);
}

.news-choice:active {
  box-shadow: 0 1px 0 #101217;
  transform: translateY(4px);
}

.sell-button.is-ready {
  color: var(--ink);
  background: var(--lime);
  border-color: var(--ink);
  box-shadow: 0 5px 0 #88a819;
  animation: ready-button 380ms ease-in-out infinite alternate;
}

.sell-button.is-ready small {
  color: #526016;
}

.sell-button:disabled {
  color: #858892;
  background: #30333b;
  border-color: #565a65;
  box-shadow: 0 5px 0 #191b20;
}

.sell-button:not(:disabled):active {
  box-shadow: 0 1px 0 #7c281d;
  transform: translateY(4px);
}

.countdown {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  color: var(--white);
  background: rgba(14, 16, 21, 0.94);
  backdrop-filter: blur(8px);
}

.countdown[hidden] {
  display: none;
}

.countdown span {
  font-size: clamp(100px, 34vw, 180px);
  font-weight: 950;
  line-height: 0.9;
  letter-spacing: -0.09em;
  text-shadow: 8px 8px 0 var(--blue);
  animation: countdown-pop 750ms cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}

.countdown small {
  margin-top: 26px;
  color: #c7c9d0;
  font-size: 11px;
  font-weight: 800;
}

/* Result */
body[data-screen="result"] {
  background: var(--paper);
}

.result-screen {
  padding-bottom: calc(30px + env(safe-area-inset-bottom));
}

.result-status {
  padding: 8px 2px 23px;
}

.result-stamp {
  display: inline-flex;
  margin-bottom: 13px;
  padding: 6px 10px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.06em;
  background: var(--lime);
  border: 1.5px solid var(--ink);
  border-radius: 7px;
  box-shadow: 2px 2px 0 var(--ink);
  transform: rotate(-2deg);
}

.result-status.is-failure .result-stamp {
  color: var(--white);
  background: var(--coral);
}

.result-kicker {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.result-status h1 {
  margin: 0 0 10px;
  font-size: clamp(42px, 13vw, 64px);
  font-weight: 950;
  line-height: 0.98;
  letter-spacing: -0.075em;
}

.result-line {
  margin: 0;
  color: #5d5f66;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.55;
}

.result-route {
  display: inline-flex;
  margin: 12px 0 0;
  padding: 8px 11px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 900;
  background: var(--lime);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  box-shadow: 2px 2px 0 var(--ink);
}

.result-card {
  position: relative;
  margin-bottom: 17px;
  padding: 17px;
  overflow: hidden;
  background: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 24px;
  box-shadow: 6px 7px 0 var(--lime-deep);
}

.result-card::after {
  position: absolute;
  top: -62px;
  right: -66px;
  width: 160px;
  height: 160px;
  content: "";
  background: var(--blue);
  border: 2px solid var(--white);
  border-radius: 50%;
  opacity: 0.56;
}

.result-card-head {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 13px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
}

.result-card-head > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.result-card-head span {
  color: #aeb0b9;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.result-card-head strong {
  overflow: hidden;
  color: var(--white);
  font-size: clamp(24px, 8vw, 38px);
  font-variant-numeric: tabular-nums;
  font-weight: 950;
  letter-spacing: -0.065em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-grade {
  display: grid;
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  place-items: center;
  color: var(--ink) !important;
  font-size: 25px !important;
  font-weight: 950 !important;
  letter-spacing: -0.08em !important;
  background: var(--lime);
  border: 2px solid var(--white);
  border-radius: 14px;
  transform: rotate(4deg);
}

.mini-chart-wrap {
  position: relative;
  z-index: 1;
  height: 170px;
  margin-bottom: 13px;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    #191c23;
  background-size: 100% 33.333%, 20% 100%, auto;
  border: 1px solid #3d414b;
  border-radius: 13px;
}

.stat-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin: 0 0 13px;
  overflow: hidden;
  background: #43464f;
  border: 1px solid #43464f;
  border-radius: 12px;
}

.stat-grid div {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 11px;
  background: #1c1f26;
}

.stat-grid dt {
  color: #8f929c;
  font-size: 8px;
  font-weight: 850;
}

.stat-grid dd {
  margin: 0;
  overflow: hidden;
  color: var(--white);
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-quote {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px;
  align-items: center;
  min-height: 56px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--lime);
  border-radius: 12px;
}

.result-quote span {
  align-self: start;
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
}

.result-quote strong {
  font-size: 13px;
  font-weight: 950;
  line-height: 1.35;
  letter-spacing: -0.035em;
}

.result-actions {
  display: grid;
  gap: 10px;
}

.result-actions .primary-button {
  grid-template-columns: 1fr auto;
  min-height: 62px;
}

.secondary-button {
  width: 100%;
  min-height: 56px;
  font-size: 14px;
  font-weight: 950;
  background: var(--white);
  border: var(--line);
  border-radius: 15px;
  box-shadow: 3px 3px 0 var(--ink);
}

.text-button {
  min-height: 37px;
  color: #555861;
  font-size: 11px;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 4px;
  background: transparent;
}

.result-disclaimer {
  margin: 19px 8px 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  left: 16px;
  z-index: 200;
  max-width: 500px;
  margin: 0 auto;
  padding: 12px 14px;
  color: var(--white);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
  background: var(--ink);
  border: 1.5px solid var(--white);
  border-radius: 12px;
  box-shadow: 3px 3px 0 var(--lime);
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.confetti-piece {
  position: fixed;
  top: -20px;
  z-index: 160;
  width: 10px;
  height: 16px;
  pointer-events: none;
  animation: confetti-fall var(--fall-time) linear forwards;
}

@media (min-width: 620px) {
  .app-shell {
    padding-top: 25px;
  }

  .site-header {
    margin-bottom: 37px;
  }

  .setup-card {
    padding: 24px;
  }

  .goal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .goal-card {
    min-height: 123px;
  }

  .game-screen {
    padding-top: 3px;
  }

  .chart-card {
    height: 270px;
  }
}

@media (max-width: 370px) {
  .app-shell {
    width: min(100% - 20px, 560px);
  }

  .site-header {
    margin-bottom: 19px;
  }

  .header-status {
    padding: 6px 9px;
    font-size: 9px;
  }

  .hero-copy-block h1 {
    font-size: 46px;
  }

  .setup-card {
    padding: 14px;
  }

  .goal-card {
    min-height: 92px;
  }

  .chart-card {
    height: 190px;
  }

  .office-stage {
    height: 105px;
  }

  .boss-desk {
    transform: scale(0.9);
    transform-origin: top right;
  }

  .trade-dock {
    padding-right: 10px;
    padding-left: 10px;
  }

  .sell-button {
    min-height: 67px;
  }
}

@media (max-height: 730px) and (orientation: portrait) {
  body[data-screen="game"] .site-header {
    display: none;
  }

  .game-header {
    margin-top: 5px;
  }

  .chart-card {
    height: 178px;
  }

  .office-stage {
    height: 96px;
  }

  .boss-desk {
    transform: scale(0.84);
    transform-origin: top right;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.72); }
}

@keyframes timer-urgent {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

@keyframes news-pop {
  0% { transform: translateY(-5px); opacity: 0.5; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes effect-float {
  0% { opacity: 0; transform: translate(-50%, 8px) rotate(-1deg) scale(0.8); }
  18% { opacity: 1; transform: translate(-50%, 0) rotate(-1deg) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -24px) rotate(2deg) scale(0.95); }
}

@keyframes letter-ready {
  from { transform: rotate(-7deg) translateY(0); }
  to { transform: rotate(2deg) translateY(-3px); }
}

@keyframes letter-submit {
  0% { transform: translate(0, 0) rotate(0); }
  50% { transform: translate(42px, -45px) rotate(12deg) scale(1.08); }
  100% { transform: translate(74px, -15px) rotate(-4deg) scale(0.88); }
}

@keyframes letter-fail {
  0% { transform: translateX(0) rotate(0); }
  20% { transform: translateX(8px) rotate(8deg); }
  45% { transform: translateX(-8px) rotate(-9deg); }
  70% { transform: translateX(5px) rotate(4deg); }
  100% { transform: translateX(-20px) translateY(10px) rotate(-14deg); }
}

@keyframes ready-button {
  from { transform: translateY(0); filter: brightness(1); }
  to { transform: translateY(-2px); filter: brightness(1.08); }
}

@keyframes countdown-pop {
  0% { opacity: 0; transform: scale(1.5); }
  18% { opacity: 1; transform: scale(0.92); }
  35% { transform: scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: scale(0.65); }
}

@keyframes confetti-fall {
  0% { transform: translate3d(0, -20px, 0) rotate(0); }
  100% { transform: translate3d(var(--drift), 110vh, 0) rotate(780deg); }
}
