:root {
  --bg-deep: #060914;
  --bg-mid: #0e1630;
  --bg-card: rgba(16, 24, 52, 0.78);
  --border-soft: rgba(255, 215, 130, 0.18);
  --border-bright: rgba(255, 215, 130, 0.45);
  --gold: #fbbf24;
  --gold-soft: #fde68a;
  --amber: #f97316;
  --crimson: #fb7185;
  --aurora: #34d399;
  --sky: #38bdf8;
  --text: #f8fafc;
  --muted: #94a3b8;
  --radius: 18px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
  background: radial-gradient(circle at 50% 0%, #17244d 0%, var(--bg-deep) 65%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.theme-lantern {
  background: radial-gradient(circle at 50% 0%, #3a1d14 0%, #12090d 70%);
}
body.theme-confetti {
  background: radial-gradient(circle at 50% 0%, #26164a 0%, #090818 70%);
}
body.theme-aurora {
  background: radial-gradient(circle at 50% 0%, #0d3b3e 0%, #060d18 70%);
}

#sky-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

.site-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px 64px;
}

/* Header */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  flex-wrap: wrap;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.45);
  font-size: 1.15rem;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lang-group {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lang-btn.active,
.lang-btn:hover {
  color: #0b0f1d;
  background: var(--gold);
}

.icon-pill {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-soft);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

/* Hero */
.hero {
  text-align: center;
  padding: 18px 0 22px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: var(--gold-soft);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.hero h1 {
  margin: 0 auto 12px;
  font-size: clamp(1.9rem, 5vw, 3.1rem);
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, #fffbeb 0%, #fde68a 45%, #fb923c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  max-width: 820px;
}

.hero p {
  margin: 0 auto 20px;
  color: #cbd5e1;
  font-size: clamp(0.98rem, 2.2vw, 1.12rem);
  max-width: 640px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 680px;
  margin: 0 auto 24px;
}

.stat-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 10px 8px;
  backdrop-filter: blur(8px);
}

.stat-num {
  display: block;
  font-size: clamp(1.1rem, 3vw, 1.45rem);
  font-weight: 900;
  color: var(--gold-soft);
}

.stat-label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
}

/* Panels */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

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

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.panel-burn {
  border-color: rgba(249, 115, 22, 0.4);
  background: linear-gradient(160deg, rgba(44, 18, 12, 0.84), rgba(16, 20, 42, 0.85));
}

.panel h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fffbeb;
}

.panel-sub {
  margin: 0 0 14px;
  font-size: 0.88rem;
  color: var(--muted);
}

/* Bonfire visual */
.bonfire-stage {
  position: relative;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 90%, rgba(249, 115, 22, 0.25), rgba(6, 9, 20, 0.85) 70%);
  border: 1px solid rgba(251, 146, 60, 0.28);
  padding: 14px;
  margin-bottom: 12px;
  overflow: hidden;
}

.bonfire-stage.burning textarea {
  animation: burnAway 1.15s forwards ease-in;
}

@keyframes burnAway {
  0% {
    filter: brightness(1);
    transform: scale(1);
    opacity: 1;
  }
  40% {
    filter: brightness(1.8) sepia(1) hue-rotate(-25deg);
    box-shadow: 0 0 28px rgba(249, 115, 22, 0.9);
    transform: scale(0.98) translateY(-4px);
    opacity: 0.9;
  }
  100% {
    filter: blur(6px) brightness(2);
    transform: scale(0.86) translateY(-28px);
    opacity: 0;
  }
}

.burn-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Inputs & Buttons */
.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 5px;
}

input[type="text"],
textarea,
select {
  width: 100%;
  background: rgba(7, 11, 24, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  color: var(--text);
  font-size: 0.95rem;
  padding: 10px 12px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.18);
}

.seg-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.seg-btn {
  background: rgba(10, 15, 32, 0.85);
  border: 1px solid var(--border-soft);
  color: #cbd5e1;
  border-radius: 12px;
  padding: 10px 10px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.seg-btn.active {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.22), rgba(249, 115, 22, 0.24));
  border-color: var(--gold);
  color: #fffbeb;
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.22);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

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

.btn-gold {
  background: linear-gradient(135deg, #fbbf24 0%, #f97316 100%);
  color: #140c04;
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.35);
}

.btn-fire {
  background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.35);
}

.btn-ghost {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-soft);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--gold);
}

.btn-full {
  width: 100%;
}

