:root {
  --color-primary: #8a0b0b; /* Blood red */
  --color-primary-glow: #e61a1a;
  --color-gold: #d4af37;
  --color-gold-glow: rgba(212, 175, 55, 0.6);
  --color-dark: #0a0a0c;
  --color-darker: #050506;
  --color-text: #e0e0e0;
  --color-text-muted: #a0a0a0;
  --font-logo: 'Cinzel', serif;
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Roboto', sans-serif;
}

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

body {
  background-color: var(--color-darker);
  /* Unsplash dark fantasy castle background overlay */
  background-image: 
    linear-gradient(to bottom, rgba(5, 5, 6, 0.5) 0%, rgba(5, 5, 6, 1) 100%),
    url('https://images.unsplash.com/photo-1542451313056-b7c8e626645f?q=80&w=2000&auto=format&fit=crop');
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
  color: var(--color-text);
  font-family: var(--font-body);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Embers / Fire Effect Container */
.embers-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Single Ember */
.ember {
  position: absolute;
  bottom: -20px;
  background: #ff5e00;
  border-radius: 50%;
  box-shadow: 0 0 10px 4px rgba(255, 94, 0, 0.8), 0 0 20px 8px rgba(255, 0, 0, 0.6);
  animation-name: floatEmber;
  animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  animation-iteration-count: infinite;
  opacity: 0;
}

@keyframes floatEmber {
  0% { transform: translateY(0) translateX(0) scale(1); opacity: 1; }
  25% { transform: translateY(-25vh) translateX(15px) scale(0.8); }
  50% { opacity: 0.8; }
  75% { transform: translateY(-75vh) translateX(-15px) scale(0.5); }
  100% { transform: translateY(-100vh) translateX(30px) scale(0.2); opacity: 0; }
}

/* Page Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 4rem;
  align-items: center;
}

/* Header & Logo */
.main-header {
  text-align: center;
  padding: 4rem 1rem 1rem;
  position: relative;
  z-index: 10;
}

.logo {
  font-family: var(--font-logo);
  font-size: 5rem;
  color: var(--color-gold);
  text-transform: uppercase;
  letter-spacing: 6px;
  text-shadow: 0 0 20px var(--color-gold-glow), 0 5px 15px rgba(0,0,0,0.9);
  margin-bottom: 0.5rem;
}

.subtitle {
  font-family: var(--font-logo);
  color: var(--color-primary);
  font-size: 1.4rem;
  letter-spacing: 10px;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(138, 11, 11, 0.9);
}

/* Flash Messages */
.flash-container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto 2rem;
  position: relative;
  z-index: 15;
}

.flash-message {
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
  border-radius: 4px;
  font-weight: 600;
  text-align: center;
  animation: slideInDown 0.5s ease;
  border: 1px solid;
}

.flash-message.success {
  background: rgba(30, 70, 32, 0.8);
  border-color: #4caf50;
  color: #a5d6a7;
  box-shadow: 0 0 15px rgba(76, 175, 80, 0.4);
}

.flash-message.error {
  background: rgba(80, 20, 20, 0.8);
  border-color: var(--color-primary);
  color: #ff8a80;
  box-shadow: 0 0 15px rgba(138, 11, 11, 0.6);
}

@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero Section */
.hero-section {
  text-align: center;
  width: 100%;
  animation: fadeIn 2s ease-in;
}

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

.hero-content h2 {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  color: #fff;
  margin-bottom: 1rem;
  text-shadow: 0 4px 15px rgba(0,0,0,0.9);
}

