/* ============================================================
   X Angel — Account Pages — Medieval Modern Theme
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Cinzel+Decorative:wght@400;700&family=IM+Fell+English:ital@0;1&display=swap');

:root {
  --bg:          #090b1e;
  --bg-card:     rgba(13, 16, 48, 0.96);
  --bg-input:    rgba(9, 11, 34, 0.9);
  --border:      rgba(100, 120, 255, 0.25);
  --border-gold: rgba(124, 92, 252, 0.5);
  --gold:        #FFC312;
  --gold-light:  #FFE082;
  --gold-dim:    #a08020;
  --text:        #e8eeff;
  --text-muted:  #7f90b8;
  --danger:      #FF5E57;
  --success:     #26DE81;
  --radius:      8px;
  --purple:      #7C5CFC;
  --teal:        #18DCFF;
  --orange:      #FF6B35;
  --green:       #26DE81;
  --blue:        #5B8EF5;

  /* Tipografia centralizada */
  --f-display: 'Cinzel Decorative', 'Cinzel', serif;
  --f-heading: 'Cinzel', serif;
  --f-body:    'IM Fell English', 'Palatino Linotype', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.8;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  display: block; height: 4px;
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  background: linear-gradient(90deg, #7C5CFC, #18DCFF, #26DE81, #FFC312, #FF6B35, #7C5CFC);
  background-size: 250% 100%;
  animation: rainbow-run 5s linear infinite;
}
@keyframes rainbow-run {
  0%   { background-position: 0% 50%; }
  100% { background-position: 250% 50%; }
}

/* ── TOPBAR ───────────────────────────────────────────── */
.med-topbar {
  margin-top: 4px;
  background: rgba(7, 8, 24, 0.98);
  border-bottom: 2px solid rgba(100,120,255,.2);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.med-topbar-brand {
  font-family: var(--f-display);
  font-size: 1.4rem;
  background: linear-gradient(135deg, #FFC312, #FF8C00, #FF6B35);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 14px rgba(255,195,18,.35));
  text-decoration: none;
  letter-spacing: 1px;
}
.med-topbar-brand:hover { color: var(--gold-light); text-decoration: none; }

.med-topbar-nav a {
  font-family: var(--f-heading);
  font-size: .75rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-left: 20px;
  text-decoration: none;
  transition: color .2s;
}
.med-topbar-nav a:hover { color: var(--gold); text-decoration: none; }

/* ── PAGE CONTAINER ───────────────────────────────────── */
.med-page {
  max-width: 680px;
  margin: 40px auto;
  padding: 0 16px;
}

.med-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 36px;
  box-shadow: 0 8px 40px rgba(0,0,0,.7), 0 0 30px rgba(124,92,252,.08);
  position: relative;
  overflow: hidden;
}

.med-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #7C5CFC, #18DCFF, #26DE81, #FFC312, #FF6B35);
}

