/* ==========================================================================
   MUHOT.online — Game Portal Theme
   Color Palette: Dark (#0a0606) / Orange (#ff6b1a) / Gold (#ffb627)
   ========================================================================== */

/* ---------- CSS Variables: ใช้เป็น Design Token ---------- */
:root {
  /* Brand Colors */
  --color-bg-base:      #0a0606;
  --color-bg-elevated:  #15100c;
  --color-bg-card:      #1c140f;
  --color-bg-input:     #0f0a07;
  --color-border:       #3a2820;
  --color-border-hover: #ff6b1a;

  /* Accent Colors */
  --color-orange:       #ff6b1a;
  --color-orange-deep:  #cc4a00;
  --color-gold:         #ffb627;
  --color-gold-deep:    #b8821a;
  --color-danger:       #ff3838;
  --color-success:      #2ecc71;
  --color-info:         #4ec3f5;

  /* Text */
  --color-text-primary:   #f5e9d3;
  --color-text-secondary: #b8a98f;
  --color-text-muted:     #75695a;

  /* Effects */
  --glow-orange:   0 0 12px rgba(255, 107, 26, .55), 0 0 28px rgba(255, 107, 26, .25);
  --glow-gold:     0 0 12px rgba(255, 182, 39, .6),  0 0 32px rgba(255, 182, 39, .25);
  --glow-soft:     0 0 8px rgba(255, 182, 39, .35);
  --shadow-card:   0 10px 40px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(255, 182, 39, .08);

  /* Gradients */
  --gradient-gold:   linear-gradient(135deg, #ffb627 0%, #ff8c1a 50%, #cc4a00 100%);
  --gradient-orange: linear-gradient(135deg, #ff6b1a 0%, #cc4a00 100%);
  --gradient-dark:   linear-gradient(180deg, #15100c 0%, #0a0606 100%);

  /* Spacing / Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Font */
  --font-display: 'Cinzel', 'Noto Serif Thai', Georgia, serif;
  --font-body:    'Sarabun', 'Inter', system-ui, -apple-system, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background-color: var(--color-bg-base);
  color: var(--color-text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  /* Background texture/grid ลายเบาๆ */
  background-image:
    radial-gradient(circle at 20% 10%, rgba(255, 107, 26, .08) 0%, transparent 35%),
    radial-gradient(circle at 80% 80%, rgba(255, 182, 39, .06) 0%, transparent 35%);
}

a { color: var(--color-gold); text-decoration: none; transition: color .2s; }
a:hover { color: var(--color-orange); }

img { max-width: 100%; display: block; }

/* Scrollbar ธีมเข้ม */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--color-bg-base); }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-orange); }

/* ==========================================================================
   Typography & Utility
   ========================================================================== */
.font-display { font-family: var(--font-display); letter-spacing: .05em; }

.text-gold   { color: var(--color-gold); }
.text-orange { color: var(--color-orange); }

.text-gradient-gold {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Glow Utility */
.glow-orange { text-shadow: var(--glow-orange); }
.glow-gold   { text-shadow: var(--glow-gold); }

/* ==========================================================================
   Layout Helpers
   ========================================================================== */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.section    { padding: 80px 0; }
.section-sm { padding: 48px 0; }

@media (max-width: 768px) {
  .section    { padding: 48px 0; }
  .container  { padding: 0 16px; }
}

/* ==========================================================================
   Header / Navigation
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 6, 6, .85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, .5);
}

.nav-wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; max-width: 1280px; margin: 0 auto;
}

/* Logo */
.brand-logo {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border-radius: 4px;
  transition: filter .3s, transform .3s;
}
.brand-logo:hover { filter: brightness(1.15) drop-shadow(0 0 10px rgba(255,182,39,.6)); transform: scale(1.02); }
.brand-logo-img {
  display: block;
  height: 52px;
  width: auto;
  filter: drop-shadow(0 0 6px rgba(255, 107, 26, .35));
}
.brand-logo .dot { color: var(--color-orange); -webkit-text-fill-color: var(--color-orange); }

@media (max-width: 600px) {
  .brand-logo-img { height: 40px; }
}

/* Nav Links */
.nav-menu {
  display: flex; gap: 8px; list-style: none; align-items: center;
}
.nav-menu > li > a,
.nav-menu > li > .nav-trigger {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 10px 16px;
  color: var(--color-text-primary);
  font-weight: 500; font-size: 15px;
  border-radius: var(--radius-md);
  transition: all .2s;
  cursor: pointer; background: transparent; border: 0;
  font-family: inherit;
}
.nav-menu > li > a:hover,
.nav-menu > li > .nav-trigger:hover {
  color: var(--color-gold);
  background: rgba(255, 182, 39, .08);
}
.nav-menu > li.active > a { color: var(--color-gold); }

/* Dropdown */
.has-dropdown { position: relative; }
.dropdown {
  position: absolute; top: calc(100% + 8px); left: 0;
  min-width: 220px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: all .2s;
  list-style: none;
  overflow: hidden;
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.dropdown a {
  display: block; padding: 12px 16px;
  color: var(--color-text-secondary);
  font-size: 14px;
  border-bottom: 1px solid var(--color-border);
}
.dropdown a:last-child { border-bottom: 0; }
.dropdown a:hover {
  background: rgba(255, 107, 26, .12);
  color: var(--color-gold);
  padding-left: 22px;
}

/* User Area */
.user-area { display: flex; align-items: center; gap: 12px; }
.btn-login,
.btn-register {
  padding: 9px 18px;
  font-weight: 600; font-size: 14px;
  border-radius: var(--radius-md);
  transition: all .2s;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-login {
  background: transparent;
  color: var(--color-text-primary);
  border-color: var(--color-border);
}
.btn-login:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
}
.btn-register {
  background: var(--gradient-gold);
  color: #1a0d04;
  box-shadow: var(--glow-soft);
}
.btn-register:hover {
  filter: brightness(1.1);
  box-shadow: var(--glow-gold);
  transform: translateY(-1px);
}

/* Logged-in state */
.user-info {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 14px 6px 6px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 999px;
}
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gradient-gold);
  display: grid; place-items: center;
  color: #1a0d04; font-weight: 700;
  box-shadow: var(--glow-soft);
}
.user-meta { display: flex; flex-direction: column; line-height: 1.1; }
.user-name  { font-weight: 600; font-size: 14px; color: var(--color-text-primary); }
.user-coins { font-size: 12px; color: var(--color-gold); }
.user-info .icon-logout {
  color: var(--color-text-muted);
  padding-left: 8px;
  border-left: 1px solid var(--color-border);
  margin-left: 4px;
}
.user-info .icon-logout:hover { color: var(--color-danger); }

