/* ============ RESET & BASE ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #0a0e17;
  --bg1: #0f1320;
  --bg2: #111827;
  --bg3: #1a2235;
  --bg4: #243049;
  --surface: #1e293b;
  --border: #2d3a4f;
  --text: #e2e8f0;
  --text1: #f1f5f9;
  --text2: #94a3b8;
  --text3: #64748b;
  --accent: #6366f1;
  --accent2: #818cf8;
  --accent-glow: rgba(99,102,241,0.3);
  --green: #22c55e;
  --green-glow: rgba(34,197,94,0.2);
  --orange: #f59e0b;
  --red: #ef4444;
  --pink: #ec4899;
  --cyan: #06b6d4;
  --gold: #fbbf24;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
}

/* ===== Light Theme ===== */
[data-theme="light"] {
  --bg: #f5f7fa;
  --bg1: #ffffff;
  --bg2: #ffffff;
  --bg3: #f0f2f5;
  --bg4: #e5e7eb;
  --surface: #ffffff;
  --border: #d1d5db;
  --text: #1f2937;
  --text1: #111827;
  --text2: #4b5563;
  --text3: #9ca3af;
  --accent: #6366f1;
  --accent2: #4f46e5;
  --accent-glow: rgba(99,102,241,0.15);
  --green: #16a34a;
  --green-glow: rgba(22,163,74,0.1);
  --orange: #d97706;
  --red: #dc2626;
  --pink: #db2777;
  --cyan: #0891b2;
  --gold: #d97706;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
}
[data-theme="light"] .ov-door { background: #e5e7eb; }
/* town/building/floor light overrides moved to end of file for specificity over !important dark rules */
[data-theme="light"] ::-webkit-scrollbar-thumb { background: #c4c9d4; }
[data-theme="light"] .admin-sidebar { background: #f8fafc; border-color: #e5e7eb; }
[data-theme="light"] .admin-main { background: #f5f7fa; }
[data-theme="light"] .admin-card { background: #fff; border-color: #e5e7eb; }
[data-theme="light"] .admin-table th { background: #f8fafc; color: var(--text2); }
[data-theme="light"] .admin-table td { border-color: #e5e7eb; }
[data-theme="light"] .admin-input { background: #f5f7fa; border-color: #d1d5db; color: var(--text1); }
[data-theme="light"] .admin-btn { background: var(--accent); color: #fff; }
[data-theme="light"] .admin-menu-item { color: var(--text2); }
[data-theme="light"] .admin-menu-item:hover { background: #f0f2f5; }
[data-theme="light"] .admin-menu-item.active { background: rgba(99,102,241,0.1); color: var(--accent); }
[data-theme="light"] .cons-msg-row.self .cons-msg-bubble { color: #fff; }
[data-theme="light"] .cons-msg-row:not(.self) .cons-msg-bubble { background: #e8ecf4; }
[data-theme="light"] .chat-item:hover { background: #f0f2f5; }
[data-theme="light"] .chat-item.active { background: rgba(99,102,241,0.08); }
[data-theme="light"] .bbs-post-card { background: #fff; border-color: #e5e7eb; }
[data-theme="light"] .bbs-post-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
[data-theme="light"] .task-wall { background: rgba(255,255,255,0.8); border-color: rgba(99,102,241,0.15); }
[data-theme="light"] .tw-card { background: #fff; border-color: #e5e7eb; }
[data-theme="light"] .tw-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
[data-theme="light"] .plaza-card { background: #fff; border-color: #e5e7eb; }
[data-theme="light"] .skill-post { background: #f8fafc; }
[data-theme="light"] .skill-post:hover { background: #f0f2f5; }
[data-theme="light"] .feed-item { background: #fff; border-color: #e5e7eb; }
[data-theme="light"] .plaza-banner { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
[data-theme="light"] .plaza-banner h3 { color: #fff !important; }
[data-theme="light"] .plaza-banner p { color: rgba(255,255,255,0.85) !important; }
[data-theme="light"] .banner-meta { color: rgba(255,255,255,0.7) !important; }
[data-theme="light"] .banner-team-count { color: rgba(255,255,255,0.85) !important; }
[data-theme="light"] .nav-bar { background: #fff; border-color: #e5e7eb; }
[data-theme="light"] .nav-tab:hover { background: #f0f2f5; }
[data-theme="light"] .nav-tab.active { background: rgba(99,102,241,0.1); color: var(--accent); }
[data-theme="light"] .town-header { background: #fff; }
[data-theme="light"] .chat-header { background: #fff; border-color: #e5e7eb; }
[data-theme="light"] .chat-input { background: #fff; border-color: #e5e7eb; }
[data-theme="light"] .chat-input input { background: #f5f7fa; color: var(--text1); border-color: #d1d5db; }
[data-theme="light"] .chat-messages { background: #f8fafc; }
[data-theme="light"] .msg-bubble { background: #e8ecf4; color: var(--text1); }
[data-theme="light"] .msg.sent .msg-bubble { background: var(--accent); color: #fff; }
[data-theme="light"] .msg-avatar { background: #e8ecf4; }
[data-theme="light"] .view { background: var(--bg); }
[data-theme="light"] .boss-left-panel { background: #fff; border-color: #e5e7eb; }
[data-theme="light"] .boss-right-panel { background: #f8fafc; border-color: #e5e7eb; }
[data-theme="light"] .opc-chat-sidebar { background: #fff; border-color: #e5e7eb; }
[data-theme="light"] .opc-chat-main { background: #f8fafc; }
[data-theme="light"] .opc-right-tabs-panel { background: #fff; border-color: #e5e7eb; }
[data-theme="light"] .task-panel { background: #fff; border-color: #e5e7eb; }
[data-theme="light"] .bbs-modal-content { background: #fff; }
[data-theme="light"] .bbs-modal-header { border-color: #e5e7eb; color: var(--text1); }
[data-theme="light"] .bbs-modal-close:hover { background: #f0f2f5; }
html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; background: var(--bg); color: var(--text); overflow: hidden; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 4px; }
button { cursor: pointer; border: none; background: none; color: inherit; font-family: inherit; }
input, textarea { font-family: inherit; }

/* ============ OPENVERSE DOOR ============ */
.ov-door {
  position: fixed; inset: 0; z-index: 2000;
  background: #020408;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  cursor: pointer; overflow: hidden; perspective: 1200px;
  transition: opacity 0.8s ease 0.4s, visibility 0.8s ease 0.4s;
}
.ov-door.gone { opacity: 0; visibility: hidden; pointer-events: none; }

/* Starfield */
.ov-stars { position: absolute; inset: 0; }
.ov-star {
  position: absolute; width: 2px; height: 2px; background: white; border-radius: 50%;
  animation: starTwinkle var(--dur) ease-in-out infinite;
  opacity: var(--opa);
}
@keyframes starTwinkle { 0%,100% { opacity: var(--opa); } 50% { opacity: 0.1; } }

/* Door Frame */
.ov-door-frame {
  width: 280px; height: 420px; position: relative;
  transform-style: preserve-3d;
  border: 2px solid rgba(99,102,241,0.3); border-radius: 4px 4px 0 0;
  box-shadow: 0 0 60px rgba(99,102,241,0.15), inset 0 0 60px rgba(99,102,241,0.05);
  overflow: hidden;
}
/* Door panels */
.ov-door-left, .ov-door-right {
  position: absolute; top: 0; width: 50%; height: 100%;
  transition: transform 1.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d; z-index: 2;
}
.ov-door-left { left: 0; transform-origin: left center; }
.ov-door-right { right: 0; transform-origin: right center; }
.ov-door.opening .ov-door-left { transform: rotateY(-105deg); }
.ov-door.opening .ov-door-right { transform: rotateY(105deg); }

.ov-door-surface {
  width: 100%; height: 100%;
  background: linear-gradient(180deg, #0d1117 0%, #161b22 40%, #0d1117 100%);
  border: 1px solid rgba(99,102,241,0.2);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  backface-visibility: hidden;
}
.ov-door-glyph {
  font-size: 16px; font-weight: 900; letter-spacing: 6px; color: rgba(99,102,241,0.4);
  writing-mode: vertical-lr; text-orientation: mixed;
}
/* Circuit lines on door */
.ov-door-circuit {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, transparent 49%, rgba(99,102,241,0.06) 49%, rgba(99,102,241,0.06) 51%, transparent 51%),
    linear-gradient(0deg, transparent 49%, rgba(99,102,241,0.06) 49%, rgba(99,102,241,0.06) 51%, transparent 51%);
  background-size: 20px 20px;
}

/* Light beam */
.ov-door-light {
  position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(ellipse at center, rgba(99,102,241,0.0) 0%, transparent 70%);
  transition: all 1.4s ease;
}
.ov-door.opening .ov-door-light {
  background: radial-gradient(ellipse at center, rgba(99,102,241,0.6) 0%, rgba(6,182,212,0.3) 40%, transparent 70%);
}
.ov-door.opened .ov-door-light {
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.9) 0%, rgba(99,102,241,0.4) 40%, transparent 70%);
}

/* Inner world visible through door */
.ov-inner-world {
  position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(ellipse at center, #1a1040 0%, #0a0e17 100%);
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  opacity: 0; transition: opacity 1s ease 0.6s;
}
.ov-door.opening .ov-inner-world { opacity: 1; }
.ov-inner-glow {
  position: absolute; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.3) 0%, transparent 70%);
  animation: innerPulse 3s ease-in-out infinite;
}
@keyframes innerPulse { 0%,100% { transform: scale(1); opacity: 0.5; } 50% { transform: scale(1.5); opacity: 1; } }
.ov-inner-text { position: relative; z-index: 1; text-align: center; }
.ov-logo-taigo { font-size: 28px; font-weight: 900; color: white; letter-spacing: 4px; }
.ov-logo-sub { font-size: 11px; color: rgba(255,255,255,0.6); margin-top: 4px; letter-spacing: 2px; }

/* Brand text below door */
.ov-brand { text-align: center; margin-top: 40px; position: relative; z-index: 10; }
.ov-brand-name {
  font-size: 42px; font-weight: 900; letter-spacing: 12px;
  background: linear-gradient(135deg, #818cf8, #06b6d4, #ec4899);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: brandShimmer 4s ease infinite;
  background-size: 200% 200%;
}
@keyframes brandShimmer { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.ov-brand-slogan {
  font-size: 15px; color: rgba(255,255,255,0.5); letter-spacing: 8px; margin-top: 8px;
  font-weight: 300;
}

/* Click prompt */
.ov-prompt {
  position: absolute; bottom: 60px; font-size: 13px; color: rgba(255,255,255,0.3);
  letter-spacing: 2px; animation: promptPulse 2.5s ease-in-out infinite;
}
@keyframes promptPulse { 0%,100% { opacity: 0.3; } 50% { opacity: 0.8; } }
.ov-door.opening .ov-prompt { opacity: 0; transition: opacity 0.3s; }

/* Rush-in effect after door opens */
.ov-door.rushing {
  animation: rushIn 1.2s cubic-bezier(0.4, 0, 0, 1) forwards;
}
@keyframes rushIn {
  0% { transform: scale(1); }
  100% { transform: scale(8); opacity: 0; }
}

/* Hidden initially */
.hidden-initial { display: none; }

/* ============ LOADING ============ */
.loading-screen {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s, visibility 0.6s;
}
.loading-screen.fade-out { opacity: 0; visibility: hidden; }
.loading-content { text-align: center; }
.loading-logo {
  font-size: 64px; font-weight: 900; letter-spacing: 8px;
  background: linear-gradient(135deg, var(--accent), var(--cyan), var(--pink));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: pulse 2s ease-in-out infinite;
}
.loading-subtitle { color: var(--text2); margin-top: 8px; font-size: 14px; letter-spacing: 4px; }
.loading-bar { width: 200px; height: 3px; background: var(--bg3); border-radius: 2px; margin: 24px auto 12px; overflow: hidden; }
.loading-bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--cyan)); border-radius: 2px; animation: loadFill 2s ease-in-out forwards; }
.loading-text { color: var(--text3); font-size: 12px; animation: blink 1s infinite; }
@keyframes loadFill { to { width: 100%; } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.hidden { display: none !important; }

/* ============ TOP NAV ============ */
.top-nav {
  height: 56px; background: var(--bg2); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
}
.nav-left { display: flex; align-items: center; gap: 12px; }
.logo { display: flex; align-items: center; gap: 8px; }
.logo-icon { font-size: 24px; }
.logo-text { font-size: 20px; font-weight: 900; letter-spacing: 2px; background: linear-gradient(135deg, var(--accent), var(--cyan)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.logo-badge { font-size: 10px; background: var(--accent); color: white; padding: 2px 6px; border-radius: 4px; font-weight: 700; }
.guide-btn {
  margin-left: 12px; padding: 5px 14px; border-radius: 16px; font-size: 12px; font-weight: 600;
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(236,72,153,0.15));
  border: 1px solid var(--accent); color: var(--accent2); cursor: pointer;
  transition: all 0.25s; white-space: nowrap;
}
.guide-btn:hover { background: linear-gradient(135deg, rgba(99,102,241,0.3), rgba(236,72,153,0.3)); transform: translateY(-1px); box-shadow: 0 4px 16px var(--accent-glow); }
.nav-center { display: flex; gap: 4px; }
.nav-tab {
  padding: 8px 20px; border-radius: 8px; font-size: 13px; font-weight: 500;
  color: var(--text2); transition: all 0.2s;
}
.nav-tab:hover { color: var(--text); background: var(--bg3); }
.nav-tab.active { color: white; background: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 12px; }
.user-info { display: flex; align-items: center; gap: 8px; }
.user-avatar { width: 32px; height: 32px; background: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
.user-name { font-size: 13px; color: var(--text2); }
.user-dropdown {
  position: absolute; top: 100%; right: 0; margin-top: 6px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3); min-width: 140px;
  display: none; z-index: 100; overflow: hidden;
}
.user-dropdown.show { display: block; }
.user-dropdown-item {
  padding: 10px 14px; font-size: 13px; color: var(--text); cursor: pointer;
  transition: background 0.15s;
}
.user-dropdown-item:hover { background: var(--bg3); }
.user-dropdown-item.logout { color: var(--red); }

/* ============ VIEWS ============ */
.app { display: flex; flex-direction: column; height: 100vh; }
.view { display: none; flex: 1; overflow: hidden; }
.view.active { display: flex; }

/* ============ BOSS VIEW ============ */
.boss-layout { display: flex; flex: 1; overflow: hidden; }
.chat-panel { display: flex; flex: 1; min-width: 0; }
.chat-sidebar { width: 280px; background: var(--bg2); border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.chat-search { padding: 12px; }
.chat-search input {
  width: 100%; padding: 8px 12px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 13px; outline: none;
}
.chat-search input:focus { border-color: var(--accent); }
.chat-list { flex: 1; overflow-y: auto; }
.chat-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  cursor: pointer; transition: background 0.15s; border-left: 3px solid transparent;
}
.chat-item:hover { background: var(--bg3); }
.chat-item.active { background: var(--bg3); border-left-color: var(--accent); }
.chat-item-avatar { font-size: 28px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--bg4); flex-shrink: 0; }
.chat-item-info { flex: 1; min-width: 0; }
.chat-item-name { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.ai-badge { font-size: 10px; background: linear-gradient(135deg, var(--accent), var(--cyan)); color: white; padding: 1px 5px; border-radius: 3px; font-weight: 600; }
.chat-item-preview { font-size: 12px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.chat-item-time { font-size: 11px; color: var(--text3); flex-shrink: 0; }

/* Chat Main */
.chat-main { flex: 1; display: flex; flex-direction: column; background: var(--bg); min-width: 0; }
.chat-header {
  height: 56px; padding: 0 16px; display: flex; align-items: center; gap: 12px;
  background: var(--bg2); border-bottom: 1px solid var(--border);
}
.chat-header-avatar { font-size: 28px; }
.chat-header-info { flex: 1; }
.chat-header-name { font-size: 15px; font-weight: 600; }
.chat-header-status { font-size: 11px; color: var(--green); }
.chat-header-actions { display: flex; gap: 8px; }
.icon-btn { font-size: 18px; padding: 6px; border-radius: 6px; transition: background 0.15s; }
.icon-btn:hover { background: var(--bg3); }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }

/* Message Bubbles */
.msg { display: flex; gap: 8px; max-width: 85%; animation: msgIn 0.3s ease; }
.msg.sent { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar { font-size: 24px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--bg3); flex-shrink: 0; }
.msg-bubble {
  padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.6;
  background: var(--bg3); position: relative;
}
.msg.sent .msg-bubble { background: var(--accent); color: white; }
.msg-bubble .msg-time { font-size: 10px; color: var(--text3); margin-top: 4px; display: block; }
.msg.sent .msg-bubble .msg-time { color: rgba(255,255,255,0.6); }
.msg-typing { display: flex; gap: 4px; padding: 4px 0; }
.msg-typing span { width: 6px; height: 6px; background: var(--text3); border-radius: 50%; animation: typing 1.2s infinite; }
.msg-typing span:nth-child(2) { animation-delay: 0.2s; }
.msg-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Consultation Chat Bubbles (Boss & OPC) ===== */
.cons-msg-row { display: flex; gap: 10px; max-width: 75%; margin-bottom: 8px; animation: msgIn 0.25s ease; }
.cons-msg-row.self { align-self: flex-end; flex-direction: row-reverse; }
.cons-msg-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; flex-shrink: 0; color: #fff; }
.cons-msg-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cons-msg-sender { font-size: 11px; color: var(--text3); margin-bottom: 3px; padding: 0 4px; }
.cons-msg-row.self .cons-msg-sender { text-align: right; }
.cons-msg-bubble { padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.6; background: var(--bg3); color: var(--text1); word-break: break-word; position: relative; display: inline-block; }
.cons-msg-row.self .cons-msg-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.cons-msg-row:not(.self) .cons-msg-bubble { border-bottom-left-radius: 4px; }
.cons-msg-bubble img { max-width: 200px; max-height: 200px; border-radius: 8px; cursor: pointer; display: block; }
.cons-msg-time { font-size: 10px; color: var(--text3); margin-top: 3px; padding: 0 4px; }
.cons-msg-row.self .cons-msg-time { text-align: right; }
.cons-msg-sensitive { font-size: 10px; color: var(--warning); margin-top: 3px; padding: 0 4px; }
.cons-msg-date-divider { text-align: center; margin: 12px 0; font-size: 11px; color: var(--text3); position: relative; }
.cons-msg-date-divider::before, .cons-msg-date-divider::after { content: ''; position: absolute; top: 50%; width: 60px; height: 1px; background: var(--border); }
.cons-msg-date-divider::before { right: calc(50% + 50px); }
.cons-msg-date-divider::after { left: calc(50% + 50px); }

/* Voice indicator */
.voice-wave { display: flex; align-items: center; gap: 3px; padding: 4px 0; }
.voice-wave span { width: 3px; background: var(--accent); border-radius: 2px; animation: wave 0.8s ease-in-out infinite; }
.voice-wave span:nth-child(1) { height: 12px; animation-delay: 0s; }
.voice-wave span:nth-child(2) { height: 20px; animation-delay: 0.1s; }
.voice-wave span:nth-child(3) { height: 16px; animation-delay: 0.2s; }
.voice-wave span:nth-child(4) { height: 24px; animation-delay: 0.3s; }
.voice-wave span:nth-child(5) { height: 14px; animation-delay: 0.4s; }
@keyframes wave { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(0.4); } }

/* Chat Input */
.chat-input-area { padding: 12px 16px; background: var(--bg2); border-top: 1px solid var(--border); }
.chat-toolbar { display: flex; gap: 4px; margin-bottom: 8px; }
.toolbar-btn { font-size: 18px; padding: 4px 8px; border-radius: 6px; transition: all 0.15s; }
.toolbar-btn:hover { background: var(--bg3); }
.toolbar-btn.recording { background: var(--red); border-radius: 50%; animation: pulse 1s infinite; }
.chat-input-wrapper { display: flex; gap: 8px; align-items: flex-end; }
.chat-input-wrapper textarea {
  flex: 1; padding: 8px 12px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 14px; resize: none;
  outline: none; max-height: 100px;
}
.chat-input-wrapper textarea:focus { border-color: var(--accent); }
.send-btn {
  padding: 8px 16px; background: var(--accent); color: white; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; transition: all 0.15s;
}
.send-btn:hover { background: var(--accent2); }

/* Task Panel */
.task-panel {
  width: 380px; background: var(--bg2); border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.panel-header {
  padding: 16px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.panel-header h3 { font-size: 15px; font-weight: 600; }
.panel-badge { font-size: 10px; background: var(--green); color: white; padding: 2px 8px; border-radius: 10px; font-weight: 600; animation: pulse 2s infinite; }
.task-flow { flex: 1; overflow-y: auto; padding: 16px; }
.task-empty { text-align: center; padding: 60px 20px; color: var(--text3); }
.task-empty-icon { font-size: 48px; margin-bottom: 12px; }
.task-empty p { font-size: 13px; line-height: 1.6; }

/* Task decomposition nodes */
.task-node {
  background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; margin-bottom: 12px; animation: nodeIn 0.4s ease;
}
@keyframes nodeIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.task-node-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.task-node-icon { font-size: 20px; }
.task-node-title { font-size: 13px; font-weight: 600; flex: 1; }
.task-node-status { font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.status-pending { background: var(--bg4); color: var(--text3); }
.status-running { background: var(--green-glow); color: var(--green); border: 1px solid var(--green); }
.status-done { background: rgba(34,197,94,0.2); color: var(--green); }
.task-node-body { font-size: 12px; color: var(--text2); line-height: 1.5; }
.task-node-assignee { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11px; color: var(--text3); }
.task-node-assignee span { background: var(--bg4); padding: 2px 8px; border-radius: 4px; }
.task-connector { width: 2px; height: 20px; background: var(--border); margin: 0 auto; position: relative; }
.task-connector::after { content: '▼'; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); color: var(--accent); font-size: 10px; }

/* Task flow list (任务拆解面板任务列表) */
.tf-empty { text-align: center; padding: 60px 20px; color: var(--text3); }
.tf-empty-icon { font-size: 48px; margin-bottom: 12px; }
.tf-empty p { font-size: 13px; line-height: 1.6; }
.tf-progress-section { margin-bottom: 16px; padding: 12px; background: var(--bg3); border-radius: var(--radius-sm); }
.tf-progress-header { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 8px; color: var(--text2); }
.tf-progress-bar { height: 6px; background: var(--bg4); border-radius: 3px; overflow: hidden; }
.tf-progress-fill { height: 100%; background: linear-gradient(90deg, var(--green), #10b981); border-radius: 3px; transition: width 0.3s ease; }
.tf-status-group { margin-bottom: 20px; }
.tf-status-header { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.tf-count { background: var(--bg4); color: var(--text3); padding: 1px 6px; border-radius: 8px; font-size: 10px; }
.tf-drawer-toggle { transition: all 0.15s; }
.tf-drawer-toggle:hover { background: var(--bg3); border-radius: var(--radius-sm); }
.tf-task-item { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 6px; cursor: pointer; transition: all 0.15s; }
.tf-task-item:hover { border-color: var(--accent); transform: translateX(2px); }
.tf-task-item.tf-frozen { border-color: rgba(59,130,246,0.3); background: linear-gradient(135deg, var(--bg3), rgba(59,130,246,0.05)); opacity: 0.85; }
.tf-task-title { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-task-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tf-badge { font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.tf-frozen-badge { background: rgba(59,130,246,0.15); color: #3b82f6; }
.tf-app-badge { background: rgba(245,158,11,0.15); color: #f59e0b; }
.tf-verify-badge { background: rgba(239,68,68,0.15); color: #ef4444; }
.tf-done-badge { background: rgba(34,197,94,0.15); color: #22c55e; }
.tf-assignee { font-size: 11px; color: var(--text3); }
.tf-reward { font-size: 11px; color: #fbbf24; margin-left: auto; }

/* Publish confirm bar (任务拆解确认发布栏) */
.publish-confirm-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; margin-top: 12px;
  background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(139,92,246,0.08));
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: 14px;
  animation: nodeIn 0.4s ease;
}
.publish-confirm-info {
  display: flex; flex-direction: column; gap: 2px;
}
.publish-confirm-info .publish-count {
  font-size: 14px; font-weight: 600; color: #3b82f6;
}
.publish-confirm-info .publish-hint {
  font-size: 11px; color: var(--text3);
}

/* ============ OPC VIEW ============ */
.opc-layout { display: flex; flex: 1; overflow: hidden; }
.opc-profile-panel { width: 340px; background: var(--bg2); border-right: 1px solid var(--border); overflow-y: auto; padding: 16px; }
.opc-card { background: var(--bg3); border-radius: var(--radius); overflow: hidden; position: relative; }
.opc-card-bg { height: 80px; background: linear-gradient(135deg, var(--accent), var(--cyan), var(--pink)); }
.opc-avatar-section { display: flex; justify-content: center; margin-top: -40px; position: relative; }
.opc-avatar-ring {
  width: 80px; height: 80px; border-radius: 50%; border: 3px solid var(--accent);
  overflow: hidden; background: var(--bg3); display: flex; align-items: center; justify-content: center;
  margin-left: auto; margin-right: auto;
}
.opc-avatar-img { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.opc-level-badge {
  position: absolute; bottom: 0; right: calc(50% - 52px);
  background: var(--gold); color: #1a1a2e; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 10px;
}
.opc-info { text-align: center; padding: 12px 16px; }
.opc-name { font-size: 18px; font-weight: 700; }
.opc-title { font-size: 12px; color: var(--text2); margin-top: 4px; }
.opc-tags { display: flex; justify-content: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 4px; }
.tag-skill { background: rgba(99,102,241,0.15); color: var(--accent2); border: 1px solid rgba(99,102,241,0.3); }
.tag-trait { background: rgba(236,72,153,0.15); color: var(--pink); border: 1px solid rgba(236,72,153,0.3); }
.opc-ai-assistant {
  display: flex; align-items: center; gap: 10px; margin: 12px 16px 16px;
  background: var(--bg4); border-radius: var(--radius-sm); padding: 10px;
}
.assistant-avatar { font-size: 24px; }
.assistant-name { font-size: 12px; font-weight: 600; color: var(--cyan); }
.assistant-msg { font-size: 11px; color: var(--text2); margin-top: 2px; }

/* RPG Stats */
.rpg-stats { margin-top: 16px; }
.section-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.stat-grid { display: flex; flex-direction: column; gap: 10px; }
.stat-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg3); border-radius: var(--radius-sm); padding: 12px;
  border: 1px solid var(--border); transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--accent); }
.stat-icon { font-size: 28px; }
.stat-info { flex: 1; }
.stat-label { font-size: 11px; color: var(--text3); font-weight: 500; }
.stat-value { font-size: 20px; font-weight: 700; margin: 2px 0; }
.stat-growth .stat-value { color: var(--green); }
.stat-action .stat-value { color: var(--orange); }
.stat-rep .stat-value { color: var(--gold); }
.stat-gold .stat-value { color: var(--cyan); }
.stat-bar { height: 4px; background: var(--bg4); border-radius: 2px; overflow: hidden; }
.stat-bar-fill { height: 100%; border-radius: 2px; transition: width 1s ease; }
.stat-growth .stat-bar-fill { background: var(--green); }
.stat-action .stat-bar-fill { background: var(--orange); }
.stat-rep .stat-bar-fill { background: var(--gold); }
.stat-gold .stat-bar-fill { background: var(--cyan); }
.stat-desc { font-size: 10px; color: var(--text3); margin-top: 4px; }

/* Growth Radar */
.growth-radar-section { margin-top: 16px; text-align: center; }
#radarChart { margin: 0 auto; }

/* ============ OPC MAIN PANEL ============ */
.opc-main-panel { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }

/* Work Group Chat */
.work-group { background: var(--bg2); border-radius: var(--radius); border: 1px solid var(--border); }
.group-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.group-header h3 { font-size: 14px; font-weight: 600; }
.group-members { display: flex; gap: -4px; }
.member-bubble {
  width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 14px; background: var(--bg4); border: 2px solid var(--bg2);
  margin-left: -6px; position: relative;
}
.member-bubble:first-child { margin-left: 0; }
.ai-member { border-color: var(--accent); }
.me-member { border-color: #22c55e; background: rgba(34,197,94,0.1); }
.collab-member { border-color: #f59e0b; }
.member-bubble.more { font-size: 10px; color: var(--text3); }
.group-messages { max-height: 380px; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.gmsg { display: flex; gap: 8px; font-size: 13px; animation: msgIn 0.3s ease; }
.gmsg-avatar { font-size: 18px; flex-shrink: 0; }
.gmsg-content { flex: 1; }
.gmsg-name { font-size: 11px; color: var(--accent2); font-weight: 500; }
.gmsg-name.ai-name { color: var(--cyan); }
.gmsg-text { color: var(--text2); margin-top: 2px; line-height: 1.5; }
.gmsg-time { font-size: 10px; color: var(--text3); margin-top: 2px; }

/* Task Board */
.task-board { background: var(--bg2); border-radius: var(--radius); border: 1px solid var(--border); padding: 16px; }
.task-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.task-tab { padding: 6px 16px; border-radius: 6px; font-size: 12px; color: var(--text3); transition: all 0.15s; }
.task-tab:hover { color: var(--text); }
.task-tab.active { background: var(--accent); color: white; }
.task-cards { display: flex; flex-direction: column; gap: 12px; }
.quest-card {
  background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; transition: all 0.2s;
}
.quest-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow); }
.quest-elite { border-color: var(--gold); background: linear-gradient(135deg, var(--bg3), rgba(251,191,36,0.05)); }
.quest-frozen { border-color: #3b82f6; background: linear-gradient(135deg, var(--bg3), rgba(59,130,246,0.08)); opacity: 0.85; }
.quest-frozen:hover { border-color: #3b82f6; transform: none; box-shadow: none; }
.quest-frozen-badge { display: inline-block; margin-left: 8px; font-size: 10px; font-weight: 600; background: rgba(59,130,246,0.15); color: #3b82f6; padding: 2px 6px; border-radius: 4px; vertical-align: middle; }
.quest-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.quest-level { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.quest-q2 .quest-level { background: rgba(34,197,94,0.15); color: var(--green); }
.quest-q3 .quest-level { background: rgba(99,102,241,0.15); color: var(--accent2); }
.quest-q4 .quest-level { background: rgba(251,191,36,0.15); color: var(--gold); }
.quest-reward { font-size: 13px; font-weight: 700; color: var(--gold); }
.quest-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.quest-desc { font-size: 12px; color: var(--text2); line-height: 1.5; margin-bottom: 8px; }
.quest-tags { display: flex; gap: 6px; margin-bottom: 10px; }
.qtag { font-size: 10px; background: var(--bg4); color: var(--text3); padding: 2px 8px; border-radius: 4px; }
.quest-meta { display: flex; gap: 12px; font-size: 11px; color: var(--text3); margin-bottom: 12px; }
.quest-actions { display: flex; gap: 8px; }
.quest-btn {
  padding: 8px 20px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; transition: all 0.15s;
}
.quest-btn.accept { background: var(--accent); color: white; }
.quest-btn.accept:hover { background: var(--accent2); }
.quest-btn.detail { background: var(--bg4); color: var(--text2); }
.quest-btn.detail:hover { background: var(--border); }

/* Demand Hall */
.demand-hall { background: var(--bg2); border-radius: var(--radius); border: 1px solid var(--border); padding: 16px; margin-top: 16px; }
.demand-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.demand-tab { padding: 6px 16px; border-radius: 6px; font-size: 12px; color: var(--text3); transition: all 0.15s; background: transparent; border: none; cursor: pointer; }
.demand-tab:hover { color: var(--text); }
.demand-tab.active { background: #6366f1; color: white; }
.demand-cards { display: flex; flex-direction: column; gap: 12px; }
.demand-post { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; transition: all 0.2s; }
.demand-post:hover { border-color: #6366f1; transform: translateY(-1px); box-shadow: var(--shadow); }
.demand-post.urgent { border-color: var(--gold); background: linear-gradient(135deg, var(--bg3), rgba(251,191,36,0.05)); }
.dp-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dp-tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.dp-tag.dp-urgent { background: rgba(239,68,68,0.15); color: #ef4444; }
.dp-tag.dp-new { background: rgba(34,197,94,0.15); color: var(--green); }
.dp-reward { font-size: 13px; font-weight: 700; color: var(--gold); }
.dp-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.dp-meta { font-size: 12px; color: var(--text3); margin-bottom: 10px; }
.dp-footer { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text3); }
.dp-apply { padding: 6px 16px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; background: #6366f1; color: white; border: none; cursor: pointer; transition: all 0.15s; }
.dp-apply:hover { background: #4f46e5; }
.dp-apply:disabled { background: var(--bg4); color: var(--text3); cursor: not-allowed; }

/* ============ OPC SIDE PANEL ============ */
.opc-side-panel { width: 280px; background: var(--bg2); border-left: 1px solid var(--border); overflow-y: auto; padding: 16px; }
.wallet-card {
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px;
}
.wallet-card h3 { font-size: 13px; opacity: 0.8; margin-bottom: 8px; }
.wallet-balance { }
.wallet-main { display: flex; align-items: baseline; gap: 4px; }
.wallet-amount { font-size: 32px; font-weight: 900; }
.wallet-unit { font-size: 14px; opacity: 0.8; }
.wallet-detail { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; font-size: 11px; opacity: 0.8; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 4px; }
.dot-r { background: #ff6b6b; }
.dot-f { background: #a78bfa; }
.dot-q { background: #ffd93d; }
.dot-g { background: #6bcb77; }

/* Leaderboard */
.leaderboard { margin-bottom: 16px; }
.lb-list { display: flex; flex-direction: column; gap: 6px; }
.lb-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: var(--bg3); border-radius: var(--radius-sm); font-size: 13px;
}
.lb-rank { width: 20px; font-weight: 700; text-align: center; }
.lb-gold .lb-rank { color: var(--gold); }
.lb-silver .lb-rank { color: #c0c0c0; }
.lb-bronze .lb-rank { color: #cd7f32; }
.lb-name { flex: 1; }
.lb-score { color: var(--text2); font-size: 12px; }
.lb-me { font-size: 10px; background: var(--accent); color: white; padding: 1px 6px; border-radius: 3px; }

/* Achievements */
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.badge-item {
  text-align: center; padding: 12px 4px; background: var(--badge-bg, var(--bg3)); border-radius: var(--radius-sm);
  border: 1px solid var(--border); transition: all 0.2s;
}
.badge-item.unlocked:hover { border-color: var(--badge-color, var(--accent)); transform: translateY(-2px); }
.badge-item.locked { opacity: 0.35; filter: grayscale(1); }
.badge-icon { font-size: 28px; display: flex; align-items: center; justify-content: center; }
.badge-icon svg { image-rendering: pixelated; }
.badge-name { font-size: 10px; color: var(--text3); margin-top: 4px; display: block; }

/* ===== Skill Tag Picker ===== */
.skill-tag-picker {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0;
}
.skill-tag-option {
  display: inline-block; padding: 4px 12px; font-size: 12px; border-radius: 16px;
  background: var(--bg3); color: var(--text2); border: 1px solid var(--border);
  cursor: pointer; transition: all 0.2s; user-select: none;
}
.skill-tag-option:hover {
  border-color: var(--accent); color: var(--text1); background: var(--bg4);
}
.skill-tag-option.selected {
  background: var(--accent); color: #fff; border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ===== Badge Picker (Admin) ===== */
.badge-picker {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0;
}
.badge-option {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; font-size: 12px; border-radius: 16px;
  background: var(--bg3); color: var(--text2); border: 1px solid var(--border);
  cursor: pointer; transition: all 0.2s; user-select: none;
}
.badge-option:hover {
  border-color: var(--badge-color, var(--accent)); color: var(--badge-color, var(--text1));
}
.badge-option.selected {
  background: var(--badge-bg, var(--badge-color, var(--accent))); color: var(--badge-color, var(--accent));
  border-color: var(--badge-color, var(--accent));
  box-shadow: 0 0 10px color-mix(in srgb, var(--badge-color, var(--accent)) 30%, transparent);
}

/* ===== Profile Badge Display (Pixel-style Animated) ===== */
.profile-badges-grid {
  display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 0;
}
.profile-badge-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 14px; background: var(--badge-bg, var(--bg3)); border-radius: 4px;
  border: 2px solid var(--badge-color, var(--accent)); position: relative; overflow: hidden;
  transition: all 0.3s ease;
  image-rendering: pixelated;
}
.profile-badge-item:hover {
  transform: translateY(-3px) scale(1.08);
  border-color: var(--badge-color, var(--accent));
  box-shadow: 0 4px 16px rgba(0,0,0,0.3), 0 0 20px color-mix(in srgb, var(--badge-color, var(--accent)) 50%, transparent);
}
.profile-badge-icon {
  font-size: 28px; display: flex; align-items: center; justify-content: center; position: relative;
  font-family: 'Courier New', monospace;
  animation: pixelBadgeBounce 2s steps(4) infinite;
  filter: drop-shadow(0 0 8px var(--badge-color, var(--accent)));
}
.profile-badge-icon svg {
  image-rendering: pixelated;
}
.profile-badge-name {
  font-size: 10px; color: var(--badge-color, var(--text3)); white-space: nowrap;
  font-family: 'Courier New', monospace; letter-spacing: 1px; font-weight: 700;
}

/* Pixel badge scan line effect */
.profile-badge-item::before {
  content: '';
  position: absolute; top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: pixelScan 4s ease-in-out infinite;
}

/* Pixel badge border pulse */
.profile-badge-item::after {
  content: '';
  position: absolute; inset: 0;
  border: 2px solid transparent;
  border-image: linear-gradient(45deg, var(--badge-color, var(--accent)), transparent, var(--badge-color, var(--accent))) 1;
  opacity: 0; z-index: -1;
  animation: pixelBorderPulse 3s ease-in-out infinite;
}

@keyframes pixelBadgeBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  25% { transform: translateY(-2px) scale(1.05); }
  75% { transform: translateY(1px) scale(0.98); }
}
@keyframes pixelScan {
  0% { left: -100%; }
  40% { left: 150%; }
  100% { left: 150%; }
}
@keyframes pixelBorderPulse {
  0%, 100% { opacity: 0; }
  50% { opacity: 0.4; }
}

/* ===== OPC Hall Badge (Small) ===== */
.opchall-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; margin-left: 3px; padding: 1px 6px;
  background: var(--badge-bg, var(--badge-color, var(--accent)));
  color: var(--badge-color, var(--accent)); border-radius: 3px; font-weight: 700;
  font-family: 'Courier New', monospace; letter-spacing: 0.5px;
  text-shadow: 0 0 4px rgba(0,0,0,0.15);
  box-shadow: 0 0 6px color-mix(in srgb, var(--badge-color, var(--accent)) 30%, transparent),
              inset 0 0 4px rgba(255,255,255,0.15);
  animation: pixelBadgeGlow 2.5s ease-in-out infinite;
  position: relative; overflow: hidden;
}
.opchall-badge svg {
  image-rendering: pixelated;
  vertical-align: middle;
}
.opchall-badge::before {
  content: '';
  position: absolute; top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: pixelShine 3s ease-in-out infinite;
}
@keyframes pixelBadgeGlow {
  0%, 100% { box-shadow: 0 0 4px var(--badge-color, var(--accent)), inset 0 0 4px rgba(255,255,255,0.15); }
  50% { box-shadow: 0 0 12px var(--badge-color, var(--accent)), 0 0 20px color-mix(in srgb, var(--badge-color, var(--accent)) 40%, transparent), inset 0 0 6px rgba(255,255,255,0.25); }
}
@keyframes pixelShine {
  0% { left: -100%; }
  50% { left: 150%; }
  100% { left: 150%; }
}
@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ============ TOWN VIEW ============ */
.town-layout { display: flex; flex: 1; overflow: hidden; }
.town-canvas-wrapper { flex: 1; overflow-y: auto; display: flex; flex-direction: column; min-width: 0; }
.town-header {
  padding: 10px 16px; display: flex; align-items: center; justify-content: space-between;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  /* Subtle top glow line */
  position: relative;
}
.town-header::after {
  content: '';
  position: absolute; bottom: -1px; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--cyan), transparent);
  opacity: 0.3;
}
.town-header h2 { font-size: 15px; }
.town-stats { display: flex; gap: 16px; }
.town-stat { font-size: 12px; color: var(--text2); }

.town-scene {
  flex: 1; display: grid; gap: 10px; padding: 12px; overflow-y: auto;
  /* Building takes more width, plaza adapts to remaining space */
  grid-template-columns: minmax(380px, 5fr) minmax(320px, 5fr);
  grid-template-rows: 1fr auto;
  align-items: stretch;
  position: relative;
}
.town-scene > .building-wrapper { grid-column: 1; grid-row: 1; }
.town-scene > .social-plaza { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.town-scene > .task-wall {
  grid-column: 1 / 3; grid-row: 3;
  margin-top: 10px; padding: 10px 14px;
  border: 1px solid rgba(99,102,241,0.15);
  /* Subtle glow bar at top */
  position: relative;
}
.town-scene > .task-wall::before {
  content: '';
  position: absolute; top: -1px; left: 20px; right: 20px;
  height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.4;
}

/* Building */
.building-wrapper { min-width: 0; position: relative; }
.building-wrapper::before {
  content: '';
  position: absolute; inset: -2px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(99,102,241,0.08), transparent 50%, rgba(6,182,212,0.05));
  pointer-events: none; z-index: -1; opacity: 0.6;
}
.building {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--bg2); border-radius: var(--radius); border: 1px solid var(--border); padding: 10px;
  position: relative; width: 100%;
}
.building-sign {
  text-align: center; font-size: 14px; font-weight: 700; padding: 8px;
  background: linear-gradient(135deg, var(--accent), var(--cyan)); border-radius: var(--radius-sm);
  margin-bottom: 4px; letter-spacing: 4px;
}
.floor {
  background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px; margin-bottom: 2px; transition: all 0.3s; cursor: pointer;
}
.floor:hover { border-color: var(--accent); box-shadow: 0 0 20px var(--accent-glow); }
.floor-label { font-size: 11px; font-weight: 700; color: var(--accent2); margin-bottom: 4px; }
.floor-content { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.floor-room {
  flex: 1; background: var(--bg4); border-radius: 6px; padding: 6px 8px;
  position: relative; min-height: 40px; min-width: 100px;
}
.room-name { font-size: 9px; color: var(--text3); margin-bottom: 4px; font-weight: 500; }
.npc-group { display: flex; gap: 4px; flex-wrap: wrap; }
.npc {
  font-size: 18px; cursor: pointer; transition: transform 0.2s;
  animation: npcFloat 3s ease-in-out infinite;
  animation-delay: calc(var(--delay) * 0.5s);
}
.npc:hover { transform: scale(1.3); }
@keyframes npcFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.ai-npc { filter: drop-shadow(0 0 4px var(--cyan)); }
.task-bubble {
  font-size: 9px; color: var(--green); background: var(--green-glow);
  padding: 2px 6px; border-radius: 4px; margin-top: 4px; display: inline-block;
}
.event-tag {
  font-size: 9px; background: rgba(239,68,68,0.15); color: var(--red);
  padding: 2px 6px; border-radius: 4px; margin-top: 4px; display: inline-block;
  animation: pulse 2s infinite;
}

/* Activity Feed */
/* Social Plaza replaces old activity-feed — game-like panel */
.social-plaza {
  display: flex; flex-direction: column; gap: 8px;
  min-width: 0; min-height: 0;
  overflow-y: auto;
  /* Subtle ambient glow from behind */
  position: relative;
}
.social-plaza::before {
  content: '';
  position: absolute; inset: -1px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(99,102,241,0.06), transparent 40%, transparent 60%, rgba(6,182,212,0.04));
  pointer-events: none; z-index: -1;
}
.feed-list { display: flex; flex-direction: column; gap: 6px; flex: 1; overflow-y: auto; }
.feed-item {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px; font-size: 12px; animation: feedIn 0.4s ease;
}
@keyframes feedIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.feed-time { font-size: 10px; color: var(--text3); margin-bottom: 4px; }
.feed-text { color: var(--text2); line-height: 1.4; }
.feed-text .feed-highlight { color: var(--accent2); font-weight: 500; }
.feed-text .feed-ai { color: var(--cyan); font-weight: 500; }

/* Town Side Panel */
.town-side {
  width: 280px; background: var(--bg2); border-left: 1px solid var(--border);
  overflow-y: auto; padding: 16px; flex-shrink: 0;
  /* Subtle inner glow for game-like depth */
  box-shadow: -4px 0 20px rgba(99,102,241,0.03);
}
.town-side h3 { font-size: 15px; font-weight: 600; margin-bottom: 16px; }
.task-map-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.map-stat {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg3); border-radius: var(--radius-sm); padding: 12px;
}
.map-stat-icon { font-size: 24px; }
.map-stat-value { font-size: 24px; font-weight: 700; color: var(--accent2); }
.map-stat-label { font-size: 10px; color: var(--text3); }

/* Agent Hierarchy */
.agent-hierarchy h4 { font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.agent-tree { display: flex; flex-direction: column; gap: 4px; }
.agent-node {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: var(--bg3); border-radius: var(--radius-sm); font-size: 12px;
  border: 1px solid var(--border); transition: border-color 0.2s;
}
.agent-node:hover { border-color: var(--accent); }
.agent-node.boss-node { background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(6,182,212,0.1)); border-color: var(--accent); }
.agent-emoji { font-size: 18px; }
.agent-label { flex: 1; font-weight: 500; }
.agent-status { font-size: 10px; padding: 2px 6px; border-radius: 4px; }
.agent-status.online { background: var(--green-glow); color: var(--green); }
.agent-status.busy { background: rgba(245,158,11,0.15); color: var(--orange); }
.agent-status.idle { background: var(--bg4); color: var(--text3); }
.agent-children { padding-left: 20px; display: flex; flex-direction: column; gap: 4px; border-left: 2px solid var(--border); margin-left: 18px; }

/* ============ TASK EXECUTION OVERLAY ============ */
.task-execution-overlay {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  display: flex; flex-direction: column;
  animation: teSlideIn 0.4s ease;
}
.task-execution-overlay.hidden { display: none; }
@keyframes teSlideIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* TE Header */
.te-header {
  display: flex; align-items: center; gap: 16px; padding: 12px 20px;
  background: var(--bg2); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.te-back {
  font-size: 13px; color: var(--text2); padding: 6px 12px; border-radius: var(--radius-sm);
  transition: all 0.15s; cursor: pointer; background: none; border: none;
}
.te-back:hover { color: var(--text); background: var(--bg3); }
.te-title-area { display: flex; align-items: center; gap: 10px; flex: 1; }
.te-level-badge { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 4px; background: rgba(99,102,241,0.15); color: var(--accent2); }
.te-title { font-size: 16px; font-weight: 600; }
.te-timer { text-align: right; }
.te-countdown { font-size: 13px; color: var(--orange); font-weight: 500; }
.te-progress-bar { width: 160px; height: 4px; background: var(--bg4); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.te-progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--green)); border-radius: 2px; transition: width 0.8s ease; width: 0%; }

/* TE Body */
.te-body { display: flex; flex: 1; overflow: hidden; }

/* Timeline */
.te-timeline {
  width: 280px; background: var(--bg2); border-right: 1px solid var(--border);
  padding: 20px; overflow-y: auto; flex-shrink: 0;
}
.te-timeline h3 { font-size: 14px; font-weight: 600; margin-bottom: 16px; }
.milestone-list { display: flex; flex-direction: column; }
.milestone-node {
  display: flex; gap: 12px; position: relative; padding-bottom: 8px;
  opacity: 0.4; transition: opacity 0.4s;
}
.milestone-node.active, .milestone-node.completed, .milestone-node.review { opacity: 1; }
.ms-dot {
  width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg4); border: 2px solid var(--border); margin-top: 4px;
  transition: all 0.4s; position: relative; z-index: 1;
}
.milestone-node.active .ms-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 12px var(--accent-glow); animation: pulse 2s infinite; }
.milestone-node.completed .ms-dot { background: var(--green); border-color: var(--green); }
.milestone-node.review .ms-dot { background: var(--orange); border-color: var(--orange); animation: pulse 1.5s infinite; }
.ms-connector { position: absolute; left: 7px; top: 22px; width: 2px; height: calc(100% - 14px); background: var(--border); }
.milestone-node.completed .ms-connector { background: var(--green); }
.milestone-node:last-child .ms-connector { display: none; }
.ms-content { flex: 1; padding-bottom: 16px; }
.ms-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ms-number { font-size: 10px; font-weight: 700; color: var(--text3); }
.ms-status { font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.ms-active { background: var(--accent-glow); color: var(--accent2); border: 1px solid var(--accent); }
.ms-locked { background: var(--bg4); color: var(--text3); }
.ms-review { background: rgba(245,158,11,0.15); color: var(--orange); border: 1px solid var(--orange); }
.ms-completed { background: rgba(34,197,94,0.15); color: var(--green); border: 1px solid var(--green); }
.ms-content h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.ms-content p { font-size: 11px; color: var(--text3); line-height: 1.4; }
.ms-reward { font-size: 10px; color: var(--gold); margin-top: 6px; }

/* Work Area */
.te-work-area { flex: 1; overflow-y: auto; padding: 20px; }
.work-phase { animation: teSlideIn 0.4s ease; }
.work-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; max-width: 700px; margin: 0 auto;
}
.work-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.doc-preview { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.doc-section {
  background: var(--bg3); border-radius: var(--radius-sm); padding: 14px;
  border-left: 3px solid var(--accent);
}
.doc-section h4 { font-size: 13px; font-weight: 600; color: var(--accent2); margin-bottom: 6px; }
.doc-section p { font-size: 12px; color: var(--text2); line-height: 1.6; }
.work-btn {
  display: block; width: 100%; padding: 12px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer; border: none; transition: all 0.2s;
}
.work-btn.primary { background: var(--accent); color: white; }
.work-btn.primary:hover { background: var(--accent2); transform: translateY(-1px); }
.work-btn.gold { background: linear-gradient(135deg, var(--gold), var(--orange)); color: #1a1a2e; }
.work-btn.gold:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(251,191,36,0.3); }

/* Editor */
.editor-area { margin-bottom: 16px; }
.editor-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; background: var(--bg3); border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border: 1px solid var(--border); border-bottom: none; font-size: 12px;
}
.editor-ai-tip { color: var(--cyan); font-size: 11px; }
.editor-title-input input {
  width: 100%; padding: 10px 12px; background: var(--bg4); border: 1px solid var(--border);
  border-bottom: none; color: var(--text); font-size: 14px; font-weight: 600; outline: none;
}
.editor-title-input input:focus { border-color: var(--accent); }
.editor-content { border: 1px solid var(--border); border-top: none; }
.editor-textarea {
  padding: 12px; min-height: 160px; font-size: 13px; color: var(--text2);
  line-height: 1.8; outline: none; background: var(--bg4);
  white-space: pre-wrap;
}
.editor-textarea:focus { color: var(--text); }
.editor-images { display: flex; gap: 8px; margin-top: 10px; }
.img-placeholder {
  flex: 1; height: 80px; background: var(--bg3); border: 2px dashed var(--border);
  border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text3); cursor: pointer; transition: border-color 0.2s;
}
.img-placeholder:hover { border-color: var(--accent); }
.editor-status { display: flex; gap: 12px; margin: 12px 0; font-size: 12px; color: var(--text3); }
.editor-status .current { color: var(--orange); font-weight: 500; }

/* Review Process */
.review-process { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.review-step {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  background: var(--bg3); border-radius: var(--radius-sm); border: 1px solid var(--border);
  transition: all 0.4s;
}
.review-step.checking { border-color: var(--orange); }
.review-step.passed { border-color: var(--green); background: rgba(34,197,94,0.05); }
.review-step-icon { font-size: 24px; transition: transform 0.3s; }
.review-step.checking .review-step-icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.review-step-title { font-size: 13px; font-weight: 600; }
.review-step-desc { font-size: 11px; color: var(--text3); margin-top: 2px; }
.review-result { text-align: center; animation: teSlideIn 0.5s ease; }
.review-score-ring { width: 120px; height: 120px; margin: 0 auto 16px; position: relative; }
.review-score-ring svg { width: 100%; height: 100%; }
.score-circle { transition: stroke-dashoffset 1.5s ease; }
.review-score-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  flex-direction: column;
}
.score-num { font-size: 36px; font-weight: 900; color: var(--green); }
.score-label { font-size: 12px; color: var(--text3); }
.review-detail { text-align: left; margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.review-item { font-size: 13px; padding: 8px 12px; background: var(--bg3); border-radius: var(--radius-sm); }
.review-item.pass { color: var(--green); }
.review-item.warn { color: var(--orange); }

/* Final Review */
.final-review { display: flex; flex-direction: column; gap: 16px; }
.fr-checker { display: flex; align-items: center; gap: 12px; }
.fr-checker-avatar { font-size: 36px; }
.fr-checker-name { font-size: 14px; font-weight: 600; color: var(--cyan); }
.fr-checker-status { font-size: 12px; color: var(--text3); }
.fr-checklist { display: flex; flex-direction: column; gap: 8px; }
.fr-check-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--bg3); border-radius: var(--radius-sm); font-size: 13px;
  border: 1px solid var(--border); transition: all 0.3s;
}
.fr-check-item.checked { border-color: var(--green); }
.fr-check-icon { font-size: 18px; }
.fr-enterprise {
  background: var(--bg3); border-radius: var(--radius); padding: 16px;
  border: 1px solid var(--gold); display: flex; gap: 12px; align-items: flex-start;
  animation: teSlideIn 0.4s ease;
}
.fr-enterprise-avatar { font-size: 32px; }
.fr-enterprise-msg strong { font-size: 13px; color: var(--gold); }
.fr-enterprise-msg p { font-size: 13px; color: var(--text2); margin-top: 4px; line-height: 1.6; font-style: italic; }
.fr-stars { margin-top: 6px; font-size: 16px; }

/* AI Chat (right panel in execution) */
.te-ai-chat {
  width: 280px; background: var(--bg2); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; flex-shrink: 0;
}
.te-ai-header {
  display: flex; align-items: center; gap: 10px; padding: 14px;
  border-bottom: 1px solid var(--border);
}
.te-ai-avatar { font-size: 28px; }
.te-ai-name { font-size: 13px; font-weight: 600; }
.te-ai-status { font-size: 11px; color: var(--green); }
.te-ai-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.te-ai-msg {
  background: var(--bg3); border-radius: 10px; padding: 10px 12px;
  font-size: 12px; color: var(--text2); line-height: 1.5; animation: msgIn 0.3s ease;
}
.te-ai-msg .ai-sender { font-size: 11px; font-weight: 600; margin-bottom: 4px; }
.te-ai-msg .ai-sender.spark { color: var(--cyan); }
.te-ai-msg .ai-sender.shrimp { color: var(--orange); }
.te-ai-msg .ai-sender.shell { color: var(--pink); }
.te-ai-msg-time { font-size: 10px; color: var(--text3); margin-top: 4px; }

/* ============ REWARD MODAL ============ */
.reward-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.reward-modal.hidden { display: none; }
.reward-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); }
.reward-content { position: relative; z-index: 1; animation: rewardPop 0.5s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes rewardPop { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
.reward-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.reward-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 20px;
  padding: 32px; width: 420px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px var(--accent-glow);
}
.reward-header { margin-bottom: 24px; }
.reward-icon { font-size: 56px; margin-bottom: 8px; display: inline-block; animation: bounce 0.6s ease; }
@keyframes bounce { 0% { transform: scale(0); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }
.reward-header h2 { font-size: 24px; font-weight: 900; background: linear-gradient(135deg, var(--gold), var(--orange)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.reward-header p { font-size: 13px; color: var(--text2); margin-top: 4px; }
.reward-items { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 20px; }
.reward-item {
  background: var(--bg3); border-radius: var(--radius); padding: 14px 8px; text-align: center;
  border: 1px solid var(--border);
  animation: rewardItemIn 0.4s ease both;
  animation-delay: calc(var(--delay) * 0.15s + 0.3s);
}
@keyframes rewardItemIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.ri-icon { font-size: 24px; display: block; margin-bottom: 4px; }
.ri-value { font-size: 20px; font-weight: 900; color: var(--gold); display: block; }
.ri-label { font-size: 10px; color: var(--text3); display: block; }
.reward-achievement {
  display: flex; align-items: center; gap: 14px; text-align: left;
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(236,72,153,0.1));
  border: 1px solid var(--accent); border-radius: var(--radius); padding: 14px;
  margin-bottom: 16px; animation: rewardItemIn 0.4s ease both; animation-delay: 0.9s;
}
.ra-badge-glow {
  width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--bg3); box-shadow: 0 0 20px var(--accent-glow);
  animation: badgeGlow 2s ease-in-out infinite;
}
@keyframes badgeGlow { 0%,100% { box-shadow: 0 0 10px var(--accent-glow); } 50% { box-shadow: 0 0 30px var(--accent-glow), 0 0 60px rgba(99,102,241,0.1); } }
.ra-badge-icon { font-size: 24px; }
.ra-title { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; }
.ra-name { font-size: 16px; font-weight: 700; color: var(--accent2); margin: 2px 0; }
.ra-desc { font-size: 11px; color: var(--text3); }
.reward-progress { margin-bottom: 20px; animation: rewardItemIn 0.4s ease both; animation-delay: 1.1s; }
.rp-label { font-size: 12px; color: var(--text2); margin-bottom: 6px; display: flex; justify-content: space-between; }
.rp-label span { color: var(--green); font-weight: 600; }
.rp-bar { height: 8px; background: var(--bg4); border-radius: 4px; overflow: hidden; }
.rp-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--green)); border-radius: 4px; width: 0%; transition: width 1.5s ease 1.3s; }
.rp-next { font-size: 11px; color: var(--text3); margin-top: 6px; }
.reward-close-btn {
  padding: 12px 32px; background: var(--accent); color: white; border: none;
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all 0.2s; animation: rewardItemIn 0.4s ease both; animation-delay: 1.3s;
}
.reward-close-btn:hover { background: var(--accent2); transform: translateY(-2px); }

/* Confetti particles */
.confetti-piece {
  position: fixed; width: 10px; height: 10px; top: -10px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ============ DEMO NARRATION OVERLAY ============ */
.demo-overlay {
  position: fixed; inset: 0; z-index: 500; pointer-events: none;
}
.demo-overlay.hidden { display: none; }
.demo-overlay.active { pointer-events: auto; }

/* Narrator Bar */
.demo-narrator {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 510;
  display: flex; align-items: center; gap: 16px;
  padding: 18px 28px;
  background: linear-gradient(180deg, rgba(15,20,35,0.92) 0%, rgba(15,20,35,0.98) 100%);
  border-top: 1px solid rgba(99,102,241,0.3);
  backdrop-filter: blur(20px);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
  pointer-events: auto;
  animation: narratorSlideIn 0.5s ease;
}
@keyframes narratorSlideIn { from { transform: translateY(100%); } to { transform: translateY(0); } }

.demo-avatar-wrap { position: relative; flex-shrink: 0; }
.demo-avatar {
  width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(236,72,153,0.2));
  font-size: 28px; border: 2px solid var(--accent);
}
.demo-avatar-ring {
  position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid transparent; border-top-color: var(--cyan); border-right-color: var(--pink);
  animation: avatarSpin 3s linear infinite;
}
@keyframes avatarSpin { to { transform: rotate(360deg); } }

.demo-text-area { flex: 1; min-width: 0; }
.demo-speaker {
  font-size: 11px; font-weight: 600; color: var(--pink);
  text-transform: uppercase; letter-spacing: 2px; margin-bottom: 4px;
}
.demo-typewriter {
  font-size: 15px; color: var(--text); line-height: 1.6; min-height: 24px;
  font-weight: 400;
}
.demo-typewriter .cursor {
  display: inline-block; width: 2px; height: 18px; background: var(--accent2);
  vertical-align: text-bottom; margin-left: 2px;
  animation: cursorBlink 0.6s step-end infinite;
}
@keyframes cursorBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* Voice wave */
.demo-voice-wave {
  display: flex; align-items: center; gap: 3px; flex-shrink: 0;
  height: 40px; padding: 0 8px; opacity: 0; transition: opacity 0.3s;
}
.demo-voice-wave.speaking { opacity: 1; }
.demo-voice-wave span {
  display: block; width: 3px; border-radius: 2px;
  background: var(--cyan); animation: none;
}
.demo-voice-wave.speaking span {
  animation: voiceBar 0.8s ease-in-out infinite;
}
.demo-voice-wave span:nth-child(1) { height: 8px; animation-delay: 0s; }
.demo-voice-wave span:nth-child(2) { height: 16px; animation-delay: 0.1s; }
.demo-voice-wave span:nth-child(3) { height: 24px; animation-delay: 0.2s; }
.demo-voice-wave span:nth-child(4) { height: 16px; animation-delay: 0.3s; }
.demo-voice-wave span:nth-child(5) { height: 8px; animation-delay: 0.4s; }
@keyframes voiceBar {
  0%, 100% { transform: scaleY(0.4); } 50% { transform: scaleY(1); }
}

/* Scene tag */
.demo-scene-tag {
  position: fixed; top: 56px; left: 50%; transform: translateX(-50%);
  z-index: 510; padding: 6px 20px; border-radius: 20px;
  background: rgba(99,102,241,0.15); border: 1px solid var(--accent);
  color: var(--accent2); font-size: 12px; font-weight: 600;
  letter-spacing: 1px; pointer-events: none;
  opacity: 0; transition: opacity 0.4s;
}
.demo-scene-tag.visible { opacity: 1; }

/* Spotlight */
.demo-spotlight {
  position: fixed; inset: 0; z-index: 505;
  pointer-events: none; opacity: 0; transition: opacity 0.5s;
}
.demo-spotlight.active {
  opacity: 1;
  background: radial-gradient(
    circle 300px at var(--sx, 50%) var(--sy, 50%),
    transparent 0%, rgba(0,0,0,0.6) 100%
  );
}

/* Skip button */
.demo-skip {
  position: fixed; top: 60px; right: 20px; z-index: 520;
  padding: 6px 16px; border-radius: 16px; font-size: 12px;
  background: rgba(255,255,255,0.08); border: 1px solid var(--border);
  color: var(--text2); cursor: pointer; pointer-events: auto;
  transition: all 0.2s;
}
.demo-skip:hover { background: rgba(255,255,255,0.15); color: var(--text); }

/* Highlight pulse on elements during demo */
.demo-highlight {
  position: relative;
}
.demo-highlight::after {
  content: ''; position: absolute; inset: -4px; border-radius: 12px;
  border: 2px solid var(--cyan); animation: demoHighlightPulse 1.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes demoHighlightPulse {
  0%, 100% { opacity: 0.4; box-shadow: 0 0 8px var(--cyan); }
  50% { opacity: 1; box-shadow: 0 0 24px var(--cyan); }
}

/* ============ V2: NPC PROFILE CARD ============ */
.npc-profile-card {
  position: fixed; z-index: 200; width: 260px;
  background: var(--bg2); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 20px var(--accent-glow);
  animation: cardPop 0.25s ease;
}
.npc-profile-card.hidden { display: none; }
@keyframes cardPop { from { opacity: 0; transform: scale(0.9) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.npc-card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.npc-card-avatar { font-size: 48px; line-height: 1; }
.npc-card-close { background: none; border: none; color: var(--text3); font-size: 16px; cursor: pointer; padding: 4px; }
.npc-card-close:hover { color: var(--text); }
.npc-card-name { font-size: 18px; font-weight: 700; margin-top: 8px; }
.npc-card-level { font-size: 12px; color: var(--accent2); font-weight: 600; margin-top: 2px; }
.npc-card-tai { font-size: 14px; color: var(--gold); font-weight: 600; margin-top: 6px; }
.npc-card-skills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.npc-card-skill-tag { font-size: 10px; padding: 3px 8px; border-radius: 10px; background: var(--bg4); color: var(--cyan); border: 1px solid rgba(6,182,212,0.2); }
.npc-card-divider { height: 1px; background: var(--border); margin: 12px 0; }
.npc-card-task-label { font-size: 11px; color: var(--text3); margin-bottom: 6px; }
.npc-card-tasks { font-size: 12px; color: var(--text2); line-height: 1.6; }
.npc-card-task-item { padding: 4px 0; display: flex; align-items: center; gap: 6px; }
.npc-card-task-item::before { content: '▸'; color: var(--accent); font-size: 10px; }
.npc-card-teamup {
  width: 100%; padding: 10px; margin-top: 14px; border: none;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  color: white; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.npc-card-teamup:hover { transform: translateY(-1px); box-shadow: 0 4px 16px var(--accent-glow); }
.npc-card-teamup.ai-card { background: var(--bg4); color: var(--cyan); border: 1px solid var(--cyan); cursor: default; }

/* ============ V2: ZOOM SYSTEM ============ */
.town-controls { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.zoom-controls { display: flex; gap: 4px; }
.zoom-btn {
  padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 500;
  background: var(--bg3); border: 1px solid var(--border); color: var(--text2);
  cursor: pointer; transition: all 0.2s;
}
.zoom-btn:hover { border-color: var(--accent); color: var(--text); }
.zoom-btn.active { background: var(--accent); border-color: var(--accent); color: white; }

.building-wrapper { transition: all 0.4s ease; }
.building-wrapper[data-zoom="overview"] .floor-detail { display: none; }
.building-wrapper[data-zoom="detail"] .floor {
  max-height: 40px; overflow: hidden; opacity: 0.35; padding: 6px 12px;
  transition: all 0.5s ease; cursor: pointer;
}
.building-wrapper[data-zoom="detail"] .floor .floor-content { display: none; }
.building-wrapper[data-zoom="detail"] .floor.zoomed-in {
  max-height: 500px; overflow: visible; opacity: 1; padding: 16px;
  border-color: var(--accent); box-shadow: 0 0 30px var(--accent-glow);
}
.building-wrapper[data-zoom="detail"] .floor.zoomed-in .floor-content { display: flex; }
/* --- Floor Detail: People-centric view --- */
.floor-detail {
  display: none; flex-direction: column; gap: 8px; margin-top: 12px;
  padding-top: 12px; border-top: 1px solid var(--border);
}
.building-wrapper[data-zoom="detail"] .floor.zoomed-in .floor-detail { display: flex; }

/* Person card */
.fd-person {
  background: var(--bg4); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; transition: all 0.3s;
}
.fd-person:hover { border-color: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.fd-person-ai { border-color: rgba(6,182,212,0.25); background: rgba(6,182,212,0.04); }
.fd-person-ai:hover { border-color: var(--cyan); box-shadow: 0 0 12px rgba(6,182,212,0.15); }
.fd-person-highlight { border-color: rgba(236,72,153,0.3); background: rgba(236,72,153,0.04); }
.fd-person-highlight:hover { border-color: var(--pink); box-shadow: 0 0 12px rgba(236,72,153,0.15); }

.fd-person-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.fd-avatar { width: 32px; height: 32px; flex-shrink: 0; }
.fd-person-info { flex: 1; min-width: 0; }
.fd-person-info strong { font-size: 12px; }
.fd-level {
  font-size: 9px; padding: 1px 5px; border-radius: 3px; margin-left: 4px;
  background: var(--accent); color: white; font-weight: 600;
}
.fd-level-ai { background: var(--cyan); }
.fd-level-vip { background: linear-gradient(135deg, #f59e0b, #ec4899); }
.fd-level-new { background: var(--green); }
.fd-level-guest { background: var(--text3); }
.fd-role { font-size: 10px; color: var(--text3); margin-top: 2px; }

/* Status dot */
.fd-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.fd-online { background: var(--green); box-shadow: 0 0 6px rgba(34,197,94,0.5); }
.fd-busy { background: var(--orange); box-shadow: 0 0 6px rgba(245,158,11,0.5); animation: pulse 2s infinite; }
.fd-idle { background: var(--text3); }

/* Skill tags */
.fd-skills { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.fd-skill {
  font-size: 9px; padding: 2px 7px; border-radius: 4px;
  background: rgba(99,102,241,0.12); color: var(--accent2); border: 1px solid rgba(99,102,241,0.15);
}
.fd-skill-ai { background: rgba(6,182,212,0.12); color: var(--cyan); border-color: rgba(6,182,212,0.2); }
.fd-skill-pending { background: rgba(245,158,11,0.12); color: var(--orange); border-color: rgba(245,158,11,0.2); }

/* Collaboration info */
.fd-collab { display: flex; flex-wrap: wrap; gap: 4px; }
.fd-ai-pair {
  font-size: 9px; padding: 2px 7px; border-radius: 4px;
  background: rgba(6,182,212,0.08); color: var(--cyan); border: 1px dashed rgba(6,182,212,0.2);
}
.fd-serving {
  font-size: 9px; padding: 2px 7px; border-radius: 4px;
  background: rgba(6,182,212,0.08); color: var(--cyan); border: 1px dashed rgba(6,182,212,0.2);
}
.fd-task-now {
  font-size: 9px; padding: 2px 7px; border-radius: 4px;
  background: rgba(245,158,11,0.08); color: var(--orange);
}

/* --- Floor Project: Overview project indicator --- */
.floor-project {
  width: 100%; margin-top: 4px; padding: 5px 8px;
  background: rgba(99,102,241,0.06); border-radius: 6px;
  border: 1px solid rgba(99,102,241,0.1);
}
.building-wrapper[data-zoom="detail"] .floor-project { display: none; }
.fp-tag {
  display: inline-block; font-size: 9px; font-weight: 700; padding: 1px 6px;
  border-radius: 3px; margin-bottom: 4px;
}
.fp-strategy { background: rgba(99,102,241,0.2); color: var(--accent2); }
.fp-live { background: rgba(239,68,68,0.2); color: var(--red); }
.fp-sprint { background: rgba(34,197,94,0.2); color: var(--green); }
.fp-onboard { background: rgba(6,182,212,0.2); color: var(--cyan); }
.fp-social { background: rgba(236,72,153,0.2); color: var(--pink); }
.fp-name { font-size: 10px; font-weight: 600; margin-bottom: 2px; }
.fp-bar {
  width: 100%; height: 4px; background: var(--bg2); border-radius: 2px;
  overflow: hidden; margin-bottom: 3px;
}
.fp-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent), var(--cyan));
  border-radius: 2px; transition: width 0.6s ease;
}
.fp-fill-active { background: linear-gradient(90deg, var(--green), var(--cyan)); animation: barPulse 2s infinite; }
.fp-fill-green { background: var(--green); }
@keyframes barPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.7; } }
.fp-phase { font-size: 9px; color: var(--text3); }

/* Legacy compat */
.fd-desk {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: var(--bg4); border-radius: var(--radius-sm); border: 1px solid var(--border);
  min-width: 140px; flex: 1; transition: border-color 0.2s; cursor: pointer;
}
.fd-desk:hover { border-color: var(--accent); }
.fd-desk strong { font-size: 12px; display: block; }
.fd-tag { font-size: 10px; color: var(--text3); }
.fd-info {
  width: 100%; font-size: 11px; color: var(--orange); padding: 6px 10px;
  background: rgba(245,158,11,0.08); border-radius: var(--radius-sm);
  border: 1px solid rgba(245,158,11,0.2);
}

/* ============ V2: BOSS DASHBOARD ============ */
.panel-tabs { display: flex; gap: 4px; }
.panel-tab {
  padding: 6px 14px; border-radius: 6px; font-size: 12px; font-weight: 500;
  color: var(--text3); background: none; border: 1px solid transparent;
  cursor: pointer; transition: all 0.15s;
}
.panel-tab:hover { color: var(--text); background: var(--bg3); }
.panel-tab.active { background: var(--accent); color: white; border-color: var(--accent); }

.boss-dashboard { padding: 16px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 12px; }
.boss-dashboard.hidden { display: none; }
.dash-card { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.dash-card-label { font-size: 12px; color: var(--text3); font-weight: 600; margin-bottom: 8px; }
.dash-card-sub { font-size: 10px; color: var(--text3); font-weight: 400; margin-left: 6px; }

.dash-tai { background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(6,182,212,0.15)); border-color: var(--accent); }
.dash-tai-amount { font-size: 36px; font-weight: 900; color: var(--gold); }
.dash-tai-unit { font-size: 12px; color: var(--text3); margin-top: -2px; }
.dash-tai-trend { font-size: 12px; color: var(--green); margin-top: 6px; }

.dash-saving-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dash-saving-item { background: var(--bg4); border-radius: var(--radius-sm); padding: 10px; text-align: center; }
.ds-val { font-size: 16px; font-weight: 700; color: var(--green); display: block; }
.ds-label { font-size: 10px; color: var(--text3); margin-top: 2px; display: block; }

.dash-task-list { display: flex; flex-direction: column; gap: 6px; }
.dash-task-item {
  display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 10px 12px;
  background: var(--bg4); border-radius: var(--radius-sm); margin-bottom: 6px;
}
.dash-task-item .dt-status { font-size: 8px; }
.dash-task-item.running .dt-status { color: var(--orange); }
.dash-task-item.done .dt-status { color: var(--green); }
.dash-task-item.task-frozen { background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.2); }
.dash-task-item .dt-meta { margin-left: auto; font-size: 10px; color: var(--text3); }

.referral-tree { font-size: 12px; }
.ref-node { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: var(--bg4); border-radius: var(--radius-sm); margin-bottom: 4px; }
.ref-root { background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(6,182,212,0.1)); border: 1px solid var(--accent); }
.ref-tai { margin-left: auto; color: var(--gold); font-weight: 600; font-size: 11px; }
.ref-children { padding-left: 16px; border-left: 2px solid var(--border); margin-left: 12px; }
.ref-branch { margin-bottom: 4px; }
.ref-sub { padding-left: 16px; font-size: 11px; color: var(--text3); margin-top: 2px; }
.ref-sub .ref-tai { font-size: 10px; }

.redeem-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.redeem-item {
  background: var(--bg4); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px; text-align: center; cursor: pointer; transition: all 0.2s;
}
.redeem-item:hover { border-color: var(--gold); box-shadow: 0 0 12px rgba(251,191,36,0.15); transform: translateY(-2px); }
.redeem-icon { font-size: 24px; margin-bottom: 4px; }
.redeem-name { font-size: 12px; font-weight: 500; }
.redeem-cost { font-size: 11px; color: var(--gold); margin-top: 2px; }

/* ============ V2: ACTIVITY BOARD ============ */
.town-side-tabs { display: flex; gap: 4px; padding: 12px 16px 0; }
.ts-tab {
  padding: 6px 14px; border-radius: 6px; font-size: 12px; font-weight: 500;
  background: none; border: 1px solid transparent; color: var(--text3);
  cursor: pointer; transition: all 0.15s;
}
.ts-tab:hover { color: var(--text); background: var(--bg3); }
.ts-tab.active { background: var(--accent); color: white; }

.event-board { padding: 12px 16px; overflow-y: auto; flex: 1; min-height: 0; }
.event-board.hidden { display: none; }
.event-card {
  background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; margin-bottom: 10px; transition: all 0.2s ease;
  position: relative; overflow: hidden;
}
.event-card::before {
  content: '';
  position: absolute; top: 0; left: -100%; width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(99,102,241,0.04), transparent);
  transition: left 0.4s ease;
}
.event-card:hover::before { left: 120%; }
.event-card:hover { border-color: var(--accent); box-shadow: 0 2px 16px rgba(99,102,241,0.08); }
.event-badge {
  display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 10px;
  border-radius: 10px; margin-bottom: 6px;
}
.badge-xingtan { background: rgba(236,72,153,0.15); color: var(--pink); }
.badge-social { background: rgba(251,191,36,0.15); color: var(--gold); }
.badge-newbie { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-xiaozhuo { background: rgba(6,182,212,0.15); color: var(--cyan); }
.event-card h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.event-meta { font-size: 11px; color: var(--text3); margin-bottom: 4px; }
.event-desc { font-size: 12px; color: var(--text2); margin-bottom: 8px; line-height: 1.4; }
.event-attendees { display: flex; align-items: center; gap: 2px; margin-bottom: 8px; }
.ea-avatar { font-size: 18px; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; background: var(--bg4); border-radius: 50%; border: 1px solid var(--border); margin-left: -4px; }
.ea-avatar:first-child { margin-left: 0; }
.ea-more { font-size: 10px; color: var(--text3); margin-left: 4px; }
.event-footer { display: flex; align-items: center; gap: 10px; }
.event-rsvp {
  padding: 6px 16px; background: var(--accent); color: white; border: none;
  border-radius: var(--radius-sm); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.event-rsvp:hover { background: var(--accent2); }
.event-rsvp:disabled { background: var(--green); cursor: default; }
.event-action-val { font-size: 10px; color: var(--orange); }
.event-reward-badge {
  font-size: 11px; color: var(--orange); background: rgba(255,165,0,0.1);
  padding: 3px 10px; border-radius: 20px; display: inline-block;
  margin-top: 4px; font-weight: 500;
}

/* ============ V2: ESG CARD → 环境监测 ============ */
.esg-card {
  background: var(--bg3); border: 1px solid rgba(6,182,212,0.2); border-radius: var(--radius);
  padding: 14px; margin: 12px 16px;
}
.esg-card h4 { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.env-metrics {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.env-metric-item {
  background: var(--bg4); border-radius: var(--radius-sm); padding: 8px 10px;
  display: flex; flex-direction: column; gap: 2px;
}
.env-metric-label {
  font-size: 10px; color: var(--text3); display: flex; align-items: center; gap: 4px;
}
.env-metric-value {
  font-size: 18px; font-weight: 800; color: var(--cyan); line-height: 1.2;
}
.env-metric-value.warn { color: var(--orange); }
.env-metric-value.danger { color: #ef4444; }
.env-metric-unit {
  font-size: 10px; font-weight: 400; color: var(--text3); margin-left: 2px;
}

/* ============ V2: SECURITY BADGE ============ */
.security-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px;
  border-radius: 16px; background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.3);
  font-size: 11px; color: var(--green); cursor: pointer; position: relative; white-space: nowrap;
}
.security-badge:hover { background: rgba(34,197,94,0.15); }
.security-tooltip {
  position: absolute; top: calc(100% + 8px); right: 0; width: 240px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px; font-size: 11px; color: var(--text2); line-height: 1.5; z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.security-tooltip.hidden { display: none; }

/* ============ V2: NPC WALKING ANIMATIONS ============ */
.npc.walking { animation: npcWalk 6s ease-in-out infinite !important; }
@keyframes npcWalk {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(20px) translateY(-2px); }
  50% { transform: translateX(40px); }
  75% { transform: translateX(20px) translateY(2px); }
}
.npc.roaming { animation: npcRoam 10s ease-in-out infinite !important; }
@keyframes npcRoam {
  0%, 100% { transform: translateX(0) scaleX(1); }
  30% { transform: translateX(50px) scaleX(1); }
  50% { transform: translateX(50px) scaleX(-1); }
  80% { transform: translateX(0) scaleX(-1); }
  90% { transform: translateX(0) scaleX(1); }
}

/* ============ V2: 3F BAR BUTTON ============ */
.bar-action-btn {
  display: block; width: 100%; margin-top: 8px; padding: 6px 10px;
  background: rgba(6,182,212,0.1); border: 1px solid var(--cyan);
  border-radius: var(--radius-sm); color: var(--cyan); font-size: 11px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.bar-action-btn:hover { background: rgba(6,182,212,0.2); transform: translateY(-1px); }

/* ============ RESIZE HANDLE (Draggable Panels) ============ */
.resize-handle-h {
  width: 6px; cursor: col-resize; background: transparent;
  flex-shrink: 0; position: relative; z-index: 10;
  transition: background 0.15s;
}
.resize-handle-h:hover,
.resize-handle-h.dragging {
  background: var(--accent);
}
.resize-handle-v {
  height: 6px; cursor: row-resize; background: transparent;
  flex-shrink: 0; position: relative; z-index: 10;
  transition: background 0.15s;
}
.resize-handle-v:hover,
.resize-handle-v.dragging {
  background: var(--accent);
}

/* ============ OPC VIEW RESTRUCTURED ============ */
.opc-layout-restructured {
  display: flex; flex: 1; overflow: hidden;
}
.opc-chat-sidebar {
  width: 280px; background: var(--bg2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; flex-shrink: 0;
}
.opc-chat-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
}
.opc-right-tabs-panel {
  width: 380px; background: var(--bg2); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; flex-shrink: 0;
}
.opc-right-tab-header {
  display: flex; border-bottom: 1px solid var(--border);
}
.opc-right-tab-btn {
  flex: 1; padding: 12px 8px; background: none; border: none;
  color: var(--text3); font-size: 13px; font-weight: 500;
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
.opc-right-tab-btn.active {
  color: var(--accent); border-bottom-color: var(--accent);
}
.opc-right-tab-btn:hover {
  color: var(--text1);
}
.opc-right-tab-content {
  flex: 1; overflow-y: auto; padding: 16px;
  display: none;
}
.opc-right-tab-content.active {
  display: block;
}

/* ============ OPC HALL VIEW ============ */
.opchall-layout {
  display: flex; flex: 1; overflow: hidden;
}
.opchall-main {
  flex: 1; overflow-y: auto; padding: 24px;
}
.opchall-star-section {
  margin-bottom: 28px;
  background: linear-gradient(135deg, rgba(6,182,212,0.06), rgba(99,102,241,0.06));
  border-radius: 16px; padding: 20px;
  border: 1px solid rgba(6,182,212,0.12);
}
.opchall-star-title {
  font-size: 17px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
  color: var(--text1);
}
.opchall-star-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px;
}
.opchall-star-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: all 0.25s; cursor: pointer; position: relative; overflow: hidden;
}
.opchall-star-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--cyan)); opacity: 0;
  transition: opacity 0.25s;
}
.opchall-star-card:hover {
  border-color: var(--accent); transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.opchall-star-card:hover::before { opacity: 1; }
.opchall-star-avatar {
  width: 56px; height: 56px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 24px;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  box-shadow: 0 2px 8px rgba(6,182,212,0.25);
}
.opchall-star-name {
  font-size: 14px; font-weight: 700; color: var(--text1);
}
.opchall-star-rep {
  font-size: 12px; color: var(--accent);
}
.opchall-star-tasks {
  font-size: 11px; color: var(--text3);
}
.opchall-star-tags {
  display: flex; flex-wrap: wrap; gap: 4px; justify-content: center;
}
.opchall-tag {
  font-size: 10px; padding: 2px 8px; border-radius: 10px;
  background: rgba(6,182,212,0.1); color: var(--cyan); border: 1px solid rgba(6,182,212,0.2);
  transition: all 0.15s;
}
.opchall-tag:hover {
  background: rgba(6,182,212,0.2); border-color: var(--cyan);
}
.opchall-search-bar {
  display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap;
  align-items: center;
}
.opchall-search-input {
  flex: 1; min-width: 200px; padding: 10px 14px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 13px;
  outline: none; transition: border-color 0.2s;
}
.opchall-search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(6,182,212,0.1); }
.opchall-tag-cloud {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px;
}
.opchall-tag-cloud-item {
  font-size: 12px; padding: 4px 10px; border-radius: 12px;
  background: var(--bg3); color: var(--text2); border: 1px solid var(--border);
  cursor: pointer; transition: all 0.15s;
}
.opchall-tag-cloud-item:hover,
.opchall-tag-cloud-item.active {
  background: rgba(6,182,212,0.15); color: var(--cyan); border-color: var(--cyan);
}
.opchall-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px;
}
.opchall-user-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; display: flex; flex-direction: column; gap: 10px; transition: all 0.2s;
}
.opchall-user-card:hover {
  border-color: var(--accent); box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.opchall-user-avatar {
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
}
.opchall-user-info { flex: 1; min-width: 0; }
.opchall-user-name { font-size: 14px; font-weight: 600; color: var(--text1); }
.opchall-user-meta { font-size: 12px; color: var(--text3); margin-top: 2px; }
.opchall-user-tasks { font-size: 11px; color: var(--text3); margin-top: 4px; }

/* OPC Hall Ranking Sidebar */
.opchall-ranking-sidebar {
  width: 300px; background: var(--bg2); border-left: 1px solid var(--border);
  overflow-y: auto; padding: 20px; flex-shrink: 0;
}
.opchall-ranking-title {
  font-size: 16px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 6px;
}
.opchall-ranking-item {
  display: flex; align-items: center; gap: 10px; padding: 12px 8px;
  border-bottom: 1px solid var(--border); transition: background 0.15s;
  border-radius: 8px; margin-bottom: 2px;
}
.opchall-ranking-item:hover {
  background: var(--bg3);
}
.opchall-ranking-pos {
  width: 28px; height: 28px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
  flex-shrink: 0;
}
.opchall-ranking-pos.gold { background: linear-gradient(135deg, #FFD700, #FFA500); color: #333; box-shadow: 0 0 8px rgba(255,215,0,0.4); }
.opchall-ranking-pos.silver { background: linear-gradient(135deg, #E8E8E8, #C0C0C0); color: #333; box-shadow: 0 0 6px rgba(192,192,192,0.3); }
.opchall-ranking-pos.bronze { background: linear-gradient(135deg, #CD7F32, #A0522D); color: #fff; box-shadow: 0 0 6px rgba(205,127,50,0.3); }
.opchall-ranking-pos.normal { background: var(--bg4); color: var(--text3); }
.opchall-ranking-info {
  flex: 1; min-width: 0;
}
.opchall-ranking-name {
  font-size: 13px; font-weight: 600; color: var(--text1);
  display: flex; align-items: center; gap: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.opchall-rank-level {
  display: inline-block; font-size: 10px; padding: 1px 5px; border-radius: 4px;
  background: rgba(139,92,246,0.12); color: #8b5cf6; font-weight: 600; flex-shrink: 0;
}
.opchall-ranking-meta {
  font-size: 11px; color: var(--text3); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: flex; align-items: center; gap: 4px; flex-wrap: nowrap;
}
.opchall-rank-tag {
  display: inline-block; font-size: 9px; padding: 1px 5px; border-radius: 6px;
  background: rgba(6,182,212,0.08); color: var(--cyan); border: 1px solid rgba(6,182,212,0.15);
}
.opchall-ranking-val {
  font-size: 12px; color: var(--accent); font-weight: 700; flex-shrink: 0;
  text-align: right; min-width: 50px;
}

/* OPC Detail Modal */
#opcDetailModalBody .opchall-tag {
  cursor: default;
}

/* ============ TASK HALL VIEW ============ */
.taskhall-layout {
  display: flex; flex: 1; overflow: hidden;
}
.taskhall-main {
  flex: 1; overflow-y: auto; padding: 20px;
}
.taskhall-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.taskhall-refresh-btn {
  background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 10px; cursor: pointer; font-size: 14px; transition: all 0.2s;
}
.taskhall-refresh-btn:hover {
  border-color: var(--accent); background: rgba(6,182,212,0.1);
}
.taskhall-refresh-btn.spinning {
  animation: spin 0.6s linear;
}
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.taskhall-title {
  font-size: 18px; font-weight: 700;
}
.taskhall-search {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.taskhall-search-input {
  flex: 1; padding: 8px 12px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 13px; outline: none;
}
.taskhall-search-input:focus { border-color: var(--accent); }
.taskhall-filters {
  display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap;
}
.taskhall-filter-btn {
  padding: 6px 12px; border-radius: 16px; border: 1px solid var(--border);
  background: var(--bg3); color: var(--text2); font-size: 12px; cursor: pointer;
  transition: all 0.15s;
}
.taskhall-filter-btn.active,
.taskhall-filter-btn:hover {
  background: rgba(6,182,212,0.15); color: var(--cyan); border-color: var(--cyan);
}
.taskhall-section-title {
  font-size: 14px; font-weight: 600; margin: 16px 0 8px; color: var(--text2);
}
.taskhall-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
@media (max-width: 600px) {
  .taskhall-grid { grid-template-columns: 1fr; }
}
.taskhall-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; transition: all 0.2s; cursor: pointer; position: relative; overflow: hidden;
}
.taskhall-card:hover {
  border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.taskhall-card-title {
  font-size: 14px; font-weight: 700; color: var(--text1); margin-bottom: 8px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.taskhall-card-meta {
  font-size: 11px; color: var(--text3); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}
.taskhall-card-reward {
  font-size: 15px; font-weight: 800; color: var(--accent);
}
.taskhall-card-tags {
  display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap;
}
.taskhall-card-actions {
  display: flex; gap: 6px; margin-top: 10px;
}
.taskhall-card-desc {
  font-size: 12px; color: var(--text2); line-height: 1.5; margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.taskhall-level-badge {
  display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 700;
  background: linear-gradient(135deg, #8b5cf6, #6366f1); color: #fff;
}
.taskhall-consult-btn {
  padding: 4px 12px; border-radius: var(--radius-sm);
  background: rgba(6,182,212,0.1); border: 1px solid var(--cyan);
  color: var(--cyan); font-size: 11px; cursor: pointer; transition: all 0.15s;
}
.taskhall-consult-btn:hover {
  background: rgba(6,182,212,0.2);
}
.taskhall-detail-btn {
  padding: 4px 12px; border-radius: var(--radius-sm);
  background: rgba(139,92,246,0.1); border: 1px solid #8b5cf6;
  color: #8b5cf6; font-size: 11px; cursor: pointer; transition: all 0.15s;
}
.taskhall-detail-btn:hover {
  background: rgba(139,92,246,0.2);
}
.taskhall-accept-btn {
  padding: 4px 12px; border-radius: var(--radius-sm);
  background: var(--accent); border: none;
  color: white; font-size: 11px; cursor: pointer; transition: all 0.15s;
}
.taskhall-accept-btn:hover {
  background: var(--accent2);
}

/* ============ BBS VIEW ============ */
.bbs-layout {
  display: flex; flex: 1; overflow: hidden;
}
.bbs-main {
  flex: 1; overflow-y: auto; padding: 20px;
}
.bbs-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.bbs-title {
  font-size: 18px; font-weight: 700;
}
.bbs-create-btn {
  padding: 8px 16px; background: var(--accent); color: white;
  border: none; border-radius: var(--radius-sm); font-size: 13px;
  font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.bbs-create-btn:hover { background: var(--accent2); }
.bbs-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.bbs-modal-content { background: var(--bg1); border-radius: 12px; width: 90%; max-width: 500px; max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
.bbs-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); font-size: 16px; font-weight: 700; color: var(--text1); }
.bbs-modal-close { background: none; border: none; font-size: 18px; color: var(--text3); cursor: pointer; padding: 4px 8px; border-radius: 4px; }
.bbs-modal-close:hover { background: var(--bg3); color: var(--text1); }
.bbs-modal-body { overflow-y: auto; }
.bbs-search {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.bbs-search-input {
  flex: 1; padding: 8px 12px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 13px; outline: none;
}
.bbs-search-input:focus { border-color: var(--accent); }
.bbs-category-filters {
  display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap;
}
.bbs-category-btn {
  padding: 6px 12px; border-radius: 16px; border: 1px solid var(--border);
  background: var(--bg3); color: var(--text2); font-size: 12px; cursor: pointer;
  transition: all 0.15s;
}
.bbs-category-btn.active,
.bbs-category-btn:hover {
  background: rgba(6,182,212,0.15); color: var(--cyan); border-color: var(--cyan);
}
.bbs-post-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  padding: 16px 0;
}
.bbs-post-card {
  background: var(--bg2);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
}
.bbs-post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.bbs-post-card.pinned {
  border: 2px solid var(--accent);
}
.bbs-post-cover {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--bg3);
}
.bbs-post-body {
  padding: 12px;
  flex: 1;
}
.bbs-post-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text1);
  margin-bottom: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bbs-post-content {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bbs-post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text3);
  padding: 8px 12px;
  background: rgba(0,0,0,0.02);
}
.bbs-post-author {
  display: flex;
  align-items: center;
  gap: 6px;
}
.bbs-post-author-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}
.bbs-post-author-name {
  font-weight: 500;
  color: var(--text2);
}
.bbs-post-stat {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bbs-post-stat-item {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--text3);
}

/* BBS Detail Modal */
.bbs-detail-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.bbs-detail-modal {
  background: var(--bg1); border-radius: var(--radius); width: 90%; max-width: 700px;
  max-height: 80vh; display: flex; flex-direction: column;
}
.bbs-detail-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.bbs-detail-close {
  background: none; border: none; color: var(--text3); font-size: 20px; cursor: pointer;
}
.bbs-detail-body {
  flex: 1; overflow-y: auto; padding: 20px;
}
.bbs-detail-title {
  font-size: 18px; font-weight: 700; margin-bottom: 8px;
}
.bbs-detail-content {
  font-size: 14px; color: var(--text2); line-height: 1.6; margin-bottom: 16px;
}
.bbs-reply-list {
  border-top: 1px solid var(--border); padding-top: 12px;
}
.bbs-reply-item {
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.bbs-reply-author {
  font-size: 12px; font-weight: 600; color: var(--text1);
}
.bbs-reply-content {
  font-size: 13px; color: var(--text2); margin-top: 4px;
}
.bbs-reply-meta {
  font-size: 11px; color: var(--text3); margin-top: 4px;
}
.bbs-detail-footer {
  padding: 12px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 8px;
}
.bbs-reply-input {
  flex: 1; padding: 8px 12px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 13px; outline: none;
}
.bbs-reply-input:focus { border-color: var(--accent); }
.bbs-reply-submit {
  padding: 8px 16px; background: var(--accent); color: white;
  border: none; border-radius: var(--radius-sm); font-size: 13px;
  font-weight: 600; cursor: pointer;
}

/* BBS Create Modal */
.bbs-create-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.bbs-create-modal {
  background: var(--bg1); border-radius: var(--radius); width: 90%; max-width: 500px;
  padding: 20px;
}
.bbs-create-title {
  font-size: 16px; font-weight: 700; margin-bottom: 12px;
}
.bbs-create-field {
  margin-bottom: 12px;
}
.bbs-create-label {
  font-size: 12px; color: var(--text3); margin-bottom: 4px;
}
.bbs-create-input {
  width: 100%; padding: 8px 12px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 13px; outline: none;
  box-sizing: border-box;
}
.bbs-create-input:focus { border-color: var(--accent); }
.bbs-create-textarea {
  width: 100%; min-height: 120px; padding: 8px 12px; background: var(--bg3);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 13px; outline: none; resize: vertical;
  box-sizing: border-box;
}
.bbs-create-textarea:focus { border-color: var(--accent); }
.bbs-create-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px;
}
.bbs-create-cancel {
  padding: 8px 16px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text2); font-size: 13px; cursor: pointer;
}
.bbs-create-submit {
  padding: 8px 16px; background: var(--accent); border: none;
  border-radius: var(--radius-sm); color: white; font-size: 13px;
  font-weight: 600; cursor: pointer;
}

/* ============ CONSULTATION CHAT INTEGRATION ============ */
.consultation-chat-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s;
}
.consultation-chat-item:hover {
  background: var(--bg3);
}
.consultation-chat-item.active {
  background: rgba(6,182,212,0.08);
  border-left: 3px solid var(--cyan);
}
.consultation-chat-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; background: linear-gradient(135deg, var(--pink), var(--accent));
  flex-shrink: 0;
}
.consultation-chat-info {
  flex: 1; min-width: 0;
}
.consultation-chat-name {
  font-size: 13px; font-weight: 500; color: var(--text1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.consultation-chat-preview {
  font-size: 11px; color: var(--text3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.consultation-chat-time {
  font-size: 10px; color: var(--text3); flex-shrink: 0;
}
.consultation-msg-image {
  max-width: 200px; max-height: 200px; border-radius: var(--radius-sm);
  cursor: pointer; margin-top: 4px;
}
.consultation-consecutive-warn {
  font-size: 11px; color: #e67e22; padding: 4px 8px;
  background: rgba(230,126,34,0.1); border-radius: var(--radius-sm);
  margin-top: 4px;
}

/* ============ MOBILE RESPONSIVE ============ */

/* --- Tablet (≤1024px) --- */
@media (max-width: 1024px) {
  /* Nav */
  .top-nav { padding: 0 10px; gap: 4px; }
  .guide-btn { display: none; }
  .nav-tab { padding: 6px 12px; font-size: 12px; }
  .logo-text { font-size: 16px; }
  .user-name { display: none; }

  /* Boss */
  .chat-sidebar { width: 220px; }
  .task-panel, .boss-right-panel { width: 320px !important; }

  /* OPC */
  .opc-profile-panel { width: 260px; padding: 12px; }
  .opc-side-panel { width: 220px; padding: 12px; }
  .opc-main-panel { padding: 12px; }

  /* Town */
  .town-side { width: 240px; padding: 12px; }

  /* Task Execution */
  .te-timeline { width: 220px; padding: 14px; }
  .te-ai-chat { width: 220px; }
}

/* --- Mobile (≤768px) --- */
@media (max-width: 768px) {
  html, body { overflow: auto; overflow-x: hidden; }

  /* === TOP NAV === */
  .top-nav { height: auto; min-height: 44px; padding: 6px 8px; position: sticky; top: 0; z-index: 50; flex-wrap: wrap; gap: 4px; }
  .nav-left { gap: 4px; flex-shrink: 0; }
  .logo-icon { font-size: 18px; }
  .logo-text { font-size: 13px; letter-spacing: 1px; }
  .logo-badge { font-size: 8px; padding: 1px 4px; }
  .guide-btn { display: none; }
  .nav-center { gap: 2px; order: 3; width: 100%; justify-content: center; }
  .nav-tab { padding: 5px 10px; font-size: 11px; border-radius: 6px; flex: 1; text-align: center; }
  .nav-right { gap: 6px; margin-left: auto; }
  .user-avatar { width: 24px; height: 24px; font-size: 10px; }
  .user-name { display: none; }

  /* === VIEWS === */
  .app { height: auto; min-height: 100vh; }
  .view { overflow: visible; }
  .view.active { flex-direction: column; }

  /* === BOSS VIEW === */
  .boss-layout { flex-direction: column; height: auto; }
  .chat-panel { flex-direction: column; height: auto; }
  .chat-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); max-height: 200px; }
  .chat-list { display: flex; overflow-x: auto; overflow-y: hidden; gap: 2px; padding: 4px 8px; }
  .chat-item { flex-direction: column; gap: 4px; padding: 8px 10px; min-width: 120px; border-left: none; border-bottom: 2px solid transparent; text-align: center; }
  .chat-item.active { border-left: none; border-bottom-color: var(--accent); }
  .chat-item-avatar { font-size: 22px; width: 36px; height: 36px; }
  .chat-item-preview { display: none; }
  .chat-item-time { display: none; }
  .chat-item-name { font-size: 12px; justify-content: center; }
  .chat-search { padding: 8px; }
  .chat-search input { padding: 6px 10px; font-size: 12px; }

  .chat-main { min-height: 320px; }
  .chat-header { height: 44px; padding: 0 10px; }
  .chat-header-name { font-size: 13px; }
  .chat-messages { padding: 10px; gap: 8px; }
  .msg { max-width: 90%; }
  .msg-avatar { width: 28px; height: 28px; font-size: 18px; }
  .msg-bubble { padding: 8px 10px; font-size: 13px; }
  .chat-input { padding: 8px; gap: 6px; }
  .chat-input input { padding: 8px 10px; font-size: 13px; }

  /* Task Panel / Boss Dashboard */
  .task-panel, .boss-right-panel { width: 100% !important; max-width: 100%; border-left: none; border-top: 1px solid var(--border); min-height: 300px; }
  .panel-header { padding: 10px 12px; }
  .panel-tabs { gap: 4px; }
  .panel-tab { font-size: 12px; padding: 5px 10px; }

  /* Boss Dashboard */
  .boss-dashboard { padding: 12px; gap: 12px; }
  .boss-tai-card { padding: 16px; }
  .boss-tai-val { font-size: 28px; }
  .boss-cost-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .cost-item { padding: 10px; }
  .cost-val { font-size: 18px; }
  .boss-task-list, .boss-referral, .boss-redeem { padding: 14px; }
  .redeem-grid { grid-template-columns: 1fr 1fr; gap: 6px; }

  /* === OPC VIEW === */
  .opc-layout { flex-direction: column; height: auto; }
  .opc-profile-panel { width: 100%; border-right: none; border-bottom: 1px solid var(--border); padding: 12px; max-height: none; overflow: visible; }

  /* Collapse OPC profile into horizontal card */
  .opc-card { display: flex; flex-direction: column; align-items: center; }
  .opc-card-bg { height: 60px; }
  .opc-avatar-section { margin-top: -30px; }
  .opc-avatar-ring { width: 60px; height: 60px; }
  .opc-level-badge { font-size: 9px; padding: 1px 6px; }
  .opc-name { font-size: 16px; }

  /* Hide RPG stats details on mobile, show compact */
  .stat-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .stat-card { padding: 8px 10px; }
  .stat-value { font-size: 16px; }
  .stat-label { font-size: 10px; }
  .stat-detail { font-size: 9px; }
  .growth-radar-section { display: none; }

  .opc-main-panel { padding: 10px; min-height: 400px; overflow: visible; }
  .opc-side-panel { width: 100%; border-left: none; border-top: 1px solid var(--border); padding: 12px; overflow: visible; }

  /* Quest cards */
  .quest-card { padding: 14px; }
  .quest-title { font-size: 14px; }
  .quest-meta { flex-wrap: wrap; gap: 6px; }

  /* Group chat */
  .group-header { padding: 10px; }
  .group-messages { padding: 8px; max-height: 200px; }

  /* Wallet compact */
  .wallet-card { padding: 14px; }
  .wallet-amount { font-size: 28px; }

  /* Leaderboard compact */
  .lb-item { padding: 6px 10px; font-size: 12px; }

  /* Achievements grid */
  .achievements-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }

  /* === TOWN VIEW === */
  .town-layout { flex-direction: column; height: auto; }
  .town-canvas-wrapper { min-height: auto; }
  .town-header { flex-direction: column; align-items: flex-start; padding: 10px 12px; gap: 8px; }
  .town-header h2 { font-size: 14px; }
  .town-stats { gap: 8px; flex-wrap: wrap; }
  .town-stat { font-size: 11px; }
  .town-controls { gap: 6px; margin-top: 4px; }
  .zoom-btn { font-size: 11px; padding: 3px 8px; }

  .town-scene { grid-template-columns: 1fr; padding: 10px; gap: 10px; }
  .town-scene > .social-plaza { grid-column: 1; grid-row: auto; }
  .town-scene > .task-wall { grid-column: 1; margin: 10px 0 0 0; }
  .building { min-width: unset; width: 100%; }
  .floor { padding: 10px; }
  .floor-label { font-size: 11px; }
  .floor-content { gap: 6px; }
  .floor-room { padding: 6px 8px; }
  .room-name { font-size: 10px; }
  .npc { font-size: 20px; width: 28px; height: 28px; }

  /* Floor detail */
  .floor-detail { flex-wrap: wrap; gap: 6px; }
  .fd-desk { padding: 6px; min-width: 60px; }

  .town-side { width: 100%; border-left: none; border-top: 1px solid var(--border); padding: 12px; overflow: visible; }

  /* Activity feed */
  .feed-item { padding: 6px 8px; font-size: 11px; }

  /* Event board */
  .event-card { padding: 10px; }
  .event-title { font-size: 13px; }
  .event-meta { font-size: 10px; }
  .event-bottom { flex-direction: column; gap: 6px; align-items: flex-start; }
  .event-rsvp { font-size: 10px; padding: 4px 10px; }

  /* ESG Card */
  .esg-card { padding: 12px; }
  .esg-stats { gap: 6px; }

  /* Building sign */
  .building-sign { font-size: 13px; padding: 10px; }

  /* Agent tree */
  .agent-tree { padding: 12px; }

  /* === TASK EXECUTION OVERLAY === */
  .task-execution-overlay { overflow-y: auto; }
  .te-header { flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px 12px; }
  .te-title { font-size: 14px; }
  .te-timer { width: 100%; }
  .te-progress-bar { width: 100%; }
  .te-countdown { font-size: 12px; }
  .te-back { font-size: 12px; padding: 4px 8px; }

  .te-body { flex-direction: column; overflow: visible; }
  .te-timeline { width: 100%; border-right: none; border-bottom: 1px solid var(--border); padding: 12px; overflow: visible; }
  .milestone-list { flex-direction: row; overflow-x: auto; gap: 8px; padding-bottom: 8px; }
  .milestone-node { flex-direction: column; min-width: 120px; padding-bottom: 0; text-align: center; }
  .ms-dot { align-self: center; }
  .ms-connector { display: none; }
  .ms-content { padding-bottom: 0; }
  .ms-content h4 { font-size: 12px; }
  .ms-content p { font-size: 10px; }
  .ms-reward { font-size: 9px; }
  .ms-number { font-size: 9px; }
  .ms-status { font-size: 9px; padding: 1px 6px; }
  .ms-header { justify-content: center; }

  .te-work-area { padding: 10px; }
  .work-card { padding: 14px; }
  .work-card h3 { font-size: 14px; }
  .doc-section { padding: 10px; }
  .doc-section h4 { font-size: 12px; }
  .doc-section p { font-size: 11px; }

  .editor-title-input input { font-size: 13px; padding: 8px 10px; }
  .editor-textarea { min-height: 120px; font-size: 12px; }
  .editor-images { flex-wrap: wrap; }
  .img-placeholder { min-width: 60px; height: 60px; font-size: 10px; }
  .editor-status { flex-wrap: wrap; font-size: 11px; gap: 8px; }

  .review-score-ring { width: 90px; height: 90px; }
  .score-num { font-size: 28px; }
  .review-item { font-size: 12px; padding: 6px 10px; }

  .te-ai-chat { width: 100%; border-left: none; border-top: 1px solid var(--border); max-height: 250px; }
  .te-ai-header { padding: 10px; }
  .te-ai-messages { padding: 8px; }
  .te-ai-msg { font-size: 11px; padding: 8px 10px; }

  /* === REWARD MODAL === */
  .reward-card { width: calc(100vw - 32px); max-width: 380px; padding: 20px; border-radius: 16px; }
  .reward-icon { font-size: 40px; }
  .reward-header h2 { font-size: 20px; }
  .reward-header p { font-size: 12px; }
  .reward-items { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .ri-icon { font-size: 20px; }
  .ri-value { font-size: 16px; }
  .ri-label { font-size: 9px; }
  .reward-achievement { padding: 10px; gap: 10px; }
  .ra-badge-glow { width: 40px; height: 40px; }
  .ra-badge-icon { font-size: 20px; }
  .ra-name { font-size: 14px; }
  .reward-close-btn { padding: 10px 24px; font-size: 13px; }

  /* === NPC PROFILE CARD === */
  .npc-profile-card { width: calc(100vw - 32px) !important; max-width: 320px; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); }

  /* === DEMO OVERLAY === */
  .demo-overlay { padding: 0 8px; }
  .demo-narration-bar { bottom: 8px; left: 8px; right: 8px; padding: 14px; border-radius: 12px; }
  .demo-text { font-size: 13px; }
  .demo-speaker { font-size: 11px; }
}

/* --- Small phone (≤480px) --- */
@media (max-width: 480px) {
  .nav-tab { padding: 4px 7px; font-size: 10px; }
  .logo-text { font-size: 12px; }
  .logo-badge { display: none; }

  .chat-sidebar { max-height: 150px; }
  .chat-item { min-width: 90px; padding: 6px 8px; }
  .chat-item-avatar { font-size: 18px; width: 30px; height: 30px; }
  .chat-item-name { font-size: 10px; }

  .stat-cards { grid-template-columns: 1fr 1fr; gap: 4px; }
  .stat-card { padding: 6px 8px; }
  .stat-value { font-size: 14px; }
  .stat-label, .stat-detail { font-size: 9px; }

  .quest-tags { gap: 4px; }
  .quest-tag { font-size: 9px; padding: 2px 6px; }
  .quest-btn { font-size: 11px; padding: 6px 12px; }

  .opc-tags { gap: 4px; }
  .opc-tags span { font-size: 10px; padding: 2px 6px; }

  .wallet-amount { font-size: 24px; }
  .wallet-breakdown { gap: 4px; font-size: 10px; }

  .reward-items { grid-template-columns: repeat(2, 1fr); }
  .reward-card { padding: 16px; }

  .te-header { padding: 8px; }
  .te-level-badge { font-size: 10px; }
  .te-title { font-size: 12px; }

  .milestone-node { min-width: 100px; }

  .boss-tai-val { font-size: 24px; }
  .cost-item { padding: 8px; }
  .cost-val { font-size: 16px; }
  .cost-label { font-size: 10px; }
  .redeem-grid { grid-template-columns: 1fr 1fr; }
}

/* ============ BOSS: Notification Bell + Application Review ============ */
.boss-notif-btn {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%; background: var(--bg3);
  border: 1px solid var(--border); cursor: pointer; font-size: 16px; transition: all 0.2s;
}
.boss-notif-btn:hover { background: var(--bg4); border-color: var(--accent); }
.boss-notif-badge {
  position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px;
  background: #ef4444; color: #fff; border-radius: 8px; font-size: 10px; font-weight: 700;
  display: none; align-items: center; justify-content: center; padding: 0 4px;
  animation: pulse 2s infinite;
}
.boss-notif-badge.show { display: flex; }

.boss-notif-panel {
  position: absolute; top: 100%; right: 0; width: 320px; max-height: 400px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4); overflow: hidden; z-index: 100;
  display: none; flex-direction: column; margin-top: 8px;
}
.boss-notif-panel.show { display: flex; }
.boss-notif-panel-header {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.boss-notif-panel-header h4 { font-size: 13px; font-weight: 700; margin: 0; }
.boss-notif-panel-body { flex: 1; overflow-y: auto; }
.boss-notif-item {
  padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s;
}
.boss-notif-item:hover { background: var(--bg3); }
.boss-notif-item.unread { background: rgba(99,102,241,0.06); }
.boss-notif-item-title { font-size: 12px; font-weight: 600; color: var(--text1); margin-bottom: 2px; }
.boss-notif-item-body { font-size: 11px; color: var(--text3); line-height: 1.4; }
.boss-notif-item-time { font-size: 10px; color: var(--text3); margin-top: 4px; opacity: 0.7; }
.boss-notif-empty { padding: 24px; text-align: center; font-size: 12px; color: var(--text3); }

/* Application review modal */
.app-review-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6); z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s;
}
.app-review-modal {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 16px;
  width: 90%; max-width: 480px; max-height: 80vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.app-review-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.app-review-header h3 { font-size: 15px; font-weight: 700; margin: 0; }
.app-review-close { background: none; border: none; color: var(--text3); font-size: 18px; cursor: pointer; padding: 4px 8px; }
.app-review-task-info { padding: 12px 20px; background: var(--bg3); font-size: 13px; }
.app-review-task-info .art-title { font-weight: 600; color: var(--text1); }
.app-review-task-info .art-meta { font-size: 11px; color: var(--text3); margin-top: 4px; }
.app-review-list { padding: 8px 0; }
.app-review-applicant {
  padding: 12px 20px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border); transition: background 0.15s;
}
.app-review-applicant:hover { background: var(--bg3); }
.app-review-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--cyan));
  display: flex; align-items: center; justify-content: center; color: #fff;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.app-review-info { flex: 1; min-width: 0; }
.app-review-name { font-size: 13px; font-weight: 600; color: var(--text1); }
.app-review-msg { font-size: 11px; color: var(--text3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-review-time { font-size: 10px; color: var(--text3); margin-top: 2px; }
.app-review-actions { display: flex; gap: 6px; flex-shrink: 0; }
.app-review-btn {
  padding: 6px 14px; border-radius: 8px; font-size: 12px; font-weight: 600;
  border: none; cursor: pointer; transition: all 0.15s;
}
.app-review-btn.approve { background: var(--green); color: #fff; }
.app-review-btn.approve:hover { background: #16a34a; }
.app-review-btn.reject { background: var(--bg4); color: var(--text2); border: 1px solid var(--border); }
.app-review-btn.reject:hover { background: #fef2f2; color: #ef4444; border-color: #ef4444; }
.app-review-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.app-review-empty { padding: 32px; text-align: center; color: var(--text3); font-size: 13px; }

/* Boss task item applicant badge */
.dash-task-item .dt-applicant-badge {
  background: #ef4444; color: #fff; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 8px; margin-left: 4px; flex-shrink: 0;
  animation: pulse 2s infinite;
}

/* OPC: My applications panel */
.my-apps-panel { padding: 12px 0; }
.my-app-item {
  padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px;
}
.my-app-status {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 6px; flex-shrink: 0;
}
.my-app-status.pending { background: rgba(245,158,11,0.15); color: #f59e0b; }
.my-app-status.approved { background: rgba(34,197,94,0.15); color: #22c55e; }
.my-app-status.rejected { background: rgba(239,68,68,0.15); color: #ef4444; }
.my-app-title { flex: 1; font-size: 12px; color: var(--text1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============ V3: GAME-LIKE TOWN UPGRADE ============ */

/* Town scene pixel art background - replace empty black with game world */
.town-scene {
  background:
    /* Pixel grid overlay */
    linear-gradient(rgba(99,102,241,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.03) 1px, transparent 1px),
    /* Sky gradient */
    linear-gradient(180deg, #0a0e27 0%, #121836 30%, #1a1f3a 60%, #0d1225 100%) !important;
  background-size: 8px 8px, 8px 8px, 100% 100%;
  position: relative;
}

/* Pixel stars in sky */
.town-scene::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 200px;
  background-image:
    radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 25% 8%, rgba(255,255,255,0.4), transparent),
    radial-gradient(2px 2px at 40% 20%, rgba(99,102,241,0.5), transparent),
    radial-gradient(1px 1px at 55% 5%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 70% 18%, rgba(255,255,255,0.3), transparent),
    radial-gradient(2px 2px at 85% 12%, rgba(6,182,212,0.4), transparent),
    radial-gradient(1px 1px at 15% 25%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 60% 28%, rgba(236,72,153,0.3), transparent),
    radial-gradient(1px 1px at 90% 22%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 35% 3%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 78% 30%, rgba(251,191,36,0.3), transparent),
    radial-gradient(1px 1px at 5% 10%, rgba(255,255,255,0.5), transparent);
  pointer-events: none; z-index: 0;
  animation: starsBlink 4s ease-in-out infinite alternate;
}
@keyframes starsBlink { 0% { opacity: 0.6; } 100% { opacity: 1; } }

/* Pixel ground/grass at bottom */
.town-scene::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 40px;
  background: repeating-linear-gradient(90deg, #1a3a1a 0px, #1a3a1a 8px, #163016 8px, #163016 16px);
  border-top: 4px solid #2d5a2d;
  z-index: 0;
  image-rendering: pixelated;
}

/* Building upgrade - more game-like */
.building {
  background: linear-gradient(180deg, #141830 0%, #111428 50%, #0f1220 100%) !important;
  border: 2px solid rgba(99,102,241,0.3) !important;
  box-shadow:
    0 0 30px rgba(99,102,241,0.1),
    inset 0 0 20px rgba(99,102,241,0.05),
    4px 4px 0 rgba(0,0,0,0.5),
    8px 8px 0 rgba(0,0,0,0.2) !important;
  image-rendering: pixelated;
  position: relative;
  z-index: 1;
}

/* Building sign upgrade */
.building-sign {
  background: linear-gradient(90deg, #1a1040, #241560, #1a1040) !important;
  border: 2px solid var(--accent) !important;
  box-shadow: 0 0 20px var(--accent-glow), 0 4px 0 rgba(0,0,0,0.4) !important;
  font-size: 16px !important;
  letter-spacing: 6px !important;
  text-shadow: 0 0 10px var(--accent-glow);
  padding: 10px 24px !important;
  animation: signGlow 3s ease-in-out infinite;
}
@keyframes signGlow { 0%,100% { box-shadow: 0 0 10px var(--accent-glow), 0 4px 0 rgba(0,0,0,0.4); } 50% { box-shadow: 0 0 30px var(--accent-glow), 0 0 60px rgba(99,102,241,0.15), 0 4px 0 rgba(0,0,0,0.4); } }

/* Floor upgrade - pixel art game tiles */
.floor {
  background: linear-gradient(180deg, rgba(20,24,48,0.9), rgba(15,18,32,0.95)) !important;
  border: 1px solid rgba(99,102,241,0.15) !important;
  border-left: 3px solid rgba(99,102,241,0.2) !important;
  border-bottom: 3px solid rgba(0,0,0,0.4) !important;
  position: relative;
  transition: all 0.3s ease !important;
}
.floor:hover {
  background: linear-gradient(180deg, rgba(30,34,68,0.95), rgba(20,24,48,0.98)) !important;
  border-left-color: var(--accent) !important;
  box-shadow: inset 0 0 20px rgba(99,102,241,0.08) !important;
}

/* Floor label - RPG style */
.floor-label {
  background: linear-gradient(90deg, rgba(99,102,241,0.2), transparent) !important;
  border-bottom: 1px solid rgba(99,102,241,0.1) !important;
  font-weight: 700 !important;
  letter-spacing: 1px !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  padding-left: 12px !important;
  position: relative;
}
.floor-label::before {
  content: '▸';
  margin-right: 6px;
  color: var(--accent2);
}

/* Room name badges - pixel game item labels */
.room-name {
  background: rgba(0,0,0,0.5) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 2px !important;
  padding: 2px 8px !important;
  font-size: 10px !important;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

/* NPC upgrade - pixel character feel */
.npc {
  font-size: 22px !important;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
  transition: all 0.2s !important;
  image-rendering: pixelated;
  position: relative;
}
.npc:hover {
  transform: scale(1.3) translateY(-4px) !important;
  filter: drop-shadow(0 4px 8px rgba(99,102,241,0.4)) !important;
}
/* NPC health/status bar */
.npc::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 50%; transform: translateX(-50%);
  width: 16px; height: 3px;
  background: var(--green);
  border-radius: 1px;
  box-shadow: 0 0 4px rgba(34,197,94,0.5);
}
.npc.ai-npc::after { background: var(--cyan); box-shadow: 0 0 4px rgba(6,182,212,0.5); }
.npc.newbie::after { background: var(--gold); box-shadow: 0 0 4px rgba(251,191,36,0.5); }
.npc.visitor::after { background: var(--text3); }

/* Task bubble - pixel game tooltip */
.task-bubble {
  background: rgba(0,0,0,0.7) !important;
  border: 1px solid var(--accent) !important;
  border-radius: 2px !important;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.4), 0 0 10px rgba(99,102,241,0.15) !important;
  font-size: 10px !important;
  padding: 3px 10px !important;
  animation: bubblePop 0.3s ease;
}
@keyframes bubblePop { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Event tag - blinking game status */
.event-tag {
  animation: eventBlink 1.5s ease-in-out infinite !important;
  text-shadow: 0 0 6px rgba(239,68,68,0.5);
}
@keyframes eventBlink { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Floor room - game zone */
.floor-room {
  background: rgba(255,255,255,0.02) !important;
  border: 1px dashed rgba(255,255,255,0.06) !important;
  border-radius: 2px !important;
  position: relative;
}
.floor-room::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0px, transparent 16px, rgba(255,255,255,0.01) 16px, rgba(255,255,255,0.01) 17px);
  pointer-events: none;
}

/* Activity feed - game log style */
.activity-feed {
  background: rgba(10,14,23,0.9) !important;
  border: 1px solid rgba(99,102,241,0.15) !important;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.3), 2px 2px 0 rgba(0,0,0,0.3) !important;
}
.activity-feed h3 {
  background: linear-gradient(90deg, rgba(99,102,241,0.15), transparent) !important;
  border-bottom: 1px solid rgba(99,102,241,0.1) !important;
  letter-spacing: 2px;
}
.feed-item {
  border-left: 2px solid transparent !important;
  transition: border-color 0.2s;
}
.feed-item:first-child { border-left-color: var(--green) !important; }

/* Town header - game HUD */
.town-header {
  background: linear-gradient(180deg, rgba(10,14,23,0.95), rgba(10,14,23,0.8)) !important;
  border-bottom: 2px solid rgba(99,102,241,0.2) !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4) !important;
}
.town-stat {
  background: rgba(99,102,241,0.08) !important;
  border: 1px solid rgba(99,102,241,0.15) !important;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2), 1px 1px 0 rgba(0,0,0,0.2);
}

/* Town side panel - game menu */
.town-side {
  background: linear-gradient(180deg, rgba(10,14,23,0.98), rgba(15,18,32,0.98)) !important;
  border-left: 2px solid rgba(99,102,241,0.15) !important;
  box-shadow: -4px 0 20px rgba(0,0,0,0.3) !important;
}

/* Pixel art decorative elements on floors */
.floor-content {
  position: relative;
}
.floor-content::after {
  content: '░░▒▓';
  position: absolute;
  right: 8px; bottom: 2px;
  font-size: 8px;
  color: rgba(99,102,241,0.08);
  letter-spacing: 1px;
  font-family: monospace;
}

/* GO咖 3F special styling */
.floor-3 {
  background: linear-gradient(180deg, rgba(30,20,10,0.9), rgba(20,15,8,0.95)) !important;
  border-left: 3px solid rgba(251,191,36,0.3) !important;
}
.floor-3:hover {
  border-left-color: var(--gold) !important;
  box-shadow: inset 0 0 20px rgba(251,191,36,0.05) !important;
}
.floor-3 .floor-label {
  background: linear-gradient(90deg, rgba(251,191,36,0.15), transparent) !important;
}
.floor-3 .floor-label::before { color: var(--gold); }

/* Pixel art window decorations on building */
.building::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    /* left side windows */
    radial-gradient(2px 3px at 4px 15%, rgba(99,102,241,0.15), transparent),
    radial-gradient(2px 3px at 4px 30%, rgba(6,182,212,0.1), transparent),
    radial-gradient(2px 3px at 4px 45%, rgba(99,102,241,0.12), transparent),
    radial-gradient(2px 3px at 4px 60%, rgba(251,191,36,0.1), transparent),
    radial-gradient(2px 3px at 4px 75%, rgba(99,102,241,0.1), transparent),
    /* right side windows */
    radial-gradient(2px 3px at calc(100% - 4px) 15%, rgba(99,102,241,0.15), transparent),
    radial-gradient(2px 3px at calc(100% - 4px) 30%, rgba(6,182,212,0.1), transparent),
    radial-gradient(2px 3px at calc(100% - 4px) 45%, rgba(99,102,241,0.12), transparent),
    radial-gradient(2px 3px at calc(100% - 4px) 60%, rgba(251,191,36,0.1), transparent),
    radial-gradient(2px 3px at calc(100% - 4px) 75%, rgba(99,102,241,0.1), transparent);
  pointer-events: none;
  z-index: 0;
}



/* ============ PIXEL ART TOWN OVERHAUL ============ */

/* Sky background with stars */
.town-scene {
  background:
    radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 25% 8%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 45% 22%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 60% 5%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 78% 18%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 92% 12%, rgba(255,255,255,0.4), transparent),
    radial-gradient(2px 2px at 15% 35%, rgba(99,102,241,0.3), transparent),
    radial-gradient(2px 2px at 85% 28%, rgba(6,182,212,0.3), transparent),
    linear-gradient(180deg, #0a0e1a 0%, #111827 40%, #1a1f35 70%, #1e293b 100%) !important;
  position: relative;
}

/* Ground strip */
.town-scene::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 32px;
  background:
    repeating-linear-gradient(90deg, #2d5a27 0px, #2d5a27 8px, #347a2e 8px, #347a2e 16px);
  border-top: 4px solid #4ade80;
  image-rendering: pixelated;
  z-index: 0;
}

/* Building as pixel art structure */
.building {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  position: relative;
  z-index: 1;
  max-width: none !important;
  margin-bottom: 0;
}

/* Pixel art building sign */
.building-sign {
  background: linear-gradient(180deg, #6366f1, #4f46e5) !important;
  border: 3px solid #818cf8 !important;
  border-bottom: 4px solid #312e81 !important;
  font-family: monospace !important;
  font-size: 16px !important;
  letter-spacing: 6px !important;
  text-shadow: 2px 2px 0 #312e81 !important;
  padding: 10px 20px !important;
  image-rendering: pixelated;
  position: relative;
  box-shadow: 0 4px 0 #312e81, 0 0 30px rgba(99,102,241,0.3) !important;
}
.building-sign::before {
  content: '🏢';
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 18px;
}

/* Roof decoration */
.building::before {
  content: '📡  ☁️         ✨   🌙';
  display: block; text-align: center; padding: 8px; font-size: 14px;
  letter-spacing: 4px;
  animation: twinkle 3s ease-in-out infinite alternate;
}
@keyframes twinkle { 0% { opacity: 0.6; } 100% { opacity: 1; } }

/* Each floor as pixel art room */
.floor {
  background:
    linear-gradient(180deg, rgba(30,41,59,0.95), rgba(30,41,59,0.85)) !important;
  border: 2px solid #475569 !important;
  border-left: 4px solid #64748b !important;
  border-right: 4px solid #334155 !important;
  border-bottom: 3px solid #1e293b !important;
  margin: 0 !important;
  border-radius: 0 !important;
  position: relative;
  overflow: visible !important;
  transition: all 0.3s;
  min-height: 90px;
}
.floor:hover {
  border-left-color: #818cf8 !important;
  border-right-color: #6366f1 !important;
  box-shadow: inset 0 0 20px rgba(99,102,241,0.1), 0 0 15px rgba(99,102,241,0.15) !important;
}

/* Floor-specific interior colors */
.floor-10 { background: linear-gradient(180deg, rgba(99,102,241,0.12), rgba(30,41,59,0.95)) !important; }
.floor-9 { background: linear-gradient(180deg, rgba(236,72,153,0.08), rgba(30,41,59,0.95)) !important; }
.floor-8 { background: linear-gradient(180deg, rgba(6,182,212,0.08), rgba(30,41,59,0.95)) !important; }
.floor-7 { background: linear-gradient(180deg, rgba(34,197,94,0.08), rgba(30,41,59,0.95)) !important; }
.floor-3 { background: linear-gradient(180deg, rgba(245,158,11,0.1), rgba(30,41,59,0.95)) !important; }

/* Pixel floor labels */
.floor-label {
  font-family: monospace !important;
  font-size: 11px !important;
  letter-spacing: 1px !important;
  padding: 6px 12px !important;
  background: rgba(0,0,0,0.4) !important;
  border-bottom: 2px solid rgba(255,255,255,0.08) !important;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
  position: relative;
}
/* Floor number pixel badge */
.floor-label::before {
  content: '▸ ';
  color: #818cf8;
}

/* Pixel art windows on each floor */
.floor::after {
  content: '';
  position: absolute; right: 8px; top: 8px;
  width: 60px; height: calc(100% - 16px);
  background:
    repeating-linear-gradient(180deg,
      rgba(99,102,241,0.15) 0px, rgba(99,102,241,0.15) 12px,
      rgba(6,182,212,0.1) 12px, rgba(6,182,212,0.1) 14px,
      transparent 14px, transparent 20px
    );
  border: 1px solid rgba(99,102,241,0.1);
  border-radius: 2px;
  pointer-events: none;
}

/* Room styling - pixel tiles */
.floor-room {
  background:
    repeating-linear-gradient(90deg,
      rgba(255,255,255,0.02) 0px, rgba(255,255,255,0.02) 24px,
      transparent 24px, transparent 48px
    ),
    repeating-linear-gradient(180deg,
      rgba(255,255,255,0.01) 0px, rgba(255,255,255,0.01) 24px,
      transparent 24px, transparent 48px
    ) !important;
  border: 1px dashed rgba(255,255,255,0.06) !important;
  border-radius: 4px !important;
  padding: 8px !important;
  position: relative;
}

/* Room name as pixel item label */
.room-name {
  font-family: monospace !important;
  font-size: 9px !important;
  background: rgba(0,0,0,0.5) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  padding: 2px 8px !important;
  border-radius: 2px !important;
  color: #94a3b8 !important;
  letter-spacing: 1px;
}

/* NPC as pixel sprites */
.npc {
  font-size: 22px !important;
  width: 36px !important; height: 36px !important;
  display: inline-flex !important; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.3) !important;
  border: 2px solid rgba(255,255,255,0.1) !important;
  border-bottom: 3px solid rgba(0,0,0,0.4) !important;
  border-radius: 4px !important;
  position: relative;
  cursor: pointer;
  transition: all 0.15s;
  image-rendering: pixelated;
}
.npc:hover {
  transform: scale(1.15) translateY(-3px) !important;
  border-color: #818cf8 !important;
  box-shadow: 0 4px 0 rgba(0,0,0,0.3), 0 0 12px rgba(99,102,241,0.3);
  z-index: 5;
}

/* Hide green zebra stripe on town scene (pixel grass) */
.town-scene::after {
  display: none !important;
}

/* Pixel HP bar under NPC - keep original */
.npc.newbie::after {
  background: linear-gradient(90deg, #f59e0b 30%, #334155 30%);
}

/* Task bubbles as pixel speech */
.task-bubble, .event-tag {
  font-family: monospace !important;
  font-size: 9px !important;
  border: 2px solid !important;
  border-radius: 2px !important;
  padding: 3px 8px !important;
  image-rendering: pixelated;
  position: relative;
}
.task-bubble {
  background: rgba(6,182,212,0.15) !important;
  border-color: #06b6d4 !important;
  color: #67e8f9 !important;
}
.task-bubble::before {
  content: '💬 ';
}
.event-tag {
  border-color: #ef4444 !important;
  animation: pixelBlink 1s step-end infinite !important;
}
@keyframes pixelBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* 3F Special warm glow */
.floor-3 .floor-room.room-cafe {
  background: rgba(245,158,11,0.08) !important;
  border-color: rgba(245,158,11,0.15) !important;
}
.floor-3 .room-name {
  color: #fbbf24 !important;
  border-color: rgba(251,191,36,0.2) !important;
}

/* Bar action button pixel style */
.bar-action-btn {
  font-family: monospace !important;
  font-size: 10px !important;
  border: 2px solid #f59e0b !important;
  border-bottom: 3px solid #b45309 !important;
  border-radius: 2px !important;
  background: rgba(245,158,11,0.15) !important;
  color: #fbbf24 !important;
  padding: 4px 10px !important;
  cursor: pointer;
  transition: all 0.1s;
}
.bar-action-btn:hover {
  background: rgba(245,158,11,0.3) !important;
  transform: translateY(-1px);
}
.bar-action-btn:active {
  transform: translateY(1px);
  border-bottom-width: 2px !important;
}

/* Pixel decorations between floors */
.floor + .floor::before {
  content: '';
  display: block; height: 4px;
  background: repeating-linear-gradient(90deg,
    #475569 0px, #475569 8px, #334155 8px, #334155 16px
  );
  margin: -2px 0;
  position: relative; z-index: 2;
}

/* Social plaza adjustments for game layout */
.social-plaza { padding-bottom: 12px; }

/* Walking animation pixel style */
.npc.walking {
  animation: pixelWalk 0.6s steps(4) infinite !important;
}
@keyframes pixelWalk {
  0% { transform: translateX(0); }
  25% { transform: translateX(8px) translateY(-2px); }
  50% { transform: translateX(16px); }
  75% { transform: translateX(24px) translateY(-2px); }
  100% { transform: translateX(32px); }
}
.npc.roaming {
  animation: pixelRoam 2s steps(8) infinite !important;
}
@keyframes pixelRoam {
  0% { transform: translateX(0); }
  50% { transform: translateX(60px) scaleX(-1); }
  100% { transform: translateX(0); }
}

/* ============ SOCIAL PLAZA ============ */
/* Banner */
.plaza-banner {
  position: relative; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(236,72,153,0.1), rgba(245,158,11,0.08));
  border: 1px solid var(--accent); border-radius: 10px; padding: 12px 14px;
}
.banner-glow {
  position: absolute; top: -50%; right: -20%; width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(99,102,241,0.2), transparent 70%);
  animation: pulse 3s ease-in-out infinite;
}
.banner-badge {
  display: inline-block; font-size: 10px; font-weight: 700; padding: 3px 10px;
  background: linear-gradient(135deg, var(--pink), var(--orange)); color: white;
  border-radius: 10px; margin-bottom: 8px; animation: pulse 2s infinite;
}
.plaza-banner h3 { font-size: 15px; font-weight: 800; margin-bottom: 2px; }
.plaza-banner p { font-size: 11px; color: var(--text2); margin-bottom: 6px; }
.banner-meta { display: flex; gap: 12px; font-size: 10px; color: var(--text3); margin-bottom: 8px; }
.banner-teams { display: flex; align-items: center; gap: 12px; }
.banner-team-avatars { display: flex; }
.banner-team-avatars span { font-size: 20px; margin-left: -4px; }
.banner-team-count { font-size: 11px; color: var(--text2); }
.banner-join-btn {
  margin-left: auto; padding: 7px 18px; background: linear-gradient(135deg, var(--accent), var(--pink));
  color: white; border: none; border-radius: 8px; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
}
.banner-join-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(99,102,241,0.3); }

/* Plaza Grid — two-column for better fit in side panel */
.plaza-grid { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; }
.plaza-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; display: flex; flex-direction: column;
  min-height: 0; flex-shrink: 0;
}
.plaza-card-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 700;
}
.plaza-card-badge {
  font-size: 9px; font-weight: 700; padding: 2px 8px; border-radius: 8px;
  background: rgba(239,68,68,0.15); color: #ef4444; animation: pulse 2s infinite;
}
.plaza-card-count { font-size: 10px; color: var(--accent2); font-weight: 600; }

/* Skill Board */
.skill-board { padding: 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.skill-post {
  display: flex; gap: 10px; padding: 8px 10px; background: var(--bg3);
  border-radius: 8px; transition: all 0.2s; cursor: pointer;
}
.skill-post:hover { background: var(--bg4); transform: translateX(3px); }
.sp-avatar { font-size: 24px; flex-shrink: 0; }
.sp-info { min-width: 0; }
.sp-name { font-size: 12px; font-weight: 600; }
.sp-level {
  font-size: 9px; padding: 1px 6px; border-radius: 6px;
  background: rgba(99,102,241,0.15); color: var(--accent2); margin-left: 4px;
}
.sp-skill { font-size: 10px; color: var(--text3); margin-top: 2px; }
.sp-status { font-size: 10px; color: var(--text2); margin-top: 3px; }

/* Demand Board — game-like task cards */
.demand-board {
  padding: 8px; display: flex; flex-direction: column; gap: 6px; flex: 1;
  min-height: 0; overflow-y: auto;
}
.demand-post {
  padding: 10px 12px; background: var(--bg3); border-radius: 8px;
  border-left: 3px solid var(--border);
  transition: all 0.2s ease; cursor: pointer;
  position: relative; overflow: hidden;
}
/* Subtle hover shimmer on demand posts */
.demand-post::before {
  content: '';
  position: absolute; top: 0; left: -100%; width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
  transition: left 0.4s ease;
}
.demand-post:hover::before { left: 120%; }
.demand-post:hover { border-left-color: var(--accent); background: var(--bg4); }
.demand-post.urgent { border-left-color: var(--pink); }
.dp-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.dp-tag {
  font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 6px;
}
.dp-urgent { background: rgba(239,68,68,0.15); color: #ef4444; }
.dp-team { background: rgba(99,102,241,0.15); color: var(--accent2); }
.dp-new { background: rgba(34,197,94,0.15); color: var(--green); }
.dp-reward { font-size: 11px; font-weight: 700; color: var(--gold); }
.dp-title { font-size: 12px; font-weight: 600; margin-bottom: 3px; }
.dp-meta { font-size: 10px; color: var(--text3); margin-bottom: 6px; }
.dp-footer { display: flex; justify-content: space-between; align-items: center; }
.dp-footer span { font-size: 10px; color: var(--text3); }
.dp-apply {
  font-size: 10px; font-weight: 600; padding: 3px 12px; border-radius: 6px;
  background: var(--accent); color: white; border: none; cursor: pointer; transition: all 0.15s;
}
.dp-apply:hover { background: var(--accent2); transform: scale(1.05); }

/* Demand Detail Modal */
.demand-detail-modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 9999; display: flex; align-items: center; justify-content: center;
}
.demand-detail-modal.hidden { display: none; }
.ddm-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
}
.ddm-body {
  position: relative; z-index: 1;
  width: 480px; max-width: 90vw; max-height: 80vh;
  background: rgba(26,28,36,0.82); border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05);
  display: flex; flex-direction: column; overflow: hidden;
}
.ddm-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(168,85,247,0.08));
}
.ddm-header h3 { margin: 0; font-size: 15px; font-weight: 700; }
.ddm-close {
  background: none; border: none; font-size: 22px; cursor: pointer;
  color: var(--text3); padding: 0 4px; line-height: 1;
}
.ddm-close:hover { color: var(--text1); }
.ddm-content { padding: 16px 18px; overflow-y: auto; flex: 1; }
.ddm-footer {
  display: flex; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--border);
  background: var(--bg2);
}
.ddm-field-label {
  font-size: 11px; color: var(--text3); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 3px; margin-top: 12px;
}
.ddm-field-label:first-child { margin-top: 0; }
.ddm-field-value { font-size: 13px; color: var(--text1); line-height: 1.6; }
.ddm-btn-claim {
  flex: 1; padding: 9px 20px; border: none; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all 0.2s;
}
.ddm-btn-claim:hover { opacity: 0.9; transform: translateY(-1px); }
.ddm-btn-claim:disabled {
  background: var(--text4); cursor: default; transform: none;
}
.ddm-status-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.ddm-status-published { background: rgba(34,197,94,0.12); color: var(--green); }
.ddm-status-closed { background: rgba(99,102,241,0.12); color: #6366f1; }
.ddm-budget-highlight {
  font-size: 22px; font-weight: 800; color: var(--accent);
  text-shadow: 0 0 20px rgba(59,130,246,0.3);
}

/* Who is here */
.plaza-who-here {
  padding: 10px 14px; border-top: 1px solid var(--border);
  background: rgba(99,102,241,0.03);
}
.wh-title { font-size: 11px; color: var(--text3); margin-bottom: 6px; font-weight: 600; }
.wh-avatars { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.wh-av {
  font-size: 18px; cursor: pointer; transition: transform 0.15s;
  animation: npcFloat 3s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.3s);
}
.wh-av:hover { transform: scale(1.3); }
.wh-more { font-size: 11px; color: var(--text3); margin-left: 4px; font-weight: 600; }

/* Events Row */
.plaza-events-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; flex-shrink: 0; }
.pe-card {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; transition: all 0.2s;
}
.pe-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.pe-card.hot { border-color: var(--pink); background: rgba(236,72,153,0.05); }
.pe-icon { font-size: 22px; flex-shrink: 0; }
.pe-info { flex: 1; min-width: 0; }
.pe-title { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pe-meta { font-size: 9px; color: var(--text3); margin-top: 2px; }
.pe-count {
  font-size: 10px; font-weight: 700; color: var(--accent2); padding: 3px 8px;
  background: rgba(99,102,241,0.1); border-radius: 6px; white-space: nowrap;
}

/* Plaza responsive */
@media (max-width: 1100px) {
  .plaza-grid { grid-template-columns: 1fr; }
  .plaza-grid .plaza-card:nth-child(3) { grid-row: auto; }
  .plaza-events-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .plaza-events-row { grid-template-columns: 1fr; }
  .banner-teams { flex-wrap: wrap; }
  .banner-meta { flex-wrap: wrap; gap: 8px; }
}

/* ============ CHARACTER AVATAR SYSTEM ============ */
.char-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(6,182,212,0.1));
  box-shadow: 0 2px 8px rgba(0,0,0,0.2), inset 0 1px 2px rgba(255,255,255,0.1);
  position: relative;
}
.char-avatar svg { width: 100%; height: 100%; display: block; }

/* Chat avatars */
.chat-item-avatar.char-avatar { width: 44px; height: 44px; font-size: 0; border-radius: 12px; }
.chat-header-avatar.char-avatar { width: 40px; height: 40px; font-size: 0; border-radius: 10px; }

/* NPC sprites in town - larger and more visible */
.npc .char-avatar,
.npc.char-avatar { width: 32px; height: 32px; font-size: 0; }
.npc.char-avatar { display: inline-flex; }

/* Floor detail avatars */
.fd-avatar.char-avatar { width: 28px; height: 28px; font-size: 0; }

/* Skill board / plaza avatars */
.sp-avatar.char-avatar { width: 36px; height: 36px; font-size: 0; }

/* Who-is-here avatars */
.wh-av.char-avatar { width: 28px; height: 28px; font-size: 0; display: inline-flex; }

/* Banner team avatars */
.banner-team-avatars .char-avatar { width: 28px; height: 28px; margin-left: -4px; }
.banner-team-avatars .char-avatar:first-child { margin-left: 0; }

/* Referral tree */
.ref-node .char-avatar { width: 20px; height: 20px; vertical-align: middle; }

/* OPC profile */
.opc-avatar-ring .char-avatar { width: 80px; height: 80px; border: 3px solid var(--accent); }
.assistant-avatar.char-avatar { width: 36px; height: 36px; font-size: 0; }

/* NPC profile card */
.npc-card-avatar .char-avatar { width: 56px; height: 56px; }

/* Chat message avatars */
.msg-avatar.char-avatar { width: 32px; height: 32px; font-size: 0; border-radius: 8px; }

/* Stat icons - keep emoji for RPG stats */

/* AI glow effect on character avatars */
.ai-npc .char-avatar,
.char-avatar[data-char="moyu"],
.char-avatar[data-char="crab"],
.char-avatar[data-char="shrimp"],
.char-avatar[data-char="spark"],
.char-avatar[data-char="painter"] {
  box-shadow: 0 0 12px rgba(6,182,212,0.4), 0 2px 8px rgba(0,0,0,0.2);
  animation: charGlow 3s ease-in-out infinite;
}
@keyframes charGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(6,182,212,0.3), 0 2px 8px rgba(0,0,0,0.2); }
  50% { box-shadow: 0 0 16px rgba(99,102,241,0.5), 0 2px 12px rgba(0,0,0,0.3); }
}

/* Pixel art overrides for town NPCs */
.building .npc .char-avatar {
  image-rendering: auto; /* override pixel rendering for SVG chars */
  border: 2px solid rgba(255,255,255,0.2);
}

/* Hover effect */
.char-avatar:hover {
  transform: scale(1.1);
  transition: transform 0.2s ease;
}

/* ============ SKILL BADGE WALL ============ */
/* ============ TASK WALL ============ */
.task-wall {
  background: var(--bg2);
  border-radius: 12px;
}
.tw-header {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px;
  padding-bottom: 6px; border-bottom: 1px solid rgba(99,102,241,0.15);
}
.tw-header h3 { font-size: 13px; letter-spacing: 2px; margin: 0; }
.tw-subtitle { font-size: 10px; color: var(--text3); }
.tw-stats { margin-left: auto; display: flex; gap: 12px; }
.tw-stat { font-size: 10px; color: var(--text3); }
.tw-stat.active { color: var(--green); font-weight: 600; }
.tw-grid {
  display: grid; grid-template-columns: 1fr; gap: 10px;
}
.tw-card {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start;
  transition: all 0.2s; position: relative;
}
.tw-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.tw-card.status-active { border-left: 3px solid var(--green); }
.tw-card.status-open { border-left: 3px solid #fbbf24; }
.tw-card.status-done { border-left: 3px solid var(--text3); opacity: 0.7; }
.tw-card.status-pending { border-left: 3px solid #ef4444; }
.tw-card.status-cancelled { border-left: 3px solid #9ca3af; opacity: 0.5; }
.tw-card.status-rejected { border-left: 3px solid #ef4444; opacity: 0.6; }
.tw-card.tw-frozen { border-left: 3px solid #3b82f6; background: linear-gradient(135deg, var(--bg3), rgba(59,130,246,0.08)); opacity: 0.85; }
.tw-card.tw-frozen:hover { border-color: #3b82f6; transform: none; box-shadow: none; }
.tw-floor {
  font-size: 10px; font-weight: 800; color: var(--accent); background: rgba(99,102,241,0.15);
  border-radius: 4px; padding: 3px 6px; flex-shrink: 0; margin-top: 1px;
}
.tw-body { flex: 1; min-width: 0; }
.tw-title { font-size: 14px; font-weight: 700; color: var(--text1); line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-meta { font-size: 12px; color: var(--text3); margin: 4px 0; }
.tw-assignee { font-size: 12px; color: var(--text2); display: flex; align-items: center; gap: 3px; }
.tw-ai { color: var(--accent2); font-size: 8px; }
.tw-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.tw-reward { font-size: 11px; font-weight: 700; color: #fbbf24; }
.tw-reward.earned { color: var(--green); }
.tw-progress { width: 60px; height: 5px; background: var(--bg4); border-radius: 3px; overflow: hidden; }
.tw-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--green)); border-radius: 3px; transition: width 0.5s; }
.tw-pct { font-size: 9px; color: var(--text3); }
.tw-pct.done { color: var(--green); font-weight: 700; }
.tw-claim {
  font-size: 10px; font-weight: 700; color: #111; background: #fbbf24; border: none;
  border-radius: 4px; padding: 3px 10px; cursor: pointer; transition: all 0.2s;
}
.tw-claim:hover { background: #f59e0b; transform: scale(1.05); }

/* ============ JENNY AI EVALUATION ============ */
.jenny-eval { margin-top: 16px; background: var(--bg2); border-radius: 12px; padding: 16px; border: 1px solid rgba(99,102,241,0.2); }
.jenny-eval-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--bg4); }
.jenny-eval-header strong { color: var(--text1); font-size: 13px; }
.jenny-eval-list { display: flex; flex-direction: column; gap: 10px; }
.jenny-eval-item { background: var(--bg3); border-radius: 10px; padding: 12px; border-left: 3px solid var(--accent); opacity: 0; transform: translateY(8px); transition: all 0.4s ease; }
.jenny-eval-item.visible { opacity: 1; transform: translateY(0); }
.eval-agent-name { font-size: 13px; font-weight: 600; color: var(--text1); margin-bottom: 4px; }
.eval-stars { font-size: 12px; margin-bottom: 6px; }
.eval-comment { font-size: 12px; color: var(--text2); line-height: 1.6; font-style: italic; }
.eval-saved { font-size: 11px; color: var(--green); margin-top: 6px; font-weight: 500; }
.jenny-eval-summary { margin-top: 14px; padding: 14px; background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(236,72,153,0.08)); border-radius: 10px; border: 1px solid rgba(99,102,241,0.2); }
.eval-summary-title { font-size: 12px; color: var(--accent); font-weight: 600; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 1px; }
.eval-summary-text { font-size: 12px; color: var(--text2); line-height: 1.7; }
.eval-summary-text strong { color: var(--green); }

/* Redeem icons - game item style */
.redeem-icon.char-avatar { width: 36px; height: 36px; border-radius: 8px; }

/* ============ PROFILE PAGE STYLES ============ */
.profile-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.profile-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.profile-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-wallet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.profile-wallet-item {
  background: var(--bg3);
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.profile-wallet-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.profile-wallet-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 2px;
}
.profile-wallet-label {
  font-size: 10px;
  color: var(--text3);
  font-weight: 500;
}

.profile-points-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.profile-points-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg3);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.profile-points-label {
  font-size: 12px;
  color: var(--text2);
}
.profile-points-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent2);
}

.profile-skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.profile-skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 16px;
  font-size: 12px;
  color: var(--accent2);
  font-weight: 500;
}

/* ============ CANTEEN VIEW (膳食坊) ============ */
.canteen-layout {
  max-width: 100%;
  margin: 0 auto;
  padding: 20px 24px 100px;
  height: 100%;
  overflow-y: auto;
  width: 100%;
}
@media (min-width: 768px) {
  .canteen-layout { max-width: 1200px; padding: 24px 32px 100px; }
}
@media (min-width: 1024px) {
  .canteen-layout { max-width: 1400px; padding: 24px 40px 100px; }
}
@media (min-width: 1400px) {
  .canteen-layout { max-width: 1600px; padding: 24px 60px 100px; }
}
.canteen-header {
  text-align: center;
  margin-bottom: 20px;
}
.canteen-header h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}
.canteen-subtitle {
  font-size: 13px;
  color: var(--text3);
}
.canteen-categories {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.canteen-cat-btn {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  transition: all .15s;
}
.canteen-cat-btn:hover { border-color: var(--accent); color: var(--text); }
.canteen-cat-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.canteen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
@media (min-width: 768px) {
  .canteen-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
}
@media (min-width: 1024px) {
  .canteen-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
}
@media (min-width: 1400px) {
  .canteen-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
}
.canteen-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all .2s;
}
.canteen-card:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.canteen-card-img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  background: linear-gradient(135deg, #1a1f3a, #12182e);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}
.canteen-card-img img { width: 100%; height: 100%; object-fit: contain; }
.canteen-card-body { padding: 12px; }
.canteen-card-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.canteen-card-desc { font-size: 12px; color: var(--text3); line-height: 1.4; height: 34px; overflow: hidden; }
.canteen-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(45,58,79,.4);
}
.canteen-card-price {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent2);
}
.canteen-card-qty {
  display: flex;
  align-items: center;
  gap: 4px;
}
.canteen-qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  user-select: none;
}
.canteen-qty-btn:hover { border-color: var(--accent); color: var(--accent); }
.canteen-qty-btn:disabled { opacity: .35; cursor: not-allowed; }
.canteen-qty-num { min-width: 28px; text-align: center; font-weight: 600; font-size: 14px; }
.canteen-card-tag {
  display: inline-block;
  font-size: 11px;
  color: #a78bfa;
  background: rgba(167,139,250,.1);
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 6px;
}
.canteen-cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10,14,23,.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 200;
}
.canteen-cart-info { display: flex; gap: 16px; align-items: center; }
.canteen-cart-count { font-size: 14px; color: var(--text2); }
.canteen-cart-total { font-size: 18px; font-weight: 700; color: #22c55e; }
.canteen-cart-btn {
  padding: 8px 28px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.canteen-cart-btn:hover { opacity: .9; transform: scale(1.02); }
.canteen-cart-btn:disabled { opacity: .4; cursor: not-allowed; }
.canteen-soldout-overlay {
  position: relative;
}
.canteen-soldout-overlay::after {
  content: '售罄';
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(239,68,68,.85);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
}
.canteen-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px;
  color: var(--text3);
  font-size: 14px;
}
.canteen-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text3);
}
.canteen-empty-icon { font-size: 48px; margin-bottom: 12px; }

/* ============ CANTEEN TABS (Browse / Orders) ============ */
.canteen-tabs {
  display: flex;
  justify-content: stretch;
  gap: 0;
  margin-bottom: 20px;
  background: var(--bg2);
  border-radius: 12px;
  padding: 4px;
}
.canteen-tab-btn {
  flex: 1 1 50%;
  min-width: 0;
  padding: 10px 16px;
  border: none;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text3);
  background: transparent;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  text-align: center;
}
.canteen-tab-btn:hover { color: var(--text); }
.canteen-tab-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,.35);
}

/* 响应式：小屏幕上保持可点击区域 */
@media (max-width: 400px) {
  .canteen-tab-btn {
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* Panel switching */
.canteen-panel { display: none; }
.canteen-panel.active { display: block; }

/* ============ MY ORDERS LIST ============ */
.my-orders-list { max-width: 100%; margin: 0 auto; }
.order-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  transition: all .2s;
}
.order-card:hover { border-color: var(--accent); }
.order-card-img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: linear-gradient(135deg, #1a1f3a, #12182e);
  flex-shrink: 0;
}
.order-card-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.order-card-info { flex: 1; min-width: 0; }
.order-card-dish { font-size: 15px; font-weight: 600; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-card-meta {
  font-size: 12px;
  color: var(--text3);
  display: flex;
  gap: 12px;
  align-items: center;
}
.order-card-qty { font-weight: 700; color: var(--accent); }
.order-card-price { font-weight: 700; color: var(--accent2); }
.order-card-time { color: var(--text3); }
.order-card-actions { flex-shrink: 0; display: flex; gap: 8px; }
.order-qr-btn {
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.order-qr-btn:hover { background: var(--accent); color: #fff; }
.order-qr-btn.expired {
  border-color: var(--text3);
  color: var(--text3);
  cursor: not-allowed;
}
.order-qr-btn.expired:hover { background: transparent; color: var(--text3); }
.order-status-tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 600;
}
.order-status-pending { background: rgba(99,102,241,.12); color: #818cf8; }
.order-status-completed { background: rgba(34,197,94,.12); color: #22c55e; }
.order-status-verified { background: rgba(59,130,246,.12); color: #3b82f6; }
.order-pickup-code {
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text2);
  background: rgba(99,102,241,.06);
  padding: 3px 10px;
  border-radius: 8px;
}
.order-pickup-code strong {
  color: #6366f1;
  font-family: 'Courier New', monospace;
  letter-spacing: 2.5px;
  font-size: 14px;
}

/* ============ QR CODE MODAL ============ */
.qr-modal { position: fixed; inset: 0; z-index: 900; display: none; }
.qr-modal.open { display: flex; align-items: center; justify-content: center; }
.qr-modal-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
}
.qr-modal-content {
  position: relative;
  z-index: 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 28px;
  text-align: center;
  width: 300px;
  animation: qrModalIn .25s ease;
}
@keyframes qrModalIn { from { transform: scale(.9) translateY(20px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.qr-modal-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; color: var(--text3);
  font-size: 26px; cursor: pointer; line-height: 1;
}
.qr-modal-close:hover { color: var(--text); }
.qr-modal-title {
  font-size: 17px; font-weight: 700; margin-bottom: 16px;
  color: var(--text); word-break: break-all;
}
.qr-code-container {
  display: inline-block; padding: 16px; background: #fff;
  border-radius: 12px; margin-bottom: 14px;
}
#qrCanvas { display: block; width: 200px !important; height: 200px !important; }
.qr-order-info { font-size: 13px; color: var(--text2); margin-bottom: 4px; }
.qr-expiry-info { font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.qr-tip { font-size: 12px; color: var(--text3); }

@media (max-width: 768px) {
  .canteen-layout { padding: 12px 10px 90px; }
  .canteen-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .canteen-card-img { height: 110px; }
  .canteen-card-body { padding: 8px; }
  .canteen-card-name { font-size: 13px; }
  .canteen-card-price { font-size: 15px; }
  .order-card { flex-wrap: wrap; gap: 10px; padding: 12px; }
  .order-card-img { width: 48px; height: 48px; font-size: 22px; }
  .order-qr-btn { font-size: 12px; padding: 6px 14px; }
}

/* ============ LIGHT THEME OVERRIDES (must be last for specificity) ============ */
[data-theme="light"] .town-scene {
  background: linear-gradient(180deg, #e8ecf4 0%, #f0f2f5 40%, #f5f7fa 100%) !important;
  background-size: 100% 100% !important;
}
[data-theme="light"] .town-scene::before {
  content: '' !important;
  background: none !important;
  opacity: 0 !important;
  display: none !important;
}
[data-theme="light"] .town-scene::after {
  display: none !important;
}
[data-theme="light"] .building {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%) !important;
  border: 2px solid rgba(99,102,241,0.2) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important;
  padding: 10px !important;
  image-rendering: auto !important;
}
[data-theme="light"] .building::before {
  content: none !important;
  display: none !important;
}
[data-theme="light"] .building-sign {
  background: linear-gradient(135deg, var(--accent), var(--cyan)) !important;
  border: none !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: none !important;
  font-family: inherit !important;
  font-size: 14px !important;
  letter-spacing: normal !important;
  text-shadow: none !important;
  padding: 8px !important;
  color: #fff !important;
}
[data-theme="light"] .building-sign::before {
  content: none !important;
  display: none !important;
}
[data-theme="light"] .floor {
  background: rgba(255,255,255,0.8) !important;
  border: 1px solid #e5e7eb !important;
  border-left: 3px solid rgba(99,102,241,0.3) !important;
  border-right: 1px solid #e5e7eb !important;
  border-bottom: 1px solid #e5e7eb !important;
  border-radius: var(--radius-sm) !important;
  margin: 2px 0 !important;
  image-rendering: auto !important;
}
[data-theme="light"] .floor:hover {
  border-left-color: var(--accent) !important;
  box-shadow: 0 2px 8px rgba(99,102,241,0.08) !important;
}
[data-theme="light"] .floor-10,
[data-theme="light"] .floor-9,
[data-theme="light"] .floor-8,
[data-theme="light"] .floor-7,
[data-theme="light"] .floor-3 {
  background: rgba(255,255,255,0.85) !important;
}
[data-theme="light"] .floor-label {
  font-family: inherit !important;
  background: rgba(99,102,241,0.08) !important;
  border-bottom: none !important;
  text-shadow: none !important;
  color: var(--accent) !important;
}
[data-theme="light"] .floor-label::before {
  content: none !important;
}
[data-theme="light"] .floor::after {
  display: none !important;
}
[data-theme="light"] .room-name {
  color: #4b5563 !important;
  background: rgba(99,102,241,0.06) !important;
  border-color: rgba(99,102,241,0.12) !important;
}
[data-theme="light"] .npc {
  background: rgba(99,102,241,0.08) !important;
  border-color: rgba(99,102,241,0.15) !important;
  border-bottom-color: rgba(99,102,241,0.1) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
  filter: none !important;
}
[data-theme="light"] .npc:hover {
  border-color: var(--accent) !important;
  box-shadow: 0 2px 8px rgba(99,102,241,0.15) !important;
}
[data-theme="light"] .town-header {
  background: #fff !important;
  border-color: #e5e7eb !important;
}
[data-theme="light"] .task-wall {
  background: rgba(255,255,255,0.9) !important;
  border-color: rgba(99,102,241,0.15) !important;
}
[data-theme="light"] .tw-card {
  background: #fff !important;
  border-color: #e5e7eb !important;
}
[data-theme="light"] .plaza-card {
  background: #fff !important;
  border-color: #e5e7eb !important;
}
[data-theme="light"] .social-plaza {
  background: rgba(255,255,255,0.6) !important;
  border-color: #e5e7eb !important;
}
[data-theme="light"] .social-plaza::before {
  background: none !important;
}

/* ---- Door (OpenVerse) Light Theme ---- */
[data-theme="light"] .ov-door {
  background: linear-gradient(180deg, #e0e7ff 0%, #ede9fe 30%, #f0f2f5 100%) !important;
}
[data-theme="light"] .ov-stars { display: none !important; }
[data-theme="light"] .ov-door-frame {
  border-color: rgba(99,102,241,0.35) !important;
  box-shadow: 0 4px 30px rgba(99,102,241,0.15), inset 0 0 30px rgba(99,102,241,0.05) !important;
}
[data-theme="light"] .ov-door-surface {
  background: linear-gradient(180deg, #c7d2fe 0%, #ddd6fe 40%, #c7d2fe 100%) !important;
  border-color: rgba(99,102,241,0.25) !important;
}
[data-theme="light"] .ov-door-glyph {
  color: rgba(99,102,241,0.6) !important;
}
[data-theme="light"] .ov-door-circuit {
  background:
    linear-gradient(90deg, transparent 49%, rgba(99,102,241,0.06) 49%, rgba(99,102,241,0.06) 51%, transparent 51%),
    linear-gradient(0deg, transparent 49%, rgba(99,102,241,0.06) 49%, rgba(99,102,241,0.06) 51%, transparent 51%) !important;
}
[data-theme="light"] .ov-inner-world {
  background: radial-gradient(ellipse at center, #c7d2fe 0%, #e0e7ff 50%, #f5f7fa 100%) !important;
}
[data-theme="light"] .ov-logo-taigo { color: #312e81 !important; }
[data-theme="light"] .ov-logo-sub { color: rgba(79,70,229,0.6) !important; }
[data-theme="light"] .ov-brand { color: #6366f1 !important; }
[data-theme="light"] .ov-brand-sub { color: rgba(99,102,241,0.5) !important; }
[data-theme="light"] .ov-prompt { color: rgba(99,102,241,0.45) !important; }

/* ---- Town right sidebar & inner components Light Theme ---- */
[data-theme="light"] .plaza-card-header {
  background: #f8fafc !important;
  border-color: #e5e7eb !important;
}
[data-theme="light"] .plaza-who-here {
  background: rgba(99,102,241,0.03) !important;
  border-color: #e5e7eb !important;
}
[data-theme="light"] .pe-card {
  background: #fff !important;
  border-color: #e5e7eb !important;
}
[data-theme="light"] .pe-card:hover {
  border-color: var(--accent) !important;
}
[data-theme="light"] .pe-card.hot {
  background: rgba(236,72,153,0.06) !important;
  border-color: var(--pink) !important;
}
[data-theme="light"] .pe-title { color: #1f2937 !important; }
[data-theme="light"] .pe-meta { color: #4b5563 !important; }
[data-theme="light"] .pe-count {
  color: #4f46e5 !important;
  background: rgba(99,102,241,0.1) !important;
}
[data-theme="light"] .skill-post {
  background: #f8fafc !important;
}
[data-theme="light"] .skill-post:hover {
  background: #f0f2f5 !important;
}
[data-theme="light"] .feed-item {
  background: #fff !important;
  border-color: #e5e7eb !important;
}
[data-theme="light"] .town-stat {
  background: rgba(99,102,241,0.06) !important;
  border-color: rgba(99,102,241,0.12) !important;
  box-shadow: none !important;
}
[data-theme="light"] .town-side {
  background: #f8fafc !important;
  border-color: #e5e7eb !important;
  box-shadow: -2px 0 8px rgba(0,0,0,0.04) !important;
}
[data-theme="light"] .floor-content::after {
  display: none !important;
}

/* ---- User dropdown Light Theme ---- */
[data-theme="light"] .user-dropdown {
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08) !important;
}
[data-theme="light"] .user-dropdown-item {
  color: var(--text1) !important;
}
[data-theme="light"] .user-dropdown-item:hover {
  background: #f0f2f5 !important;
}
