/* ==========================================
   CCworld — Warm Bright Theme v3
   Setup: warm cream light
   Game: warm dark immersive
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@600;700;800;900&display=swap');

/* ── Design tokens ── */
:root {
  /* Warm palette */
  --bg-page:       #FFF8F0;   /* warm cream */
  --bg-card:       #FFFFFF;
  --bg-card-tint:  #FFF4E8;   /* warm card tint */
  --border-card:   #F0D9C0;   /* warm border */
  --shadow-card:   rgba(180,100,40,0.10);

  --accent:        #E8682A;   /* warm orange */
  --accent-dark:   #C04F18;
  --accent-light:  #FFF0E6;
  --accent2:       #F5A623;   /* amber */
  --accent2-dark:  #C07D10;

  --success:       #1D9E75;
  --success-dark:  #0d6b53;
  --success-bg:    #E6F7F1;
  --error:         #D64236;
  --error-dark:    #A02820;
  --error-bg:      #FEF0EF;

  --text-primary:  #2C1810;   /* warm dark brown */
  --text-body:     #4A3020;   /* medium warm brown */
  --text-muted:    #9A7A6A;   /* warm grey-brown */
  --text-faint:    #C4A898;

  /* Game screen (dark warm) */
  --game-bg:       #1E0E04;   /* warm near-black */
  --game-mid:      #2E1808;
  --game-card:     #FFFFFF;
  --game-border:   rgba(255,180,100,0.15);
  --game-text:     rgba(255,240,220,0.90);
  --game-muted:    rgba(255,200,140,0.55);
}

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

body {
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  background: #FFF8F0;
  min-height: 100vh;
  padding: 0 0 16px;
  max-width: 600px;
  margin: 0 auto;
  color: #2C1810;
}

/* ── Screens ── */
.screen { display: none; padding: 0 14px; }
.screen.active { display: block; }

/* ── Game screens get dark warm bg ── */
#s-game, #s-loading, #s-prologue {
  background: #FFF8F0;
  min-height: 100vh;
  padding: 0 14px;
}
#s-result, #s-leaderboard {
  background: #FFF8F0;
  min-height: 100vh;
  padding: 0 14px;
}