/* Mobile Toggle */
.nav-toggle {
  display: none;
  background: transparent; border: 0;
  color: var(--color-text-primary);
  font-size: 24px; cursor: pointer;
}

@media (max-width: 960px) {
  .nav-menu {
    position: fixed; top: 72px; left: 0; right: 0;
    flex-direction: column;
    background: var(--color-bg-elevated);
    border-bottom: 1px solid var(--color-border);
    padding: 20px;
    transform: translateY(-110%);
    transition: transform .3s;
    align-items: stretch;
  }
  .nav-menu.open { transform: translateY(0); }
  .nav-menu > li > a,
  .nav-menu > li > .nav-trigger { width: 100%; padding: 14px 16px; }
  .dropdown {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: 0; border-radius: 0;
    background: rgba(255, 255, 255, .02);
  }
  .nav-toggle { display: inline-flex; }
}

/* ==========================================================================
   Buttons (Global)
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 28px;
  font-family: var(--font-display);
  font-size: 15px; font-weight: 600;
  letter-spacing: .08em;
  border-radius: var(--radius-md);
  border: 0; cursor: pointer;
  transition: all .25s;
  text-transform: uppercase;
}
.btn-primary {
  background: var(--gradient-gold);
  color: #1a0d04;
  box-shadow: var(--glow-soft);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-gold);
  filter: brightness(1.08);
}
.btn-secondary {
  background: var(--gradient-orange);
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 107, 26, .35);
}
.btn-secondary:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}
.btn-ghost {
  background: transparent;
  color: var(--color-gold);
  border: 1px solid var(--color-border);
}
.btn-ghost:hover {
  border-color: var(--color-gold);
  background: rgba(255, 182, 39, .06);
}
.btn-block { width: 100%; }
.btn-lg { padding: 16px 36px; font-size: 16px; }

/* ==========================================================================
   Video Background (loop, autoplay, muted, playsinline)
   ========================================================================== */
.video-bg {
  position: absolute; inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #0a0606;          /* matches hero fallback so no flash */
}
.video-bg video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(.55) contrast(1.05) saturate(.85);
  animation: kenburns 24s ease-in-out infinite alternate;
}
.video-bg .video-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 6, 6, .4) 0%, rgba(10, 6, 6, .65) 50%, rgba(10, 6, 6, .9) 100%),
    radial-gradient(ellipse at center, transparent 30%, rgba(0, 0, 0, .6) 100%);
  z-index: 1;
}
@keyframes kenburns {
  0%   { transform: scale(1)    translate(0, 0); }
  100% { transform: scale(1.12) translate(-2%, -1%); }
}

body::before {
  content: '';
  position: fixed; inset: 0;
  z-index: -100;
  background: #0a0606;
}

[data-bg="video"] {
  position: relative;
  overflow: hidden;
}

.video-controls {
  position: absolute;
  bottom: 12px; right: 12px;
  z-index: 5;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, .55);
  border: 1px solid rgba(255, 182, 39, .35);
  border-radius: 999px;
  color: var(--color-text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}
.video-controls:hover {
  color: var(--color-gold);
  border-color: var(--color-gold);
}
.video-controls .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-success);
}
.video-controls.paused .dot { background: var(--color-text-muted); }

/* ==========================================================================
   HERO / Home Banner (Z-Pattern Anchor)
   ========================================================================== */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex; align-items: center;
  padding: 100px 24px 80px;
  overflow: hidden;
  /* Fallback only — black behind video. Video layer (z:-2) covers this when it plays. */
  background: #0a0606;
}
/* Grid pattern overlay sits BEHIND the video */
.hero::before {
  z-index: 0;          /* Same layer as background, doesn't matter visually since we removed backdrop */
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 182, 39, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 182, 39, .04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  pointer-events: none;
  opacity: 0.4;
}
.hero > .hero-inner {
  position: relative;
  z-index: 2;
}
.hero > .video-controls {
  position: absolute; bottom: 12px; right: 12px; z-index: 10;
}
.hero-inner {
  position: relative; z-index: 2;
  max-width: 1280px; margin: 0 auto; width: 100%;
  display: grid; gap: 48px;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 107, 26, .12);
  border: 1px solid var(--color-orange-deep);
  border-radius: 999px;
  color: var(--color-orange);
  font-size: 13px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.05;
  margin: 16px 0;
  letter-spacing: .04em;
}
.hero-title .accent {
  background: var(--gradient-gold);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 20px rgba(255, 182, 39, .5));
}
.hero-desc {
  font-size: 17px; line-height: 1.7;
  color: var(--color-text-secondary);
  max-width: 560px;
  margin-bottom: 28px;
}
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-stats {
  display: flex; gap: 32px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--color-border);
}
.stat-item .num {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 700;
  color: var(--color-gold);
  display: block;
}
.stat-item .lbl {
  font-size: 12px; color: var(--color-text-muted);
  text-transform: uppercase; letter-spacing: .12em;
}

