/* ============================================================
   KickRPG — Character Management Dashboard Styles
   ============================================================ */

.hidden {
  display: none !important;
}

.character-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* Header & Switcher */
.char-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.char-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.char-avatar-pic {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: #111;
  object-fit: cover;
}

.char-header-info h2 {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--gold-soft);
  margin-bottom: 2px;
}

.char-header-info p {
  font-size: 13px;
  color: var(--text-dim);
}

.char-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.world-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
}

.world-select-wrap label {
  font-size: 12px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.world-select {
  background: transparent;
  color: var(--gold-soft);
  font-weight: 600;
  border: none;
  outline: none;
  font-size: 14px;
  cursor: pointer;
}

.world-select option {
  background: #1c1712;
  color: #fff;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 24px;
  align-items: start;
}

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

/* Left Column: 3D Showcase & Paperdoll */
.viewer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.canvas-container {
  position: relative;
  width: 100%;
  height: 440px;
  background: radial-gradient(circle at 50% 40%, #1f1814 0%, #0c0907 85%);
  cursor: grab;
}

.canvas-container:active {
  cursor: grabbing;
}

.canvas-container canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.canvas-overlay-hints {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 8, 6, 0.75);
  backdrop-filter: blur(6px);
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-soft);
  font-size: 11px;
  color: var(--text-dim);
  pointer-events: none;
  white-space: nowrap;
}

/* Canvas Emote Bar */
.canvas-emote-bar {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
  background: rgba(10, 8, 6, 0.75);
  backdrop-filter: blur(8px);
  padding: 4px 8px;
  border-radius: 24px;
  border: 1px solid var(--border-soft);
  z-index: 10;
}

.emote-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
  line-height: 1;
}

.emote-btn:hover {
  background: rgba(212, 169, 78, 0.25);
  border-color: var(--gold-dim);
  transform: scale(1.15);
}

.emote-btn.active {
  background: rgba(83, 252, 24, 0.2);
  border-color: var(--kick);
  box-shadow: 0 0 8px rgba(83, 252, 24, 0.4);
}

.char-quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 16px;
  border-top: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.25);
  text-align: center;
}

.stat-box .stat-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold-soft);
}

.stat-box .stat-lbl {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
}

/* Paperdoll Slots */
.paperdoll-section {
  padding: 18px 16px;
  border-top: 1px solid var(--border-soft);
}

.section-title {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--gold);
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.paperdoll-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.slot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  transition: border-color 0.2s;
}

.slot-row:hover {
  border-color: var(--gold-dim);
}

/* Item Rarity Frames */
.rarity-common {
  border-color: #5a5044 !important;
  box-shadow: inset 0 0 8px rgba(90, 80, 68, 0.2);
}
.rarity-uncommon {
  border-color: #2ecc71 !important;
  box-shadow: inset 0 0 8px rgba(46, 204, 113, 0.25), 0 0 6px rgba(46, 204, 113, 0.2);
}
.rarity-rare {
  border-color: #00b4d8 !important;
  box-shadow: inset 0 0 8px rgba(0, 180, 216, 0.3), 0 0 8px rgba(0, 180, 216, 0.25);
}
.rarity-epic {
  border-color: #a855f7 !important;
  box-shadow: inset 0 0 8px rgba(168, 85, 247, 0.35), 0 0 10px rgba(168, 85, 247, 0.3);
}
.rarity-legendary {
  border-color: #f59e0b !important;
  box-shadow: inset 0 0 10px rgba(245, 158, 11, 0.4), 0 0 12px rgba(245, 158, 11, 0.35);
}

.item-icon-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, #1e1915 0%, #0d0a08 90%);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s;
}

.item-icon-frame img.item-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  image-rendering: auto;
  pointer-events: none;
}

/* Paperdoll slot icon */
.slot-icon-frame {
  width: 44px;
  height: 44px;
  border-radius: 8px;
}

.slot-icon-frame.slot-empty {
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.slot-placeholder-icon {
  font-size: 20px;
  opacity: 0.25;
  filter: grayscale(1);
  user-select: none;
}

.slot-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.slot-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-faint);
  width: 70px;
  flex-shrink: 0;
}

.slot-item-info {
  display: flex;
  flex-direction: column;
}

.slot-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.slot-item-empty {
  font-size: 12px;
  font-style: italic;
  color: var(--text-faint);
}

.slot-item-stats {
  font-size: 11px;
  color: var(--kick);
}

.btn-unequip {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-soft);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-unequip:hover {
  background: rgba(220, 50, 50, 0.15);
  border-color: rgba(220, 50, 50, 0.5);
  color: #ff6b6b;
}

/* Right Column: Inventory & Skills */
.management-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  min-height: 700px;
  display: flex;
  flex-direction: column;
}

/* Tabs */
.tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  padding: 0 16px;
}

.tab-btn {
  background: transparent;
  color: var(--text-dim);
  border: none;
  border-bottom: 2px solid transparent;
  padding: 16px 20px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn:hover {
  color: var(--gold-soft);
}

.tab-btn.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  background: rgba(212, 169, 78, 0.05);
}

.tab-pane {
  display: none;
  padding: 24px;
  flex: 1;
}

.tab-pane.active {
  display: block;
}

/* Inventory Grids */
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.inv-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.15s, border-color 0.2s;
}

.inv-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-2px);
}

.inv-card.equipped {
  border-color: var(--kick-glow);
  background: rgba(83, 252, 24, 0.03);
}

.inv-card-main {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.inv-card-icon-frame {
  width: 52px;
  height: 52px;
  border-radius: 8px;
}

.inv-card-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inv-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}

.inv-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.inv-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.tier-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  white-space: nowrap;
}

