@import url('https://fonts.googleapis.com/css2?family=MedievalSharp&family=Cinzel:wght@400;600;700&family=IM+Fell+English&display=swap');

/* ═══════════════════════════════════════════════
   DREADMARK ONLINE — GLOBAL STYLES
═══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-darkest: #080608;
  --bg-dark: #100c10;
  --bg-mid: #1a1218;
  --bg-panel: #150f14;
  --border-gold: #6b4a1a;
  --border-gold-bright: #c8962a;
  --border-dark: #2a1f28;
  --text-gold: #c8962a;
  --text-light: #d4c4a0;
  --text-dim: #7a6a58;
  --text-white: #efe8d8;
  --red-hp: #8b1a1a;
  --red-hp-bright: #cc2222;
  --blue-mp: #1a2a6b;
  --blue-mp-bright: #2244bb;
  --xp-color: #1a6b2a;
  --xp-bright: #22bb44;
  --gold-coin: #ffd700;
  --common: #9d9d9d;
  --uncommon: #1eff00;
  --rare: #0070dd;
  --superior: #a335ee;
  --epic: #ff8000;
  --legendary: #ff0000;
  --font-title: 'Cinzel', 'Times New Roman', serif;
  --font-body: 'IM Fell English', Georgia, serif;
  --font-ui: 'Cinzel', serif;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg-darkest);
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.4;
  user-select: none;
}

/* ── SCROLLBARS ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-darkest); }
::-webkit-scrollbar-thumb { background: var(--border-gold); border-radius: 3px; }

/* ── SCREEN LAYERS ── */
#screen-title, #screen-charCreate, #screen-game {
  position: absolute; inset: 0;
  display: none;
}
#screen-title.active, #screen-charCreate.active, #screen-game.active {
  display: flex;
}

/* ── TITLE SCREEN ── */
#screen-title {
  flex-direction: row;
  align-items: stretch;
  background: radial-gradient(ellipse at center, #1a0a0a 0%, #050205 60%, #000 100%);
}

.title-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(80,20,0,0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(20,0,60,0.3) 0%, transparent 50%);
}

/* ── Left panel ── */
.title-left {
  position: relative; z-index: 1;
  flex: 0 0 66.666%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
}

.title-logo {
  text-align: center;
  margin-bottom: 36px;
}

#title-logo-img {
  width: clamp(130px, 18vw, 240px);
  height: auto;
  margin-bottom: 18px;
  filter: drop-shadow(0 0 24px rgba(200,140,30,0.55)) drop-shadow(0 4px 12px rgba(0,0,0,0.8));
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.title-logo h1 {
  font-family: var(--font-title);
  font-size: clamp(28px, 4.5vw, 64px);
  font-weight: 700;
  color: var(--text-gold);
  text-shadow:
    0 0 20px rgba(200,150,42,0.8),
    0 0 40px rgba(200,100,0,0.4),
    2px 2px 0 #000,
    -1px -1px 0 rgba(0,0,0,0.8);
  letter-spacing: 6px;
  text-transform: uppercase;
}

.title-logo .subtitle {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 4px;
  margin-top: 8px;
  text-transform: uppercase;
}

.title-divider {
  width: 320px; max-width: 70%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--border-gold), transparent);
  margin: 0 auto 30px;
}

.title-buttons {
  position: relative; z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.title-ver-label {
  position: absolute;
  bottom: 18px;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 2px;
  font-family: var(--font-ui);
}

/* ── Language selector (title screen) ── */
.title-lang-selector {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
}
.title-lang-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: rgba(0,0,0,0.3);
  border: 1.5px solid rgba(180,140,40,0.25);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.title-lang-btn span {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
}
.title-lang-btn img {
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  display: block;
  object-fit: cover;
}
.title-lang-btn:hover {
  background: rgba(180,140,40,0.12);
  border-color: rgba(180,140,40,0.5);
  transform: translateY(-1px);
}
.title-lang-btn.lang-active {
  background: rgba(180,140,40,0.15);
  border-color: rgba(200,160,60,0.7);
  box-shadow: 0 0 10px rgba(200,160,60,0.2);
}
.title-lang-btn.lang-active span {
  color: var(--text-gold);
}

/* ── Options button (title screen) ── */
.title-options-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  min-width: 140px;
  justify-content: center;
  font-size: 12px;
  letter-spacing: 1px;
}
.title-options-btn img {
  opacity: 0.75;
  filter: sepia(1) saturate(0.8) hue-rotate(5deg);
}
.title-options-btn:hover img { opacity: 1; }