/* Hero visual: ลอยเฉยๆ — ไม่มีวงกลมรอบ logo */
.hero-visual {
  position: relative;
  display: grid; place-items: center;
  min-height: 320px;
}
.hero-logo-big {
  display: block;
  max-width: 100%;
  width: min(560px, 100%);
  height: auto;
  /* Subtle floating animation */
  animation: heroFloat 6s ease-in-out infinite;
  /* Light glow around the logo only */
  filter:
    drop-shadow(0 0 24px rgba(255, 107, 26, .35))
    drop-shadow(0 0 48px rgba(255, 182, 39, .15));
  /* Hover scaling */
  transition: transform .3s, filter .3s;
}
.hero-logo-big:hover {
  transform: scale(1.03);
  filter:
    drop-shadow(0 0 32px rgba(255, 107, 26, .55))
    drop-shadow(0 0 64px rgba(255, 182, 39, .25));
}
@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { min-height: 240px; }
}

/* ==========================================================================
   Card / Panel
   ========================================================================== */
.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.card:hover {
  border-color: rgba(255, 107, 26, .5);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(255, 182, 39, .15);
}
.card-title {
  font-family: var(--font-display);
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--color-gold);
}

/* ==========================================================================
   Section Heading
   ========================================================================== */
.section-head {
  text-align: center;
  margin-bottom: 56px;
}
.section-head .eyebrow {
  display: inline-block;
  color: var(--color-orange);
  letter-spacing: .25em;
  font-size: 13px; font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: .04em;
  margin-bottom: 12px;
}
.section-head p {
  color: var(--color-text-secondary);
  max-width: 620px; margin: 0 auto;
  font-size: 16px;
}
.section-head .divider {
  width: 80px; height: 2px;
  background: var(--gradient-gold);
  margin: 18px auto 0;
  box-shadow: var(--glow-soft);
}

/* ==========================================================================
   Feature Grid
   ========================================================================== */
.feature-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.feature-item .icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  background: rgba(255, 107, 26, .12);
  color: var(--color-orange);
  display: grid; place-items: center;
  font-size: 24px;
  margin-bottom: 16px;
  box-shadow: inset 0 0 0 1px var(--color-orange-deep);
}
.feature-item h3 { font-family: var(--font-display); font-size: 18px; margin-bottom: 8px; }
.feature-item p  { color: var(--color-text-secondary); font-size: 14px; }

/* ==========================================================================
   Server Status / Live Banner
   ========================================================================== */
.server-status {
  display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between;
  gap: 20px;
  padding: 24px 28px;
  background: linear-gradient(135deg, rgba(255, 107, 26, .12), rgba(255, 182, 39, .06));
  border: 1px solid var(--color-orange-deep);
  border-radius: var(--radius-lg);
  margin: 0 auto;
  max-width: 1100px;
}
.server-status .indicator {
  display: inline-flex; align-items: center; gap: 8px;
}
.pulse-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 0 0 rgba(46, 204, 113, .7);
  animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
  0%   { box-shadow: 0 0 0 0 rgba(46, 204, 113, .7); }
  70%  { box-shadow: 0 0 0 12px rgba(46, 204, 113, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}
.server-info-list {
  display: flex; flex-wrap: wrap; gap: 18px 32px;
  font-size: 14px; color: var(--color-text-secondary);
}
.server-info-list b { color: var(--color-gold); }

/* ---------- Server capacity bar (สีเขียว) ---------- */
.cap-wrap {
  max-width: 1100px;
  margin: 16px auto 0;
  padding: 18px 22px;
  background: rgba(15, 20, 40, .55);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px rgba(255, 200, 100, .04);
}

/* Hero variant: ขนาดเท่ากับขอบของ hero-stats */
.hero-cap {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 182, 39, .18);
}
.hero-cap-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
}
.hero-cap-label {
  letter-spacing: .04em;
}
.hero-cap-pct {
  font-family: var(--font-display);
  font-size: 15px;
  color: #2ecc71;
  text-shadow: 0 0 8px rgba(46, 204, 113, .45);
}
.cap-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
}
.cap-meta .cap-pct {
  font-family: var(--font-display);
  font-size: 16px;
  color: #2ecc71;
  text-shadow: 0 0 8px rgba(46, 204, 113, .4);
  letter-spacing: .04em;
}
.cap-bar {
  position: relative;
  width: 100%; height: 14px;
  background: rgba(0, 0, 0, .5);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(255, 255, 255, .04);
}
.cap-fill {
  height: 100%;
  background: linear-gradient(90deg, #27c93f 0%, #2ecc71 100%);
  border-radius: 999px;
  width: 0%;
  box-shadow:
    0 0 8px rgba(46, 204, 113, .55),
    inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: width 1.4s cubic-bezier(.22, 1, .36, 1);
  position: relative;
}
.cap-fill::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; right: 0; width: 18px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35));
  border-radius: 999px;
}
.cap-sub {
  display: none;
}
.cap-sub b {
  color: var(--color-gold);
  font-family: var(--font-display);
}

/* ==========================================================================
   Forms (Auth)
   ========================================================================== */
