:root {
  --bg: #0f1218;
  --bg-elev: #171c26;
  --bg-card: #1d2432;
  --bg-card-2: #242d3f;
  --border: rgba(218, 178, 108, 0.18);
  --border-strong: rgba(218, 178, 108, 0.42);
  --text: #f3efe6;
  --text-muted: #a6b0c3;
  --gold: #eab308;
  --gold-soft: #fde68a;
  --cinnabar: #e11d48;
  --cinnabar-2: #f43f5e;
  --jade: #10b981;
  --azure: #38bdf8;
  --purple: #a855f7;
  --orange: #f97316;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --q1: #94a3b8;
  --q2: #22c55e;
  --q3: #38bdf8;
  --q4: #c084fc;
  --q5: #fb923c;
  --q6: #fb7185;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top center, #1c2233 0%, #0f1218 65%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

.hidden {
  display: none !important;
}

/* ================= Auth Gate ================= */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(circle at 20% 20%, rgba(225, 29, 72, 0.18), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(234, 179, 8, 0.16), transparent 45%),
    linear-gradient(160deg, #0d1017 0%, #171e2d 100%);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(24, 30, 42, 0.94);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px);
}

.auth-brand {
  text-align: center;
  margin-bottom: 20px;
}

.auth-emblem {
  width: 58px;
  height: 58px;
  margin: 0 auto 10px;
  border-radius: 16px;
  background: linear-gradient(135deg, #b91c1c, #eab308);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 8px 24px rgba(225, 29, 72, 0.4);
}

.auth-brand h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #fde68a, #f59e0b, #fb7185);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-brand p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(10, 14, 22, 0.65);
  padding: 5px;
  border-radius: 12px;
  margin-bottom: 18px;
}

.auth-tab {
  padding: 9px;
  border-radius: 9px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s;
}

.auth-tab.active {
  background: linear-gradient(135deg, #b91c1c, #dc2626);
  color: #fff;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(11, 15, 23, 0.85);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.input:focus {
  border-color: var(--gold);
}

.auth-error {
  background: rgba(225, 29, 72, 0.16);
  border: 1px solid rgba(225, 29, 72, 0.45);
  color: #fda4af;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
}

.auth-footer-tip {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.auth-footer-tip a {
  color: var(--gold-soft);
  text-decoration: none;
}

/* ================= Buttons & Badges ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  color: var(--text);
  transition: transform 0.12s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: #2c374d;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

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

.btn-primary {
  background: linear-gradient(135deg, #b91c1c, #dc2626);
  border-color: rgba(254, 202, 202, 0.25);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #dc2626, #ef4444);
}

.btn-gold {
  background: linear-gradient(135deg, #ca8a04, #eab308);
  border-color: rgba(254, 240, 138, 0.4);
  color: #1a1203;
}

.btn-gold:hover:not(:disabled) {
  background: linear-gradient(135deg, #eab308, #facc15);
}

.btn-jade {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
}

.btn-azure {
  background: linear-gradient(135deg, #0284c7, #0ea5e9);
  color: #fff;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
  padding: 11px 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
}

.q1 { color: var(--q1); border-color: rgba(148, 163, 184, 0.35); }
.q2 { color: var(--q2); border-color: rgba(34, 197, 94, 0.35); }
.q3 { color: var(--q3); border-color: rgba(56, 189, 248, 0.4); }
.q4 { color: var(--q4); border-color: rgba(192, 132, 252, 0.45); }
.q5 { color: var(--q5); border-color: rgba(251, 146, 60, 0.5); }
.q6 { color: var(--q6); border-color: rgba(251, 113, 133, 0.6); }

/* ================= Top Header & Marquee ================= */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(15, 18, 26, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
}

.topbar-inner {
  max-width: 1460px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #b91c1c, #eab308);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
}

.player-meta {
  min-width: 0;
}

.player-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 14px;
}

.player-title-tag {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(234, 179, 8, 0.16);
  color: var(--gold-soft);
  border: 1px solid rgba(234, 179, 8, 0.35);
}

.player-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.currency-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
}

.stat-pill.spirit {
  border-color: rgba(56, 189, 248, 0.4);
  color: #7dd3fc;
}

.stat-pill.copper {
  border-color: rgba(234, 179, 8, 0.38);
  color: #fde68a;
}

.stat-pill.power {
  border-color: rgba(244, 63, 94, 0.4);
  color: #fda4af;
}

.festival-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #b91c1c, #ea580c);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.45);
  animation: pulseGlow 2.2s infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 12px rgba(239, 68, 68, 0.45); }
  50% { box-shadow: 0 0 24px rgba(250, 204, 21, 0.7); }
}