.tier-badge.t1 { background: #3d352e; color: #b8aba0; }
.tier-badge.t2 { background: #5c4326; color: #df9a57; }
.tier-badge.t3 { background: #5a4b32; color: #e6be67; }
.tier-badge.t4 { background: #3a4550; color: #a4bccf; }
.tier-badge.t5 { background: #454752; color: #cbd0e0; }
.tier-badge.t6 { background: #1c3d52; color: #4fc3f7; }
.tier-badge.t7 { background: #1a4731; color: #66bb6a; }
.tier-badge.t8 { background: #542220; color: #ef5350; }
.tier-badge.t9 { background: #3d2459; color: #ba68c8; }
.tier-badge.t10 { background: #611833; color: #ff4081; box-shadow: 0 0 8px rgba(255, 64, 129, 0.4); }

.inv-stats-list {
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
}

.stat-pill.bonus {
  color: var(--kick);
}

.inv-req-warning {
  font-size: 11px;
  color: #ff6b6b;
  background: rgba(220, 50, 50, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  border-left: 2px solid #ff6b6b;
}

.inv-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.inv-price {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
}

.inv-actions {
  display: flex;
  gap: 6px;
}

.btn-act {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.btn-equip {
  background: var(--kick-dim);
  color: var(--kick);
  border-color: rgba(83, 252, 24, 0.4);
}

.btn-equip:hover:not(:disabled) {
  background: var(--kick);
  color: #000;
}

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

.btn-sell {
  background: rgba(212, 169, 78, 0.15);
  color: var(--gold-soft);
  border-color: var(--gold-dim);
}

.btn-sell:hover {
  background: var(--gold);
  color: #000;
}

.btn-drop {
  background: rgba(200, 50, 50, 0.1);
  color: #e06060;
  border-color: rgba(200, 50, 50, 0.25);
}

.btn-drop:hover {
  background: #e06060;
  color: #fff;
}

/* Skills Tab */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.skill-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 12px;
}

.skill-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.skill-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-transform: capitalize;
}

.skill-level {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-soft);
}

.skill-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.skill-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--kick));
  border-radius: 3px;
}

.skill-xp-text {
  font-size: 10px;
  color: var(--text-faint);
  text-align: right;
}

/* Empty States */
.empty-inventory {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

.empty-inventory .icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.6;
}

/* Modal Dialog */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-overlay.hidden {
  display: none;
}

.modal-dialog {
  background: var(--bg-2);
  border: 1px solid var(--gold-dim);
  border-radius: 12px;
  width: 100%;
  max-width: 440px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--gold-soft);
  margin-bottom: 12px;
}

.modal-body {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 20px;
}

/* Modal item preview */
.modal-item-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.modal-icon-frame {
  width: 56px;
  height: 56px;
  border-radius: 10px;
}

.modal-item-preview-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.modal-slider-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

.modal-slider-wrap input[type="range"] {
  flex: 1;
  accent-color: var(--gold);
}

.modal-num-display {
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  min-width: 40px;
  text-align: right;
}

.modal-calc-value {
  background: rgba(0, 0, 0, 0.4);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--gold-dim);
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  animation: toastIn 0.25s ease-out;
}

.toast.success { border-color: var(--kick); color: #fff; }
.toast.error { border-color: #ff6b6b; color: #ff6b6b; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Linked Accounts & Twitch Buttons
   ============================================================ */

.btn-twitch {
  background: linear-gradient(160deg, #b066ff, #9146ff);
  color: #ffffff;
  box-shadow: 0 6px 30px rgba(145, 70, 255, 0.32);
  border: none;
  cursor: pointer;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-twitch:hover {
  box-shadow: 0 10px 40px rgba(145, 70, 255, 0.5);
  transform: translateY(-2px);
}

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

.account-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}

.account-badge.kick {
  border-color: rgba(83, 252, 24, 0.4);
  color: #a4ff82;
  background: rgba(83, 252, 24, 0.08);
}

.account-badge.twitch {
  border-color: rgba(169, 112, 255, 0.4);
  color: #d1abff;
  background: rgba(145, 70, 255, 0.12);
}

.account-unlink-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0 2px;
  font-size: 13px;
  line-height: 1;
  transition: color 0.15s;
}

.account-unlink-btn:hover {
  color: #ff6b6b;
}

.btn-link-platform {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 500;
  border: 1px dashed var(--border);
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s;
}

.btn-link-platform:hover {
  border-color: var(--gold);
  color: var(--gold-soft);
  background: rgba(255, 255, 255, 0.06);
}

/* ============================================================
   Conflict Modal (Option B: Cross-Save Hero Choice)
   ============================================================ */

.conflict-dialog {
  max-width: 640px !important;
  width: 90% !important;
}

.conflict-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}

@media (max-width: 580px) {
  .conflict-cards-grid {
    grid-template-columns: 1fr;
  }
}

.conflict-card {
  background: rgba(20, 20, 24, 0.8);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.conflict-card:hover {
  border-color: var(--gold);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.conflict-platform-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.conflict-platform-tag.platform-kick {
  background: rgba(83, 252, 24, 0.15);
  color: #a4ff82;
  border: 1px solid rgba(83, 252, 24, 0.3);
}

.conflict-platform-tag.platform-twitch {
  background: rgba(145, 70, 255, 0.2);
  color: #d1abff;
  border: 1px solid rgba(145, 70, 255, 0.4);
}

.conflict-hero-name {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--gold-soft);
  margin-bottom: 12px;
}

.conflict-stats {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  text-align: left;
}

.c-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.c-stat span {
  color: var(--text-dim);
}

.c-stat strong {
  color: #fff;
}

.conflict-choose-btn {
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  justify-content: center;
}

.conflict-notice {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 10px;
}