.auth-page {
  min-height: calc(100vh - 80px);
  display: grid; place-items: center;
  padding: 60px 24px;
  background:
    radial-gradient(ellipse at top, rgba(255, 107, 26, .08), transparent 60%),
    var(--color-bg-base);
}
.auth-card {
  width: 100%; max-width: 480px;
  background: var(--gradient-dark);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(255, 182, 39, .08);
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--gradient-gold);
  box-shadow: var(--glow-gold);
}
.auth-head { text-align: center; margin-bottom: 28px; }
.auth-head h1 {
  font-family: var(--font-display);
  font-size: 28px;
  margin: 12px 0 6px;
  letter-spacing: .08em;
}
.auth-head p { color: var(--color-text-secondary); font-size: 14px; }
.auth-head .auth-icon {
  width: 64px; height: 64px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--gradient-orange);
  display: grid; place-items: center;
  font-size: 28px; color: #fff;
  box-shadow: var(--glow-orange);
}

.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px; font-weight: 600;
  letter-spacing: .08em;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.input-wrap { position: relative; }
.form-control {
  width: 100%;
  padding: 13px 16px;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-family: inherit; font-size: 15px;
  transition: all .2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(255, 182, 39, .15);
}
.form-control::placeholder { color: var(--color-text-muted); }

.input-status {
  position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  pointer-events: none;
}
.input-status.ok    { color: var(--color-success); }
.input-status.error { color: var(--color-danger); }

.form-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 6px;
}
.form-hint.error   { color: var(--color-danger); }
.form-hint.success { color: var(--color-success); }

.password-strength {
  height: 4px;
  background: var(--color-bg-input);
  border-radius: 2px;
  margin-top: 8px; overflow: hidden;
}
.password-strength-bar {
  height: 100%; width: 0;
  transition: width .3s, background .3s;
}

/* Captcha */
.captcha-box {
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.captcha-question {
  flex: 1; font-weight: 600;
  color: var(--color-text-primary);
}
.captcha-question code {
  background: rgba(255, 182, 39, .15);
  color: var(--color-gold);
  padding: 2px 8px; border-radius: 4px;
}
.captcha-reload {
  background: transparent; border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .2s;
}
.captcha-reload:hover { color: var(--color-gold); border-color: var(--color-gold); }

/* Checkbox row */
.check-row {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14px; color: var(--color-text-secondary);
}
.check-row input[type=checkbox] {
  appearance: none;
  width: 18px; height: 18px; flex-shrink: 0;
  margin-top: 2px;
  border: 2px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-bg-input);
  cursor: pointer;
  position: relative;
  transition: all .2s;
}
.check-row input[type=checkbox]:checked {
  background: var(--gradient-gold);
  border-color: var(--color-gold);
}
.check-row input[type=checkbox]:checked::after {
  content: '✓';
  position: absolute; inset: 0;
  color: #1a0d04; font-weight: 700; font-size: 12px;
  display: grid; place-items: center;
}
.check-row a { color: var(--color-gold); text-decoration: underline; }

/* Auth footer */
.auth-footer {
  text-align: center;
  margin-top: 22px;
  font-size: 14px;
  color: var(--color-text-secondary);
}
.auth-footer a { color: var(--color-gold); font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

/* ==========================================================================
   Toast Notification (Custom)
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}
.toast {
  pointer-events: auto;
  min-width: 280px; max-width: 380px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex; align-items: flex-start; gap: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .7);
  animation: toastIn .35s cubic-bezier(.21, 1, .32, 1);
  position: relative;
  overflow: hidden;
}
.toast::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--color-info);
}
.toast.success::before { background: var(--color-success); }
.toast.error::before   { background: var(--color-danger); }
.toast.warning::before { background: var(--color-gold); }
.toast.info::before    { background: var(--color-info); }

.toast .toast-icon {
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px;
  background: rgba(78, 195, 245, .15);
  color: var(--color-info);
}
.toast.success .toast-icon { background: rgba(46, 204, 113, .15); color: var(--color-success); }
.toast.error   .toast-icon { background: rgba(255, 56, 56, .15);  color: var(--color-danger); }
.toast.warning .toast-icon { background: rgba(255, 182, 39, .15); color: var(--color-gold); }

.toast-body { flex: 1; }
.toast-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.toast-desc  { font-size: 13px; color: var(--color-text-secondary); }

.toast-close {
  background: transparent; border: 0;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 16px; padding: 0 0 0 6px;
}
.toast-close:hover { color: var(--color-text-primary); }

.toast.hiding { animation: toastOut .3s forwards; }
@keyframes toastIn  { from { transform: translateX(120%); opacity: 0; }
                       to   { transform: translateX(0);    opacity: 1; } }
@keyframes toastOut { from { transform: translateX(0);    opacity: 1; }
                       to   { transform: translateX(120%); opacity: 0; } }

/* Progress bar */
.toast .toast-progress {
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: rgba(255, 255, 255, .08);
}
.toast-progress-bar {
  height: 100%; width: 100%;
  background: var(--color-info);
  animation: progressBar linear forwards;
}
.toast.success .toast-progress-bar { background: var(--color-success); }
.toast.error   .toast-progress-bar { background: var(--color-danger); }
.toast.warning .toast-progress-bar { background: var(--color-gold); }
@keyframes progressBar { from { width: 100%; } to { width: 0%; } }

/* ==========================================================================
   Modal (Terms of Service)
   ========================================================================== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, .8);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
}
.modal-backdrop.open { display: flex; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  max-width: 640px; width: 100%;
  max-height: 80vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .7);
}
.modal-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { font-family: var(--font-display); color: var(--color-gold); letter-spacing: .06em; }
.modal-body {
  padding: 24px;
  overflow-y: auto;
  color: var(--color-text-secondary); font-size: 14px; line-height: 1.8;
}
.modal-body h4 { color: var(--color-text-primary); margin: 16px 0 6px; font-size: 15px; }
.modal-foot {
  padding: 14px 24px;
  border-top: 1px solid var(--color-border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ==========================================================================
   Dashboard
   ========================================================================== */
.dash-wrap {
  max-width: 1280px; margin: 0 auto;
  padding: 32px 24px;
  display: grid; gap: 24px;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  height: fit-content;
  position: sticky; top: 96px;
}
.sidebar-head {
  text-align: center; padding-bottom: 18px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 12px;
}
.sidebar-head .avatar {
  width: 64px; height: 64px;
  margin: 0 auto 10px;
  font-size: 24px;
}
.sidebar-head .name { font-family: var(--font-display); font-size: 18px; }
.sidebar-head .role { font-size: 12px; color: var(--color-text-muted); letter-spacing: .12em; text-transform: uppercase; }

.side-menu { list-style: none; }
.side-menu li a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  color: var(--color-text-secondary);
  border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500;
  transition: all .2s;
  border: 1px solid transparent;
}
.side-menu li a:hover {
  background: rgba(255, 107, 26, .08);
  color: var(--color-gold);
}
.side-menu li.active a {
  background: rgba(255, 182, 39, .1);
  color: var(--color-gold);
  border-color: var(--color-orange-deep);
}
.side-menu li .ico { font-size: 16px; }

