:root {
  color-scheme: dark;
  --bg: #07141c;
  --panel: #102735;
  --line: #2d5a6e;
  --text: #e8f4f8;
  --muted: #9bb8c4;
  --accent: #3ee0a5;
  --warn: #ffb454;
  --danger: #ff6b7a;
  --safe: #5eead4;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: auto;
  background: #f7fbf8;
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--text);
  touch-action: manipulation;
  user-select: text;
  -webkit-user-select: text;
}

body.is-game {
  overflow: hidden;
  background: radial-gradient(circle at 30% 20%, #123246 0%, var(--bg) 55%);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#game-root {
  width: 100%;
  height: 100dvh;
  min-height: 100%;
  position: relative;
  z-index: 1;
}

#game-root canvas {
  display: block;
  margin: 0 auto;
  touch-action: none;
}

#game-root.is-home canvas {
  visibility: hidden;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 12px 16px;
  border-radius: 12px;
  background: #ffffff;
  color: #381735;
  font-weight: 900;
  transform: translateY(-160%);
  transition: transform 180ms ease;
}

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

#boot-splash {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 20;
  background: radial-gradient(circle at 50% 40%, #164058, #07141c 70%);
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

#boot-splash.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-card {
  width: min(92vw, 380px);
  padding: 28px 24px;
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(24, 58, 78, 0.95), rgba(10, 28, 40, 0.98));
  border: 1px solid rgba(94, 234, 212, 0.25);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.boot-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(62, 224, 165, 0.15);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.boot-card h1 {
  margin: 14px 0 8px;
  font-size: 34px;
  font-weight: 900;
}

.boot-card p {
  margin: 0 0 18px;
  color: var(--muted);
  font-weight: 700;
}

.boot-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.boot-bar span {
  display: block;
  height: 100%;
  width: 35%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3ee0a5, #5eead4);
  animation: load 1.1s ease-in-out infinite;
}

@keyframes load {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

/* ── Report modal (HTML, clicks fiables) ── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  touch-action: manipulation;
  user-select: none;
}

.modal[hidden] {
  display: none !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 14, 22, 0.72);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  width: min(92vw, 560px);
  padding: 28px 24px 24px;
  border-radius: 22px;
  background: linear-gradient(165deg, #123041 0%, #0b1f2a 100%);
  border: 2px solid rgba(62, 224, 165, 0.55);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.modal-card h2 {
  margin: 0 0 8px;
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 900;
}

.modal-sub {
  margin: 0 0 20px;
  color: var(--muted);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

@media (max-width: 520px) {
  .report-grid {
    grid-template-columns: 1fr;
  }
}

.report-card-btn {
  appearance: none;
  border: 3px solid #2d5a6e;
  background: #143246;
  border-radius: 16px;
  padding: 16px 10px;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  touch-action: manipulation;
}

.report-card-btn:hover {
  border-color: #3d7a92;
}

.report-card-btn:active {
  transform: scale(0.97);
}

.report-card-btn.is-selected {
  border-color: var(--accent);
  background: #1a4a3a;
  box-shadow: 0 0 0 2px rgba(62, 224, 165, 0.25);
}

.report-card-btn .icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 4px;
}

.report-card-btn .icon.msg {
  background: #2a4a5c;
  color: #dceef5;
}

.report-card-btn .icon.pin {
  background: #5c2a3a;
  color: #ff6b8a;
}

.report-card-btn .icon.sos {
  background: #ff4d6d;
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.report-card-btn small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
}

.report-card-btn strong {
  display: block;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.25;
}

.modal-hint {
  margin: 0 0 14px;
  min-height: 1.2em;
  font-size: 14px;
  font-weight: 700;
  color: var(--warn);
}

.modal-hint.is-ok {
  color: var(--accent);
}

.modal-btn {
  appearance: none;
  border: 0;
  border-radius: 14px;
  padding: 14px 36px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 900;
  background: var(--accent);
  color: #062018;
  cursor: pointer;
  touch-action: manipulation;
  transition: opacity 0.15s, transform 0.12s;
}

.modal-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.modal-btn:not(:disabled):hover {
  filter: brightness(1.06);
}

.modal-btn:not(:disabled):active {
  transform: scale(0.98);
}

.modal-btn-secondary {
  background: #143246;
  color: var(--text);
  border: 2px solid #2d5a6e;
}

.modal-btn-secondary:hover {
  filter: brightness(1.1);
  border-color: #3d7a92;
}

.modal-card-complete {
  width: min(92vw, 520px);
}

.complete-star {
  font-size: 56px;
  color: var(--warn);
  line-height: 1;
  margin-bottom: 8px;
  animation: star-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes star-pop {
  from {
    transform: scale(0.4) rotate(-20deg);
    opacity: 0;
  }
  to {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
}

.modal-actions .modal-btn {
  min-width: 160px;
}

/* Calma FAB */
.calm-fab {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border: 2px solid rgba(127, 166, 196, 0.55);
  border-radius: 16px;
  background: rgba(11, 31, 42, 0.88);
  color: var(--text);
  font-family: inherit;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

.calm-fab:hover {
  border-color: #7fa6c4;
}

.calm-fab-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid #7fa6c4;
  box-shadow: inset 0 0 0 4px rgba(11, 31, 42, 0.9);
}

.calm-card {
  width: min(92vw, 420px);
  pointer-events: none;
}

.calm-backdrop {
  cursor: pointer;
}

.calm-ring-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 18px auto 22px;
  display: grid;
  place-items: center;
}

