* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #0e1510;
  color: #c8d4c0;
  font-family: 'Courier New', Courier, monospace;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 860px;
  margin: 0 auto;
  position: relative;
}

/* ── FLICKER ── */
@keyframes flicker {
  0%, 89%, 91%, 93%, 100% { opacity: 1; }
  90% { opacity: 0.25; }
  92% { opacity: 0.7; }
}
@keyframes flicker-slow {
  0%, 96%, 98%, 100% { opacity: 1; }
  97% { opacity: 0.15; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-2px); }
  40% { transform: translateX(2px); }
  60% { transform: translateX(-1px); }
  80% { transform: translateX(1px); }
}
@keyframes pulse-glow {
  0%, 100% { text-shadow: 0 0 8px rgba(140,200,140,0.4); }
  50% { text-shadow: 0 0 18px rgba(140,200,140,0.8), 0 0 40px rgba(80,160,80,0.3); }
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
@keyframes cost-appear {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── SCENE ── */
.scene {
  position: relative;
  flex: 0 0 38%;
  overflow: hidden;
  background: #0a160a;
  border-bottom: 1px solid #1e3020;
  animation: flicker-slow 12s infinite;
}

.scene-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.scene-flicker {
  position: absolute;
  inset: 0;
  background: rgba(160,220,160,0.03);
  animation: flicker 9s infinite;
  pointer-events: none;
}

.scene-blur {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(1.5px);
  pointer-events: none;
}

.stage-label {
  position: absolute;
  top: 0.5rem;
  left: 0.8rem;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: #4a6a4a;
  text-transform: uppercase;
}

/* ── STAFF BADGE ── */
.staff-badge {
  position: absolute;
  bottom: 0.6rem;
  left: 0.8rem;
  animation: slide-up 0.4s ease;
}
.staff-name {
  font-size: 0.75rem;
  font-weight: bold;
  color: #a0d0a0;
  display: block;
}
.staff-title {
  font-size: 0.55rem;
  color: #5a7a5a;
  display: block;
  max-width: 380px;
  line-height: 1.4;
}

/* ── DIALOGUE ── */
.dialogue {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0.8rem 1.2rem;
  overflow: hidden;
  gap: 0.5rem;
}

.blurb {
  font-size: 0.7rem;
  color: #4a6a50;
  font-style: italic;
  animation: slide-up 0.3s ease;
}

.question-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #d8e8d0;
  animation: slide-up 0.35s ease;
}

.question-note {
  font-size: 0.65rem;
  color: #4a6a50;
  font-style: italic;
}

/* ── ANSWERS ── */
.answers {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  overflow-y: auto;
  flex: 1;
  padding-right: 0.3rem;
}

.answers::-webkit-scrollbar { width: 4px; }
.answers::-webkit-scrollbar-track { background: #0e1510; }
.answers::-webkit-scrollbar-thumb { background: #2a3a2a; border-radius: 2px; }

.answer-btn {
  background: #111a11;
  border: 1px solid #1e3020;
  color: #8aaa88;
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  padding: 0.45rem 0.7rem;
  text-align: left;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  animation: slide-up 0.3s ease;
}

.answer-btn:hover {
  background: #162016;
  border-color: #3a5a3a;
  color: #b0c8a8;
}

.answer-btn.selected {
  background: #142814;
  border-color: #4a7a4a;
  color: #c8e8b8;
}

.answer-check {
  flex-shrink: 0;
  color: #3a5a3a;
  font-size: 0.85rem;
  line-height: 1;
  margin-top: 0.05rem;
}

.answer-btn.selected .answer-check {
  color: #70b060;
}

/* ── CONTROLS ── */
.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.4rem;
  border-top: 1px solid #1a2a1a;
  flex-shrink: 0;
}

.progress {
  font-size: 0.6rem;
  color: #3a5a3a;
  letter-spacing: 0.1em;
}

.btn-primary {
  background: #1a3a1a;
  border: 1px solid #3a6a3a;
  color: #8ad08a;
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  padding: 0.45rem 1.2rem;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s;
}

.btn-primary:hover { background: #223a22; border-color: #5a8a5a; color: #b0e8a0; }
.btn-primary:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── INTRO ── */
.intro-scene {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1rem;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.intro-scene::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 29px,
    #0d1a0d 29px,
    #0d1a0d 30px
  ),
  repeating-linear-gradient(
    90deg,
    transparent,
    transparent 29px,
    #0d1a0d 29px,
    #0d1a0d 30px
  );
  opacity: 0.5;
  pointer-events: none;
}

.intro-light {
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 6px;
  background: linear-gradient(to bottom, #c0e8c0, transparent);
  filter: blur(3px);
  animation: flicker 7s infinite;
}

.intro-title {
  font-size: clamp(2.5rem, 8vw, 5rem);
  letter-spacing: 0.4em;
  color: #b8d8b0;
  animation: pulse-glow 3s ease infinite;
  position: relative;
  z-index: 1;
}

.intro-subtitle {
  font-size: 0.75rem;
  color: #4a6a4a;
  letter-spacing: 0.2em;
  position: relative;
  z-index: 1;
}

.intro-text {
  font-size: 0.85rem;
  color: #7a9a78;
  max-width: 480px;
  line-height: 1.8;
  position: relative;
  z-index: 1;
}

.intro-cursor {
  display: inline-block;
  animation: blink-cursor 1s step-end infinite;
}

/* ── DIAGNOSIS ── */
.diagnosis-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.2rem;
  padding: 2rem;
  position: relative;
}

.diagnosis-header {
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: #4a6a4a;
  text-transform: uppercase;
}

.diagnosis-text {
  font-size: 1.1rem;
  color: #d0e8c0;
  max-width: 500px;
  line-height: 1.6;
  border-left: 2px solid #3a6a3a;
  padding-left: 1rem;
  text-align: left;
  animation: pulse-glow 4s ease infinite;
}

.prognosis-text {
  font-size: 0.8rem;
  color: #6a8a68;
  font-style: italic;
}

.diagnosis-note {
  font-size: 0.65rem;
  color: #3a5a3a;
  max-width: 400px;
  line-height: 1.6;
}

/* ── TREATMENT ── */
.treatment-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.2rem;
  overflow: hidden;
}

.treatment-header {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: #4a6a4a;
  text-transform: uppercase;
  flex-shrink: 0;
}

.treatments-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-right: 0.3rem;
}