/* ── Top nav bar ── */
.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; margin-bottom: 2px; height: 52px; box-sizing: border-box;
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(135deg, #E8682A, #F5A623);
  box-shadow: 0 4px 12px rgba(232,104,42,0.3);
}
.top-bar-logo {
  font-size: 20px; font-weight: 900; letter-spacing: -0.5px;
  color: #FFFFFF; text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.top-bar-right { display: flex; align-items: center; gap: 8px; }


/* ── Hamburger ── */
.hamburger {
  width: 34px; height: 34px; border-radius: 10px;
  background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.3);
  cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
}
.hamburger span { display: block; width: 15px; height: 2px; background: #fff; border-radius: 1px; }

/* ── Sidebar overlay ── */
.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(44,24,16,0.5);
  z-index: 200; opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.sidebar-overlay.open { opacity: 1; pointer-events: all; }

.sidebar {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(300px, 88vw); background: #2C1810;
  border-left: 1px solid rgba(255,180,100,0.15);
  z-index: 201; transform: translateX(110%);
  transition: transform 0.24s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column; overflow-y: auto;
}
.sidebar.open { transform: translateX(0); }
.sidebar-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255,180,100,0.12); flex-shrink: 0;
  background: linear-gradient(135deg, #E8682A, #F5A623);
}
.sidebar-title { font-size: 15px; font-weight: 800; color: #fff; }
.sidebar-close { background: none; border: none; color: rgba(255,255,255,0.8); font-size: 22px; cursor: pointer; }
.sidebar-body { padding: 14px 18px; flex: 1; }
.sidebar-section { margin-bottom: 20px; }
.sidebar-section-title {
  font-size: 10px; font-weight: 800; color: rgba(255,200,140,0.6);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px;
}
.sidebar-auth-logged { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sidebar-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #E8682A, #F5A623);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 900; color: #fff; flex-shrink: 0;
}
.sidebar-user-name { font-size: 13px; font-weight: 800; color: rgba(255,240,220,0.95); }
.sidebar-user-email { font-size: 11px; color: rgba(255,200,140,0.55); margin-top: 1px; }
.sidebar-btn {
  width: 100%; padding: 10px 13px; border-radius: 10px;
  border: 1px solid rgba(255,180,100,0.15); background: rgba(255,255,255,0.06);
  color: rgba(255,240,220,0.85); font-size: 13px; font-weight: 700;
  cursor: pointer; text-align: left; display: flex; align-items: center; gap: 8px;
  transition: background 0.12s; margin-bottom: 5px; font-family: inherit;
}
.sidebar-btn:hover { background: rgba(255,180,100,0.12); }
.sidebar-btn.danger { color: #F97474; border-color: rgba(249,116,116,0.2); }
.sidebar-btn.primary { background: rgba(232,104,42,0.2); border-color: rgba(232,104,42,0.4); color: #FFBF8A; }
.lang-pills { display: flex; gap: 5px; }
.lang-pill {
  flex: 1; padding: 7px; border-radius: 8px;
  border: 1.5px solid rgba(255,180,100,0.2); background: rgba(255,255,255,0.05);
  color: rgba(255,200,140,0.7); font-size: 12px; font-weight: 700;
  cursor: pointer; text-align: center; font-family: inherit;
}
.lang-pill.active { border-color: #F5A623; background: rgba(245,166,35,0.15); color: #F5A623; }
.grade-pill {
  padding: 8px 6px; border-radius: 9px;
  border: 1.5px solid rgba(255,180,100,0.15); background: rgba(255,255,255,0.05);
  color: rgba(255,220,180,0.75); font-size: 12px; font-weight: 700;
  cursor: pointer; text-align: center; font-family: inherit;
}
.grade-pill .grade-age { font-size: 9px; color: rgba(255,180,100,0.4); display: block; margin-top: 2px; }
.grade-pill.active { border-color: #F5A623; background: rgba(245,166,35,0.18); color: #FFD580; }
.sidebar-input {
  width: 100%; padding: 9px 11px;
  border: 1.5px solid rgba(255,180,100,0.15); border-radius: 9px;
  background: rgba(255,255,255,0.06); color: rgba(255,240,220,0.9);
  font-size: 13px; font-family: inherit; outline: none; margin-top: 5px;
}
.sidebar-input:focus { border-color: #E8682A; }
.sidebar-input::placeholder { color: rgba(255,200,140,0.3); }
.sidebar-select {
  width: 100%; padding: 9px 11px;
  border: 1.5px solid rgba(255,180,100,0.15); border-radius: 9px;
  background: #2C1810; color: rgba(255,240,220,0.85);
  font-size: 13px; font-family: inherit; outline: none; margin-bottom: 7px; cursor: pointer;
}

/* ── Card (setup page white cards on warm bg) ── */
.card {
  background: #FFFFFF; border-radius: 16px; padding: 13px;
  margin-bottom: 8px; box-shadow: 0 2px 12px rgba(180,100,40,0.10);
  border: 1px solid #F0D9C0;
}
.card .label {
  font-size: 10px; color: #9A7A6A; font-weight: 800;
  margin-bottom: 9px; display: block; text-transform: uppercase; letter-spacing: 0.8px;
}

/* ── Setup header ── */
.setup-back-bar {
  padding: 14px 0 10px 0; position: sticky; top: 52px;
  background: #FFFAF5; z-index: 90;
}
.setup-header { text-align: center; padding: 8px 0 6px; }

/* ── 设置页表单控件品牌化(select/checkbox)，只改外观，不动底层逻辑 ── */
.picker-trigger-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 20px;
  border: 1.5px solid #F0D9C0; background: #FFFAF5;
  color: #4A3020; font-weight: 700; font-size: 13px;
  font-family: inherit; cursor: pointer;
}
.picker-trigger-btn:hover { border-color: #E8682A; }
.picker-trigger-arrow { color: #C07D10; font-size: 10px; }

.picker-modal-row {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; background: none; border: none; border-top: 1px solid #F0D9C0;
  padding: 14px 20px; font-size: 14px; font-weight: 700; color: #4A3020;
  text-align: left; cursor: pointer; font-family: inherit;
}
.picker-modal-row:first-child { border-top: none; }
.picker-modal-row:hover, .picker-modal-row:active { background: #FFF0E6; }
.picker-modal-row.active { color: #C0491A; }
.picker-modal-check { color: #E8682A; font-weight: 900; }



#s-setup #boss-qtype-checkboxes label {
  display: inline-flex !important; align-items: center; gap: 5px;
  background: #FFFAF5; border: 1.5px solid #F0D9C0; border-radius: 16px;
  padding: 5px 12px 5px 8px !important; font-size: 12px !important; font-weight: 700;
  color: #9A7A6A; cursor: pointer; transition: all 0.15s;
}
#s-setup #boss-qtype-checkboxes label:has(input:checked) {
  background: #FFF0E6; border-color: #E8682A; color: #C0491A;
}
#s-setup #boss-qtype-checkboxes input[type="checkbox"] {
  accent-color: #E8682A; width: 14px; height: 14px; margin: 0;
}
.setup-tagline { font-size: 11px; color: #9A7A6A; font-weight: 600; }

/* ── Mode grid ── */
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.mode-card {
  border-radius: 12px; border: 2px solid #F0D9C0; background: #FFFFFF;
  padding: 10px 8px; cursor: pointer; text-align: center; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.mode-card:hover { border-color: #E8682A; box-shadow: 0 2px 10px rgba(232,104,42,0.15); }
.mode-card.active { border-color: #1D9E75; background: #E6F7F1; }
.mode-card.coming-soon { opacity: 0.5; cursor: not-allowed; }
.mode-card.coming-soon::after {
  content: 'Coming soon'; position: absolute; top: 5px; right: 5px;
  background: #9A7A6A; color: #fff; font-size: 8px; font-weight: 700;
  padding: 2px 5px; border-radius: 6px;
}
.mode-icon { font-size: 22px; }

/* ── Subject chips ── */
.chip {
  padding: 5px 12px; border-radius: 15px;
  border: 1.5px solid #F0D9C0; background: #FFF8F0;
  color: #4A3020; font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: border-color 0.12s;
}
.chip:hover { border-color: #E8682A; color: #E8682A; }
.chip.active { border-color: #E8682A; background: #FFF0E6; color: #C04F18; }

/* ── World / Guide grids ── */
.world-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
@media(max-width:380px){.world-grid{grid-template-columns:repeat(2,1fr);}}
.world-card {
  border-radius: 12px; border: 2px solid #F0D9C0; background: #FFFFFF;
  text-align: center; padding: 5px 3px; cursor: pointer;
  transition: border-color 0.12s; position: relative;
  display: flex; flex-direction: column; align-items: center;
}
.world-card:hover { border-color: #F5A623; }
.world-card.active { border-color: #F5A623; background: #FFF9EC; box-shadow: 0 0 10px rgba(245,166,35,0.2); }
.world-card svg { width: 100%; max-height: 64px; border-radius: 8px; overflow: hidden; }
.world-card-label { font-size: 10px; font-weight: 800; margin-top: 3px; color: #2C1810; }
.world-card .card-desc { font-size: 9px; color: #9A7A6A; margin-top: 1px; line-height: 1.3; display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden; }
.world-card .lore-btn {
  margin-top: 3px; background: none; border: 1px solid #F0D9C0;
  border-radius: 10px; padding: 1px 6px; font-size: 8px; color: #C4A898;
  cursor: pointer; font-weight: 700; font-family: inherit;
}
.active-check {
  position: absolute; top: 4px; right: 4px; background: #F5A623;
  color: #fff; border-radius: 50%; width: 15px; height: 15px;
  font-size: 8px; font-weight: 900; display: none; align-items: center; justify-content: center;
}
.world-card.active .active-check { display: flex; }

.guide-card {
  border-radius: 12px; border: 2px solid #F0D9C0; background: #FFFFFF;
  text-align: center; padding: 5px 3px; cursor: pointer;
  transition: border-color 0.12s; position: relative;
  display: flex; flex-direction: column; align-items: center;
}
.guide-card:hover { border-color: #F5A623; }
.guide-card.active { border-color: #F5A623; background: #FFF9EC; }
.guide-card svg { width: 100%; max-height: 72px; }
.guide-card-name { font-size: 10px; font-weight: 800; margin-top: 2px; color: #2C1810; }
.guide-card .card-desc { font-size: 9px; color: #9A7A6A; margin-top: 1px; line-height: 1.3; display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden; }
.guide-card .lore-btn {
  margin-top: 3px; background: none; border: 1px solid #F0D9C0;
  border-radius: 10px; padding: 1px 6px; font-size: 8px; color: #C4A898;
  cursor: pointer; font-weight: 700; font-family: inherit;
}
.guide-card .active-check { display: none; }
.guide-card.active .active-check { display: flex; }
.card-desc { font-size: 11px; color: #9A7A6A; line-height: 1.5; margin-top: 4px; text-align: center; }

/* ── Q count ── */
.q-num { font-size: 20px; font-weight: 900; color: #2C1810; min-width: 26px; text-align: center; }

/* ── Action buttons ── */
.action-btn {
  width: 100%; padding: 13px;
  background: #E8682A; color: #fff; border: none; border-radius: 14px;
  font-size: 15px; font-weight: 800; cursor: pointer; margin-bottom: 7px;
  font-family: inherit; box-shadow: 0 4px 0 #C04F18;
  transition: transform 0.1s, box-shadow 0.1s;
}
.action-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #C04F18; }
.action-btn:hover { background: #F07830; }
.action-btn.sec { background: #FFFFFF; color: #4A3020; box-shadow: 0 4px 0 #F0D9C0; border: 1px solid #F0D9C0; }
.action-btn.sec:hover { background: #FFF4E8; }
.action-btn.share { background: #7C4DDB; box-shadow: 0 4px 0 #4A2AA0; }
.action-btn.share:hover { background: #8D5AE8; }

/* ── Error ── */
.err { background: #FEF0EF; border: 1.5px solid #F5B8B7; border-radius: 10px; padding: 9px 13px; font-size: 13px; color: #D64236; margin-bottom: 9px; display: none; font-weight: 600; }

/* ── Sidebar inputs (already styled above) ── */
.key-input {
  width: 100%; padding: 9px 11px;
  border: 1.5px solid rgba(255,180,100,0.15); border-radius: 9px;
  background: rgba(255,255,255,0.06); color: rgba(255,240,220,0.9);
  font-size: 13px; font-family: monospace; outline: none;
}
.key-input:focus { border-color: #E8682A; }

/* ── Progress bar (game screen) ── */

/* ── Star row ── */
.star-row { display: flex; gap: 2px; align-items: center; }

/* ── Guide bubble (game screen) ── */
.bubble {
  display: flex; gap: 9px; padding: 11px;
  background: #FFFFFF; border-radius: 14px;
  margin-bottom: 9px; box-shadow: 0 2px 10px rgba(180,80,20,0.1);
  border: 1px solid #F0D9C0;
}
.av {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #E8682A, #F5A623);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 900; color: #fff; flex-shrink: 0;
}
.av-name { font-size: 10px; color: #E8682A; font-weight: 800; margin-bottom: 2px; }
.av-text { font-size: 13px; color: #2C1810; line-height: 1.5; font-weight: 600; }

/* ── Battle arena (game screen — keep dark) ── */
.battle-arena {
  border-radius: 14px; background: linear-gradient(160deg, #200A02, #2E1000);
  margin-bottom: 9px; border: 1px solid rgba(255,140,60,0.12);
  display: flex; align-items: center; justify-content: space-around; padding: 12px 8px;
}
.vs-label { font-size: 13px; font-weight: 900; color: rgba(255,120,60,0.7); letter-spacing: 2px; }
.player-side, .monster-side { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.guide-avatar-battle, .monster-svg { width: 66px; height: 66px; }
.monster-name { font-size: 10px; font-weight: 800; color: rgba(255,220,170,0.7); text-transform: uppercase; }
.player-hp { background: linear-gradient(90deg, #E8682A, #F5A623); }
.monster-hp { background: linear-gradient(90deg, #D64236, #F07830); }

/* ── Question card (game screen — white on dark bg) ── */
.q-card { position: relative; }
.story-before {
  background: #FFF9F5; border-left: 3px solid #E8682A;
  border-radius: 0 9px 9px 0; padding: 9px 11px;
  font-size: 13px; color: #4A3020; line-height: 1.6; font-style: italic; margin-bottom: 9px;
}
.story-divider {
  display: flex; align-items: center; justify-content: center;
  margin: 9px 0; gap: 8px; font-size: 15px;
}
.story-divider::before,.story-divider::after { content:''; flex:1; height:1px; background:#F0D9C0; }
.q-text { font-size: 16px; font-weight: 800; color: #2C1810; line-height: 1.55; margin-bottom: 14px; }
.q-blank {
  display: inline-block; min-width: 52px; border-bottom: 2.5px solid #E8682A;
  text-align: center; color: transparent; padding: 0 7px; margin: 0 3px;
  vertical-align: baseline; position: relative; top: -1px;
}
.q-blank.filled { border-bottom: none; border-radius: 7px; color: #fff; font-weight: 800; padding: 2px 10px; top: 0; }
.q-blank.filled.right { background: #1D9E75; }
.q-blank.filled.wrong { background: #D64236; }

/* ── Drop zone ── */
.drop-zone {
  border: 2px dashed #F0C090; border-radius: 12px; padding: 16px;
  text-align: center; margin-bottom: 12px;
  background: #FFFAF5; min-height: 72px;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.12s, background-color 0.12s;
}
.drop-zone.over { border-color: #E8682A; background: #FFF0E6; }
.drop-zone.result-right { border-color: #1D9E75; background: #E6F7F1; }
.drop-zone.result-wrong { border-color: #D64236; background: #FEF0EF; }
.drop-zone-hint { display: flex; flex-direction: column; align-items: center; gap: 4px; color: #D4A070; font-size: 12px; font-weight: 700; }

/* ── Answer cards ── */
.cards-tray { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-bottom: 5px; }
.answer-card {
  padding: 18px 10px; border-radius: 12px;
  border: 2px solid #F0D9C0; background: #FFFFFF;
  color: #2C1810; font-size: 15px; font-weight: 800;
  cursor: pointer; text-align: center; line-height: 1.4;
  user-select: none; position: relative;
  box-shadow: 0 3px 0 #F0D9C0;
}
.answer-card:active { cursor: grabbing; }
.answer-card.is-placed { opacity: 0.38; cursor: not-allowed; }
.answer-card.is-locked { cursor: not-allowed; }
.answer-card.result-right { border-color: #1D9E75; background: #E6F7F1; box-shadow: 0 3px 0 #0d6b53; color: #0d4a2a; }
.answer-card.result-wrong { border-color: #D64236; background: #FEF0EF; box-shadow: 0 3px 0 #A02820; color: #5a0a06; }
.answer-card.result-reveal { border-color: #1D9E75; background: #E6F7F1; box-shadow: 0 3px 0 #0d6b53; }

/* ── Dragging ghost ── */
.dragging-ghost {
  position: fixed; pointer-events: none; z-index: 9999;
  border-radius: 12px; padding: 12px 16px;
  background: linear-gradient(135deg, #E8682A, #F5A623);
  color: #fff; font-weight: 800; font-size: 13px;
  box-shadow: 0 8px 20px rgba(232,104,42,0.4);
  max-width: 170px; text-align: center; will-change: transform; transform: rotate(2deg);
}

/* ── Confirm / Next buttons ── */
.confirm-btn { background: #7C4DDB !important; box-shadow: 0 4px 0 #4A2AA0 !important; }
.confirm-btn:active { transform: translateY(3px) !important; box-shadow: 0 1px 0 #4A2AA0 !important; }
#btn-next { position: sticky; bottom: 14px; z-index: 10; box-shadow: 0 4px 16px rgba(232,104,42,0.3), 0 0 0 2px rgba(255,255,255,0.6); }

/* ── Feedback ── */
.fb {
  border-radius: 11px; padding: 11px 13px; margin-top: 11px;
  font-size: 13px; line-height: 1.6; font-weight: 700; display: none;
  border-left: 3px solid #1D9E75; background: #E6F7F1; color: #0d4a2a;
}
.fb.bad { border-left-color: #D64236; background: #FEF0EF; color: #5a0a06; }

/* ── Prologue screen ── */
.seed-box { background: #FFFFFF; border: 1px solid #F0D9C0; border-radius: 11px; padding: 11px; margin-bottom: 11px; text-align: center; box-shadow: 0 2px 8px rgba(180,100,40,0.08); }
.seed-id { font-size: 10px; color: #9A7A6A; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 4px; }
.seed-val { font-size: 19px; font-weight: 900; color: #2C1810; letter-spacing: 2px; }
.badge { display: inline-block; border-radius: 7px; padding: 2px 8px; font-size: 11px; font-weight: 800; }
.bt { background: #FFF0E6; color: #C04F18; }
.bp { background: #FFF9EC; color: #8A5C10; }
.bb { background: #F3EDFF; color: #5A2FAA; }

/* ── Loading ── */
.dots { display: flex; gap: 7px; justify-content: center; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #E8682A; animation: bounce 1.2s infinite; }
.dot:nth-child(2){animation-delay:.2s;} .dot:nth-child(3){animation-delay:.4s;}
@keyframes bounce{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-10px)}}

/* ── Result screen ── */
.lb-row { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px solid #F0D9C0; font-size: 13px; color: #4A3020; }
.lb-row:last-child { border-bottom: none; }
.lb-rank { font-weight: 900; color: #9A7A6A; width: 20px; }
.lb-name { flex: 1; font-weight: 700; color: #2C1810; }
.lb-score { font-weight: 800; color: #E8682A; }

/* ── Game top bar ── */
#g-home-btn {
  background: #FFFFFF; border: 1px solid #F0D9C0;
  border-radius: 16px; padding: 5px 11px; font-size: 12px;
  color: #4A3020; cursor: pointer; font-weight: 700; font-family: inherit;
  box-shadow: 0 2px 6px rgba(180,100,40,0.08);
}
#g-home-btn:hover { background: #FFF4E8; }

/* ── Modals ── */
.copy-toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #2C1810; color: #fff; padding: 9px 18px; border-radius: 18px; font-size: 13px; font-weight: 700; z-index: 9999; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.copy-toast.show { opacity: 1; }
.modal-overlay { position: fixed; inset: 0; background: rgba(44,24,16,0.5); z-index: 9000; display: flex; align-items: center; justify-content: center; }
.modal-overlay.hidden { display: none; }
.modal-box { background: #FFFFFF; border-radius: 18px; padding: 22px; width: min(340px,92vw); }
.modal-title { font-size: 17px; font-weight: 800; color: #2C1810; margin-bottom: 5px; }
.modal-sub { font-size: 12px; color: #9A7A6A; margin-bottom: 12px; }
.name-input { width: 100%; padding: 11px; border: 2px solid #F0D9C0; border-radius: 9px; font-size: 14px; font-family: inherit; outline: none; color: #2C1810; }
.name-input:focus { border-color: #E8682A; }

/* ── Particles ── */
#particle-container { position: fixed; inset: 0; pointer-events: none; z-index: 9998; overflow: hidden; }

/* ── Guide Animation ── */
@keyframes guideFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* ── 互动故事专属主题（仅在 body.story-theme 时生效，不影响Boss Rush）── */
.story-theme #g-prog {
  color: #9A9186 !important; font-size: 11px !important; letter-spacing: 0.5px;
}
.story-theme .progress { display: none; }

.story-theme .q-card {
  background: #F2F0EA; border-radius: 16px; padding: 0; overflow: hidden;
  border: 1px solid #E3DFD3; box-shadow: 0 4px 14px rgba(60,54,42,0.06);
}
.story-theme .q-card > div, .story-theme .q-card > .q-text, .story-theme .q-card > .fb {
  padding-left: 20px; padding-right: 20px;
}
.story-theme #g-subject-label, .story-theme #g-subtopic-label { display: none; }
.story-theme #g-chapter-label {
  color: #8A7F6E !important; margin-top: 14px !important; font-size: 10px !important;
}
.story-theme #g-story-before {
  color: #8A7F6E !important; font-size: 12px !important;
}
.story-theme #g-story-divider { display: none !important; }
.story-theme .q-text {
  font-family: Georgia, 'Songti SC', serif; font-size: 15px; font-weight: 400;
  color: #3A342C; line-height: 1.85; margin-bottom: 18px;
  padding-bottom: 20px;
}

.story-theme .bubble {
  background: transparent; box-shadow: none; padding: 10px 4px 6px;
}
.story-theme .av { display: none; }
.story-theme .av-name { display: none; }
.story-theme .av-text { color: #9A8F7D; font-size: 12px; font-style: italic; }

.story-theme .us-choices {
  display: flex; flex-direction: column; gap: 0;
  background: #F2F0EA; border-radius: 0 0 16px 16px; margin: 0; padding: 0 4px 8px;
}
.story-theme .answer-card {
  background: transparent; border: none; border-top: 1px solid #E3DFD3;
  border-radius: 0; box-shadow: none; color: #3A342C; text-align: left;
  font-family: Georgia, 'Songti SC', serif; font-weight: 400; font-size: 14px;
  padding: 14px 34px 14px 20px; position: relative;
}
.story-theme .answer-card::after {
  content: '›'; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-family: system-ui, sans-serif; font-size: 20px; font-weight: 700; color: #C9C2AF;
}
.story-theme .answer-card:hover:not(.is-locked) { background: rgba(232,104,42,0.06); }
.story-theme .answer-card:active:not(.is-locked) { background: rgba(232,104,42,0.12); }
.story-theme .answer-card.is-locked::after { display: none; }
.story-theme .answer-card.us-choice-new {
  background: rgba(245,166,35,0.08);
}
.story-theme .answer-card.result-right {
  background: rgba(29,158,117,0.10); box-shadow: none; color: #157A5A; border-top-color: #E3DFD3;
}
.story-theme .answer-card.result-wrong {
  background: rgba(214,66,54,0.10); box-shadow: none; color: #B22E1F; border-top-color: #E3DFD3;
}
.story-theme .drop-zone { display: none !important; }

.story-theme #us-container { padding-bottom: 0; }

.story-theme .us-header { margin-bottom: 14px; }
.story-theme .us-back-btn { color: #8A7F6E; }
.story-theme .us-chapter { color: #8A7F6E; font-weight: 700; }
.story-theme .us-card {
  background: #F2F0EA; border-radius: 16px 16px 0 0; padding: 0; overflow: hidden;
  border: 1px solid #E3DFD3; border-bottom: none; box-shadow: 0 4px 14px rgba(60,54,42,0.06);
  margin-bottom: 0;
}
.story-theme .us-node-title {
  font-family: Georgia, 'Songti SC', serif; font-size: 18px; font-weight: 700;
  color: #2C1810; border-bottom: none; margin: 20px 20px 10px; padding-bottom: 0;
}
.story-theme .us-node-text {
  font-family: Georgia, 'Songti SC', serif; font-size: 15px; font-weight: 400;
  color: #4A4234; line-height: 1.85; padding: 0 20px 20px;
}


.boss-theme .bubble {
  padding: 7px 11px; box-shadow: none; border: none;
  background: transparent; margin-bottom: 4px;
}
.boss-theme .av { width: 26px; height: 26px; font-size: 12px; }
.boss-theme .av-name { display: none; }
.boss-theme .av-text { font-size: 12px; color: #9A7A6A; font-weight: 700; }

.boss-theme .q-card { background: #fff; border: 1px solid #F0D9C0; border-radius: 14px; padding: 16px; }
.boss-theme .q-text {
  font-size: 19px; font-weight: 800; text-align: center;
  margin-bottom: 4px; color: #1A1410;
}
.boss-theme .story-before {
  font-size: 12px; padding: 6px 10px; margin-bottom: 6px;
  font-style: normal; color: #9A7A6A; border-left-width: 2px;
}
.boss-theme .story-divider { display: none; }
.boss-theme #g-chapter-label { font-size: 10px; padding: 1px 7px; }

.boss-theme .progress { height: 5px; }
.boss-theme .bar { background: linear-gradient(90deg, #D64236, #E8682A); }

.boss-theme .drop-zone {
  border: none; background: transparent; min-height: 0;
  padding: 4px 0; margin-bottom: 6px;
}
.boss-theme .drop-zone-hint { color: #C4A88C; font-size: 11px; }
.boss-theme .drop-zone .dropped-card-label {
  font-size: 13px; font-weight: 700; color: #9A7A6A;
}


.br-fb-header {
  font-size: 15px; font-weight: 800; color: #D64236; text-align: center;
}
.br-fb-sub {
  font-size: 11px; color: #9A7A6A; text-align: center; line-height: 1.4;
  margin-bottom: 2px;
}
.br-fb-q-block {
  background: #fff; border: 1.5px solid #F0D9C0; border-radius: 10px; padding: 9px 10px;
  transition: border-color 0.15s, background-color 0.15s;
}
.br-fb-q-block.br-fb-answered { border-color: #1D9E75; background: #F5FBF8; }
.br-fb-q-status {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
  color: #E8682A; margin-bottom: 4px;
}
.br-fb-q-block.br-fb-answered .br-fb-q-status { color: #1D9E75; }
.br-fb-q-block.br-fb-wrong .br-fb-q-status { color: #D64236; }
.br-fb-q-text { font-size: 13px; font-weight: 800; color: #2C1810; margin-bottom: 7px; line-height: 1.35; }
.br-fb-options { display: flex; gap: 7px; }
.br-fb-opt-btn {
  flex: 1; background: #FFF8F0; border: 2px solid #F0D9C0; border-radius: 9px;
  padding: 7px 8px; font-size: 12px; font-weight: 700; color: #2C1810;
  cursor: pointer; text-align: center;
}
.br-fb-opt-btn.br-fb-opt-correct {
  border-color: #1D9E75; background: #E6F7F1; color: #0d4a2a; opacity: 1 !important;
}
.br-fb-opt-btn.br-fb-opt-wrong {
  border-color: #D64236; background: #FEF0EF; color: #8a241c; opacity: 1 !important;
}
.br-fb-q-block.br-fb-answered .br-fb-opt-btn:not(.br-fb-opt-correct):not(.br-fb-opt-wrong) { opacity: 0.4; }

.br-player-hit-flash {
  position: absolute; inset: -3px; border-radius: 18px;
  pointer-events: none; opacity: 0;
  box-shadow: 0 0 0 3px rgba(214,66,54,0.75), 0 0 18px rgba(214,66,54,0.55);
}
.br-player-hit-active { animation: flashCrit 0.5s ease-out; }

.br-result-stat {
  background: #FFF0E6; border-radius: 10px; padding: 7px 13px;
  font-size: 12px; font-weight: 700; color: #C0491A;
  border: 1px solid #F0D9C0;
}

.br-boss-row { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.br-boss-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: #FFF0E6; border: 2px solid #F0D9C0;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; flex-shrink: 0;
}
.br-boss-info { flex: 1; min-width: 0; }

.br-hit-shake { animation: hitShake 0.32s ease-out; }
.br-hit-shake-crit { animation: hitShakeCrit 0.4s ease-out; }
@keyframes hitShake {
  0% { transform: translateX(0) scale(1); }
  20% { transform: translateX(-4px) scale(0.96); }
  40% { transform: translateX(4px) scale(0.96); }
  60% { transform: translateX(-2px) scale(1); }
  100% { transform: translateX(0) scale(1); }
}
@keyframes hitShakeCrit {
  0% { transform: translateX(0) scale(1) rotate(0); }
  15% { transform: translateX(-6px) scale(0.9) rotate(-4deg); }
  35% { transform: translateX(6px) scale(0.9) rotate(4deg); }
  55% { transform: translateX(-3px) scale(1.05) rotate(-2deg); }
  75% { transform: translateX(3px) scale(1.05) rotate(2deg); }
  100% { transform: translateX(0) scale(1) rotate(0); }
}
.br-hp-hit { animation: hpHit 0.3s ease-out; }
@keyframes hpHit {
  0% { filter: brightness(1); }
  30% { filter: brightness(1.8) saturate(1.3); }
  100% { filter: brightness(1); }
}

.br-top-bar {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 10px;
}
.br-stage-label {
  font-size: 11px; font-weight: 800; color: #E8682A;
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px;
}
.br-boss-name { font-size: 17px; font-weight: 800; color: #2C1810; }
.br-combo-badge {
  background: #2C1810; color: #FFF8F0; font-size: 12px; font-weight: 800;
  padding: 5px 13px; border-radius: 20px; white-space: nowrap;
  animation: comboPop 0.2s ease-out;
}
@keyframes comboPop { 0% { transform: scale(0.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.br-hp-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.br-hp-label { font-size: 11px; font-weight: 700; color: #9A7A6A; text-transform: uppercase; letter-spacing: 0.5px; }
.br-hp-text { font-size: 12px; font-weight: 800; color: #2C1810; }
.br-hp-track { height: 10px; background: #F0D9C0; border-radius: 6px; overflow: hidden; margin-bottom: 6px; }
.br-hp-fill { height: 100%; background: #D64236; border-radius: 6px; transition: width 0.35s ease; }

.br-dmg-popup {
  text-align: center; font-size: 22px; font-weight: 800; color: #E8682A;
  margin-bottom: 4px; height: 28px; line-height: 28px;
  opacity: 0; visibility: hidden;
}
.br-dmg-popup.br-dmg-crit { color: #D64236; font-size: 26px; }
.br-dmg-anim { visibility: visible; animation: dmgFloat 0.7s ease-out; }
@keyframes dmgFloat {
  0% { opacity: 0; transform: translateY(6px) scale(0.9); }
  30% { opacity: 1; transform: translateY(0) scale(1.05); }
  100% { opacity: 0; transform: translateY(-10px) scale(1); }
}

.br-taunt {
  font-size: 13px; font-style: italic; color: #4A3020; text-align: center;
  padding: 8px; margin-bottom: 12px; background: #FFF0E6; border-radius: 8px;
  border-left: 3px solid #E8682A;
}
.br-crit-wrap {
  background: #fff; border-radius: 10px; padding: 8px 12px;
  border: 1px solid #F0D9C0; margin-bottom: 12px;
}
.br-crit-label { font-size: 11px; font-weight: 800; color: #2C1810; display: block; margin-bottom: 6px; }
.br-crit-track { height: 8px; background: #F0D9C0; border-radius: 4px; overflow: hidden; }
.br-crit-bar { height: 100%; background: #E8682A; width: 100%; transition: width 0.1s linear; }

@keyframes bounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}
body.boss-theme #br-hud {
  position: sticky; top: 52px; z-index: 40;
  background: #FFF8F0; padding-top: 8px; padding-bottom: 8px;
  box-shadow: 0 4px 10px rgba(44,24,16,0.08);
}

#br-hud { position: relative; }
.br-crit-flash {
  position: absolute; inset: -3px; border-radius: 18px;
  pointer-events: none; opacity: 0;
  box-shadow: 0 0 0 3px rgba(232,104,42,0.7), 0 0 16px rgba(232,104,42,0.5);
}
.br-crit-active {
  animation: flashCrit 0.45s ease-out;
}
@keyframes flashCrit {
  0% { opacity: 0; }
  35% { opacity: 1; }
  100% { opacity: 0; }
}

/* ── Battle animations ── */
@keyframes hitShake{0%,100%{transform:translateX(0)}25%{transform:translateX(-5px)}75%{transform:translateX(5px)}}
.battle-guide-avatar.hit,.monster-svg.hit{animation:hitShake 0.35s ease;}

/* ── Lore modal ── */
#lore-modal { display: none; position: fixed; inset: 0; background: rgba(44,24,16,0.6); z-index: 9200; align-items: flex-start; justify-content: center; padding: 16px; overflow-y: auto; }
#lore-box { background: #FFFFFF; border-radius: 20px; width: min(500px,96vw); box-shadow: 0 20px 60px rgba(44,24,16,0.3); margin: auto; }
#lore-body { padding: 14px 18px 24px; font-size: 13px; color: #4A3020; line-height: 1.8; white-space: pre-line; }



/* ── Misc ── */
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.sep { border: none; border-top: 1px solid #F0D9C0; margin: 12px 0; }

/* ── Topic picker (grid) ── */
#rogue-topic-card { border: 1px solid #F0D9C0; }

/* ── Auth modal ── */
#auth-modal > div { background: #FFFFFF; }
#profile-modal > div { background: #FFFFFF; }

/* ── World customize textarea ── */
#world-custom-input:focus { border-color: #E8682A !important; background: #FFFFFF !important; }
#world-custom-input::placeholder { color: #C4A898; }
#world-custom-input:disabled { background: #F5F0E8 !important; color: #C4A898; cursor: not-allowed; }

/* ==========================================
   Discover Feed
   ========================================== */
/* ── Home page discover grid ── */
.home-discover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.home-disc-card {
  background: #FFFFFF; border: 1.5px solid #F0D9C0; border-radius: 14px;
  padding: 12px; display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 4px 16px rgba(180,100,40,0.08); cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.home-disc-card:active { transform: scale(0.96); }
.home-disc-mode {
  font-size: 10px; font-weight: 800; color: #E8682A;
  background: #FFF0E6; padding: 3px 8px; border-radius: 8px;
  align-self: flex-start;
}
.home-disc-title {
  font-size: 13px; font-weight: 700; color: #2C1810; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.home-disc-meta {
  font-size: 10px; color: #9A7A6A; font-weight: 600;
  margin-top: auto; display: flex; justify-content: space-between; align-items: center;
}
.home-disc-play {
  font-size: 11px; font-weight: 800; color: #FFF; background: #E8682A;
  padding: 4px 10px; border-radius: 10px; border: none; cursor: pointer;
  width: 100%; margin-top: 6px;
}
.home-disc-score {
  display: flex; align-items: center; justify-content: center;
  background: #E6F7F1; border: 1px solid #A2E1C9; border-radius: 8px;
  font-size: 11px; font-weight: 800; color: #2E7D32;
  padding: 4px; margin-top: 6px; gap: 4px;
}
.home-disc-score svg { width: 14px; height: 14px; }

/* ── Filter sticky bar ── */
.disc-sticky-bar {
  background: #FFF8F0;
  padding: 10px 14px 4px;
  margin: 0 -14px 12px;
  border-bottom: 1px solid #F0D9C0;
  position: sticky; top: 52px; z-index: 40;
}
.disc-chip {
  background: #FFFFFF; border: 1.5px solid #F0D9C0;
  border-radius: 16px; padding: 4px 12px;
  font-size: 12px; font-weight: 700; color: #9A7A6A;
  cursor: pointer; flex-shrink: 0; white-space: nowrap;
  transition: all 0.2s;
}
.disc-chip.active {
  background: #FFF0E6; border-color: #E8682A; color: #C04F18;
}
#disc-back-to-top {
  position: fixed; right: 18px; bottom: 24px; z-index: 80;
  width: 42px; height: 42px; border-radius: 50%; border: none;
  background: #E8682A; color: #fff; font-size: 18px; font-weight: 900;
  box-shadow: 0 4px 14px rgba(232,104,42,0.4); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
#disc-back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }


.discover-card {
  background: #FFFFFF; border-radius: 18px;
  border: 1.5px solid #F0D9C0;
  box-shadow: 0 4px 20px rgba(180,100,40,0.12);
  overflow: hidden;
}
.discover-card-art svg { width: 100%; max-height: 160px; }
.discover-guide-chip svg { width: 18px; height: 18px; }

/* ── Horizontal scroll grids (mode / world / guide) ── */
.mode-grid-scroll, .world-grid-scroll, .guide-grid-scroll {
  display: flex;
  overflow-x: auto;
  gap: 9px;
  padding-bottom: 8px;
  padding-right: 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #F0D9C0 transparent;
}
.mode-grid-scroll::-webkit-scrollbar,
.world-grid-scroll::-webkit-scrollbar,
.guide-grid-scroll::-webkit-scrollbar {
  height: 4px;
}
.mode-grid-scroll::-webkit-scrollbar-thumb,
.world-grid-scroll::-webkit-scrollbar-thumb,
.guide-grid-scroll::-webkit-scrollbar-thumb {
  background: #F0D9C0; border-radius: 2px;
}

/* Each item: fixed width + snap */
.mode-grid-scroll .mode-card {
  flex: 0 0 148px; scroll-snap-align: start;
  min-width: 148px;
}
.world-grid-scroll .world-card,
.guide-grid-scroll .guide-card {
  flex: 0 0 105px; scroll-snap-align: start;
  min-width: 105px;
}

/* Scroll hint arrow on right edge */
@keyframes scrollPulse { 0%,100%{opacity:.4} 50%{opacity:1} }

/* ==========================================
   Interactive Story Editor + Player
   ========================================== */
#s-story-editor {
  background: #FFF8F0;
  min-height: 100vh;
  padding: 10px 14px 22px;
}

.story-top, .story-player-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.story-back-btn {
  background: #FFFFFF;
  border: 1.5px solid #F0D9C0;
  border-radius: 18px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 800;
  color: #4A3020;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}
.story-back-btn:hover { border-color: #E8682A; color: #C04F18; }
.story-top-title {
  font-size: 20px;
  font-weight: 900;
  color: #2C1810;
  line-height: 1.2;
}
.story-top-sub {
  font-size: 12px;
  color: #9A7A6A;
  font-weight: 700;
  margin-top: 2px;
}
.story-editor-workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}
@media(max-width: 768px) {
  .story-editor-workspace { flex-direction: column; }
}

.story-chat-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #F8F9FA;
  border-right: 1px solid #E0E0E0;
  min-width: 300px;
}
@media(max-width: 768px) {
  .story-chat-pane { border-right: none; border-bottom: 1px solid #E0E0E0; min-height: 50vh; }
}

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

.chat-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
  position: relative;
}

.chat-bubble.ai {
  align-self: flex-start;
  background: #FFFFFF;
  color: #333;
  border: 1px solid #E0E0E0;
  border-bottom-left-radius: 4px;
}

.chat-bubble.user {
  align-self: flex-end;
  background: #6C3EE8;
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

.chat-input-area {
  padding: 12px 20px;
  background: #FFFFFF;
  border-top: 1px solid #E0E0E0;
  display: flex;
  gap: 8px;
}

.chat-input-area textarea {
  flex: 1;
  height: 40px;
  min-height: 40px;
  max-height: 120px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid #CCC;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.chat-input-area textarea:focus { border-color: #6C3EE8; }

.chat-send-btn {
  background: #6C3EE8;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}
.chat-send-btn:hover { opacity: 0.9; }
.chat-send-btn:disabled { background: #CCC; cursor: not-allowed; }


.story-code-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px 20px;
  background: #FFFFFF;
  overflow: hidden;
}

.story-editor-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.story-editor-actions.bottom {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.story-mini-btn {
  border: 1.5px solid #F0D9C0;
  background: #FFFFFF;
  border-radius: 10px;
  padding: 9px 8px;
  font-size: 12px;
  font-weight: 800;
  color: #4A3020;
  cursor: pointer;
  font-family: inherit;
}
.story-mini-btn:hover { border-color: #E8682A; color: #C04F18; }
.story-json-input {
  width: 100%;
  min-height: 420px;
  resize: vertical;
  border: 1.5px solid #F0D9C0;
  border-radius: 14px;
  padding: 13px;
  background: #2C1810;
  color: #FFF8F0;
  font-family: Consolas, Menlo, Monaco, monospace;
  font-size: 12px;
  line-height: 1.55;
  outline: none;
  box-shadow: 0 2px 12px rgba(180,100,40,0.10);
}
.story-json-input:focus { border-color: #E8682A; }
.story-json-input::placeholder { color: rgba(255,240,220,0.45); }
.story-validation {
  margin-top: 10px;
  border-radius: 12px;
  border: 1.5px solid #F0D9C0;
  background: #FFFFFF;
  padding: 11px 13px;
  font-size: 12px;
  color: #4A3020;
  line-height: 1.55;
}
.story-validation.ok { border-color: #A7F3D0; background: #E6F7F1; }
.story-validation.bad { border-color: #F5B8B7; background: #FEF0EF; }
.story-validation-title {
  font-size: 13px;
  font-weight: 900;
  color: #2C1810;
  margin-bottom: 6px;
}
.story-validation-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.story-validation-stats span {
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(180,100,40,0.12);
  border-radius: 14px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
}
.story-validation-block { margin-top: 6px; }
.story-validation-block b { display: block; margin-bottom: 3px; }
.story-validation ul { padding-left: 18px; }