/* ── New Game (destructive) button on title screen ── */
.title-newgame-btn {
  margin-top: 6px;
  color: rgba(220,140,100,0.75) !important;
  border-color: rgba(140,60,30,0.4) !important;
  font-size: 10px !important;
  letter-spacing: 1.5px;
}
.title-newgame-btn:hover {
  color: rgba(255,160,100,0.95) !important;
  border-color: rgba(180,80,40,0.7) !important;
  background: rgba(100,30,10,0.25) !important;
}

/* ── Settings topbar button (in-game) ── */
.topbar-settings-btn {
  width: 28px !important;
  height: 28px !important;
  padding: 0 !important;
  min-width: unset !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
.topbar-settings-btn img {
  filter: sepia(1) saturate(0.6) hue-rotate(5deg);
  opacity: 0.7;
}
.topbar-settings-btn:hover img { opacity: 1; }

/* ── Language row inside Settings modal ── */
.settings-lang-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(180,140,40,0.15);
}
.settings-lang-btns {
  display: flex;
  gap: 6px;
}
.settings-lang-btn {
  background: rgba(0,0,0,0.3);
  border: 1.5px solid rgba(180,140,40,0.2);
  border-radius: 5px;
  padding: 4px 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  line-height: 0;
}
.settings-lang-btn img { border-radius: 2px; box-shadow: 0 1px 3px rgba(0,0,0,0.5); display: block; object-fit: cover; }
.settings-lang-btn:hover {
  background: rgba(180,140,40,0.12);
  border-color: rgba(180,140,40,0.5);
}
.settings-lang-btn.lang-active {
  border-color: rgba(200,160,60,0.8);
  background: rgba(180,140,40,0.15);
  box-shadow: 0 0 8px rgba(200,160,60,0.2);
}

/* ── Vertical divider ── */
.title-vdivider {
  position: relative; z-index: 1;
  flex-shrink: 0;
  width: 1px;
  align-self: stretch;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(200,150,42,0.15) 10%,
    rgba(200,150,42,0.55) 35%,
    rgba(200,150,42,0.55) 65%,
    rgba(200,150,42,0.15) 90%,
    transparent 100%
  );
}

/* ── Right panel ── */
.title-right {
  position: relative; z-index: 1;
  flex: 0 0 33.333%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 28px;
  overflow-y: auto;
}

/* ══════════════════════════════════════════
   ROAD MAP — Title Screen (Vertical Timeline)
══════════════════════════════════════════ */
.title-roadmap {
  width: 100%;
  max-width: 420px;
}

.rm-header-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.rm-h-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,150,42,0.4));
}
.rm-h-line-r {
  background: linear-gradient(270deg, transparent, rgba(200,150,42,0.4));
}
.rm-h-text {
  font-family: var(--font-title);
  font-size: 10px;
  color: rgba(200,150,42,0.65);
  letter-spacing: 7px;
  white-space: nowrap;
}

.rm-scroll {
  overflow-y: auto;
  max-height: calc(100vh - 120px);
  padding-right: 4px;
}
.rm-scroll::-webkit-scrollbar { width: 2px; }
.rm-scroll::-webkit-scrollbar-track { background: transparent; }
.rm-scroll::-webkit-scrollbar-thumb { background: rgba(200,150,42,0.3); border-radius: 2px; }

/* ── Vertical track with timeline line ── */
.rm-track {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 38px;
}

/* The vertical connecting line */
.rm-track::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 18px;
  bottom: 18px;
  width: 0;
  border-left: 1px dashed rgba(200,150,42,0.28);
}

/* ── Base card ── */
.rm-card {
  position: relative;
  background: rgba(6,3,10,0.88);
  border: 1px solid rgba(200,150,42,0.1);
  border-radius: 5px;
  padding: 13px 15px 12px;
  backdrop-filter: blur(8px);
  overflow: hidden;
}

/* Left accent bar */
.rm-card::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 2px;
  background: rgba(200,150,42,0.12);
}

/* ── Timeline dot ── */
.rm-dot {
  position: absolute;
  left: -25px;
  top: 14px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #08040d;
  border: 2px solid rgba(200,150,42,0.28);
  z-index: 1;
}

/* ── Card header row (ver + date side by side) ── */
.rm-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