@media (max-width: 900px) {
  .dash-wrap { grid-template-columns: 1fr; }
  .sidebar    { position: static; }
}

/* Dash content panel */
.dash-panel {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}
.panel-head h2 {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--color-gold);
  letter-spacing: .06em;
}

/* Account overview */
.overview-stats {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 32px;
}
.stat-card {
  padding: 18px;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--gradient-gold);
}
.stat-card .lbl {
  font-size: 12px; color: var(--color-text-muted);
  text-transform: uppercase; letter-spacing: .1em;
  margin-bottom: 6px;
}
.stat-card .val {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 700;
  color: var(--color-gold);
}
.stat-card .val.online { color: var(--color-success); }
.stat-card .val.offline { color: var(--color-text-muted); }

/* Character cards */
.character-list {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.character-card {
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
  transition: all .25s;
}
.character-card:hover {
  border-color: var(--color-orange-deep);
  transform: translateY(-2px);
}
.character-card .char-head {
  display: flex; align-items: center; gap: 12px;
}
.character-card .class-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  font-size: 22px;
  background: rgba(255, 107, 26, .15);
  color: var(--color-orange);
  border: 1px solid var(--color-orange-deep);
}
.character-card .char-name {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 600;
}
.character-card .char-class {
  font-size: 12px; color: var(--color-text-muted);
}
.character-card .status-tag {
  position: absolute; top: 14px; right: 14px;
  font-size: 11px; padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .08em; font-weight: 600;
}
.status-tag.online {
  background: rgba(46, 204, 113, .15);
  color: var(--color-success);
}
.status-tag.offline {
  background: rgba(117, 105, 90, .15);
  color: var(--color-text-muted);
}

.char-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  font-size: 13px; color: var(--color-text-secondary);
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}
.char-stats b { color: var(--color-gold); font-family: var(--font-display); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: 80px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  padding: 40px 24px 20px;
}
.footer-inner {
  max-width: 1280px; margin: 0 auto;
  display: grid; gap: 32px;
  grid-template-columns: 1.2fr 1fr 1fr;
}
@media (max-width: 700px) {
  .footer-inner { grid-template-columns: 1fr; }
}
.footer-col h4 {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--color-gold);
  letter-spacing: .12em;
  margin-bottom: 14px;
  text-transform: uppercase;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; font-size: 14px; color: var(--color-text-secondary); }
