/* ============================================================
   RO PvP Arena — Main Styles
   ============================================================ */

:root {
  --bg:         #0d0f14;
  --bg2:        #13161e;
  --bg3:        #1a1e2b;
  --border:     #2a2f40;
  --accent:     #e8a020;
  --accent2:    #c0392b;
  --text:       #dde1ee;
  --text-dim:   #7a8099;
  --green:      #2ecc71;
  --gold:       #f1c40f;
  --silver:     #bdc3c7;
  --bronze:     #cd7f32;
  --radius:     8px;
  --sidebar-w:  300px;
  --topbar-h:   52px;
}

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

html { font-size: 15px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- TOP BAR ---- */
.topbar {
  height: var(--topbar-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.server-name {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  color: var(--accent);
  letter-spacing: .5px;
}

.server-subtitle {
  color: var(--text-dim);
  font-size: .8rem;
  margin-left: 12px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.online-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: .82rem;
  color: var(--text-dim);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
}

.dot.pulse {
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .35; }
}

.btn-outline {
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 14px;
  font-size: .82rem;
  color: var(--text-dim);
  transition: border-color .2s, color .2s;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ---- MAIN LAYOUT ---- */
.layout {
  display: flex;
  flex-shrink: 0;
  height: calc(100vh - var(--topbar-h));
  overflow: hidden;
}

/* ---- GAME PANEL ---- */
.game-panel {
  flex: 1;
  position: relative;
  background: #000 url('login-bg.jpg') center center / cover no-repeat;
}

#game-container {
  width: 100%;
  height: 100%;
  position: relative;
}

#game-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Overlay shown before user clicks Play */
.game-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #0d0f14ee 60%, #1a0a00cc);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.overlay-content {
  text-align: center;
  max-width: 480px;
  padding: 20px;
}

.overlay-content h1 {
  font-family: 'Cinzel', serif;
  font-size: 2.4rem;
  color: var(--accent);
  margin-bottom: 14px;
  text-shadow: 0 0 30px #e8a02088;
}

.overlay-content p {
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 18px;
}

.feature-list {
  list-style: none;
  margin: 0 auto 24px;
  text-align: left;
  display: inline-block;
}

.feature-list li {
  padding: 3px 0;
  font-size: .9rem;
  color: var(--text);
}

.btn-play {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius);
  padding: 13px 36px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 0 30px #e8a02055;
}

.btn-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px #e8a02099;
}

.note {
  font-size: .78rem;
  color: var(--text-dim);
  margin-top: 14px;
}

/* ---- LEADERBOARD SIDEBAR ---- */
.leaderboard-panel {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

.lb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}

.lb-title {
  font-weight: 700;
  font-size: .95rem;
  color: var(--accent);
}

.lb-live {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  color: var(--green);
  letter-spacing: .5px;
}

.lb-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.lb-loading {
  text-align: center;
  color: var(--text-dim);
  font-size: .85rem;
  padding: 30px 0;
}

/* individual row */
.lb-row {
  display: grid;
  grid-template-columns: 28px 1fr 48px 36px;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--bg3);
  transition: background .15s;
  cursor: default;
}

.lb-row:hover { background: var(--bg3); }

.lb-row.flash {
  animation: rowFlash .6s ease-out;
}

@keyframes rowFlash {
  0%   { background: #e8a02033; }
  100% { background: transparent; }
}

.lb-rank {
  font-size: .78rem;
  color: var(--text-dim);
  font-weight: 600;
  text-align: right;
}

.lb-rank.rank-1 { color: var(--gold);   font-size: .9rem; }
.lb-rank.rank-2 { color: var(--silver); }
.lb-rank.rank-3 { color: var(--bronze); }

.lb-name {
  font-size: .85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-kills {
  font-size: .9rem;
  font-weight: 700;
  color: var(--accent);
  text-align: right;
}

.lb-kd {
  font-size: .75rem;
  color: var(--text-dim);
  text-align: right;
}

.lb-footer {
  padding: 8px 14px;
  font-size: .72rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}

/* ---- HOW TO PLAY ---- */
.info-section {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 50px 24px;
}

.info-inner {
  max-width: 800px;
  margin: 0 auto;
}

.info-inner h2 {
  font-family: 'Cinzel', serif;
  color: var(--accent);
  font-size: 1.6rem;
  margin-bottom: 28px;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.step-num {
  width: 34px;
  height: 34px;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step strong { color: var(--text); }
.step div { line-height: 1.6; color: var(--text-dim); }

/* ---- FOOTER ---- */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 18px 24px;
  text-align: center;
  font-size: .75rem;
  color: var(--text-dim);
  line-height: 1.7;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .layout { flex-direction: column; height: auto; }

  .game-panel {
    height: 60vh;
    min-height: 380px;
  }

  .leaderboard-panel {
    width: 100%;
    height: auto;
    max-height: 340px;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .server-subtitle { display: none; }
}