/* ── HEADINGS ─────────────────────────────────────────── */
.med-title {
  font-family: var(--f-heading);
  font-size: 1.4rem;
  background: linear-gradient(135deg, #FFC312, #FF9F43);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 12px rgba(255,195,18,.3));
  text-align: center;
  letter-spacing: 2px;
  margin-bottom: 6px;
}
.med-subtitle {
  font-family: var(--f-heading);
  font-size: .7rem;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 28px;
}
.med-divider {
  border: none;
  border-top: 1px solid var(--border-gold);
  margin: 20px 0;
  opacity: .5;
}

/* ── FORM ELEMENTS ────────────────────────────────────── */
.med-form-group { margin-bottom: 18px; }

.med-label {
  display: block;
  font-family: var(--f-heading);
  font-size: .78rem;
  color: var(--teal);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.med-input {
  width: 100%;
  background: rgba(10, 7, 2, 0.75);
  border: 2px solid var(--border-gold);
  color: var(--text);
  padding: 11px 15px;
  font-family: var(--f-body);
  font-size: .97rem;
  border-radius: var(--radius);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.med-input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 14px rgba(124,92,252,.3), inset 0 1px 4px rgba(0,0,0,.4);
}
.med-input::placeholder { color: var(--text-muted); opacity: .6; }

.med-hint {
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-style: italic;
}

/* Radio groups */
.med-radio-group { display: flex; flex-direction: column; gap: 8px; }
.med-radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-family: var(--f-heading);
  font-size: .82rem;
  color: var(--text);
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  transition: all .2s;
}
.med-radio-label:hover {
  border-color: var(--border-gold);
  background: rgba(200,168,75,.05);
  color: var(--gold-light);
}
.med-radio-label input[type="radio"] { accent-color: var(--gold); }

/* ── BUTTON ROW (grupo de botões de form/ações) ─────── */
.med-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* ── BUTTONS ──────────────────────────────────────────── */
.med-btn {
  display: inline-block;
  background: linear-gradient(135deg, #7C5CFC, #5B8EF5);
  border: none;
  color: var(--gold-light);
  padding: 11px 28px;
  font-family: var(--f-heading);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.med-btn:hover {
  background: linear-gradient(135deg, #9D7DFF, #7aabff);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(124,92,252,.5);
  transform: translateY(-2px);
}
.med-btn:visited { color: var(--gold-light); }
.med-btn:active { transform: translateY(0); }

.med-btn-secondary {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text-muted);
  box-shadow: none;
}
.med-btn-secondary:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: rgba(24,220,255,.06);
  box-shadow: 0 4px 14px rgba(24,220,255,.2);
  transform: translateY(-1px);
}
.med-btn-secondary:visited { color: var(--text-muted); }

/* ── MESSAGES ─────────────────────────────────────────── */
.med-error {
  background: rgba(192,57,43,.12);
  border: 1px solid rgba(192,57,43,.4);
  color: #e07070;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: .88rem;
  margin-bottom: 16px;
}
.med-success {
  background: rgba(39,174,96,.1);
  border: 1px solid rgba(39,174,96,.3);
  color: #6ec896;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: .88rem;
  margin-bottom: 16px;
}
.med-warning {
  background: rgba(200,168,75,.1);
  border: 1px solid rgba(200,168,75,.3);
  color: var(--gold);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: .88rem;
  margin-bottom: 16px;
}

/* ── CHARACTER LIST ───────────────────────────────────── */
.med-char-list { list-style: none; }
.med-char-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  background: rgba(255,255,255,.02);
  transition: border-color .2s;
}
.med-char-item:hover { border-color: var(--border-gold); }
.med-char-name {
  font-family: var(--f-heading);
  font-size: .9rem;
  color: var(--gold-light);
  font-weight: 600;
}
.med-char-info { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }
.med-char-actions { display: flex; gap: 8px; }

/* ── TABLE ────────────────────────────────────────────── */
.med-table { width: 100%; border-collapse: collapse; }
.med-table th {
  background: rgba(200,168,75,.08);
  color: var(--gold);
  font-family: var(--f-heading);
  font-size: .78rem;
  letter-spacing: .5px;
  padding: 10px 14px;
  border: 1px solid var(--border-gold);
  text-align: left;
}
.med-table td {
  padding: 9px 14px;
  border: 1px solid var(--border);
  font-size: .88rem;
}
.med-table tr:nth-child(even) td { background: rgba(255,255,255,.02); }
.med-table tr:hover td { background: rgba(124,92,252,.05); transition: background .15s; }

/* ── FOOTER ───────────────────────────────────────────── */
.med-footer {
  text-align: center;
  padding: 28px 16px;
  color: var(--text-muted);
  font-size: .72rem;
  font-family: var(--f-heading);
  letter-spacing: 1px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.med-footer a { color: var(--gold-dim); }
.med-footer a:hover { color: var(--gold); }

/* ── SCROLLBAR ────────────────────────────────────────── */
body { scrollbar-color: var(--purple) #090b1e; }
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: #090b1e; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #7C5CFC, #5B8EF5);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #a080ff, #18DCFF);
}

/* ── SHOP (shop.php) ──────────────────────────────────── */
.shop-balance {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.shop-balance .sb-icon { flex-shrink: 0; }
.shop-balance .sb-info { flex: 1 1 auto; min-width: 140px; }
.shop-balance .sb-label {
  font-size: .7rem; color: var(--text-muted);
  font-family: var(--f-heading); letter-spacing: 1.5px; text-transform: uppercase;
}
.shop-balance .sb-value {
  font-size: 1.6rem; font-weight: 700;
  color: var(--gold); font-family: var(--f-heading);
}
.shop-balance .sb-unit { font-size: .85rem; opacity: .8; }
.shop-balance .sb-btn {
  margin-left: auto; font-size: .72rem; padding: 6px 14px;
  flex-shrink: 0;
}

.shop-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

/* ── RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 720px) {
  .med-page { margin: 16px auto; padding: 0 12px; }
  .med-card { padding: 20px 16px; }
  .med-topbar { padding: 10px 16px; }
  .med-topbar-brand { font-size: 1.1rem; }
  .med-title { font-size: 1.2rem; letter-spacing: 1.5px; }
  .med-subtitle { font-size: .65rem; letter-spacing: 2px; }

  /* Botões de form: stackam verticalmente e ocupam largura toda */
  .med-btn-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .med-btn-row .med-btn,
  .med-btn-row a.med-btn,
  .med-btn-row button.med-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: 12px 16px;
  }

  /* Tabelas ganham scroll horizontal pra não estourar o card */
  .med-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    max-width: 100%;
  }
  .med-table thead, .med-table tbody, .med-table tr { display: table; width: 100%; table-layout: fixed; }
  .med-table th, .med-table td { font-size: .82rem; padding: 8px 10px; }

  /* Radio group com style inline flex-direction:row (create_character sexo) */
  .med-radio-group[style*="flex-direction:row"],
  .med-radio-group[style*="flex-direction: row"] {
    flex-direction: column !important;
  }
  .med-radio-group[style*="flex-direction:row"] .med-radio-label,
  .med-radio-group[style*="flex-direction: row"] .med-radio-label {
    flex: 1 1 auto !important;
  }

  /* Char list: stack info + ações em coluna */
  .med-char-item { flex-direction: column; align-items: stretch; gap: 10px; }
  .med-char-actions { width: 100%; }
  .med-char-actions .med-btn { width: 100%; text-align: center; }

  /* Inputs maiores em mobile pra facilitar toque */
  .med-input { padding: 12px 14px; font-size: 1rem; }

  /* Shop (shop.php): saldo stacka e botão vira full-width */
  .shop-balance { padding: 16px; gap: 12px; }
  .shop-balance .sb-btn {
    margin-left: 0;
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .med-card { padding: 16px 12px; }
  .med-title { font-size: 1.05rem; }
  .med-page { padding: 0 8px; }
}

/* X Angel blue/gold UX pass: account surfaces must match the main site. */
:root {
  --border: rgba(121,84,32,.42);
  --border-gold: #8d6427;
  --gold: #d99a2b;
  --gold-light: #fff0bd;
  --text: #241407;
  --text-muted: #61451f;
  --purple: #285f9e;
  --teal: #173356;
  --blue: #285f9e;
}

body::before {
  display: none;
}

.med-page {
  max-width: 720px;
  margin: 34px auto;
}

.med-card {
  background: linear-gradient(rgba(246,226,164,.98), rgba(212,181,111,.98));
  border: 2px solid #795420;
  border-radius: 5px;
  color: #241407;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22), 0 14px 32px rgba(0,0,0,.26);
}

.med-card::before {
  height: 0;
  background: none;
}

.med-title {
  background: linear-gradient(#30649f, #173356);
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: #fff0bd;
  color: #fff0bd;
  border: 1px solid #7e5a22;
  border-bottom: 3px solid #d99a2b;
  border-radius: 4px;
  padding: 12px 16px;
  text-shadow: 0 1px #071224;
  filter: none;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

#content-body .med-title::before,
#content-body .med-title::after {
  display: none;
}

.med-subtitle {
  color: #5d3d18;
  letter-spacing: 1.6px;
  margin-bottom: 22px;
}

.med-divider {
  border-top-color: rgba(40,95,158,.34);
  opacity: 1;
}

.med-label {
  color: #173356;
  font-weight: 700;
}

.med-input,
.med-card select,
.med-card textarea {
  background: #fff4cf !important;
  border: 2px solid #8d6427 !important;
  color: #201204 !important;
  border-radius: 4px;
  font-family: Inter, Arial, sans-serif;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.16);
}

.med-input::placeholder,
.med-card textarea::placeholder {
  color: #6d5a3a !important;
  opacity: 1;
}

.med-input:focus,
.med-card select:focus,
.med-card textarea:focus {
  border-color: #285f9e !important;
  box-shadow: 0 0 0 3px rgba(40,95,158,.22), inset 0 1px 3px rgba(0,0,0,.16);
}

.med-hint,
.med-char-info,
.shop-balance .sb-label {
  color: #61451f;
  font-family: Inter, Arial, sans-serif;
}

#content-body .med-btn,
.med-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(#f0b746, #9c641f) !important;
  border: 1px solid #8e5a24;
  border-radius: 4px;
  color: #201204 !important;
  font-family: Inter, Arial, sans-serif;
  font-weight: 900;
  box-shadow: inset 0 1px rgba(255,255,255,.32), 0 3px 0 #4c2c0b;
}

#content-body .med-btn:hover,
#content-body .med-btn:visited,
.med-btn:hover,
.med-btn:visited {
  color: #201204 !important;
}

#content-body .med-btn:hover,
.med-btn:hover {
  background: linear-gradient(#f7ca62, #ad7128) !important;
  box-shadow: inset 0 1px rgba(255,255,255,.38), 0 3px 0 #4c2c0b, 0 7px 16px rgba(0,0,0,.16);
}

#content-body .med-btn-secondary,
.med-btn-secondary {
  background: linear-gradient(#316aa7, #173356) !important;
  border: 1px solid #8ab2dd;
  color: #fff0bd !important;
  box-shadow: inset 0 1px rgba(255,255,255,.18), 0 3px 0 #09182b;
}

#content-body .med-btn-secondary:hover,
#content-body .med-btn-secondary:visited,
.med-btn-secondary:hover,
.med-btn-secondary:visited {
  color: #fff0bd !important;
}

#content-body .med-btn-secondary:hover,
.med-btn-secondary:hover {
  background: linear-gradient(#3e78b8, #1f4169) !important;
}

.med-error,
.med-success,
.med-warning {
  border-radius: 4px;
  font-family: Inter, Arial, sans-serif;
  font-weight: 700;
}

.med-error {
  background: #f8d0c7;
  border-color: #a5442f;
  color: #5d160d;
}

.med-success {
  background: #d8efd2;
  border-color: #3b7c2d;
  color: #173b12;
}

.med-warning {
  background: #fff0bd;
  border-color: #9c641f;
  color: #4c2c0b;
}

.med-radio-label,
.med-char-item {
  background: rgba(255,244,207,.58);
  border-color: rgba(121,84,32,.55);
  color: #241407;
}

.med-radio-label:hover,
.med-char-item:hover {
  background: rgba(255,244,207,.84);
  border-color: #285f9e;
  color: #173356;
}

.med-char-name,
.shop-balance .sb-value {
  color: #173356;
}

.med-table {
  background: rgba(255,244,207,.58);
  color: #241407;
}

.med-table th {
  background: linear-gradient(#30649f, #173356);
  border-color: rgba(61,32,12,.35);
  color: #fff0bd;
}

.med-table td {
  border-color: rgba(61,32,12,.24);
  color: #2f1d0d;
}

.med-table tr:nth-child(even) td {
  background: rgba(255,255,255,.2);
}

.med-table tr:hover td {
  background: rgba(40,95,158,.12);
}

.med-card a:not(.med-btn) {
  color: #005da4 !important;
  font-weight: 800;
}

.shop-products .med-card,
.shop-balance {
  background: linear-gradient(rgba(255,244,207,.9), rgba(226,198,132,.9));
}

@media (max-width: 720px) {
  .med-page {
    margin: 18px auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .med-card {
    padding: 18px 14px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .med-title {
    font-size: 1rem;
    letter-spacing: .8px;
  }

  .med-subtitle {
    letter-spacing: .8px;
  }
}

.med-table-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(61,32,12,.24);
  border-radius: 4px;
  background: rgba(255,244,207,.3);
}

.med-table-scroll .med-table {
  margin-bottom: 0;
  border: 0;
}

.med-table--rank {
  min-width: 720px;
  table-layout: auto;
}

.med-table--rank th,
.med-table--rank td {
  white-space: nowrap;
}

.med-table--rank th:nth-child(1),
.med-table--rank td:nth-child(1) {
  width: 64px;
  text-align: center;
}

.med-table--rank th:nth-child(2),
.med-table--rank td:nth-child(2) {
  min-width: 170px;
}

.med-table--rank th:nth-child(3),
.med-table--rank td:nth-child(3) {
  min-width: 150px;
}

.med-table--rank th:nth-child(5),
.med-table--rank td:nth-child(5) {
  min-width: 150px;
}

@media (max-width: 720px) {
  #content-body,
  #main-content {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: hidden;
  }

  #content-body .med-page,
  .med-page {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding-left: 0;
    padding-right: 0;
  }

  #content-body .med-card,
  .med-card {
    overflow: hidden;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .med-title {
    max-width: 100%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .med-title span {
    margin-right: 0 !important;
  }

  .ranking-tabs {
    gap: 6px !important;
  }

  .ranking-tabs .med-btn {
    flex: 1 1 calc(33.333% - 6px);
    max-width: calc(33.333% - 4px);
    min-height: 36px;
    padding: 6px 10px !important;
    font-size: .66rem !important;
    letter-spacing: .4px !important;
  }

  .med-table-scroll {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    overflow-x: auto !important;
    overflow-y: hidden;
    margin-left: 0;
    margin-right: 0;
  }

  .med-table-scroll .med-table {
    display: table !important;
    width: max-content !important;
    max-width: none !important;
    table-layout: auto !important;
    white-space: normal;
  }

  .med-table-scroll .med-table thead {
    display: table-header-group !important;
    width: auto !important;
  }

  .med-table-scroll .med-table tbody {
    display: table-row-group !important;
    width: auto !important;
  }

  .med-table-scroll .med-table tr {
    display: table-row !important;
    width: auto !important;
    table-layout: auto !important;
  }

  .med-table th,
  .med-table td {
    white-space: nowrap;
    font-size: .82rem;
    padding: 8px 10px;
  }

  .med-table--rank {
    min-width: 760px !important;
  }
}

@media (max-width: 420px) {
  .med-title {
    font-size: .86rem;
    letter-spacing: .2px;
    padding-left: 8px;
    padding-right: 8px;
  }

  .med-title span {
    font-size: .86rem !important;
  }
}

html,
body {
  background:
    radial-gradient(circle at 18% -8%, rgba(78,139,200,.24), transparent 34%),
    radial-gradient(circle at 82% 10%, rgba(245,207,108,.18), transparent 32%),
    linear-gradient(rgba(8, 13, 22, .46), rgba(18, 10, 6, .78)),
    url("/templates/scrolls/xangel-demon-party-bg.png") center top / cover fixed !important;
}