.footer-col a { color: var(--color-text-secondary); }
.footer-col a:hover { color: var(--color-gold); }
.footer-bottom {
  max-width: 1280px; margin: 32px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Warehouse Grid (8 rows × 15 cols = 120 slots) - MU Classic style
   ========================================================================== */
.warehouse-wrap {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  overflow-x: auto;
}

/* Title bar (red header like classic MU inventory) — sits inside the red panel */
.warehouse-title-bar {
  position: relative;
  background: linear-gradient(180deg, #5a0a0a 0%, #3a0505 50%, #2a0303 100%);
  border: 1px solid #8a1a1a;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  padding: 8px 36px 8px 16px;
  text-align: center;
  font-family: var(--font-display);
  color: #f5e9d3;
  font-size: 14px;
  letter-spacing: .15em;
  box-shadow: inset 0 0 0 1px rgba(255, 200, 100, .15),
              0 2px 8px rgba(0, 0, 0, .5);
  text-shadow: 0 0 8px rgba(255, 200, 100, .4);
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}
.warehouse-title-bar::before,
.warehouse-title-bar::after {
  content: '';
  position: absolute; left: 8px; right: 8px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #ff8c4c, transparent);
}
.warehouse-title-bar::before { top: 2px; }
.warehouse-title-bar::after  { bottom: 2px; }

.warehouse-close {
  position: absolute; top: 50%; right: 8px;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, .4);
  color: #ffaa7a;
  border: 1px solid #ff6b3a;
  width: 22px; height: 22px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  transition: all .15s;
}
.warehouse-close:hover {
  background: rgba(255, 107, 26, .3);
  color: #fff;
  box-shadow: 0 0 6px rgba(255, 107, 58, .6);
}

/* Warehouse section container — holds red panel + warning side-by-side */
.warehouse-section {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

/* Outer panel: ornate border red + dark blue interior — snug against grid */
.warehouse-panel {
  position: relative;
  background:
    radial-gradient(ellipse at center, rgba(20, 25, 45, .6) 0%, rgba(10, 12, 25, .85) 70%),
    repeating-linear-gradient(45deg, rgba(40, 50, 80, .05) 0px, rgba(40, 50, 80, .05) 2px, transparent 2px, transparent 4px),
    #0a0d1f;
  border: 1px solid #6a1212;
  border-top: none;
  border-radius: 0 0 4px 4px;
  padding: 0;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, .8),
              0 4px 16px rgba(0, 0, 0, .6);
  flex: 0 0 auto;
  overflow: visible;
}

/* Warning side panel — sits OUTSIDE the red panel */
.warehouse-warning {
  flex: 0 0 200px;
  max-width: 240px;
  padding: 16px 14px;
  background: rgba(80, 10, 10, .25);
  border: 1px solid rgba(255, 100, 80, .35);
  border-radius: 4px;
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.6;
}
.warehouse-warning .warn-icon {
  font-size: 32px;
  color: #ff8c4c;
  display: block;
  margin-bottom: 8px;
  text-shadow: 0 0 8px rgba(255, 140, 76, .6);
}
.warehouse-warning .warn-title {
  font-family: var(--font-display);
  font-size: 14px;
  color: #ff8c4c;
  letter-spacing: .08em;
  margin-bottom: 10px;
  display: block;
}
.warehouse-warning ul {
  margin: 0; padding-left: 18px;
  font-size: 12px;
}
.warehouse-warning li { margin: 4px 0; }

@media (max-width: 720px) {
  .warehouse-warning { display: none; }   /* too narrow, hide to save space */
}

/* Ornate corners: ✦ symbols on all 4 corners */
.warehouse-panel::before,
.warehouse-panel::after {
  content: '✦';
  position: absolute;
  color: #c8a878;
  font-size: 14px;
  text-shadow: 0 0 6px rgba(200, 168, 120, .6);
  pointer-events: none;
}
.warehouse-panel::before { left: 6px; top: 6px; }
.warehouse-panel::after  { right: 6px; bottom: 6px; }

.warehouse-corner-tr,
.warehouse-corner-bl {
  position: absolute;
  color: #c8a878;
  font-size: 14px;
  text-shadow: 0 0 6px rgba(200, 168, 120, .6);
  pointer-events: none;
}
.warehouse-corner-tr { right: 6px; top: 6px; }
.warehouse-corner-bl { left: 6px; bottom: 6px; }

.warehouse-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(15, 1fr);
  grid-auto-rows: 0;            /* implicit rows from item spans collapse to 0 */
  grid-auto-columns: 0;
  gap: 0;
  background: transparent;
  padding: 0;
  border-radius: 0;
  margin: 0 auto;
  flex: 0 0 auto;
  width: 378px;
  max-width: 378px;             /* was 420, shrunk 10% */
  min-width: 378px;
  aspect-ratio: 8 / 15;
  height: 708px;                /* 378 × 15 / 8 = 708.75 */
  border: 1px solid #6a1212;
  border-top: none;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, .8);
  overflow: hidden;
}

/* Shrink (zoom out) gracefully on small/short screens — keep all 8x15 visible */
@media (max-height: 800px) {
  .warehouse-grid { max-width: 340px; }
  .warehouse-panel { padding: 8px; }
}
@media (max-height: 650px) {
  .warehouse-grid { max-width: 280px; }
  .warehouse-panel { padding: 6px; }
  .warehouse-title-bar { padding: 5px 32px 5px 12px; font-size: 12px; }
}
@media (max-height: 550px) {
  .warehouse-grid { max-width: 220px; }
  .warehouse-panel { padding: 4px; }
}
@media (max-width: 480px) {
  .warehouse-grid { max-width: 100%; }
}

.warehouse-slot {
  background: rgba(15, 20, 40, .55);
  border: 1px solid rgba(60, 80, 120, .3);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: rgba(180, 200, 230, .25);
  transition: background .12s, border-color .12s;
  cursor: default;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.warehouse-slot:hover {
  background: rgba(40, 60, 100, .4);
  border-color: rgba(120, 160, 220, .5);
}
.warehouse-slot.filled {
  background: rgba(30, 25, 20, .7);
  border-color: rgba(255, 180, 90, .3);
  cursor: pointer;
}
.warehouse-slot.filled:hover {
  background: rgba(60, 40, 25, .85);
  border-color: rgba(255, 180, 90, .7);
  box-shadow: inset 0 0 8px rgba(255, 180, 90, .25);
}

/* Item info tooltip on hover */
.warehouse-slot .item-name {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #2a0303, #1a0202);
  color: #ffd4a8;
  padding: 6px 12px;
  border-radius: 3px;
  font-size: 12px;
  white-space: nowrap;
  border: 1px solid #8a3a1a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .8), inset 0 0 0 1px rgba(255, 200, 100, .15);
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s;
  z-index: 100;
  font-family: var(--font-display);
  letter-spacing: .06em;
}
.warehouse-slot:hover .item-name { opacity: 1; }

.warehouse-slot .lvl-tag {
  position: absolute; top: 1px; left: 2px;
  font-size: 9px; font-weight: 700;
  color: #4cff7a;
  text-shadow: 1px 1px 0 #000, 0 0 4px rgba(76, 255, 122, .6);
  z-index: 2;
}
.warehouse-slot .dur-bar {
  position: absolute;
  bottom: 1px; left: 2px; right: 2px;
  height: 2px;
  background: rgba(0, 0, 0, .6);
  z-index: 2;
}
.warehouse-slot .dur-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, #4cff7a, #b8e03a);
}
.warehouse-slot .dur-bar .fill.mid { background: #ffa040; }
.warehouse-slot .dur-bar .fill.low { background: #ff3838; }

/* Item icon (PNG sprite) — fills the multi-cell slot (W columns × H rows) */
.warehouse-slot .item-icon {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .9));
  pointer-events: none;       /* click goes to the slot */
  user-select: none;
}
.warehouse-slot .item-icon-fallback {
  font-size: min(40%, 36px);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .9));
  opacity: .85;
}