/* ── LIVE (Alpha 1) ── */
.rm-live {
  border-color: rgba(200,150,42,0.55);
  box-shadow: 0 0 18px rgba(200,120,0,0.15), inset 0 0 24px rgba(180,90,0,0.04);
}
.rm-live::before {
  background: linear-gradient(180deg, var(--text-gold), rgba(220,160,40,0.3));
}
.rm-live .rm-dot {
  background: var(--text-gold);
  border-color: var(--border-gold-bright);
  box-shadow: 0 0 8px rgba(200,150,42,0.7);
}

/* ── NEXT (Alpha 2) ── */
.rm-next {
  border-color: rgba(200,150,42,0.25);
}
.rm-next::before {
  background: rgba(200,150,42,0.35);
}
.rm-next .rm-dot {
  border-color: rgba(200,150,42,0.45);
}

/* ── FUTURE (Beta 1, Beta 2) ── */
.rm-future {
  opacity: 0.5;
}

/* ── RELEASE (Versão Oficial) ── */
.rm-release {
  border-color: rgba(210,190,70,0.22);
  opacity: 0.46;
}
.rm-release::before {
  background: linear-gradient(180deg, rgba(210,190,70,0.38), rgba(210,190,70,0.1));
}

/* ── Badge (LIVE / RELEASE) ── */
.rm-badge {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 8px;
  letter-spacing: 1.5px;
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 5px;
  background: rgba(180,100,0,0.2);
  border: 1px solid rgba(200,150,42,0.5);
  color: var(--text-gold);
  text-transform: uppercase;
}
.rm-badge-release {
  background: rgba(80,70,0,0.2);
  border-color: rgba(210,190,70,0.42);
  color: #d4c060;
}

/* ── Version name ── */
.rm-ver {
  font-family: var(--font-title);
  font-size: 15px;
  color: var(--text-gold);
  letter-spacing: 0.5px;
}
.rm-next  .rm-ver { color: rgba(200,170,100,0.85); }
.rm-future .rm-ver,
.rm-release .rm-ver { color: var(--text-light); }

/* ── Date ── */
.rm-date {
  font-family: var(--font-ui);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 1.5px;
  padding-top: 2px;
  white-space: nowrap;
}

/* ── Separator ── */
.rm-sep {
  height: 1px;
  background: linear-gradient(90deg, rgba(200,150,42,0.2), transparent);
  margin-bottom: 9px;
}

/* ── Feature list ── */
.rm-list {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rm-list li {
  font-family: var(--font-body);
  font-size: 11.5px;
  color: rgba(155,135,105,0.65);
  padding-left: 13px;
  position: relative;
  line-height: 1.35;
}
.rm-list li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: rgba(200,150,42,0.4);
}
.rm-live .rm-list li         { color: var(--text-light); }
.rm-live .rm-list li::before { color: var(--text-gold); }
.rm-next .rm-list li         { color: rgba(180,160,130,0.78); }
.rm-next .rm-list li::before { color: rgba(200,150,42,0.55); }

/* ── Responsive ── */
@media (max-width: 820px) {
  #screen-title { flex-direction: column; }
  .title-left   { flex: none; padding: 32px 24px 20px; }
  .title-vdivider {
    width: 280px; height: 1px; align-self: center;
    background: linear-gradient(90deg, transparent, rgba(200,150,42,0.45), transparent);
  }
  .title-right  { padding: 20px 24px; justify-content: flex-start; }
  .rm-scroll    { max-height: 260px; }
}
@media (max-width: 480px) {
  .title-left  { padding: 24px 16px 16px; }
  .title-right { padding: 16px; }
  .rm-list li  { font-size: 10.5px; }
}

/* ══════════════════════════════════════════
   CHARACTER CREATE — Full Redesign
══════════════════════════════════════════ */
#screen-charCreate {
  flex-direction: row;
  align-items: stretch;
  background: #060408;
  overflow: hidden;
}

/* ── Left: Class Portrait ── */
#cc-portrait-side {
  flex: 0 0 42%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #060408;
}

#cc-portrait-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, var(--cc-glow-color, rgba(150,80,20,0.35)) 0%, transparent 65%);
  transition: background 0.6s ease;
  pointer-events: none;
}

#cc-portrait-backdrop::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(0,0,0,0.06) 40px, rgba(0,0,0,0.06) 41px),
    repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(0,0,0,0.06) 40px, rgba(0,0,0,0.06) 41px);
}

