/* Landing page theme: mirrors the game client (Verdana bold, white on the
   shared surface textures). One texture; darker surfaces are a black multiply
   overlay (1-alpha) over it. */
:root {
  --surface: url("/png/bg.png");
  --surface-raised: linear-gradient(rgba(0, 0, 0, 0.66), rgba(0, 0, 0, 0.66)), url("/png/bg.png");
  --surface-control: linear-gradient(rgba(0, 0, 0, 0.43), rgba(0, 0, 0, 0.43)), url("/png/bg.png");
  --border-color: black;
  --accent: #cfccc6;
  --online: #4caf50;
  --offline: #777;
  --muted: #b8b2aa;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: white;
  font-size: 13px;
  font-family: Verdana, "Sans-Serif";
  font-weight: bold;
  text-shadow: 0 0 2px black, 0 0 2px black, 0 0 2px black;
  background-color: #0e0e0e;
  background-image: var(--surface-control);
  -webkit-text-size-adjust: 100%;
}

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  box-sizing: border-box;
}

/* Hero */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 16px 48px;
  margin-bottom: 24px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  background-color: #14110f;
  background-image: linear-gradient(rgba(10, 8, 6, 0.55), rgba(10, 8, 6, 0.85)), url("/png/background.png");
  background-size: cover;
  background-position: center;
}

.hero-logo {
  width: 68px;
  height: 68px;
  image-rendering: pixelated;
}

.hero-title {
  margin: 12px 0 0;
  font-size: 38px;
  letter-spacing: 2px;
}

.hero-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 1px;
}

.play-button {
  display: inline-block;
  margin-top: 24px;
  padding: 12px 32px;
  color: white;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: #2c2622;
  background-image: var(--surface);
}

.play-button:hover {
  border-color: var(--accent);
  box-shadow: 0 0 6px 0 rgba(207, 204, 198, 0.3);
}

/* Panels */
.panel {
  margin-bottom: 24px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background-color: #201d1b;
  background-image: var(--surface);
  overflow: hidden;
}

.panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  background-color: #2a2521;
  background-image: var(--surface-raised);
}

.panel-header h2 {
  margin: 0;
  font-size: 16px;
}

.realms-summary {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

/* Simple centered message panel (e.g. the premium placeholder) */
.notice-body {
  padding: 28px 20px;
  text-align: center;
  line-height: 1.6;
}

.notice-body p {
  margin: 0 0 10px;
  color: var(--muted);
  font-weight: normal;
}

.notice-coin {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
}

/* Realms */
.realms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  padding: 16px;
}

.realm-card {
  display: block;
  padding: 14px;
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: #17140f;
  background-image: var(--surface-control);
}

.realm-card:hover {
  border-color: var(--accent);
}

.realm-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--offline);
  box-shadow: 0 0 4px var(--offline);
}

.status-dot.is-online {
  background-color: var(--online);
  box-shadow: 0 0 6px var(--online);
}

.realm-name {
  flex: 1 1 auto;
  margin: 0;
  font-size: 15px;
}

.realm-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.realm-stat {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--online);
}

.realm-stat.is-offline {
  color: var(--offline);
}

.realm-details {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: normal;
}

.realms-notice {
  grid-column: 1 / -1;
  padding: 8px 2px;
  color: var(--muted);
  font-weight: normal;
}

/* The game library: cards linking to the static content that never changes between realms */
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  padding: 16px;
}

.library-card {
  display: block;
  padding: 14px;
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: #17140f;
  background-image: var(--surface-control);
}

.library-card:hover {
  border-color: var(--accent);
}

.library-card-title {
  display: block;
  font-size: 15px;
}

.library-card-note {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: normal;
}

/* Realm page */
.back-link {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.back-link:hover {
  color: white;
}

/* Breadcrumb trail back through a page's ancestors, the realm first */
.breadcrumb {
  display: block;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 12px;
}

.breadcrumb .crumb {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb .crumb:hover {
  color: white;
}

/* The final crumb names the page currently shown, so it stands out and links nowhere */
.breadcrumb .crumb-current {
  color: white;
}

.breadcrumb .crumb-separator {
  margin: 0 6px;
}

.realm-title {
  margin: 0;
  font-size: 20px;
}

/* Links from a realm through to its characters, guilds, and houses */
.realm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 16px;
}

.browse-link {
  color: var(--accent);
  font-size: 12px;
  text-decoration: none;
}

.browse-link:hover {
  color: white;
}

.character-link {
  color: white;
  text-decoration: none;
}

.character-link:hover {
  color: var(--accent);
}

.table-wrap {
  padding: 4px 8px 8px;
  overflow-x: auto;
}

.player-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.player-table th,
.player-table td {
  padding: 8px 12px;
  text-align: left;
  white-space: nowrap;
}

.player-table thead th {
  color: var(--muted);
  font-size: 11px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.6);
}

.player-table tbody tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.25);
}

.player-table tbody td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.35);
}

/* FAQ */
.faq {
  border-top: 1px solid rgba(0, 0, 0, 0.6);
}

.faq:first-of-type {
  border-top: none;
}

.faq > summary {
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
}

.faq > summary::-webkit-details-marker {
  display: none;
}

.faq > summary::before {
  content: "+";
  display: inline-block;
  width: 16px;
  color: var(--accent);
}

.faq[open] > summary::before {
  content: "\2212";
}

.faq[open] > summary {
  color: var(--accent);
}

.faq-body {
  padding: 0 16px 16px 32px;
  font-weight: normal;
  color: var(--muted);
}

.faq-body p {
  margin: 0 0 8px;
  line-height: 1.5;
}

.faq-body ol {
  margin: 0 0 8px;
  padding-left: 18px;
  line-height: 1.6;
}

.faq-body strong {
  color: white;
}

.faq-note {
  font-size: 12px;
}

/* News: the latest updates, newest first, each a collapsible entry rendered from /news.json */
.news-list {
  padding: 4px 16px 8px;
}

.news-entry {
  border-top: 1px solid rgba(0, 0, 0, 0.6);
}

.news-entry:first-child {
  border-top: none;
}

.news-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  cursor: pointer;
  list-style: none;
}

.news-summary::-webkit-details-marker {
  display: none;
}

.news-tag {
  flex: 0 0 auto;
  padding: 2px 8px;
  color: var(--accent);
  font-size: 11px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background-image: var(--surface-control);
}

.news-title {
  flex: 1 1 auto;
  font-size: 14px;
}

.news-date {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: normal;
}

/* The collapse marker, a plus that turns to a minus once the entry is open */
.news-summary::after {
  content: "+";
  width: 16px;
  color: var(--accent);
  text-align: right;
}

.news-entry[open] .news-summary::after {
  content: "\2212";
}

.news-body {
  margin: 0;
  padding: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: normal;
  line-height: 1.5;
}

/* Footer */
.page-footer {
  margin-top: 8px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: normal;
}

.page-footer a {
  color: var(--muted);
  text-decoration: none;
}

.page-footer a:hover {
  color: white;
}

.footer-sep {
  margin: 0 6px;
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 30px;
  }
  .realms-grid {
    grid-template-columns: 1fr;
  }
}
