* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: radial-gradient(circle at top, #2a1f14 0%, #120d08 60%, #060402 100%);
  color: #e8d9b8;
  padding: 24px;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.bg-overlay {
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(45deg, rgba(212, 175, 55, 0.02) 0, rgba(212, 175, 55, 0.02) 2px, transparent 2px, transparent 40px);
  pointer-events: none;
}

.card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, #1c140c 0%, #150f09 100%);
  border: 1px solid #4a3820;
  border-radius: 12px;
  padding: 36px 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(212, 175, 55, 0.08) inset;
  animation: card-in 0.5s ease-out;
}

.brand {
  text-align: center;
  margin-bottom: 20px;
}

.brand-title {
  display: block;
  font-family: 'Cinzel', 'Segoe UI', serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 6px;
  color: #d4af37;
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.35);
}

.brand-subtitle {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  letter-spacing: 3px;
  color: #8a7554;
  text-transform: uppercase;
}

.dev-notice {
  margin: 0 0 22px;
  padding: 12px 14px;
  border: 1px dashed #6b5424;
  border-radius: 8px;
  background: rgba(212, 175, 55, 0.05);
  color: #c9b98a;
  font-size: 12.5px;
  line-height: 1.5;
}

.dev-notice strong {
  color: #e8c766;
}

.downloads {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 22px;
}

.download-link {
  display: block;
  text-align: center;
  padding: 10px 14px;
  border: 1px solid #4a3820;
  border-radius: 6px;
  background: rgba(212, 175, 55, 0.06);
  color: #d4af37;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.download-link:hover {
  background: rgba(212, 175, 55, 0.12);
  border-color: #d4af37;
}

h1 {
  font-size: 20px;
  margin: 0 0 4px;
  color: #f2e6c9;
  text-align: center;
}

.hint {
  text-align: center;
  font-size: 13px;
  color: #a08f6a;
  margin: 0 0 24px;
}

.alert {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 18px;
  border: 1px solid transparent;
}

.alert-error {
  background: rgba(178, 34, 34, 0.15);
  border-color: rgba(178, 34, 34, 0.4);
  color: #ff9d9d;
}

.alert-success {
  background: rgba(60, 130, 70, 0.15);
  border-color: rgba(60, 130, 70, 0.4);
  color: #a6e6b0;
}

form {
  display: flex;
  flex-direction: column;
}

label {
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #b9a06a;
  margin: 14px 0 6px;
}

input {
  background: #0f0b06;
  border: 1px solid #4a3820;
  border-radius: 6px;
  padding: 11px 12px;
  color: #f2e6c9;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder {
  color: #6b5b3d;
}

input:focus {
  border-color: #d4af37;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

button {
  margin-top: 26px;
  padding: 13px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(180deg, #d4af37 0%, #a9822a 100%);
  color: #1a1206;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}

button:hover {
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.35);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

.link-row {
  text-align: center;
  font-size: 13px;
  color: #a08f6a;
  margin: 18px 0 0;
}

.link-row a {
  color: #d4af37;
  text-decoration: none;
  border-bottom: 1px dotted #d4af37;
}

.card-wide {
  max-width: 640px;
}

.section-title {
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #b9a06a;
  margin: 18px 0 10px;
}

.chars {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.char-card {
  border: 1px solid #4a3820;
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(212, 175, 55, 0.04);
}

.char-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  gap: 8px;
}

.char-name {
  font-family: 'Cinzel', 'Segoe UI', serif;
  font-size: 17px;
  font-weight: 700;
  color: #f2e6c9;
  word-break: break-all;
}

.char-lvl {
  font-size: 12px;
  color: #d4af37;
  white-space: nowrap;
}

.char-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: #a08f6a;
  padding: 2px 0;
  gap: 8px;
}

.char-row b {
  color: #e8d9b8;
  font-weight: 600;
  text-align: right;
}

.logout-form {
  margin-top: 6px;
}

.char-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.char-link:hover {
  border-color: #d4af37;
  background: rgba(212, 175, 55, 0.09);
}

.char-more {
  margin-top: 8px;
  font-size: 12px;
  color: #d4af37;
  text-align: right;
}

.sec-box {
  border: 1px solid #4a3820;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 10px;
  background: rgba(212, 175, 55, 0.03);
}

.sec-box summary {
  cursor: pointer;
  font-size: 13.5px;
  color: #d4af37;
}

.sec-box form {
  margin-top: 4px;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, 46px);
  gap: 5px;
  justify-content: start;
}

.tile {
  position: relative;
  width: 46px;
  height: 46px;
  border: 1px solid #4a3820;
  border-radius: 6px;
  background: #0f0b06;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.tile.empty {
  background: rgba(15, 11, 6, 0.5);
  border-style: dashed;
  border-color: #33260f;
}

.tile .plus {
  position: absolute;
  top: 1px;
  right: 3px;
  font-size: 11px;
  font-weight: 700;
  color: #ffd75e;
  text-shadow: 0 0 3px #000, 0 0 3px #000;
}

.tile .qty {
  position: absolute;
  bottom: 1px;
  right: 3px;
  font-size: 11px;
  font-weight: 700;
  color: #f2e6c9;
  text-shadow: 0 0 3px #000, 0 0 3px #000;
}

.tile .cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  font-size: 8.5px;
  text-align: center;
  color: #8a7554;
  background: rgba(0, 0, 0, 0.55);
  letter-spacing: 0;
  line-height: 1.5;
}