.hero-content p {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  max-width: 700px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
  text-shadow: 0 2px 5px rgba(0,0,0,0.8);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 1rem 2.8rem;
  font-family: var(--font-logo);
  font-weight: 800;
  font-size: 1.1rem;
  text-transform: uppercase;
  text-decoration: none;
  letter-spacing: 2px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary.glow-btn {
  background: linear-gradient(135deg, var(--color-primary) 0%, #4a0000 100%);
  color: #fff;
  border: 1px solid var(--color-primary-glow);
  box-shadow: 0 0 15px rgba(230, 26, 26, 0.6), inset 0 0 10px rgba(255,255,255,0.1);
}

.btn-primary.glow-btn:hover {
  background: linear-gradient(135deg, var(--color-primary-glow) 0%, var(--color-primary) 100%);
  box-shadow: 0 0 25px rgba(230, 26, 26, 0.9), inset 0 0 15px rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

.btn-gold {
  background: linear-gradient(135deg, #a67c00 0%, #bf953f 40%, #ffeb82 80%, #b38728 100%);
  background-size: 200% auto;
  color: #1a1a1a;
  border: 1px solid #fbf5b7;
  width: 100%;
  margin-top: 1rem;
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
  transition: 0.5s;
}

.btn-gold:hover {
  background-position: right center; /* Shine effect */
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.8);
  transform: translateY(-2px);
  color: #000;
}

/* Registration Form Panel */
.registration-section {
  width: 100%;
  max-width: 520px;
}

.glass-panel {
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-top: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 6px;
  padding: 3rem 2.8rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.9), inset 0 0 40px rgba(0,0,0,0.6);
  position: relative;
}

.glass-panel::before {
  content: '';
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  z-index: -1;
  background: linear-gradient(45deg, var(--color-gold), transparent, var(--color-primary));
  opacity: 0.2;
  border-radius: 8px;
}

.form-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.form-header h3 {
  font-family: var(--font-logo);
  font-size: 2.2rem;
  color: var(--color-gold);
  text-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.ornament {
  height: 2px;
  width: 70%;
  background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
  margin: 15px auto 0;
  position: relative;
}
.ornament::after {
  content: '♦';
  color: var(--color-gold);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px;
  text-shadow: 0 0 8px var(--color-gold);
}

/* Inputs */
.input-group {
  margin-bottom: 2rem;
  position: relative;
}

.input-group label {
  display: block;
  font-family: var(--font-heading);
  color: var(--color-gold);
  margin-bottom: 0.6rem;
  font-size: 1rem;
  letter-spacing: 1px;
}

.input-group input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(5, 5, 5, 0.7);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: #fff;
  font-size: 1.05rem;
  font-family: var(--font-body);
  border-radius: 4px;
  transition: all 0.3s ease;
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.input-group input:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.3), inset 0 2px 4px rgba(0,0,0,0.5);
  background: rgba(5, 5, 5, 0.9);
}

.input-group input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

/* Client Validation Styles */
.error-msg {
  color: var(--color-primary-glow);
  font-size: 0.85rem;
  position: absolute;
  bottom: -22px;
  left: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  text-shadow: 0 0 5px rgba(230, 26, 26, 0.5);
}

.input-group.invalid input {
  border-color: var(--color-primary-glow);
  box-shadow: 0 0 15px rgba(230, 26, 26, 0.4);
}

.input-group.invalid .error-msg {
  opacity: 1;
}

.form-footer {
  text-align: center;
  margin-top: 1.8rem;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.form-footer a {
  color: var(--color-gold);
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
}

.form-footer a:hover {
  text-shadow: 0 0 8px var(--color-gold);
  color: #fff;
}

.main-footer {
  text-align: center;
  padding: 2rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  position: relative;
  z-index: 10;
  opacity: 0.6;
}

/* Stats Section */
.stats-section {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  animation: fadeIn 2s ease-in 0.5s;
  animation-fill-mode: both;
}

.stats-grid {
  display: flex;
  justify-content: space-around;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-box {
  background: rgba(10, 10, 12, 0.7);
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 1.5rem 2rem;
  border-radius: 6px;
  text-align: center;
  flex: 1;
  box-shadow: 0 5px 15px rgba(0,0,0,0.8), inset 0 0 10px rgba(0,0,0,0.5);
  transition: all 0.3s ease;
}

.stat-box:hover {
  border-color: var(--color-gold);
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.9), inset 0 0 15px rgba(212, 175, 55, 0.2);
}

.stat-value {
  display: block;
  font-family: var(--font-logo);
  font-size: 2.5rem;
  color: var(--color-gold);
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-family: var(--font-heading);
  color: var(--color-text-muted);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.top-players {
  padding: 2rem;
  margin-top: 1rem;
}

.top-players h3 {
  font-family: var(--font-logo);
  color: var(--color-gold);
  text-align: center;
  font-size: 2.2rem;
  text-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.top-players ul {
  list-style: none;
  margin-top: 1.5rem;
}

.top-players li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
  transition: background 0.3s ease;
}

.top-players li:hover {
  background: rgba(212, 175, 55, 0.05);
}

.top-players li:last-child {
  border-bottom: none;
}

.player-rank {
  color: var(--color-gold);
  font-family: var(--font-logo);
  font-weight: bold;
  font-size: 1.2rem;
  width: 40px;
}

.player-name {
  flex: 1;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: #fff;
}

.player-xp {
  color: var(--color-primary-glow);
  font-weight: bold;
  font-family: var(--font-body);
}

/* Main Layout Grid */
.container {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 2rem;
  align-items: start;
}

.content-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar-area {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem;
}

/* Navigation */
.main-nav {
  margin-top: 1.5rem;
  background: rgba(138, 11, 11, 0.1);
  border-top: 1px solid rgba(212, 175, 55, 0.3);
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  padding: 1rem 0;
}

.main-nav ul {
  display: flex;
  justify-content: center;
  gap: 3rem;
  list-style: none;
}

.main-nav a {
  color: var(--color-gold);
  text-decoration: none;
  font-family: var(--font-logo);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: all 0.3s ease;
  position: relative;
}

.main-nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 50%;
  background-color: var(--color-primary-glow);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.main-nav a:hover {
  text-shadow: 0 0 10px var(--color-gold-glow);
  color: #fff;
}

.main-nav a:hover::after {
  width: 100%;
}

/* Sidebar Widgets */
.sidebar-widget h3 {
  font-family: var(--font-logo);
  color: var(--color-primary-glow);
  font-size: 1.4rem;
  margin-bottom: 1rem;
  text-align: center;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  padding-bottom: 0.5rem;
}

.server-status ul {
  list-style: none;
  color: var(--color-text-muted);
}

.server-status li {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px dashed rgba(255,255,255,0.05);
}

.server-status span {
  color: #fff;
  font-weight: bold;
}

.status-online {
  color: #4caf50 !important;
  text-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
}

/* News Section */
.news-item {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.news-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.news-item h4 {
  font-family: var(--font-heading);
  color: var(--color-gold);
  font-size: 1.5rem;
  margin-bottom: 0.3rem;
}

.news-date {
  font-size: 0.85rem;
  color: var(--color-primary);
  display: block;
  margin-bottom: 0.8rem;
  font-weight: bold;
}

/* Tables (Rankings) */
.rankings-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.rankings-table th {
  font-family: var(--font-logo);
  color: var(--color-primary-glow);
  text-transform: uppercase;
  padding: 1rem;
  text-align: left;
  border-bottom: 2px solid rgba(212, 175, 55, 0.3);
}

.rankings-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rankings-table tr:hover td {
  background: rgba(212, 175, 55, 0.05);
}

.player-name-col {
  color: #fff;
  font-weight: bold;
  font-family: var(--font-heading);
  font-size: 1.1rem;
}

/* Responsiveness overrides for the new grid */
@media (max-width: 992px) {
  .container {
    grid-template-columns: 1fr;
  }
}

/* Responsiveness */
@media (max-width: 768px) {
  .logo { font-size: 3rem; letter-spacing: 4px; }
  .subtitle { font-size: 1rem; letter-spacing: 6px; }
  .hero-content h2 { font-size: 2.5rem; }
  .glass-panel { padding: 2.5rem 1.8rem; }
  .container { gap: 2rem; }
}

@media (max-width: 480px) {
  .logo { font-size: 2.2rem; }
  .subtitle { font-size: 0.8rem; letter-spacing: 4px; }
  .hero-content h2 { font-size: 2rem; }
  .hero-content p { font-size: 1rem; }
  .glass-panel { padding: 2rem 1.2rem; }
  .input-group input { font-size: 1rem; }
}
