/* ========== Character Card ========== */
.char-card { text-align: center; padding: 12px 0; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.char-realm { font-family: 'Ma Shan Zheng', cursive; font-size: 22px; color: var(--gold); text-shadow: 0 0 15px rgba(201,168,76,0.25); }
.char-name { font-size: 12px; color: var(--dim); margin-top: 2px; }
.char-pt { font-size: 11px; color: var(--jade); margin-top: 4px; }

/* ========== Bars ========== */
.hp-bar-container, .qi-bar-container { margin: 6px 0; }
.bar-label { font-size: 11px; display: flex; justify-content: space-between; margin-bottom: 2px; }
.bar-track { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; transition: width 0.3s ease; }
.hp-fill { background: linear-gradient(90deg, var(--crimson), #e86060); }
.qi-fill { background: linear-gradient(90deg, var(--jade), #80ffd0); }

/* ========== Stats & Resources ========== */
.stat-section { margin-bottom: 12px; }
.stat-section h4 { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 6px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.stat-row { display: flex; justify-content: space-between; font-size: 12px; padding: 2px 0; }
.stat-row .stat-name { color: var(--dim); }
.stat-row .stat-val { color: var(--text); font-weight: 600; }
.resource-list .res-row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 12px; }
.resource-list .res-row .rn { color: var(--dim); }
.resource-list .res-row .rv { color: var(--gold-bright); font-weight: 600; }

/* ========== Tabs ========== */
#tab-bar { display: flex; background: var(--surface); border-bottom: 1px solid var(--border); overflow-x: auto; flex-shrink: 0; }
.tab-btn { padding: 10px 18px; font-size: 13px; color: var(--dim); background: none; border: none; cursor: pointer; white-space: nowrap; transition: all 0.2s; font-family: 'Noto Serif SC', serif; position: relative; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--gold); }
.tab-btn.active::after { content: ''; position: absolute; bottom: 0; left: 20%; right: 20%; height: 2px; background: var(--gold); border-radius: 1px; }
.tab-btn .lock { font-size: 10px; color: var(--crimson); margin-left: 4px; }

#tab-content { flex: 1; overflow-y: auto; padding: 16px 20px; }

/* ========== Log ========== */
.log-entry { color: var(--dim); border-bottom: 1px solid rgba(37,37,69,0.5); padding: 1px 0; }
.log-entry .log-time { color: var(--border); margin-right: 8px; }
.log-gain { color: var(--jade) !important; }
.log-loss { color: var(--crimson) !important; }
.log-gold { color: var(--gold) !important; }
.log-combat { color: #e89040 !important; }

/* ========== Buttons ========== */
.breakthrough-btn {
  display: block; margin: 16px auto 0; padding: 10px 32px;
  background: linear-gradient(135deg, var(--gold), #a08030); color: #000; border: none;
  font-family: 'Ma Shan Zheng', cursive; font-size: 18px; cursor: pointer; border-radius: 4px; letter-spacing: 3px; transition: all 0.2s;
}
.breakthrough-btn:hover:not(:disabled) { transform: scale(1.05); box-shadow: 0 0 20px rgba(201,168,76,0.4); }
.breakthrough-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.build-btn { padding: 6px 16px; background: var(--surface3); color: var(--gold); border: 1px solid var(--gold); font-family: 'Noto Serif SC', serif; font-size: 12px; cursor: pointer; border-radius: 3px; transition: all 0.2s; }
.build-btn:hover:not(:disabled) { background: var(--gold); color: #000; }
.build-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.shop-btn { padding: 5px 14px; background: var(--surface); color: var(--gold); border: 1px solid var(--gold); border-radius: 3px; cursor: pointer; font-size: 11px; font-family: 'Noto Serif SC', serif; }
.shop-btn:hover:not(:disabled) { background: var(--gold); color: #000; }
.shop-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.item-btn { margin-top: 4px; padding: 3px 12px; font-size: 11px; background: var(--surface); color: var(--jade); border: 1px solid var(--jade); border-radius: 3px; cursor: pointer; font-family: 'Noto Serif SC', serif; }
.item-btn:hover { background: var(--jade); color: #000; }

.section-title { font-family: 'Ma Shan Zheng', cursive; font-size: 22px; color: var(--gold); margin-bottom: 12px; letter-spacing: 2px; }

/* ========== Modal ========== */
#modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 100; display: none; align-items: center; justify-content: center; }
#modal-overlay.show { display: flex; }
#modal { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 24px; max-width: 500px; width: 90%; max-height: 80vh; overflow-y: auto; position: relative; }
#modal-close { position: absolute; top: 8px; right: 12px; background: none; border: none; color: var(--dim); font-size: 20px; cursor: pointer; }
#modal-close:hover { color: var(--text); }

/* ========== Float Text ========== */
.float-text { position: absolute; pointer-events: none; font-weight: 700; font-size: 16px; color: var(--gold-bright); text-shadow: 0 0 8px rgba(208,208,96,0.5); animation: floatUp 1s ease-out forwards; z-index: 100; white-space: nowrap; }

@media (max-width: 768px) { .equip-layout { grid-template-columns: 1fr; } .cult-stats { grid-template-columns: 1fr 1fr; } }