.join-bar {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.join-bar input {
  flex: 1 1 200px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

/* Wall View */
.wall-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.wall-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.wall-title {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 900;
  color: #fffbeb;
}

.code-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: var(--gold-soft);
  padding: 5px 12px;
  border-radius: 999px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 800;
  font-size: 0.86rem;
}

.burned-banner {
  background: rgba(249, 115, 22, 0.12);
  border: 1px dashed rgba(249, 115, 22, 0.45);
  border-radius: 12px;
  padding: 9px 14px;
  font-size: 0.86rem;
  color: #fed7aa;
}

.action-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Lantern / Prediction Grid */
.wish-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 24px;
}

@media (max-width: 760px) {
  .wish-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.wish-card {
  position: relative;
  min-height: 172px;
  border-radius: 16px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--border-soft);
  background: linear-gradient(155deg, rgba(23, 33, 66, 0.9), rgba(10, 15, 32, 0.92));
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.wish-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(251, 191, 36, 0.18);
}

.wish-card.style-gold {
  border-color: rgba(251, 191, 36, 0.5);
  background: linear-gradient(155deg, rgba(66, 42, 12, 0.85), rgba(16, 20, 42, 0.92));
}
.wish-card.style-crimson {
  border-color: rgba(251, 113, 133, 0.5);
  background: linear-gradient(155deg, rgba(72, 18, 34, 0.85), rgba(16, 20, 42, 0.92));
}
.wish-card.style-aurora {
  border-color: rgba(52, 211, 153, 0.5);
  background: linear-gradient(155deg, rgba(12, 60, 52, 0.85), rgba(12, 20, 38, 0.92));
}
.wish-card.style-sakura {
  border-color: rgba(244, 114, 182, 0.5);
  background: linear-gradient(155deg, rgba(70, 22, 58, 0.85), rgba(16, 20, 42, 0.92));
}
.wish-card.style-holo {
  border-color: rgba(56, 189, 248, 0.55);
  background: linear-gradient(155deg, rgba(24, 48, 86, 0.88), rgba(44, 20, 74, 0.9));
}

.wish-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--gold-soft);
  font-weight: 700;
  margin-bottom: 8px;
}

.wish-body {
  font-size: 0.94rem;
  color: #f8fafc;
  word-break: break-word;
  margin-bottom: 10px;
}

.wish-doodle {
  width: 100%;
  height: 54px;
  display: block;
  margin-bottom: 6px;
}

.wish-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--muted);
}

.sealed-mask {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 1;
  gap: 6px;
  color: var(--gold-soft);
  padding: 12px 6px;
}

/* Scratch-Off Gold Foil Overlay */
.scratch-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  touch-action: none;
  cursor: grab;
  border-radius: 15px;
}

.scratch-overlay:active {
  cursor: grabbing;
}

/* Quick prompts & styles */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.chip {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-soft);
  color: #e2e8f0;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.76rem;
  cursor: pointer;
}

.chip.active,
.chip:hover {
  border-color: var(--gold);
  color: var(--gold-soft);
}

.doodle-pad {
  width: 100%;
  height: 120px;
  background: rgba(6, 9, 20, 0.9);
  border: 1px dashed rgba(251, 191, 36, 0.45);
  border-radius: 12px;
  touch-action: none;
  cursor: crosshair;
  display: block;
}

.k-banner {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(249, 115, 22, 0.24));
  border: 1px solid var(--gold);
  border-radius: 16px;
  padding: 16px;
  margin: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  border: 1px solid var(--gold);
  color: #fffbeb;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  z-index: 999;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
  backdrop-filter: blur(6px);
}

.modal-card {
  width: 100%;
  max-width: 460px;
  background: #0e1630;
  border: 1px solid var(--border-bright);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

/* Static SSR SEO Guide Section */
.seo-section {
  margin-top: 42px;
  background: rgba(10, 15, 32, 0.74);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 20px;
  padding: 28px 24px;
}

.seo-section h2 {
  font-size: 1.45rem;
  color: var(--gold-soft);
  margin: 24px 0 10px;
}

.seo-section h2:first-child {
  margin-top: 0;
}

.seo-section h3 {
  font-size: 1.08rem;
  color: #f8fafc;
  margin: 16px 0 6px;
}

.seo-section p,
.seo-section li {
  color: #cbd5e1;
  font-size: 0.94rem;
}

.site-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.84rem;
  color: var(--muted);
}

.site-footer a {
  color: #cbd5e1;
  text-decoration: none;
  margin-right: 14px;
}

.site-footer a:hover {
  color: var(--gold-soft);
}

.hidden {
  display: none !important;
}