#cc-portrait-img {
  position: relative;
  z-index: 2;
  width: 72%;
  max-width: 340px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 0 32px var(--cc-glow-sharp, rgba(200,100,30,0.7)));
  transition: filter 0.5s ease, transform 0.5s ease;
  transform: translateY(0px);
  animation: portraitFloat 4s ease-in-out infinite;
}

#cc-portrait-img.switching {
  animation: none;
  opacity: 0;
  transform: translateX(-12px) scale(0.97);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

#cc-portrait-img.entering {
  animation: none;
  opacity: 1;
  transform: translateX(0) scale(1);
  transition: opacity 0.28s ease 0.05s, transform 0.28s ease 0.05s;
}

@keyframes portraitFloat {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-10px); }
}

#cc-portrait-glow-ring {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 120px;
  background: radial-gradient(ellipse at 50% 100%, var(--cc-glow-color, rgba(180,80,20,0.5)) 0%, transparent 70%);
  transition: background 0.5s ease;
  pointer-events: none;
  z-index: 1;
}

/* Particles */
#cc-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  overflow: hidden;
}

.cc-particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: particleRise var(--dur, 3s) ease-in infinite;
  animation-delay: var(--delay, 0s);
  background: var(--cc-glow-sharp, rgba(200,150,50,0.8));
  width: var(--size, 3px);
  height: var(--size, 3px);
  left: var(--x, 50%);
}

@keyframes particleRise {
  0%   { opacity: 0;   transform: translateY(0) scale(1); }
  15%  { opacity: 0.8; }
  80%  { opacity: 0.3; }
  100% { opacity: 0;   transform: translateY(-220px) scale(0.3); }
}

/* Corner decorations */
#cc-portrait-side::before,
#cc-portrait-side::after {
  content: '';
  position: absolute;
  width: 50px; height: 50px;
  border-color: var(--border-gold);
  border-style: solid;
  opacity: 0.5;
  z-index: 5;
  transition: border-color 0.5s;
}
#cc-portrait-side::before { top: 16px; left: 16px; border-width: 2px 0 0 2px; }
#cc-portrait-side::after  { bottom: 16px; right: 16px; border-width: 0 2px 2px 0; }

#cc-class-info {
  position: relative;
  z-index: 4;
  text-align: center;
  padding: 18px 24px 28px;
  width: 100%;
}

#cc-class-name-big {
  font-family: var(--font-title);
  font-size: clamp(22px, 3vw, 32px);
  color: var(--cc-text-color, var(--text-gold));
  letter-spacing: 5px;
  text-transform: uppercase;
  text-shadow: 0 0 20px var(--cc-glow-sharp, rgba(200,150,42,0.7));
  transition: color 0.4s, text-shadow 0.4s;
  margin-bottom: 10px;
}

#cc-class-lore {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.7;
  max-width: 300px;
  margin: 0 auto;
  font-style: italic;
}

/* Divider line */
#cc-portrait-side .cc-side-divider {
  position: absolute;
  top: 10%;
  bottom: 10%;
  right: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--border-gold) 30%, var(--border-gold) 70%, transparent);
  opacity: 0.6;
}

/* ── Right: Form Panel ── */
#cc-form-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 4vw, 52px) clamp(20px, 4vw, 52px);
  background: linear-gradient(135deg, #0e0b14 0%, #08060c 100%);
  overflow-y: auto;
}

#cc-form-side h2 {
  font-family: var(--font-title);
  font-size: clamp(16px, 2.2vw, 22px);
  color: var(--text-gold);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 6px;
  text-shadow: 0 0 12px rgba(200,150,42,0.35);
}

#cc-form-subtitle {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 2px;
  margin-bottom: 28px;
  font-family: var(--font-ui);
}

.cc-divider {
  height: 1px;
  background: linear-gradient(90deg, var(--border-gold), transparent);
  margin-bottom: 24px;
  opacity: 0.5;
}

/* Form fields */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-family: var(--font-ui);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 7px;
}

.form-group input[type="text"] {
  width: 100%;
  background: rgba(0,0,0,0.55);
  border: 1px solid var(--border-gold);
  border-radius: 2px;
  color: var(--text-white);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input[type="text"]:focus {
  border-color: var(--border-gold-bright);
  box-shadow: 0 0 10px rgba(200,150,42,0.25);
}

/* ── Class Selector Row ── */
.class-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 6px;
}

.class-card {
  background: rgba(0,0,0,0.55);
  border: 1px solid var(--border-dark);
  border-radius: 4px;
  padding: 0;
  cursor: pointer;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s;
  text-align: center;
  overflow: hidden;
  position: relative;
}