.marquee-bar {
  background: rgba(17, 22, 34, 0.9);
  border-bottom: 1px solid var(--border);
  padding: 6px 16px;
  font-size: 12px;
  color: var(--gold-soft);
  display: flex;
  align-items: center;
  gap: 10px;
}

.marquee-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

/* ================= Main Responsive Grid ================= */
.layout-grid {
  max-width: 1460px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 310px;
  gap: 16px;
  flex: 1;
}

.sidebar-left, .sidebar-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.main-stage {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px;
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--gold-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-muted);
  font-weight: 600;
  text-align: left;
  transition: all 0.15s;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.nav-btn.active {
  background: linear-gradient(135deg, rgba(185, 28, 28, 0.35), rgba(234, 179, 8, 0.18));
  border: 1px solid var(--border-strong);
  color: #fff;
}

/* ================= Cards & Grids ================= */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 12px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sub-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.sub-tab {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.sub-tab.active {
  background: linear-gradient(135deg, #b91c1c, #dc2626);
  color: #fff;
  border-color: transparent;
}

/* ================= Festival Banner ================= */
.festival-banner {
  background: linear-gradient(135deg, rgba(153, 27, 27, 0.9), rgba(180, 83, 9, 0.85));
  border: 1px solid rgba(253, 224, 71, 0.55);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.festival-banner h3 {
  margin: 0 0 4px;
  font-size: 16px;
  color: #fef08a;
}

.festival-banner p {
  margin: 0;
  font-size: 12px;
  color: #fff7ed;
}

/* ================= Map & Battle ================= */
.map-hero {
  background: linear-gradient(145deg, rgba(29, 36, 50, 0.96), rgba(19, 25, 38, 0.96));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 16px;
}

.map-compass {
  display: grid;
  grid-template-columns: repeat(3, minmax(84px, 1fr));
  gap: 8px;
  max-width: 360px;
  margin-top: 12px;
}

.compass-cell {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.npc-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.hp-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #16a34a, #4ade80);
  transition: width 0.25s ease;
}

.hp-fill.enemy {
  background: linear-gradient(90deg, #dc2626, #fb7185);
}

.battle-arena {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.battle-log {
  max-height: 210px;
  overflow-y: auto;
  background: rgba(9, 12, 18, 0.72);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.battle-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* ================= Logs & Chat ================= */
.log-list {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.log-item {
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid rgba(148, 163, 184, 0.4);
}

.log-item.rare {
  border-left-color: var(--gold);
  background: rgba(234, 179, 8, 0.08);
}

.log-item.system {
  border-left-color: var(--azure);
}

.log-item.warn {
  border-left-color: var(--cinnabar);
}

.log-time {
  color: var(--text-muted);
  margin-right: 6px;
  font-family: monospace;
}

/* ================= Modals & Red Packet Rain ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(4, 7, 13, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}

.rain-stage {
  position: relative;
  width: 100%;
  height: 380px;
  border-radius: 14px;
  overflow: hidden;
  background: radial-gradient(circle at top, #5c0f15 0%, #1d090f 85%);
  border: 2px solid rgba(250, 204, 21, 0.55);
  user-select: none;
  touch-action: manipulation;
}

.rain-packet {
  position: absolute;
  top: -70px;
  width: 56px;
  height: 68px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  cursor: pointer;
  background: linear-gradient(160deg, #ef4444, #b91c1c);
  border: 2px solid #facc15;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  animation: packetFall linear forwards;
  will-change: transform;
}

.rain-packet.golden {
  background: linear-gradient(160deg, #fde047, #d97706);
  border-color: #fff7ed;
  box-shadow: 0 0 22px rgba(250, 204, 21, 0.85);
}

@keyframes packetFall {
  from { transform: translateY(0) rotate(-6deg); }
  to { transform: translateY(470px) rotate(8deg); }
}

.rain-pop {
  position: absolute;
  pointer-events: none;
  font-weight: 800;
  font-size: 16px;
  color: #fde047;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  animation: floatUp 0.65s ease-out forwards;
}

@keyframes floatUp {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-42px) scale(1.25); }
}

/* ================= Toast ================= */
.toast-wrap {
  position: fixed;
  top: 72px;
  right: 16px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
  pointer-events: none;
}

.toast {
  background: rgba(23, 28, 38, 0.96);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: fadeSlide 0.2s ease;
}

.toast.error {
  border-color: rgba(244, 63, 94, 0.7);
  color: #fecdd3;
}

.toast.success {
  border-color: rgba(16, 185, 129, 0.7);
  color: #a7f3d0;
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================= Mobile Bottom Nav ================= */
.mobile-nav {
  display: none;
}

/* ================= Responsive Breakpoints ================= */
@media (max-width: 1120px) {
  .layout-grid {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .sidebar-right {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 820px) {
  body {
    padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  }
  .topbar {
    padding: 8px 12px;
  }
  .layout-grid {
    grid-template-columns: 1fr;
    padding: 10px;
    gap: 10px;
  }
  .sidebar-left {
    display: none;
  }
  .sidebar-right {
    display: flex;
    flex-direction: column;
  }
  .battle-arena {
    grid-template-columns: 1fr;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
  .toast-wrap {
    left: 12px;
    right: 12px;
    max-width: none;
  }
  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: rgba(13, 17, 25, 0.96);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 11px;
    color: var(--text-muted);
    padding: 4px 2px;
    border-radius: 8px;
  }
  .mobile-nav-btn .ico {
    font-size: 18px;
    line-height: 1.1;
  }
  .mobile-nav-btn.active {
    color: var(--gold-soft);
    background: rgba(234, 179, 8, 0.12);
  }
}

/* ================= Visual Art & Portraits ================= */
.auth-hero-art {
  width: 100%;
  height: 148px;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--border-strong);
  position: relative;
  background: #111722;
}

.auth-hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.auth-hero-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(15, 18, 24, 0.88) 100%);
}

.scene-hero {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  min-height: 148px;
  margin-bottom: 14px;
  border: 1px solid var(--border-strong);
  background: #121824;
  display: flex;
  align-items: flex-end;
}

.scene-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.76) saturate(1.08);
}

.scene-hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(12, 16, 24, 0.15) 0%, rgba(12, 16, 24, 0.86) 82%, rgba(12, 16, 24, 0.96) 100%);
}

.scene-hero-body {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 14px 16px;
}

.scene-hero-title {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  color: #fff7ed;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.scene-hero-desc {
  margin: 4px 0 0;
  font-size: 12px;
  color: #e2e8f0;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}

.festival-banner.has-art {
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.festival-banner.has-art::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(84, 10, 22, 0.9) 0%, rgba(120, 20, 28, 0.72) 55%, rgba(28, 10, 14, 0.88) 100%);
  z-index: 0;
}

.festival-banner.has-art > * {
  position: relative;
  z-index: 1;
}

.art-avatar {
  position: relative;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #101521;
  border: 2px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.42);
}

.art-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.art-sm { width: 44px; height: 44px; border-radius: 10px; }
.art-md { width: 58px; height: 58px; border-radius: 12px; }
.art-lg { width: 72px; height: 72px; border-radius: 14px; }
.art-xl { width: 88px; height: 88px; border-radius: 16px; }

.art-elem-tag {
  position: absolute;
  right: 2px;
  bottom: 2px;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  padding: 2px 4px;
  border-radius: 5px;
  background: rgba(10, 14, 22, 0.82);
  color: #fde68a;
  border: 1px solid rgba(250, 204, 21, 0.4);
}

.q1-frame { border-color: #64748b; }
.q2-frame { border-color: #22c55e; box-shadow: 0 0 10px rgba(34, 197, 94, 0.25); }
.q3-frame { border-color: #38bdf8; box-shadow: 0 0 12px rgba(56, 189, 248, 0.3); }
.q4-frame { border-color: #c084fc; box-shadow: 0 0 14px rgba(192, 132, 252, 0.35); }
.q5-frame { border-color: #fb923c; box-shadow: 0 0 16px rgba(251, 146, 60, 0.45); }
.q6-frame { border-color: #fb7185; box-shadow: 0 0 20px rgba(251, 113, 133, 0.55); }

.pet-card-head,
.party-row-art,
.battle-unit-row,
.item-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pet-card-info,
.battle-unit-meta {
  flex: 1;
  min-width: 0;
}

.egg-art-img,
.item-icon-img {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  flex-shrink: 0;
  display: block;
}

.codex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.codex-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.codex-card.locked {
  opacity: 0.62;
  filter: grayscale(0.55);
}

.fest-modal-hero {
  width: 100%;
  height: 150px;
  border-radius: 12px;
  object-fit: cover;
  margin-bottom: 12px;
  border: 1px solid rgba(250, 204, 21, 0.45);
}

@media (max-width: 820px) {
  .scene-hero { min-height: 128px; }
  .art-lg { width: 62px; height: 62px; }
  .codex-grid { grid-template-columns: repeat(2, 1fr); }
}
