/* pRO site styling.
 *
 * The look follows the 2006 Level Up! Philippine Ragnarok page - a left sidebar of
 * ornate buttons, a banner strip, parchment panels with blue title bars - but the
 * build is responsive, because most players arrive on a phone and a fixed 800px
 * layout is unusable there.
 *
 * Colours are sampled from the game logo rather than picked by eye: #24306C is its
 * darkest outline ink, the same value the login screen sets its type in.
 */

:root {
  --ink:       #24306C;
  --ink-2:     #36457F;
  --blue:      #4A63A8;
  --blue-deep: #171F45;
  --gold:      #B8862B;
  --gold-lt:   #E7BE55;
  --paper:     #F7F2E6;
  --paper-2:   #EFE7D3;
  --panel:     #FFFDF7;
  --rule:      #D8CBAF;
  --text:      #2B2721;
  --muted:     #6C6455;
  --shadow:    rgba(23, 31, 69, .18);
  --wash:      linear-gradient(180deg, rgba(255,255,255,.34), rgba(255,255,255,.62));
  --sidebar-w: 232px;
  --maxw:      1180px;
}

/* Dark theme: parchment becomes deep navy, ink becomes parchment. Tokens only -
   no component defines a colour inside a media query. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink:       #C8D2F5;
    --ink-2:     #A9B6E4;
    --blue:      #33417A;
    --blue-deep: #0E1330;
    --gold:      #E0AE43;
    --gold-lt:   #F2CE72;
    --paper:     #161B33;
    --paper-2:   #1D2340;
    --panel:     #1B2039;
    --rule:      #2E3760;
    --text:      #E7E3D6;
    --muted:     #9A9683;
    --shadow:    rgba(0, 0, 0, .45);
    --wash:      linear-gradient(180deg, rgba(10,14,34,.52), rgba(10,14,34,.78));
  }
}
:root[data-theme="dark"] {
  --ink:       #C8D2F5;
  --ink-2:     #A9B6E4;
  --blue:      #33417A;
  --blue-deep: #0E1330;
  --gold:      #E0AE43;
  --gold-lt:   #F2CE72;
  --paper:     #161B33;
  --paper-2:   #1D2340;
  --panel:     #1B2039;
  --rule:      #2E3760;
  --text:      #E7E3D6;
  --muted:     #9A9683;
  --shadow:    rgba(0, 0, 0, .45);
  --wash:      linear-gradient(180deg, rgba(10,14,34,.52), rgba(10,14,34,.78));
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper-2);
  color: var(--text);
  font: 16px/1.65 "Nunito Sans", "Segoe UI", Tahoma, Verdana, sans-serif;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, .brand-name, .panel-title, .btn {
  font-family: Cinzel, "Times New Roman", Georgia, serif;
  letter-spacing: .02em;
}
h1, h2, h3 { color: var(--ink); text-wrap: balance; margin: 0 0 .5em; }
h1 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem); }
h2 { font-size: 1.28rem; }
h3 { font-size: 1.06rem; }
p  { margin: 0 0 1em; max-width: 68ch; }
a  { color: var(--ink); }
a:hover { color: var(--gold); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 3px; }
img { max-width: 100%; height: auto; }

/* ---------- hero banner ---------- */

.hero {
  position: relative;
  background: var(--blue-deep) url("../img/hero-bg.jpg") center 32% / cover no-repeat;
  border-bottom: 4px solid var(--gold);
  overflow: hidden;
}
.hero::after {                    /* wash, so logo and type stay legible over art */
  content: ""; position: absolute; inset: 0; background: var(--wash);
}
.hero-inner {
  position: relative; z-index: 1;
  max-width: var(--maxw); margin: 0 auto;
  padding: 30px 20px 26px;
  display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center;
}
.hero-logo { width: min(430px, 68vw); filter: drop-shadow(0 3px 6px var(--shadow)); }
.hero-tag {
  margin: .5em 0 1.1em; max-width: 46ch;
  color: var(--ink); font-weight: 600; font-size: 1.02rem;
}
.hero-heroes { width: min(330px, 34vw); align-self: end; margin-bottom: -26px; }
@media (max-width: 860px) {
  .hero-heroes { display: none; }
  .hero-inner { grid-template-columns: 1fr; }
}

/* ---------- layout ---------- */

.wrap {
  max-width: var(--maxw); margin: 0 auto; padding: 22px 20px 56px;
  display: grid; grid-template-columns: var(--sidebar-w) 1fr; gap: 22px; align-items: start;
}
@media (max-width: 860px) { .wrap { grid-template-columns: 1fr; } }

/* ---------- sidebar ---------- */

.side { position: sticky; top: 16px; }
@media (max-width: 860px) { .side { position: static; } }

.brand {
  background: linear-gradient(160deg, var(--gold-lt), var(--gold));
  color: #2A1F06; border-radius: 10px 10px 0 0;
  padding: 12px 14px; text-align: center;
  border: 1px solid var(--gold); border-bottom: none;
}
.brand-name { display: block; font-size: 1.12rem; font-weight: 700; line-height: 1.15; }
.brand-sub  { display: block; font-size: .74rem; letter-spacing: .09em; text-transform: uppercase; opacity: .82; }