.treatments-list::-webkit-scrollbar { width: 4px; }
.treatments-list::-webkit-scrollbar-track { background: #0e1510; }
.treatments-list::-webkit-scrollbar-thumb { background: #2a3a2a; }

.treatment-card {
  background: #111a11;
  border: 1px solid #1e3020;
  border-radius: 2px;
  padding: 0.6rem 0.8rem;
  animation: slide-up 0.4s ease;
}

.treatment-name {
  font-size: 0.8rem;
  color: #a0c898;
  display: flex;
  justify-content: space-between;
}

.treatment-cost {
  color: #6a9a68;
}

.treatment-detail {
  font-size: 0.65rem;
  color: #4a6a48;
  margin-top: 0.3rem;
  line-height: 1.5;
}

/* ── INVOICE ── */
.invoice-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0.8rem 1.2rem;
  overflow: hidden;
  gap: 0.5rem;
}

.invoice-header {
  text-align: center;
  flex-shrink: 0;
}

.invoice-hosp {
  font-size: 0.85rem;
  color: #c0d8b8;
  letter-spacing: 0.1em;
}

.invoice-tagline {
  font-size: 0.6rem;
  color: #4a6a4a;
  font-style: italic;
}

.invoice-meta {
  font-size: 0.6rem;
  color: #3a5a3a;
  margin-top: 0.3rem;
}

.invoice-scroll {
  flex: 1;
  overflow-y: auto;
  font-size: 0.68rem;
  padding-right: 0.3rem;
}

.invoice-scroll::-webkit-scrollbar { width: 4px; }
.invoice-scroll::-webkit-scrollbar-track { background: #0e1510; }
.invoice-scroll::-webkit-scrollbar-thumb { background: #2a3a2a; }

.invoice-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.2rem 0;
  border-bottom: 1px dotted #1a2a1a;
  animation: cost-appear 0.3s ease;
  color: #7a9a78;
}

.invoice-row.free { color: #3a5a3a; }
.invoice-row.total-row {
  color: #c0e8b0;
  font-weight: bold;
  border-top: 1px solid #3a6a3a;
  border-bottom: none;
  padding-top: 0.4rem;
  font-size: 0.8rem;
}

.invoice-desc { flex: 1; }
.invoice-cost { flex-shrink: 0; text-align: right; }

.disclaimer {
  font-size: 0.55rem;
  color: #2a4a2a;
  line-height: 1.6;
  margin-top: 0.8rem;
  padding: 0.5rem;
  border: 1px solid #1a2a1a;
  border-radius: 2px;
  font-style: italic;
}

.social-section {
  text-align: center;
  padding: 0.8rem 0 0.4rem;
  flex-shrink: 0;
}

.social-label {
  font-size: 0.65rem;
  color: #4a6a4a;
  letter-spacing: 0.15em;
  display: block;
  margin-bottom: 0.5rem;
}

.stars {
  display: flex;
  justify-content: center;
  gap: 0.3rem;
  margin-bottom: 0.6rem;
}

.star {
  font-size: 1.4rem;
  cursor: pointer;
  color: #2a4a2a;
  transition: color 0.1s;
}
.star.lit { color: #c8a840; }

.social-btns {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  flex-wrap: wrap;
}

.social-btn {
  background: #111a11;
  border: 1px solid #2a4a2a;
  color: #6a9a68;
  font-family: 'Courier New', monospace;
  font-size: 0.65rem;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s;
}

.social-btn:hover { background: #182818; border-color: #4a7a4a; color: #a0c898; }

.end-note {
  text-align: center;
  font-size: 0.6rem;
  color: #2a4a2a;
  letter-spacing: 0.2em;
  padding: 0.4rem 0;
  flex-shrink: 0;
}

/* ── BLINK OVERLAY ── */
@keyframes blink-close {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes blink-open {
  from { opacity: 1; }
  to   { opacity: 0; }
}

#blink-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 999;
}
#blink-overlay.blink-closing {
  animation: blink-close 0.1s ease-in forwards;
}
#blink-overlay.blink-opening {
  animation: blink-open 0.15s ease-out forwards;
}

#scene-art {
  position: absolute;
  inset: 0;
}

/* ── SOUND TOGGLE ── */
.sound-toggle {
  position: fixed;
  top: 0.5rem;
  right: 0.6rem;
  z-index: 200;
  background: #0d1a0d;
  border: 1px solid #2a4a2a;
  color: #3a5a3a;
  font-family: 'Courier New', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  padding: 0.22rem 0.5rem;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s;
}
.sound-toggle:hover { border-color: #4a7a4a; color: #7ab87a; }
.sound-toggle.active { border-color: #4a8a4a; color: #80c880; background: #0e200e; }

#admitted-ad-banner {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, 100%);
  z-index: 50;
}

#admitted-ad-banner .kuro-ad-strip {
  padding: 6px 14px;
}

#admitted-ad-banner .kuro-ad-label {
  display: none;
}

#admitted-ad-banner .kuro-ad-slogan {
  font-size: 0.75rem !important;
  font-family: 'Courier New', monospace !important;
}

#admitted-ad-banner .kuro-ad-cta {
  font-size: 0.62rem !important;
  font-family: 'Courier New', monospace !important;
}
