/* ========================
   FONT SETUP
======================== */
@font-face {
  font-family: "gear-wide-ultra";
  font-weight: 900;
  font-style: normal;
}

/* ========================
   BASE
======================== */
body {
  margin: 0;
  background: #e9e9e9;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: black;
}

/* GRID BACKGROUND */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(#dcdcdc 1px, transparent 1px),
                    linear-gradient(90deg, #dcdcdc 1px, transparent 1px);
  background-size: 80px 80px;
  z-index: -1;
}

/* ========================
   NAVBAR
======================== */
.navbar {
  margin: 30px;
  padding: 15px 25px;
  border: 2px solid black;

  display: flex;
  justify-content: space-between;
  align-items: center;

  background: transparent;
}

.nav-left,
.nav-right {
  display: flex;
  gap: 15px;
}

.nav-center {
  font-family: "gear-wide-ultra";
  font-size: 16px;
  color: #ff2ea6;
  -webkit-text-stroke: 1.5px black;
  letter-spacing: 2px;
  text-align: center;
}

.nav-center-page02 {
  font-family: "gear-wide-ultra";
  font-size: 16px;
  color: #ffffff;
  -webkit-text-stroke: 1.5px black;
  letter-spacing: 2px;
  text-align: center;
}

.nav-btn {
  background: #d9ff00;
  border: 2px solid black;
  padding: 8px 16px;
  font-weight: bold;
  color: black;
  cursor: pointer;
  transition: 0.2s;
}

.nav-btn:hover {
  transform: translateY(-2px);
}

/* ========================
   HERO (PAGE 01)
======================== */
.hero {
  height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.hero h1 {
  font-family: "gear-wide-ultra";
  font-size: 80px;
  line-height: 1.1;
  color: #ff2ea6;
  margin: 0;
  transform: translateY(-60px);
}

.subtitle {
  margin-top: 60px;
  font-size: 14px;
}

.cta {
  font-family: "gear-wide-ultra";
  font-size: 18px;
  color: #d9ff00;
  -webkit-text-stroke: 1.5px black;
  letter-spacing: 2px;
  cursor: pointer;
  transition: 0.2s;
  background: transparent;
  padding: 10px 20px;
}

.cta:hover {
  transform: scale(1.05);
}

/* ========================
   PAGE 02 BASE
======================== */
body.page02 {
  background: #d9ff00;
}

/* GRID BACKGROUND OVERRIDE */
body.page02::before {
  background-image: linear-gradient(rgba(0,0,0,0.08) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(0,0,0,0.08) 1px, transparent 1px);
  background-size: 80px 80px;
}

/* CENTER WRAPPER */
.page02-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ========================
   PAGE 02 LAYOUT
======================== */
.hero-page02 {
  height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 60px;
}

.before-label {
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 0.25rem;
  margin-left: 4px;
}

/* TITLE */
.identify-title {
  font-family: "gear-wide-ultra";
  font-size: clamp(60px, 9vw, 110px);
  line-height: 0.95;
  margin: 0 0 1rem 0;
}

.identify-outline {
  display: block;
  color: white;
  -webkit-text-stroke: 3px black;
  text-align: right;
}

/* NOTE */
.identify-note {
  font-size: 13px;
  font-weight: bold;
  width: 780px;
  max-width: 100%;
  margin-bottom: 2.5rem;
  text-align: right;
}

/* ========================
   GRID
======================== */
.identity-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 780px;
  margin: 0 auto 2rem auto;
}

/* ========================
   BUTTONS 
======================== */
.identity-btn {
  background: white;
  border: 2px solid black;
  padding: 20px 16px;
  cursor: pointer;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 4px;
  text-align: center;

  width: 100%;
  min-height: 110px;
}

.identity-btn:hover {
  background: black;
}

.identity-btn:hover .id-main,
.identity-btn:hover .id-sub {
  color: #d9ff00;
}

.identity-btn.selected {
  background: #ff2ea6;
  border-color: #ff2ea6;
}

.identity-btn.selected .id-main,
.identity-btn.selected .id-sub {
  color: white;
}

/* ========================
   BUTTON TEXT
======================== */
.id-main,
.id-sub {
  width: 100%;
  text-align: center;
  display: block;
  margin: 0;
}

.id-main {
  font-family: "gear-wide-ultra";
  font-size: 16px;
  letter-spacing: 0.05em;
}

.id-sub {
  font-size: 12px;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

/* ========================
   CONTINUE BUTTON
======================== */
.continue-row {
  display: flex;
  justify-content: flex-end;
  max-width: 780px;
}

.cta-page02 {
  font-family: "gear-wide-ultra";
  font-size: 18px;
  color: #ffffff;
  -webkit-text-stroke: 1.5px black;
  letter-spacing: 2px;
  cursor: pointer;
  transition: 0.2s;
  background: transparent;
  padding: 10px 20px;
}

#continueBtn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ========================
   PAGE CHAT — BASE
======================== */
body.page-chat {
  background: #ffffff;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

body.page-chat::before {
  background-image: linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px);
  background-size: 80px 80px;
}

/* ========================
   CHAT NAVBAR
======================== */
.navbar-chat {
  margin: 20px 20px 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.nav-story-title {
  font-family: "gear-wide-ultra";
  font-size: 11px;
  color: #ff2ea6;
  -webkit-text-stroke: 0.5px black;
  letter-spacing: 2px;
  text-transform: uppercase;
  max-width: 200px;
}

.nav-center-chat {
  font-family: "gear-wide-ultra";
  font-size: 14px;
  color: #ff2ea6;
  -webkit-text-stroke: 1px black;
  letter-spacing: 2px;
  text-align: center;
}

.nav-identity-tag {
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 0.1em;
  color: rgba(0,0,0,0.35);
  text-transform: uppercase;
  text-align: right;
  max-width: 200px;
}

/* ========================
   SITUATION STRIP
======================== */
.situation-strip {
  background: #ff2ea6;
  padding: 12px 40px;
  margin: 20px 20px 0 20px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-shrink: 0;
}

.situation-label {
  font-family: "gear-wide-ultra";
  font-size: 11px;
  letter-spacing: 0.15em;
  color: white;
  white-space: nowrap;
  flex-shrink: 0;
}

.situation-text {
  font-size: 13px;
  font-weight: bold;
  color: white;
  line-height: 1.5;
}

/* ========================
   CHAT MAIN
======================== */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 20px 20px 20px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ========================
   MESSAGE BUBBLES
======================== */
.msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: msgIn 0.3s ease forwards;
}

.msg-label {
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.msg-world .msg-label { color: rgba(0,0,0,0.3); }
.msg-user  .msg-label { color: #ff2ea6; }

.msg-world .msg-bubble {
  display: inline-block;
  border: 2px solid black;
  background: white;
  padding: 12px 16px;
  font-size: 15px;
  line-height: 1.7;
  max-width: 520px;
}

.msg-user .msg-bubble {
  font-family: "gear-wide-ultra";
  font-size: 17px;
  color: rgba(0,0,0,0.4);
  font-style: italic;
  line-height: 1.5;
  align-self: flex-end;
  text-align: right;
}

.msg-user {
  align-items: flex-end;
}

/* Typing dots */
.typing-dots {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 4px 0;
}

.typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: black;
  opacity: 0.25;
  animation: dotBlink 1.3s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

/* ========================
   CHAT INPUT
======================== */
.chat-input-area {
  border-top: 2px solid black;
  padding-top: 16px;
  flex-shrink: 0;
  transition: opacity 0.3s;
}

.turn-indicators {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.turn-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0,0,0,0.15);
  transition: background 0.3s;
}

.turn-dot.done { background: #ff2ea6; }

.chat-input-row {
  display: flex;
  gap: 16px;
  align-items: flex-end;
}

.chat-textarea {
  flex: 1;
  border: none;
  border-bottom: 2px solid black;
  background: transparent;
  font-family: "gear-wide-ultra";
  font-style: italic;
  font-size: 18px;
  padding: 6px 0 8px;
  resize: none;
  outline: none;
  line-height: 1.4;
  transition: border-color 0.15s;
}

.chat-textarea:focus { border-color: #ff2ea6; }
.chat-textarea::placeholder {
  color: rgba(0,0,0,0.2);
  font-style: normal;
  font-family: "Helvetica Neue", sans-serif;
  font-size: 13px;
}

.reply-btn {
  font-family: "gear-wide-ultra";
  font-size: 18px;
  color: #d9ff00;
  -webkit-text-stroke: 1.5px black;
  letter-spacing: 2px;
  background: transparent;
  border: 2px solid black;
  padding: 8px 24px;
  cursor: pointer;
  transition: 0.15s;
  white-space: nowrap;
}

.reply-btn:hover { background: black; color: #d9ff00; -webkit-text-stroke: 0; }
.reply-btn:disabled { opacity: 0.25; cursor: not-allowed; }

/* ========================
   PAGE STORY — BASE
======================== */
body.page-story {
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.page-story::before { display: none; }

/* ========================
   STORY HEADER
======================== */
.story-title-header {
  border-bottom: 2px solid #ff2ea6;
  padding: 16px 30px;
  flex-shrink: 0;
}

.story-header-title {
  font-family: "gear-wide-ultra";
  font-size: clamp(28px, 5vw, 56px);
  color: #ff2ea6;
  -webkit-text-stroke: 0px;
  letter-spacing: 0.03em;
  margin: 0;
  text-transform: uppercase;
  line-height: 1;
}

/* ========================
   STORY BODY
======================== */
.story-main {
  flex: 1;
  padding: 40px 30px;
  display: flex;
  justify-content: center;
}

.story-text-box {
  background: white;
  border: 2px solid #ff2ea6;
  padding: 36px 40px;
  max-width: 860px;
  width: 100%;
}

.story-text {
  font-size: clamp(14px, 1.6vw, 17px);
  line-height: 1.95;
  color: black;
  white-space: pre-wrap;
  margin: 0;
}

/* ========================
   STORY FOOTER NAV
======================== */
.story-footer {
  border-top: 2px solid #ff2ea6;
  padding: 14px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.story-nav-left {
  display: flex;
  gap: 12px;
}

.story-nav-btn {
  font-family: "gear-wide-ultra";
  font-size: 14px;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.3);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 6px 16px;
  cursor: pointer;
  transition: all 0.12s;
  text-transform: uppercase;
}

.story-nav-btn:hover,
.story-nav-btn.active {
  color: #ff2ea6;
  border-color: #ff2ea6;
}

.home-btn { color: rgba(255,255,255,0.3); }
.home-btn:hover { color: white; border-color: white; }

/* ========================
   ANIMATIONS
======================== */
@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes dotBlink {
  0%, 80%, 100% { opacity: 0.15; }
  40%           { opacity: 1; }
}