.nav {
  list-style: none; margin: 0 0 18px; padding: 0;
  border: 1px solid var(--rule); border-radius: 0 0 10px 10px; overflow: hidden;
  background: var(--panel); box-shadow: 0 2px 10px var(--shadow);
}
.nav li + li { border-top: 1px solid var(--rule); }
.nav a {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 13px; text-decoration: none; color: var(--ink);
  font-weight: 700; font-size: .95rem;
  background: linear-gradient(180deg, var(--panel), var(--paper-2));
}
.nav a::before {                 /* the small gem the original nav buttons carried */
  content: ""; width: 9px; height: 9px; flex: none; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, var(--gold-lt), var(--gold));
}
.nav a:hover { background: linear-gradient(180deg, var(--paper), var(--paper-2)); color: var(--gold); }
.nav a[aria-current="page"] { background: var(--blue); color: #FFF9EA; }
.nav a[aria-current="page"]::before { background: #FFF9EA; }

/* On phones the sidebar becomes a horizontal rail instead of a tall stack. */
@media (max-width: 860px) {
  .nav { display: flex; overflow-x: auto; border-radius: 10px; }
  .nav li + li { border-top: none; border-left: 1px solid var(--rule); }
  .nav a { white-space: nowrap; }
  .brand { border-radius: 10px; border-bottom: 1px solid var(--gold); margin-bottom: 10px; }
}

/* ---------- panels ---------- */

.panel {
  background: var(--panel) url("../img/panel.png") repeat;
  border: 1px solid var(--rule); border-radius: 10px;
  box-shadow: 0 2px 10px var(--shadow);
  margin: 0 0 20px; overflow: hidden;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .panel { background-image: none; }
}
:root[data-theme="dark"] .panel { background-image: none; }

.panel-title {
  background: var(--blue);
  color: #FFF7E4; margin: 0; padding: 9px 15px;
  font-size: 1.02rem; letter-spacing: .05em; text-transform: uppercase;
  border-bottom: 2px solid var(--gold);
}
.panel-body { padding: 16px 18px; }
.panel-body > :last-child { margin-bottom: 0; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 8px; text-decoration: none;
  font-weight: 700; font-size: 1rem; border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:hover { transform: none; } }
.btn-play {
  background: linear-gradient(180deg, var(--gold-lt), var(--gold));
  color: #2A1F06; border-color: var(--gold);
  font-size: 1.08rem; padding: 14px 26px;
}
.btn-alt {
  background: var(--ink); color: #F3F1E6; border-color: var(--blue-deep);
}
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 0; }

/* ---------- news ---------- */

.news { list-style: none; margin: 0; padding: 0; }
.news li { padding: 11px 0; border-bottom: 1px dashed var(--rule); }
.news li:last-child { border-bottom: none; padding-bottom: 0; }
.news time {
  display: inline-block; min-width: 84px; color: var(--muted);
  font-size: .82rem; font-variant-numeric: tabular-nums;
}
.news .tag {
  display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 999px;
  background: var(--blue); color: #FFF7E4; font-size: .72rem;
  letter-spacing: .06em; text-transform: uppercase; font-weight: 700;
}
.news h3 { margin: 2px 0 3px; font-size: 1rem; }
.news p  { margin: 0; color: var(--muted); font-size: .93rem; }

/* ---------- server status ---------- */

.status { display: flex; flex-wrap: wrap; gap: 10px; }
.stat {
  flex: 1 1 120px; background: var(--paper-2); border: 1px solid var(--rule);
  border-radius: 8px; padding: 10px 12px;
}
.stat b { display: block; font-size: 1.24rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat span { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.dot.up   { background: #3F9B4F; }
.dot.down { background: #B23B3B; }

/* ---------- facts ---------- */

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.fact { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; }
.fact b { display: block; color: var(--ink); font-size: 1.02rem; }
.fact span { font-size: .88rem; color: var(--muted); }

/* ---------- forms ---------- */

.form { max-width: 26rem; }
.field { margin: 0 0 14px; }
.field label { display: block; font-weight: 700; font-size: .92rem; color: var(--ink); margin: 0 0 5px; }
.field input {
  width: 100%; padding: 11px 12px; font: inherit;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--rule); border-radius: 7px;
}
.field input:focus { outline: 3px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
.field .hint { font-size: .8rem; color: var(--muted); margin: 4px 0 0; }
/* Honeypot. Off-screen rather than display:none - some bots skip hidden fields. */
.hp { position: absolute; left: -9999px; top: -9999px; }

.alert { border-radius: 8px; padding: 12px 14px; margin: 0 0 14px; font-size: .94rem; border: 1px solid; }
.alert-error { background: color-mix(in srgb, #B23B3B 12%, transparent); border-color: #B23B3B; color: var(--text); }
.alert-ok    { background: color-mix(in srgb, #3F9B4F 14%, transparent); border-color: #3F9B4F; color: var(--text); }

/* ---------- download cards ---------- */

.dl { display: grid; gap: 14px; }
.dl-item {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: 9px; padding: 14px 16px;
}
.dl-item h3 { margin: 0 0 3px; }
.dl-item p  { margin: 0; color: var(--muted); font-size: .92rem; max-width: 46ch; }
.dl-size {
  font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink);
  font-size: .9rem; white-space: nowrap;
}

table.req { border-collapse: collapse; width: 100%; font-size: .94rem; }
table.req th, table.req td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.req th { color: var(--ink); width: 34%; }
.scroll-x { overflow-x: auto; }

/* ---------- footer ---------- */

.foot {
  background: var(--blue-deep); color: #C9D0E8;
  border-top: 4px solid var(--gold); padding: 22px 20px 30px;
}
.foot-inner { max-width: var(--maxw); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 16px 32px; }
.foot a { color: #E7BE55; }
.foot small { color: #8E97B8; display: block; margin-top: 10px; line-height: 1.6; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; z-index: 9; background: var(--gold); color: #2A1F06; padding: 8px 12px; border-radius: 6px; }
