/* ==========================================================================
   SLAYERS ONLINE: REVIVAL - RIGHT-SIDE IN-GAME HUD SIDEBAR
   Fiel ao layout e texturas de madeira autênticas do jogo original (Slayers Online)
   ========================================================================== */

/* Main Two-Column Layout (Sidebar explicitly on the Right) */
.app-layout {
  display: flex !important;
  flex-direction: row !important;
  min-height: 100vh;
  width: 100%;
  position: relative;
  overflow-x: hidden;
}

.main-wrapper {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin-right: 310px !important;
  margin-left: 0 !important;
  width: calc(100% - 310px) !important;
}

/* Authentic Game HUD Sidebar (ALWAYS ANCHORED RIGHT) */
.game-sidebar {
  width: 310px !important;
  height: 100vh !important;
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  left: auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  z-index: 1000 !important;
  background-color: #0b0200;
  background-image: 
    linear-gradient(90deg, rgba(0,0,0,0.6) 0%, transparent 12%, transparent 88%, rgba(0,0,0,0.6) 100%),
    radial-gradient(circle at 50% 0%, rgba(220, 38, 38, 0.2) 0%, transparent 60%),
    url('../images/slayers_hud_wood.png');
  background-repeat: repeat-y;
  background-size: 100% auto;
  border-left: 3px solid #8b5a2b !important;
  border-right: none !important;
  box-shadow: -6px 0 30px rgba(0, 0, 0, 0.9) !important;
  display: flex !important;
  flex-direction: column !important;
  color: #f1f5f9;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.3) transparent;
}

/* Decorative Authentic Wood Border Columns (vertedge.png) */
.game-sidebar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 100%;
  background-image: url('../images/vertedge.png');
  background-repeat: repeat-y;
  z-index: 5;
  pointer-events: none;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.7);
  opacity: 0.85;
}

.game-sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 12px;
  height: 100%;
  background-image: url('../images/vertedge.png');
  background-repeat: repeat-y;
  z-index: 5;
  pointer-events: none;
  box-shadow: -2px 0 6px rgba(0, 0, 0, 0.7);
  opacity: 0.85;
}

.game-sidebar::-webkit-scrollbar {
  width: 5px;
}
.game-sidebar::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.4);
  border-radius: 3px;
}

/* Sidebar Brand / Game Header */
.sidebar-brand {
  padding: 16px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 2px solid rgba(212, 175, 55, 0.35);
  background: rgba(0, 0, 0, 0.65);
  position: relative;
  z-index: 6;
}

.sidebar-brand a {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.sidebar-brand img {
  width: 38px;
  height: 38px;
  filter: drop-shadow(0 0 8px rgba(220, 38, 38, 0.8));
}

.sidebar-brand-title {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #fff;
  line-height: 1.1;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.5), 1px 1px 2px #000;
}

.sidebar-brand-tag {
  display: inline-block;
  font-size: 0.62rem;
  background: linear-gradient(135deg, #c02626, #7f1d1d);
  color: #fff;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 1px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  vertical-align: middle;
  border: 1px solid rgba(248, 113, 113, 0.3);
}

/* In-Game HUD Container */
.player-hud-container {
  padding: 14px 18px;
  border-bottom: 2px solid rgba(212, 175, 55, 0.3);
  background: rgba(8, 2, 1, 0.7);
  position: relative;
  z-index: 6;
}

/* Celestial / Year Clock Header */
.hud-year-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(18, 5, 2, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 4px;
  padding: 4px 10px;
  margin-bottom: 8px;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.8);
}

.hud-year-text {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  color: #f6c445;
  font-size: 0.82rem;
  letter-spacing: 1px;
  text-shadow: 1px 1px 2px #000;
}

.hud-location-text {
  font-family: 'Cinzel', serif;
  color: #f7e28b;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(246, 196, 69, 0.6), 1px 1px 2px #000;
}

/* HUD Wood Card Box */
.hud-card-wood {
  background: rgba(22, 10, 6, 0.9);
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 6px;
  padding: 12px;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.9), 0 4px 12px rgba(0, 0, 0, 0.5);
  position: relative;
}

.hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
  padding-bottom: 4px;
}

.hud-title {
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  color: #f7e28b;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Guest / Login Form */
.hud-login-form .form-group-mini {
  margin-bottom: 8px;
}

.hud-input-mini {
  width: 100%;
  padding: 7px 10px;
  background: rgba(10, 4, 3, 0.95);
  border: 1px solid rgba(139, 90, 43, 0.6);
  border-radius: 4px;
  color: #f1f5f9;
  font-size: 0.82rem;
  outline: none;
  box-sizing: border-box;
  transition: all 0.2s;
}

.hud-input-mini:focus {
  border-color: #d4af37;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
  background: #150604;
}

.hud-btn-login {
  width: 100%;
  padding: 7px;
  background: linear-gradient(180deg, #d4af37 0%, #8b5a2b 100%);
  border: 1px solid #f7e28b;
  color: #1a0800;
  font-weight: 700;
  font-size: 0.84rem;
  font-family: 'Cinzel', serif;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.2s;
  margin-top: 4px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.hud-btn-login:hover {
  background: linear-gradient(180deg, #f7e28b 0%, #b8860b 100%);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.7);
  transform: translateY(-1px);
}

.hud-links-mini {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.74rem;
}

.hud-links-mini a {
  color: #cbd5e1;
  text-decoration: none;
}
.hud-links-mini a:hover {
  color: #f7e28b;
  text-decoration: underline;
}

/* In-Game Portrait & Flanking Curved Gauges */
.hud-in-game-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 6px auto 10px;
  position: relative;
}

/* Left Curved Blue Gauge (MP) */
.hud-gauge-left {
  width: 14px;
  height: 68px;
  background: #091224;
  border: 1px solid #3b82f6;
  border-radius: 10px 0 0 10px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 4px #000, 0 0 8px rgba(59, 130, 246, 0.4);
}

.hud-gauge-left-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(0deg, #1d4ed8 0%, #38bdf8 100%);
  transition: height 0.3s ease;
  box-shadow: 0 0 6px #38bdf8;
}

/* Right Curved Red Gauge (HP) */
.hud-gauge-right {
  width: 14px;
  height: 68px;
  background: #240909;
  border: 1px solid #ef4444;
  border-radius: 0 10px 10px 0;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 4px #000, 0 0 8px rgba(239, 68, 68, 0.4);
}

.hud-gauge-right-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(0deg, #991b1b 0%, #f87171 100%);
  transition: height 0.3s ease;
  box-shadow: 0 0 6px #f87171;
}

/* Center Character Oval/Arched Portrait */
.hud-avatar-center {
  width: 68px;
  height: 68px;
  border: 2px solid #d4af37;
  border-radius: 50%;
  overflow: hidden;
  background: #050201;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.6), inset 0 0 8px #000;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hud-avatar-center img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hud-char-details {
  text-align: center;
  margin-bottom: 8px;
}

.hud-char-name {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 700;
  color: #f6c445;
  text-shadow: 0 0 8px rgba(246, 196, 69, 0.5), 1px 1px 2px #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-char-sub {
  font-size: 0.78rem;
  color: #cbd5e1;
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
}

.hud-badges-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 6px 0 10px;
}

.hud-rank-badge {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  color: #f7e28b;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.4);
  padding: 2px 8px;
  border-radius: 3px;
}

.hud-stance-badge {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 600;
}

/* Horizontal HP & MP bars */
.hud-bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}

.hud-bar-wrap {
  height: 16px;
  background: #050201;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 4px #000;
}

.hud-bar-hp {
  height: 100%;
  background: linear-gradient(90deg, #7f1d1d, #dc2626, #ef4444);
  transition: width 0.3s ease;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

.hud-bar-mp {
  height: 100%;
  background: linear-gradient(90deg, #1e3a8a, #2563eb, #38bdf8);
  transition: width 0.3s ease;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.6);
}

.hud-bar-label {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  color: #fff;
  text-shadow: 1px 1px 2px #000, 0 0 4px #000;
  letter-spacing: 0.5px;
}

.hud-char-select {
  width: 100%;
  padding: 5px 8px;
  background: #0a0302;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 4px;
  color: #f7e28b;
  font-size: 0.78rem;
  margin-bottom: 8px;
  outline: none;
  cursor: pointer;
}

.hud-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.hud-action-btn {
  background: rgba(35, 15, 10, 0.9);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: #f1f5f9;
  padding: 5px 2px;
  border-radius: 4px;
  font-size: 0.72rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hud-action-btn:hover {
  background: #451a14;
  border-color: #d4af37;
  color: #f7e28b;
  box-shadow: 0 0 6px rgba(212, 175, 55, 0.4);
}

.hud-action-btn.btn-danger:hover {
  background: #7f1d1d;
  border-color: #ef4444;
  color: #fff;
}

/* Sidebar Navigation Menu */
.sidebar-nav {
  flex: 1;
  padding: 14px 18px;
  position: relative;
  z-index: 6;
}

.sidebar-nav-title {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  color: #f6c445;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(18, 7, 5, 0.8);
  border: 1px solid rgba(139, 90, 43, 0.4);
  border-radius: 4px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 4px rgba(0, 0, 0, 0.5);
}

.sidebar-menu li a:hover {
  background: linear-gradient(90deg, rgba(80, 20, 15, 0.9) 0%, rgba(30, 10, 8, 0.95) 100%);
  border-color: #d4af37;
  color: #f7e28b;
  transform: translateX(-3px);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.35);
}

.sidebar-menu li a.active {
  background: linear-gradient(90deg, rgba(120, 25, 20, 0.95) 0%, rgba(45, 12, 8, 0.95) 100%);
  border-color: #f6c445;
  color: #fff;
  font-weight: 700;
  box-shadow: inset 0 0 10px rgba(220, 38, 38, 0.5), 0 0 12px rgba(212, 175, 55, 0.4);
  border-right: 3px solid #f6c445;
}

.sidebar-link-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-icon {
  font-size: 1.05rem;
}

.sidebar-badge {
  font-size: 0.65rem;
  background: rgba(212, 175, 55, 0.2);
  color: #f7e28b;
  border: 1px solid rgba(212, 175, 55, 0.4);
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 700;
}

/* Sidebar Footer & Realtime Status */
.sidebar-footer {
  padding: 14px 18px;
  border-top: 2px solid rgba(212, 175, 55, 0.3);
  background: rgba(6, 1, 0, 0.85);
  position: relative;
  z-index: 6;
}

.sidebar-server-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #34d399;
  margin-bottom: 6px;
}

.sidebar-server-ip {
  font-size: 0.74rem;
  font-family: monospace;
  background: rgba(20, 8, 5, 0.9);
  padding: 4px 8px;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border: 1px solid rgba(139, 90, 43, 0.5);
  color: #f7e28b;
}

.sidebar-server-ip:hover {
  border-color: #d4af37;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}

.sidebar-version-tag {
  color: #94a3b8;
  font-size: 0.72rem;
  margin-top: 4px;
  text-align: right;
}

/* Mobile Responsive Topbar */
.mobile-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(11, 2, 0, 0.96);
  border-bottom: 1px solid rgba(212, 175, 55, 0.4);
  position: sticky;
  top: 0;
  z-index: 999;
  backdrop-filter: blur(8px);
}

.mobile-hamburger {
  background: rgba(35, 15, 10, 0.9);
  border: 1px solid rgba(212, 175, 55, 0.5);
  color: #f7e28b;
  font-size: 1.1rem;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-weight: 700;
}

@media (min-width: 769px) {
  .mobile-topbar {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .main-wrapper {
    margin-right: 0 !important;
    width: 100% !important;
  }

  .game-sidebar {
    width: 295px !important;
    right: 0 !important;
    left: auto !important;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000 !important;
  }

  .game-sidebar.open {
    transform: translateX(0) !important;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1999;
    backdrop-filter: blur(4px);
  }

  .sidebar-backdrop.active {
    display: block;
  }
}