.class-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,0.85) 100%);
  z-index: 1;
  pointer-events: none;
}

.class-card-img-wrap {
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  position: relative;
}

.class-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.35s ease, filter 0.35s ease;
  filter: brightness(0.75) saturate(0.8);
}

.class-card:hover .class-card-img-wrap img {
  transform: scale(1.06);
  filter: brightness(0.9) saturate(1);
}

.class-card.selected .class-card-img-wrap img {
  filter: brightness(1) saturate(1.15);
}

.class-card-footer {
  position: relative;
  z-index: 2;
  padding: 8px 4px 10px;
  background: rgba(0,0,0,0.0);
}

.class-card .class-name {
  font-family: var(--font-ui);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: color 0.25s;
}

/* Selected glow per class */
.class-card.selected {
  transform: translateY(-3px);
}

.class-card.selected .class-name { color: var(--cc-text-color, var(--text-gold)); }

.class-card[data-class="swordsman"]:hover,
.class-card[data-class="swordsman"].selected {
  border-color: rgba(200, 60, 40, 0.7);
  box-shadow: 0 0 18px rgba(200,60,40,0.4), 0 0 6px rgba(200,60,40,0.2) inset;
}
.class-card[data-class="mage"]:hover,
.class-card[data-class="mage"].selected {
  border-color: rgba(140, 60, 220, 0.7);
  box-shadow: 0 0 18px rgba(140,60,220,0.4), 0 0 6px rgba(140,60,220,0.2) inset;
}
.class-card[data-class="archer"]:hover,
.class-card[data-class="archer"].selected {
  border-color: rgba(50, 180, 80, 0.7);
  box-shadow: 0 0 18px rgba(50,180,80,0.4), 0 0 6px rgba(50,180,80,0.2) inset;
}
.class-card[data-class="cleric"]:hover,
.class-card[data-class="cleric"].selected {
  border-color: rgba(220, 190, 60, 0.7);
  box-shadow: 0 0 18px rgba(220,190,60,0.4), 0 0 6px rgba(220,190,60,0.2) inset;
}

/* Selected tick */
.class-card.selected::after {
  content: '✦';
  position: absolute;
  top: 5px; right: 7px;
  font-size: 10px;
  color: var(--cc-text-color, var(--text-gold));
  z-index: 3;
  text-shadow: 0 0 6px currentColor;
}

/* ── Skill Preview ── */
#cc-skill-preview {
  margin-top: 18px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(107,74,26,0.35);
  border-radius: 3px;
  padding: 12px 14px;
  min-height: 80px;
  transition: border-color 0.4s;
}

#cc-skill-preview-title {
  font-family: var(--font-ui);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

#cc-skills-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.cc-skill-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  opacity: 0;
  transform: translateY(8px);
  animation: ccSkillFadeIn 0.35s ease forwards;
  cursor: pointer;
}

@keyframes ccSkillFadeIn {
  to { opacity: 1; transform: translateY(0); }
}

.cc-skill-icon {
  width: 68px; height: 68px;
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--border-dark);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s;
}

.cc-skill-icon:hover {
  border-color: var(--cc-card-border, var(--border-gold));
  box-shadow: 0 0 14px var(--cc-card-glow, rgba(200,150,42,0.4));
  transform: translateY(-2px);
}

.cc-skill-img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 3px;
  display: block;
}

.cc-skill-name {
  font-family: var(--font-ui);
  font-size: 8px;
  color: var(--text-dim);
  letter-spacing: 0.4px;
  text-align: center;
  line-height: 1.3;
}

.cc-skill-type-badge {
  font-size: 7px;
  padding: 1px 5px;
  border-radius: 8px;
  border: 1px solid;
  font-family: var(--font-ui);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 0.85;
}

.cc-skill-item:hover .cc-skill-name { color: var(--text-light); }

/* ── CC Skill Tooltip ── */
#cc-skill-tip {
  position: fixed;
  z-index: 99000;
  width: 238px;
  pointer-events: none;
  display: none;
  background: linear-gradient(160deg, #1c1108 0%, #0d0806 100%);
  border: 1px solid rgba(180,130,40,0.55);
  border-radius: 5px;
  box-shadow: 0 10px 36px rgba(0,0,0,0.85), 0 0 0 1px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,220,100,0.06);
  overflow: hidden;
}

.cst-header {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px 9px;
  background: rgba(0,0,0,0.35);
  border-bottom: 1px solid rgba(180,130,40,0.18);
}