.calm-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 5px solid #7fa6c4;
  background: rgba(127, 166, 196, 0.14);
  transform: scale(1);
}

.calm-ring.is-breathing {
  animation: breath 4s ease-in-out infinite;
}

@keyframes breath {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.95;
  }
  50% {
    transform: scale(2.1);
    opacity: 0.55;
  }
}

/* ── SOCIALITE home dashboard ── */
#home-dashboard {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(circle at 5% 5%, rgba(255, 220, 108, 0.34), transparent 28%),
    radial-gradient(circle at 96% 16%, rgba(255, 161, 188, 0.28), transparent 30%),
    #f7fbf8;
  color: #3d2145;
  isolation: isolate;
}

#home-dashboard[hidden] {
  display: none !important;
}

#home-dashboard::before,
#home-dashboard::after {
  position: absolute;
  z-index: -1;
  display: block;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  content: "";
  filter: blur(2px);
  opacity: 0.55;
}

#home-dashboard::before {
  top: 42%;
  left: -96px;
  background: #b6f0d2;
}

#home-dashboard::after {
  right: -80px;
  bottom: 8%;
  background: #c8c5ff;
}

.home-shell {
  width: min(100% - 32px, 1220px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 0 max(28px, env(safe-area-inset-bottom));
}

.home-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
}

.home-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #3d2145;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 14px;
  background: #e11d65;
  box-shadow: 0 7px 0 #a91550, 0 13px 24px rgba(225, 29, 101, 0.22);
  color: #ffffff;
  transform: rotate(-5deg);
}