.warehouse-slot .slot-num {
  position: absolute;
  bottom: 1px; right: 2px;
  font-size: 8px;
  color: rgba(180, 200, 230, .15);
  font-family: var(--font-display);
}

.warehouse-info {
  display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 14px 18px;
  background:
    linear-gradient(180deg, rgba(40, 8, 8, .6), rgba(20, 4, 4, .4)),
    repeating-linear-gradient(45deg, transparent 0 6px, rgba(255, 200, 100, .03) 6px 8px);
  border: 1px solid #6a1212;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 200, 100, .08);
}
.warehouse-info .zen {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-size: 18px;
  color: #ffd4a8;
  text-shadow: 0 0 6px rgba(255, 200, 100, .4);
}
.warehouse-info .zen b { color: #ffd4a8; }
.warehouse-info .slots-count {
  font-size: 13px; color: var(--color-text-secondary);
}
.warehouse-info .slots-count b {
  color: #ffd4a8;
  font-family: var(--font-display);
}

.warehouse-empty {
  text-align: center; padding: 60px 20px;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Ranking — 3 columns (Top Player / Top Killer / Top Guild) + pagination
   ========================================================================== */
.ranking-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 1100px) {
  .ranking-3col { grid-template-columns: 1fr; }
}

.rank-panel {
  background: linear-gradient(180deg, rgba(20, 14, 10, .85), rgba(10, 6, 6, .95));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.rank-header {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--color-text-primary);
  letter-spacing: .06em;
}
.rank-header .accent-bar {
  display: inline-block;
  width: 4px; height: 14px;
  background: var(--gradient-gold);
  border-radius: 1px;
}
.rank-header .count {
  margin-left: auto;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--color-text-muted);
}

.rank-list {
  list-style: none;
  padding: 8px;
  margin: 0;
  min-height: 320px;
}
.rank-item {
  display: grid;
  grid-template-columns: 32px 40px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px;
  margin-bottom: 4px;
  border-radius: var(--radius-md);
  transition: background .15s;
}
.rank-item:hover { background: rgba(255, 182, 39, .05); }
.rank-item .rank-no {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 700;
  text-align: center;
  color: var(--color-gold);
}
.rank-item .rank-no.top1 { color: #ffd700; text-shadow: 0 0 6px rgba(255, 215, 0, .6); font-size: 18px; }
.rank-item .rank-no.top2 { color: #c0c0c0; }
.rank-item .rank-no.top3 { color: #cd7f32; }

.rank-item .char-thumb {
  width: 36px; height: 36px;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(255, 107, 26, .25), rgba(255, 182, 39, .1));
  display: grid; place-items: center;
  font-size: 22px;
  border: 1px solid rgba(255, 107, 26, .35);
  color: var(--color-orange);
}
.rank-item .rank-info .name {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--color-text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: .03em;
}
.rank-item .rank-info .sub {
  font-size: 11px; color: var(--color-text-muted);
  margin-top: 2px;
}

.rank-item .value-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 14px;
  background: var(--gradient-gold);
  color: #1a0d04;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: var(--glow-soft), inset 0 0 0 1px rgba(255, 255, 255, .15);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .25);
  letter-spacing: .04em;
  transition: transform .15s, box-shadow .15s;
}
.rank-item:hover .value-tag {
  transform: scale(1.05);
  box-shadow: var(--glow-gold), inset 0 0 0 1px rgba(255, 255, 255, .25);
}

/* Tier-based accents: gold/silver/bronze for top 3 */
.rank-item.top1 .value-tag {
  background: linear-gradient(135deg, #fff4c4 0%, #ffd700 50%, #b8860b 100%);
  color: #4a2a00;
  box-shadow: 0 0 12px rgba(255, 215, 0, .6), inset 0 0 0 1px rgba(255, 255, 255, .3);
}
.rank-item.top2 .value-tag {
  background: linear-gradient(135deg, #f8f8ff 0%, #d3d3d3 50%, #909090 100%);
  color: #2a2a2a;
  box-shadow: 0 0 8px rgba(200, 200, 200, .5);
}
.rank-item.top3 .value-tag {
  background: linear-gradient(135deg, #f4d6b0 0%, #cd7f32 50%, #8b4513 100%);
  color: #3a1d00;
  box-shadow: 0 0 8px rgba(205, 127, 50, .5);
}

.rank-empty {
  text-align: center; padding: 60px 16px;
  color: var(--color-text-muted); font-size: 13px;
}

.rank-loading {
  text-align: center; padding: 40px 16px;
  color: var(--color-text-muted); font-size: 13px;
}

/* Pagination */
.rank-pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--color-border);
}
.rank-pagination button {
  background: rgba(255, 255, 255, .04);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  width: 36px; height: 36px;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all .15s;
}
.rank-pagination button:hover:not(:disabled) {
  background: rgba(255, 182, 39, .1);
  border-color: var(--color-gold);
  color: var(--color-gold);
}
.rank-pagination button:disabled {
  opacity: .3; cursor: not-allowed;
}
.rank-pagination .page-info {
  padding: 8px 12px;
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--color-text-secondary);
}
.rank-pagination .page-info b { color: var(--color-gold); }

/* Guild logo (rendered from 32-byte hex via pixel grid) */
.guild-mark {
  width: 36px; height: 36px;
  display: grid;
  background: rgba(0, 0, 0, .5);
  border: 1px solid rgba(255, 200, 100, .3);
  border-radius: 4px;
  image-rendering: pixelated;
}
.guild-mark .row { display: contents; }
.guild-mark .pix {
  width: 3px; height: 3px;
  background: transparent;
}
/* Game info dropdown loading state */
.dropdown-loading {
  padding: 10px 16px;
  font-size: 12px;
  color: var(--color-text-muted);
  font-style: italic;
}
/* ==========================================================================
   News & Events (2 columns) on Home Page
   ========================================================================== */
.news-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 900px) {
  .news-2col { grid-template-columns: 1fr; }
}