.cst-img {
  width: 52px; height: 52px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid rgba(180,130,40,0.35);
  flex-shrink: 0;
}

.cst-icon-fallback {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  border: 1px solid rgba(180,130,40,0.3);
  border-radius: 3px;
  background: rgba(0,0,0,0.45);
  flex-shrink: 0;
}

.cst-title-block { flex: 1; min-width: 0; }

.cst-name {
  font-family: var(--font-title);
  font-size: 13px;
  color: var(--text-gold);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cst-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.cst-type-badge {
  font-size: 8px;
  padding: 1px 6px;
  border-radius: 8px;
  border: 1px solid;
  font-family: var(--font-ui);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.cst-elem {
  font-size: 9px;
  color: rgba(200,200,200,0.55);
  font-family: var(--font-ui);
}

.cst-costs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: rgba(0,0,0,0.2);
}

.cst-cost-mp  { font-size: 10px; color: #5c9adf; font-family: var(--font-ui); }
.cst-cost-cd  { font-size: 10px; color: #999;    font-family: var(--font-ui); }
.cst-divider  { color: rgba(180,130,40,0.3); font-size: 12px; }

.cst-sep-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(180,130,40,0.22), transparent);
  margin: 2px 10px;
}

.cst-desc {
  padding: 8px 12px 6px;
  font-size: 11px;
  color: rgba(225,205,165,0.88);
  font-family: var(--font-body);
  line-height: 1.55;
}

.cst-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 2px 12px 10px;
}

.cst-tag {
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 3px;
  font-family: var(--font-ui);
  letter-spacing: 0.2px;
  line-height: 1.5;
}