.brand-mark svg {
  width: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.home-topnote {
  color: #765c79;
  font-size: 14px;
  font-weight: 800;
}

.home-hero {
  position: relative;
  display: grid;
  gap: 28px;
  margin-top: 18px;
  padding: clamp(26px, 5vw, 64px);
  overflow: hidden;
  border-radius: 34px;
  background: linear-gradient(135deg, #241740 0%, #39205a 62%, #502457 100%);
  box-shadow: 0 20px 0 rgba(61, 33, 69, 0.08), 0 28px 60px rgba(53, 31, 75, 0.22);
}

.home-hero::after {
  position: absolute;
  right: -100px;
  bottom: -130px;
  width: 330px;
  height: 330px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  box-shadow: 0 0 0 36px rgba(255, 255, 255, 0.04), 0 0 0 72px rgba(255, 255, 255, 0.025);
  content: "";
}

.hero-copy,
.hero-illustration {
  position: relative;
  z-index: 1;
}

.home-eyebrow {
  display: inline-block;
  color: #ffcf5a;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.home-eyebrow-dark {
  color: #d84d78;
}

.hero-copy h1 {
  max-width: 650px;
  margin: 12px 0 16px;
  color: #ffffff;
  font-size: clamp(38px, 7vw, 76px);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.hero-copy h1 span {
  color: #ffbd58;
}

.hero-lead {
  max-width: 570px;
  margin: 0;
  color: #e4dcef;
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 700;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
}

.home-primary-btn {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 13px 22px 13px 24px;
  border: 0;
  border-radius: 17px;
  background: #ffca55;
  box-shadow: 0 6px 0 #d08b2b, 0 12px 24px rgba(255, 202, 85, 0.2);
  color: #342040;
  cursor: pointer;
  font: inherit;
  font-size: 17px;
  font-weight: 900;
  touch-action: manipulation;
  transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
}

.home-primary-btn svg,
.scenario-arrow b {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.home-primary-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-2px);
}

.home-primary-btn:active {
  box-shadow: 0 2px 0 #d08b2b, 0 7px 14px rgba(255, 202, 85, 0.18);
  transform: translateY(3px);
}

.home-secondary-link {
  min-height: 44px;
  padding: 12px 4px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.5);
  text-underline-offset: 4px;
}

.hero-note {
  display: flex;
  max-width: 500px;
  align-items: center;
  gap: 9px;
  margin: 24px 0 0;
  color: #c9bddd;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.hero-note svg,
.support-icon svg {
  flex: 0 0 auto;
  width: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.hero-illustration {
  display: grid;
  min-height: 250px;
  align-items: center;
  justify-items: center;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.hero-illustration svg {
  width: min(100%, 460px);
  height: auto;
}

.illustration-glow {
  position: absolute;
  top: 25px;
  right: 35px;
  width: 105px;
  height: 105px;
  border-radius: 50%;
  background: rgba(255, 205, 93, 0.25);
  filter: blur(14px);
}

.illustration-sun {
  fill: #ffcb5a;
}

.illustration-ground {
  fill: none;
  stroke: #93d7b5;
  stroke-linecap: round;
  stroke-width: 18;
}

.illustration-path {
  fill: none;
  stroke: #e4bc84;
  stroke-linecap: round;
  stroke-width: 25;
}

.illustration-bush {
  fill: #65c69a;
}

.illustration-bush-alt {
  fill: #7fceae;
}

.illustration-person circle {
  fill: #f6bd94;
  stroke: #3b2151;
  stroke-width: 3;
}

.illustration-person > path:first-of-type {
  fill: #f6bd94;
  stroke: #3b2151;
  stroke-linejoin: round;
  stroke-width: 3;
}

.illustration-person .person-shirt {
  fill: #f36c81;
  stroke: none;
}

.illustration-person .person-shirt-two {
  fill: #3c91e6;
}

.illustration-person .person-arm {
  fill: none;
  stroke: #f6bd94;
  stroke-linecap: round;
  stroke-width: 13;
}

.illustration-person .person-eye {
  fill: #3b2151;
  stroke: none;
}

.illustration-person .person-smile {
  fill: none;
  stroke: #3b2151;
  stroke-linecap: round;
  stroke-width: 2.5;
}

.illustration-speech {
  fill: #ffffff;
  stroke: #f0b0cb;
  stroke-width: 3;
}

.illustration-speech-line {
  fill: none;
  stroke: #d9467c;
  stroke-linecap: round;
  stroke-width: 5;
}

.illustration-star {
  fill: #ffca55;
}

.illustration-caption {
  position: absolute;
  right: 18px;
  bottom: 14px;
  left: 18px;
  color: #f2e8f1;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.home-section {
  padding: clamp(38px, 7vw, 76px) 0 12px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.section-heading h2,
.home-support h2 {
  margin: 8px 0 0;
  color: #3d2145;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.section-heading p {
  max-width: 330px;
  margin: 0;
  color: #765c79;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
}

.scenario-grid {
  display: grid;
  gap: 16px;
}

.scenario-card {
  position: relative;
  display: flex;
  min-height: 250px;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px;
  border: 2px solid #e8ddeb;
  border-radius: 25px;
  background: #ffffff;
  box-shadow: 0 10px 0 rgba(61, 33, 69, 0.05), 0 16px 30px rgba(73, 36, 82, 0.08);
  color: #3d2145;
  text-align: left;
}

button.scenario-card {
  width: 100%;
  cursor: pointer;
  font: inherit;
  touch-action: manipulation;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

button.scenario-card:hover {
  border-color: #e11d65;
  box-shadow: 0 12px 0 rgba(225, 29, 101, 0.08), 0 20px 32px rgba(73, 36, 82, 0.12);
  transform: translateY(-3px);
}

button.scenario-card:active {
  transform: translateY(1px);
}

.scenario-card-soon {
  background: rgba(255, 255, 255, 0.72);
}

.scenario-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 22px;
  place-items: center;
  border-radius: 17px;
}

.scenario-icon svg {
  width: 27px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.scenario-icon-green {
  background: #d8f6e7;
  color: #14865a;
}

.scenario-icon-blue {
  background: #dcecff;
  color: #2563eb;
}

.scenario-icon-yellow {
  background: #fff0c5;
  color: #a66312;
}

.scenario-status {
  margin-bottom: 8px;
  color: #c23d70;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.scenario-card strong {
  margin-bottom: 8px;
  font-size: 23px;
  font-weight: 900;
}

.scenario-card > span:not(.scenario-icon):not(.scenario-status):not(.scenario-arrow) {
  max-width: 290px;
  color: #765c79;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}

.scenario-arrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding-top: 22px;
  color: #2563eb;
  font-size: 14px;
  font-weight: 900;
}

.scenario-arrow b {
  width: auto;
  font-size: 22px;
  line-height: 1;
}

.scenario-arrow-muted {
  color: #8f7d92;
}

.home-support {
  display: grid;
  gap: 18px;
  align-items: start;
  margin-top: clamp(28px, 5vw, 56px);
  padding: 24px;
  border: 2px solid #dcefe5;
  border-radius: 25px;
  background: #ecfaf2;
}

.support-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 17px;
  background: #b9efd3;
  color: #13734f;
}

.home-support h2 {
  max-width: 700px;
  font-size: clamp(25px, 4vw, 36px);
}

.home-support p {
  max-width: 720px;
  margin: 15px 0 0;
  color: #5f6f68;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
}

.home-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 30px 4px 8px;
  color: #927e93;
  font-size: 13px;
  font-weight: 800;
}

.home-footer span:first-child {
  color: #c23d70;
  letter-spacing: 0.08em;
}

.home-primary-btn:focus-visible,
.home-secondary-link:focus-visible,
.scenario-card:focus-visible,
.home-brand:focus-visible {
  outline: 4px solid #8fb8ff;
  outline-offset: 4px;
}

@media (min-width: 720px) {
  .home-shell {
    width: min(100% - 56px, 1220px);
  }

  .home-hero {
    grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
    align-items: center;
  }

  .scenario-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .home-support {
    grid-template-columns: auto 1fr;
    padding: 30px;
  }
}

@media (min-width: 1080px) {
  .home-hero {
    min-height: 470px;
  }

  .hero-illustration {
    min-height: 360px;
  }
}

@media (max-width: 560px) {
  .home-shell {
    width: min(100% - 24px, 1220px);
  }

  .home-topnote {
    max-width: 145px;
    font-size: 12px;
    line-height: 1.3;
    text-align: right;
  }

  .home-hero {
    border-radius: 25px;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .home-primary-btn,
  .home-secondary-link {
    width: 100%;
    text-align: center;
  }

  .home-secondary-link {
    padding: 12px;
  }

  .section-heading {
    display: block;
  }

  .section-heading p {
    margin-top: 12px;
  }

  .scenario-card {
    min-height: 230px;
  }

  .home-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}

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

/* ── Choice scenario modal ── */
.choice-modal {
  z-index: 130;
  overflow-y: auto;
}

.choice-backdrop {
  background: rgba(29, 17, 48, 0.78);
}

.choice-modal-card {
  position: relative;
  width: min(94vw, 860px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 22px clamp(18px, 5vw, 42px) 30px;
  border: 3px solid #f2c9dc;
  border-radius: 30px;
  background: linear-gradient(160deg, #fffdfd 0%, #fff3f7 100%);
  box-shadow: 0 30px 90px rgba(9, 4, 20, 0.38);
  color: #3d2145;
  text-align: center;
}

.choice-layout {
  display: grid;
  grid-template-columns: minmax(245px, 0.82fr) minmax(300px, 1.18fr);
  gap: 22px;
  margin-top: 22px;
  text-align: left;
}

.choice-composition {
  display: flex;
  min-height: 330px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow: hidden;
  border: 2px solid #d7eee1;
  border-radius: 24px;
  background: #e9f8ef;
  color: #3d2145;
  text-align: center;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.choice-composition[data-state="try-again"] {
  border-color: #f1d496;
  background: #fff7e1;
}

.choice-composition[data-state="success"] {
  border-color: #8bd6ad;
  background: #e5f8ed;
}

.choice-composition.is-reacting {
  animation: composition-pop 280ms ease-out;
}

@keyframes composition-pop {
  0% {
    transform: scale(0.97);
  }
  65% {
    transform: scale(1.015);
  }
  100% {
    transform: scale(1);
  }
}

.choice-composition-kicker,
.choice-conversation-label {
  color: #b14973;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.choice-composition svg {
  width: min(100%, 240px);
  margin: 10px 0 4px;
}

.choice-character-labels {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  color: #765c79;
  font-size: 12px;
  font-weight: 900;
}

.choice-character-labels span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.choice-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.choice-dot-player {
  background: #e75d80;
}

.choice-dot-friend {
  background: #4f94de;
}

.choice-composition strong {
  margin-top: 14px;
  color: #3d2145;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
}

.choice-conversation {
  min-width: 0;
  padding: 18px;
  border: 2px solid #f0dce7;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.8);
}

.choice-conversation-label {
  display: block;
  margin-bottom: 12px;
}

.choice-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 2px solid #ead5e2;
  border-radius: 14px;
  background: #ffffff;
  color: #765c79;
  cursor: pointer;
  touch-action: manipulation;
}

.choice-close:hover {
  border-color: #e11d65;
  color: #c23d70;
}

.choice-close svg {
  width: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.2;
}

.choice-visual {
  display: grid;
  width: min(100%, 230px);
  height: 132px;
  margin: 4px auto 10px;
  place-items: center;
  border-radius: 22px;
  background: #e9f8ef;
}

.choice-visual svg {
  width: 190px;
}

.choice-visual-ground {
  fill: none;
  stroke: #7bc99d;
  stroke-linecap: round;
  stroke-width: 9;
}

.choice-visual-head {
  stroke: #4b2856;
  stroke-width: 2;
}

.choice-visual-head-one {
  fill: #ffc89e;
}

.choice-visual-head-two {
  fill: #f2b685;
}

.choice-visual-body {
  stroke: #4b2856;
  stroke-linejoin: round;
  stroke-width: 2;
}

.choice-visual-body-one {
  fill: #e75d80;
}

.choice-visual-body-two {
  fill: #4f94de;
}

.choice-visual-bubble {
  fill: #ffffff;
  stroke: #e7a4c1;
  stroke-width: 2;
}

.choice-visual-line {
  fill: none;
  stroke: #d84d78;
  stroke-linecap: round;
  stroke-width: 3;
}

.choice-kicker {
  display: inline-block;
  color: #c23d70;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.choice-modal-card h2 {
  margin: 7px 0 6px;
  color: #3d2145;
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.choice-intro {
  max-width: 420px;
  margin: 0 auto 20px;
  color: #765c79;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
}

.choice-dialogue {
  display: grid;
  gap: 9px;
  max-height: 195px;
  margin: 0 auto 18px;
  overflow-y: auto;
  padding-right: 4px;
  text-align: left;
}

.choice-bubble {
  width: fit-content;
  max-width: 88%;
  margin: 0;
  padding: 12px 15px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.4;
}

.choice-bubble-friend {
  border-bottom-left-radius: 5px;
  background: #e7f6ed;
  color: #276044;
}

.choice-bubble-player {
  justify-self: end;
  border-bottom-right-radius: 5px;
  background: #e9e2ff;
  color: #4a327c;
}

.choice-choices {
  display: grid;
  gap: 10px;
  text-align: left;
}

.choice-option {
  display: flex;
  min-height: 62px;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 11px 16px;
  border: 2px solid #ead5e2;
  border-radius: 16px;
  background: #ffffff;
  color: #3d2145;
  cursor: pointer;
  font: inherit;
  text-align: left;
  touch-action: manipulation;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.choice-option:hover {
  border-color: #c490d2;
  background: #fcf7ff;
  transform: translateX(2px);
}

.choice-option strong {
  font-size: 17px;
  font-weight: 900;
}

.choice-option span {
  color: #765c79;
  font-size: 13px;
  font-weight: 700;
}

.choice-option.is-correct {
  border-color: #30a96d;
  background: #e7f8ef;
}

.choice-option:disabled {
  cursor: default;
  opacity: 1;
}

.choice-feedback {
  min-height: 1.5em;
  margin: 15px 0 4px;
  color: #806b83;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
}

.choice-feedback.is-help {
  color: #a66312;
}

.choice-feedback.is-success {
  color: #168157;
}

.choice-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

.choice-actions .modal-btn {
  min-height: 48px;
  padding-inline: 20px;
  font-size: 16px;
}

@media (max-width: 520px) {
  .choice-modal-card {
    border-radius: 24px;
  }

  .choice-actions {
    flex-direction: column;
  }

  .choice-actions .modal-btn {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .choice-layout {
    grid-template-columns: 1fr;
  }

  .choice-composition {
    min-height: 250px;
  }

  .choice-conversation {
    padding: 16px;
  }
}

.calm-phase {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 28px;
  font-weight: 900;
}

/* ── World conversation dock ── */
.world-dialogue-panel {
  position: fixed;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 95;
  width: min(calc(100% - 24px), 680px);
  padding: 16px 18px 18px;
  border: 2px solid rgba(126, 239, 194, 0.7);
  border-radius: 22px;
  background: rgba(8, 30, 42, 0.96);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  color: #e8f4f8;
  transform: translateX(-50%);
  touch-action: manipulation;
}

.world-dialogue-panel[hidden] {
  display: none !important;
}

.world-dialogue-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.world-dialogue-kicker {
  color: #7eefc2;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.world-dialogue-heading h2 {
  margin: 4px 0 0;
  color: #ffffff;
  font-size: clamp(18px, 3vw, 23px);
  font-weight: 900;
}

.world-dialogue-close {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(194, 225, 233, 0.32);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #d3e6ea;
  cursor: pointer;
  font: inherit;
  font-size: 25px;
  line-height: 1;
  touch-action: manipulation;
}

.world-dialogue-close:hover,
.world-dialogue-close:focus-visible {
  border-color: #7eefc2;
  color: #7eefc2;
}

.world-dialogue-prompt {
  margin: 12px 0 13px;
  color: #f5fbfd;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.4;
}

.world-dialogue-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.world-dialogue-choice {
  display: flex;
  min-height: 62px;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 9px 12px;
  border: 2px solid rgba(163, 224, 231, 0.3);
  border-radius: 14px;
  background: #143246;
  color: #f5fbfd;
  cursor: pointer;
  font: inherit;
  text-align: left;
  touch-action: manipulation;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.world-dialogue-choice:hover,
.world-dialogue-choice:focus-visible {
  border-color: #7eefc2;
  background: #1b4b4d;
  transform: translateY(-2px);
}

.world-dialogue-choice strong {
  font-size: 15px;
  font-weight: 900;
}

.world-dialogue-choice span {
  color: #a9c4cb;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.world-dialogue-choice:disabled {
  cursor: wait;
  opacity: 0.52;
  transform: none;
}

.world-dialogue-panel.is-busy .world-dialogue-feedback {
  color: #b7d1d7;
}

.world-dialogue-feedback {
  min-height: 1.3em;
  margin: 11px 0 0;
  color: #9ebcc5;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.world-dialogue-feedback.is-help {
  color: #ffcf75;
}

.world-dialogue-feedback.is-success {
  color: #7eefc2;
}

.world-dialogue-continue {
  min-height: 48px;
  margin-top: 10px;
  padding: 11px 22px;
  border: 0;
  border-radius: 13px;
  background: #3ee0a5;
  color: #062018;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  touch-action: manipulation;
}

.world-dialogue-continue:hover,
.world-dialogue-continue:focus-visible {
  filter: brightness(1.08);
}

.world-dialogue-continue[hidden] {
  display: none;
}

.world-dialogue-panel button:focus-visible {
  outline: 3px solid #ffcf75;
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .world-dialogue-panel {
    width: calc(100% - 16px);
    padding: 13px 13px 14px;
    border-radius: 18px;
  }

  .world-dialogue-choices {
    grid-template-columns: 1fr;
  }

  .world-dialogue-choice {
    min-height: 52px;
  }
}