.bag {
  grid-template-columns: repeat(auto-fill, 40px);
  gap: 4px;
}

.bag .tile {
  width: 40px;
  height: 40px;
}

.tile .plus,
.tile .qty {
  font-size: 9.5px;
}

.tile .cap {
  font-size: 7px;
}

.btn-secondary {
  background: transparent;
  border: 1px solid #4a3820;
  color: #b9a06a;
}

.btn-secondary:hover {
  box-shadow: none;
  border-color: #d4af37;
  color: #d4af37;
}

.footer {
  margin-top: 20px;
  text-align: center;
  font-size: 11.5px;
  letter-spacing: 0.3px;
  color: #6b5b3d;
}

/* Barra de navegación y comunidad (ranking, jugadores) */
.topnav {
  align-self: stretch;
  width: 100%;
  max-width: 860px;
  margin: 0 auto 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 10px 16px;
  background: linear-gradient(180deg, #1c140c 0%, #150f09 100%);
  border: 1px solid #4a3820;
  border-radius: 10px;
  position: relative;
}

.nav-logo {
  font-family: 'Cinzel', 'Segoe UI', serif;
  font-weight: 700;
  letter-spacing: 4px;
  color: #d4af37;
  text-decoration: none;
  font-size: 15px;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.nav-links a {
  color: #b9a06a;
  text-decoration: none;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
}

.nav-links a:hover {
  color: #d4af37;
  border-color: #4a3820;
}

.nav-links a.active {
  color: #1a1206;
  background: linear-gradient(180deg, #d4af37 0%, #a9822a 100%);
  font-weight: 700;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0 0 14px;
}

.tabs a {
  color: #b9a06a;
  text-decoration: none;
  font-size: 12.5px;
  padding: 6px 12px;
  border: 1px solid #4a3820;
  border-radius: 999px;
}

.tabs a.active {
  color: #d4af37;
  border-color: #d4af37;
  background: rgba(212, 175, 55, 0.1);
}

.table-wrap {
  overflow-x: auto;
}

table.rank {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.rank th,
table.rank td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #33260f;
}

table.rank th {
  font-size: 11.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #b9a06a;
}

table.rank a {
  color: #f2e6c9;
  text-decoration: none;
  border-bottom: 1px dotted #8a7554;
  font-weight: 600;
}

table.rank tr.top1 td { background: rgba(212, 175, 55, 0.10); }
table.rank tr.top2 td { background: rgba(190, 190, 200, 0.06); }
table.rank tr.top3 td { background: rgba(180, 110, 60, 0.07); }
table.rank td.detail { color: #a08f6a; font-size: 12px; }

@media (max-width: 640px) {
  table.rank .detail { display: none; }
}

.search-form {
  flex-direction: row;
  gap: 10px;
}

.search-form input {
  flex: 1;
}