.tag-aoe     { background: rgba(200,70,30,0.2);  color: #e08060; border: 1px solid rgba(200,70,30,0.4); }
.tag-multi   { background: rgba(110,70,190,0.2); color: #b090ee; border: 1px solid rgba(110,70,190,0.4); }
.tag-hits    { background: rgba(180,140,30,0.2); color: #e0b050; border: 1px solid rgba(180,140,30,0.4); }
.tag-status  { background: rgba(60,160,70,0.15); color: #70cc80; border: 1px solid rgba(60,160,70,0.3); }
.tag-consume { background: rgba(190,50,50,0.18); color: #e07070; border: 1px solid rgba(190,50,50,0.35); }
.tag-buff    { background: rgba(180,155,30,0.18); color: #ddbb45; border: 1px solid rgba(180,155,30,0.35); }
.tag-heal    { background: rgba(30,160,80,0.18); color: #55d090; border: 1px solid rgba(30,160,80,0.35); }

/* CC Action buttons */
.cc-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* CC portrait text transitions */
#cc-class-name-big {
  transition: opacity 0.3s, transform 0.3s, color 0.4s, text-shadow 0.4s;
}
#cc-class-lore {
  transition: opacity 0.35s 0.05s;
}

/* CC skill preview border matches class color */
#cc-skill-preview {
  border-color: rgba(107,74,26,0.35);
  transition: border-color 0.4s;
}

/* When a class is selected, update preview border via CSS custom prop */
#screen-charCreate .cc-skill-icon {
  border-color: var(--cc-card-border, var(--border-dark));
  transition: border-color 0.4s, box-shadow 0.4s;
}

/* Scanline overlay for portrait side */
#cc-portrait-side::before,
#cc-portrait-side::after {
  transition: border-color 0.5s;
}

/* Prevent image drag on all class images */
.class-card img, #cc-portrait-img {
  -webkit-user-drag: none;
  user-select: none;
}

/* Responsive char create */
@media (max-width: 680px) {
  #screen-charCreate { flex-direction: column; }
  #cc-portrait-side  { flex: 0 0 220px; }
  #cc-portrait-img   { width: 50%; }
  .class-grid        { grid-template-columns: repeat(2, 1fr); }
}

/* ── BUTTONS ── */
.btn {
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 10px 28px;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s;
  outline: none;
}

.btn-primary {
  background: linear-gradient(180deg, #6b3a10 0%, #3d1f08 50%, #2a1505 100%);
  color: var(--text-gold);
  border: 1px solid var(--border-gold);
  box-shadow: 0 2px 8px rgba(0,0,0,0.6), inset 0 1px 0 rgba(200,150,42,0.2);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #8b4e14 0%, #5a2d0a 50%, #3d1e08 100%);
  box-shadow: 0 0 12px rgba(200,150,42,0.3), 0 2px 8px rgba(0,0,0,0.6);
  color: #ffd080;
}
.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
  background: rgba(0,0,0,0.4);
  color: var(--text-dim);
  border: 1px solid var(--border-dark);
}
.btn-secondary:hover { border-color: var(--border-gold); color: var(--text-light); }

.btn-danger {
  background: linear-gradient(180deg, #6b1a1a 0%, #3d0a0a 100%);
  color: #ff8888;
  border: 1px solid #6b1a1a;
}
.btn-danger:hover { background: linear-gradient(180deg, #8b2020 0%, #5a1010 100%); }

.btn-sm { padding: 5px 14px; font-size: 10px; letter-spacing: 1px; }
.btn-icon {
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--border-dark);
  color: var(--text-dim);
  width: 28px; height: 28px;
  padding: 0;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.btn-icon:hover { border-color: var(--border-gold); color: var(--text-gold); }

/* ── PANEL FRAME ── */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  position: relative;
}

.panel::before {
  content: '';
  position: absolute;
  inset: 2px;
  border: 1px solid rgba(107,74,26,0.3);
  pointer-events: none;
}

.panel-header {
  background: linear-gradient(180deg, #1e1418 0%, #120d10 100%);
  border-bottom: 1px solid var(--border-gold);
  padding: 5px 10px;
  font-family: var(--font-ui);
  font-size: 10px;
  color: var(--text-gold);
  letter-spacing: 2px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── ORB ── */
@keyframes orbShimmer {
  0%, 100% { opacity: 0.06; }
  50% { opacity: 0.14; }
}

.orb-container {
  position: relative;
  width: 86px; height: 86px;
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 4px 14px rgba(0,0,0,0.9));
}

.orb-bg {
  position: absolute; inset: 0;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(ellipse at 40% 30%, #161020 0%, #050308 100%);
}

.orb-fill {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  transition: height 0.4s ease;
  border-radius: 0 0 50% 50%;
}

.orb-wave { display: none; }

.orb-hp .orb-fill {
  background: radial-gradient(ellipse at 35% 55%, #f90000 0%, #6e0c0c 55%, #ffc3c3 100%);
  box-shadow: 0 -2px 12px rgba(220,40,40,0.4);
}
.orb-hp .orb-wave { background: #ff5555; }

.orb-mp .orb-fill {
  background: radial-gradient(ellipse at 35% 55%, #0097f2 0%, #081b8c 55%, #b0b6e1 100%);
  box-shadow: 0 -2px 12px rgba(50,80,220,0.4);
}
.orb-mp .orb-wave { background: #5588ff; }

/* Glass shine overlay */
.orb-shine {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(ellipse at 32% 22%, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.03) 45%, transparent 70%);
  z-index: 3;
  pointer-events: none;
  animation: orbShimmer 5s ease-in-out infinite;
}

.orb-border {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 3px solid #a07820;
  box-shadow:
    0 0 0 1px rgba(200,140,30,0.25),
    0 0 12px rgba(0,0,0,0.9),
    inset 0 0 10px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,200,60,0.12);
  z-index: 4;
  pointer-events: none;
}

.orb-text {
  position: relative; z-index: 5;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  pointer-events: none;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

/* ── PROGRESS BARS ── */
.bar-wrap {
  height: 12px;
  background: rgba(0,0,0,0.7);
  border: 1px solid var(--border-dark);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  transition: width 0.3s ease;
  position: relative;
}

.bar-hp .bar-fill {
  background: linear-gradient(90deg, #6b1a1a, #cc2222);
  box-shadow: 0 0 6px rgba(200,50,50,0.4);
}

.bar-mp .bar-fill {
  background: linear-gradient(90deg, #1a2a6b, #2244bb);
  box-shadow: 0 0 6px rgba(50,80,200,0.4);
}

.bar-xp .bar-fill {
  background: linear-gradient(90deg, #1a5a2a, #22aa44);
  box-shadow: 0 0 6px rgba(50,180,80,0.4);
}

.bar-enemy-hp .bar-fill {
  background: linear-gradient(90deg, #6b0000, #dd1111);
}

/* ── TOOLTIP ── */
.tooltip {
  position: absolute;
  z-index: 9999;
  background: rgba(10,6,12,0.97);
  border: 1px solid var(--border-gold);
  padding: 10px 14px;
  min-width: 160px;
  max-width: 220px;
  pointer-events: none;
  font-size: 11px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.9);
}

.tooltip-name {
  font-family: var(--font-ui);
  font-size: 13px;
  margin-bottom: 4px;
}

.tooltip-desc { color: var(--text-dim); font-size: 11px; margin: 4px 0; }
.tooltip-stat { font-size: 10px; color: #aaffaa; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  display: none;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--bg-panel);
  border: 2px solid var(--border-gold);
  padding: 24px;
  width: min(400px, 90vw);
  box-shadow: 0 0 40px rgba(0,0,0,0.9);
  position: relative;
}

.modal h3 {
  font-family: var(--font-title);
  color: var(--text-gold);
  margin-bottom: 16px;
  letter-spacing: 2px;
}

/* ── DEATH SCREEN ── */
.death-overlay {
  position: fixed; inset: 0;
  background: rgba(80,0,0,0.6);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  animation: deathFadeIn 1s ease;
}
.death-overlay.active { display: flex; }

.death-text {
  font-family: var(--font-title);
  font-size: 48px;
  color: #ff2222;
  text-shadow: 0 0 30px rgba(255,0,0,0.8), 0 0 60px rgba(255,0,0,0.4);
  margin-bottom: 8px;
}
.death-subtitle {
  font-family: var(--font-body);
  font-size: 14px;
  color: rgba(255, 160, 160, 0.7);
  letter-spacing: 1px;
  margin-bottom: 20px;
}

/* ── STATUS EFFECTS ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 10px;
  font-family: var(--font-ui);
  letter-spacing: 1px;
}

.status-burn    { background: rgba(150,50,0,0.6);    color: #ff8844; border: 1px solid #8b3000; }
.status-poison  { background: rgba(0,100,0,0.6);    color: #88ff44; border: 1px solid #006600; }
.status-freeze  { background: rgba(0,50,150,0.6);   color: #88ccff; border: 1px solid #0044aa; }
.status-bleed   { background: rgba(100,0,20,0.6);   color: #ff4466; border: 1px solid #660011; }
.status-stun    { background: rgba(150,130,0,0.6);  color: #ffee44; border: 1px solid #998800; }
.status-chill   { background: rgba(0,80,140,0.6);   color: #aaddff; border: 1px solid #005588; }
.status-shock   { background: rgba(80,60,0,0.6);    color: #ffdd44; border: 1px solid #665500; }
.status-marked  { background: rgba(120,0,120,0.6);  color: #ff88ff; border: 1px solid #660066; }
.status-weakness{ background: rgba(60,0,0,0.6);     color: #ff6666; border: 1px solid #440000; }
.status-root    { background: rgba(20,80,10,0.6);   color: #88ff88; border: 1px solid #1a4a0a; }
.status-shield  { background: rgba(30,60,120,0.6);  color: #88ccff; border: 1px solid #3366aa; }

/* ── RARITY COLORS ── */
.rarity-common    { color: var(--common); }
.rarity-uncommon  { color: var(--uncommon); }
.rarity-rare      { color: var(--rare); }
.rarity-superior  { color: var(--superior); }
.rarity-epic      { color: var(--epic); }
.rarity-legendary { color: var(--legendary); animation: legendaryPulse 2s infinite; }
.rarity-mythic    { color: #e268a8; }
.rarity-ancient   { color: #ff7c0a; }
.rarity-divine    { color: #ffffff; }
.rarity-transcendent { color: #00ffff; }

/* ── ANIMATIONS ── */
@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

@keyframes legendaryPulse {
  0%, 100% { text-shadow: 0 0 4px rgba(255,0,0,0.6); }
  50% { text-shadow: 0 0 12px rgba(255,100,0,0.9); }
}

@keyframes deathFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes levelUpAnim {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 1; color: #ffff00; }
  100% { transform: scale(1); opacity: 0; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

@keyframes damageFloat {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-40px); opacity: 0; }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 4px rgba(200,150,42,0.2); }
  50% { box-shadow: 0 0 12px rgba(200,150,42,0.5); }
}

.anim-shake { animation: shake 0.3s ease; }
.anim-glow { animation: glowPulse 2s infinite; }

.damage-float {
  position: absolute;
  pointer-events: none;
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: bold;
  text-shadow: 0 0 6px rgba(0,0,0,0.9), 1px 1px 0 #000;
  animation: damageFloat 1.2s ease forwards;
  z-index: 100;
}

.damage-float.crit { font-size: 24px; color: #ffcc00; }
.damage-float.heal { color: #44ff88; }
.damage-float.miss { color: #888888; font-size: 14px; }