.news-col {
  background: linear-gradient(180deg, rgba(20, 14, 10, .85), rgba(10, 6, 6, .95));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.news-col-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  background: rgba(0, 0, 0, .25);
}

/* News column cover image (13.jpg / 14.jpg) — icon style */
.news-cover {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: linear-gradient(135deg, rgba(255, 107, 26, .12), rgba(255, 182, 39, .04));
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  transition: opacity .15s, background .15s;
  min-height: 60px;
}
.news-cover:hover {
  background: linear-gradient(135deg, rgba(255, 107, 26, .18), rgba(255, 182, 39, .08));
  opacity: 1;
}
.news-cover img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--color-orange-deep);
  flex-shrink: 0;
  filter: brightness(1.05) contrast(1.05);
}
.news-cover-caption {
  display: flex; align-items: center; gap: 8px;
  flex: 1; min-width: 0;
}
.news-cover-icon { font-size: 24px; }
.news-cover-title {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--color-gold);
  letter-spacing: .06em;
  margin: 0;
}
.news-cover-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.news-view-all-btn {
  display: block;
  text-align: center;
  padding: 12px;
  margin-top: 8px;
  border-top: 1px solid var(--color-border);
  color: var(--color-gold);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background .15s, color .15s;
}
.news-view-all-btn:hover {
  background: rgba(255, 182, 39, .08);
  color: var(--color-orange);
}
.news-col-icon {
  font-size: 22px;
  filter: drop-shadow(0 0 4px rgba(255, 182, 39, .4));
}
.news-col-title {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--color-text-primary);
  letter-spacing: .06em;
  margin: 0;
}
.news-col-count {
  margin-left: 6px;
  font-size: 12px;
  color: var(--color-text-muted);
}
.news-view-all {
  margin-left: auto;
  font-size: 13px;
  color: var(--color-gold);
  text-decoration: none;
  transition: color .15s;
}
.news-view-all:hover { color: var(--color-orange); }

.news-list {
  list-style: none;
  margin: 0;
  padding: 8px;
}
.news-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(15, 20, 40, .35);
  border: 1px solid rgba(60, 80, 120, .18);
  margin-bottom: 6px;
  transition: background .15s, border-color .15s, transform .15s;
  cursor: pointer;
}
.news-item:hover {
  background: rgba(40, 60, 100, .25);
  border-color: rgba(255, 182, 39, .35);
  transform: translateX(4px);
}
.news-item.pinned {
  border-color: rgba(255, 107, 26, .4);
  background: rgba(60, 30, 10, .35);
}
.news-item .news-title {
  font-size: 14px;
  color: var(--color-text-primary);
  font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.news-row-mid {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  min-width: 90px;
}
.news-item .news-time {
  font-family: 'Cascadia Code', 'Consolas', monospace;
  font-size: 11px;
  color: var(--color-gold);
  white-space: nowrap;
}
.news-item .news-tag-small {
  display: inline-block;
  align-self: flex-end;
  font-size: 10px;
  font-family: var(--font-display);
  letter-spacing: .06em;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(78, 195, 245, .12);
  color: var(--color-info);
  border: 1px solid rgba(78, 195, 245, .25);
  white-space: nowrap;
}
.news-item.pinned .news-tag-small {
  background: rgba(255, 107, 26, .15);
  color: var(--color-orange);
  border-color: rgba(255, 107, 26, .35);
}
.news-item .news-status {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  text-align: center;
}
.news-item .news-status.active    { background: rgba(46, 204, 113, .15); color: #2ecc71; border: 1px solid rgba(46, 204, 113, .35); }
.news-item .news-status.upcoming  { background: rgba(255, 182, 39, .15); color: var(--color-gold); border: 1px solid rgba(255, 182, 39, .35); }
.news-item .news-status.ended     { background: rgba(120, 120, 120, .15); color: var(--color-text-muted); border: 1px solid rgba(120, 120, 120, .25); }

.news-loading, .news-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
  list-style: none;
}

/* ==========================================================================
   Single-page wrap (no sidebar — full width content)
   Used by: admin-news-edit, news-detail, news-list
   ========================================================================== */
.single-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}
.single-wrap main {
  width: 100%;
}
@media (max-width: 720px) {
  .single-wrap { padding: 16px; }
}

/* ==========================================================================
   Admin Panel — tables
   ========================================================================== */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
}
.admin-table thead th {
  text-align: left;
  padding: 12px 14px;
  background: rgba(255, 107, 26, .08);
  color: var(--color-gold);
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: .08em;
  border-bottom: 1px solid var(--color-orange-deep);
  text-transform: uppercase;
}
.admin-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 182, 39, .06);
  color: var(--color-text-secondary);
}
.admin-table tbody tr:hover td {
  background: rgba(255, 182, 39, .04);
  color: var(--color-text-primary);
}

.overview-stats {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 28px;
}

#gameInfoList ul { max-height: 480px; overflow-y: auto; }
#gameInfoList li:hover { background: rgba(255, 182, 39, .04); }

/* ==========================================================================
   Misc
   ========================================================================== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11px; font-weight: 600;
  border-radius: 999px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.badge-gold   { background: rgba(255, 182, 39, .15); color: var(--color-gold); }
.badge-orange { background: rgba(255, 107, 26, .15); color: var(--color-orange); }
.badge-success{ background: rgba(46, 204, 113, .15); color: var(--color-success); }
