/* 7Kingdoms Online — bright sky theme.
   Layout follows Ice's PSD: sky-blue page, white content panel, gold-on-blue
   panel headers, character art decorations, 3-column body layout. */

:root {
  /* Bright sky palette */
  --bg:           #53a8ff;     /* page background — bright sky blue */
  --bg-dark:      #1e3a66;     /* navbar / footer / dark accents */
  --bg-darker:    #0e2240;     /* deeper navy for shadows */
  --panel:        #ffffff;     /* main content container */
  --panel-soft:   #f5f9ff;     /* soft white-blue for inner panels */
  --panel-border: #d9e6f5;     /* subtle border between sections */

  /* Text */
  --fg:        #1a2640;        /* main text — dark navy for legibility */
  --fg-soft:   #3a4c70;        /* secondary text */
  --fg-muted:  #6c80a0;        /* hints, captions */
  --fg-dim:    #98abc8;        /* placeholder text */
  --fg-light:  #ffffff;        /* text on dark backgrounds */

  /* Brand accents */
  --gold:         #f4b830;     /* the warm 7K gold */
  --gold-bright:  #ffd35e;
  --gold-deep:    #c98a14;
  --gold-soft:    rgba(244, 184, 48, 0.15);

  --blue:         #2e86dc;
  --blue-bright:  #4ea0ed;
  --blue-deep:    #1c5fa8;

  --link:         #1c5fa8;
  --link-hover:   #2e86dc;

  /* Status */
  --success:    #2ea869;
  --success-bg: #d4f0e0;
  --danger:     #d24545;
  --danger-bg:  #fad9d9;

  --shadow-sm:  0 2px 6px rgba(14, 34, 64, 0.12);
  --shadow:     0 4px 16px rgba(14, 34, 64, 0.18);
  --shadow-lg:  0 8px 28px rgba(14, 34, 64, 0.22);

  --radius:    8px;
  --radius-lg: 14px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--fg);
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--bg);
  /* Subtle vertical gradient to keep it from being too flat */
  background-image: linear-gradient(180deg, #6ab4ff 0%, #4ea0ed 50%, #3a8aff 100%);
  background-attachment: fixed;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
  width: 100%;
}

/* ============================================================ */
/*  Topbar — navy bar with 7K Online logo + nav                 */
/* ============================================================ */

.topbar {
  background: var(--bg-dark);
  border-bottom: 3px solid var(--gold-deep);
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow);
}
.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 64px;
}

.brand-mark {
  display: flex; align-items: center;
  flex-shrink: 0;
}
.brand-mark img {
  height: 48px;
  width: auto;
  display: block;
}
.brand-mark:hover { text-decoration: none; opacity: 0.9; }

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}
.topnav-link {
  display: inline-block;
  padding: 12px 18px;
  color: var(--fg-light);
  text-transform: uppercase;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 1px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.topnav-link:hover {
  color: var(--gold-bright);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}
.topnav-link.active {
  color: var(--gold);
}
.topnav-link.donate {
  color: var(--gold);
}
.topnav-link.donate:hover {
  color: var(--gold-bright);
}
.topnav-link.topnav-admin {
  color: var(--gold);
  border: 1px solid var(--gold-deep);
  background: rgba(244, 184, 48, 0.08);
}
.topnav-link.topnav-admin:hover {
  background: rgba(244, 184, 48, 0.16);
}

/* ============================================================ */
/*  Hero — temple banners scene + new wordmark + party + ship    */
/* ============================================================ */

.hero {
  position: relative;
  background: url('/assets/images/hero-bg.png') center top / cover no-repeat,
              linear-gradient(180deg, #6ab4ff, #4ea0ed);
  min-height: 380px;
  border-bottom: 4px solid var(--gold-deep);
  overflow: hidden;
}
.hero-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(400px, 700px) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  min-height: 380px;
}

.hero-ship {
  justify-self: start;
  align-self: end;
  width: 100%;
  max-width: 340px;
  height: auto;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.4));
  margin-bottom: -20px;
}
.hero-wordmark {
  justify-self: center;
  width: 100%;
  max-width: 680px;
  height: auto;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.5));
}
.hero-party {
  justify-self: end;
  align-self: end;
  width: 100%;
  max-width: 320px;
  height: auto;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.5));
  margin-bottom: -20px;
}

@media (max-width: 1000px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-ship, .hero-party {
    max-width: 200px;
    justify-self: center;
    margin-bottom: 0;
  }
  .hero-wordmark { max-width: 560px; }
}

/* ============================================================ */
/*  Body — main white content panel                             */
/* ============================================================ */

main.container {
  flex: 1;
  padding-top: 24px;
  padding-bottom: 48px;
}

.body-panel {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--panel-border);
}

/* 3-column homepage layout */
.home-grid {
  display: grid;
  grid-template-columns: 260px 1fr 260px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 1200px) {
  .home-grid {
    grid-template-columns: 240px 1fr;
  }
  .side-right { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .home-grid { grid-template-columns: 1fr; }
  .side-left, .side-right { order: 2; }
  .main-col { order: 1; }
}

/* ============================================================ */
/*  Section panels — gold-on-blue header pattern                 */
/* ============================================================ */

.section {
  margin-bottom: 16px;
  background: var(--panel-soft);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.section:last-child { margin-bottom: 0; }

.section-header {
  background: linear-gradient(180deg, var(--blue-bright), var(--blue-deep));
  padding: 10px 16px;
  border-bottom: 3px solid var(--gold-deep);
  position: relative;
}
.section-header h2,
.section-header h3 {
  margin: 0;
  color: var(--gold-bright);
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.section-body {
  padding: 14px 16px;
}

/* ============================================================ */
/*  Slider (rotating featured content)                            */
/* ============================================================ */

.slider {
  position: relative;
  background: var(--bg-darker);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--panel-border);
  aspect-ratio: 12 / 5;
  box-shadow: var(--shadow-sm);
}
.slider-track { position: absolute; inset: 0; }
.slider-slide {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  display: flex; align-items: flex-end;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.slider-slide.is-active { opacity: 1; }
.slider-caption {
  width: 100%;
  background: linear-gradient(0deg, rgba(14, 34, 64, 0.85), transparent);
  padding: 18px 22px;
  color: var(--fg-light);
}
.slider-caption-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}
.slider-dots {
  position: absolute;
  bottom: 8px; right: 14px;
  display: flex; gap: 6px;
  z-index: 2;
}
.slider-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: background 0.15s;
}
.slider-dot.is-active { background: var(--gold); }

/* ============================================================ */
/*  Sidebar action buttons (Download/Register/Forum/Game Guides)*/
/* ============================================================ */

.action-buttons { display: grid; gap: 10px; }
.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: var(--bg-darker);
  border: 2px solid var(--gold-deep);
  border-radius: var(--radius);
  font-weight: 800;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.08s ease, box-shadow 0.15s, filter 0.15s;
}
.action-btn:hover {
  filter: brightness(1.08);
  color: var(--bg-darker);
  text-decoration: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.action-btn:active { transform: translateY(1px); }

.action-btn.action-btn-secondary {
  background: linear-gradient(180deg, var(--blue-bright), var(--blue));
  color: var(--fg-light);
  border-color: var(--blue-deep);
}
.action-btn.action-btn-secondary:hover { color: var(--fg-light); }

/* ============================================================ */
/*  Login form (right sidebar)                                   */
/* ============================================================ */

.login-card .field { margin-bottom: 10px; }
.login-card .field label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--fg-soft);
  font-weight: 700;
  margin-bottom: 4px;
  display: block;
}
.login-card .field input {
  width: 100%;
  padding: 8px 10px;
  background: white;
  color: var(--fg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
}
.login-card .field input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(46, 134, 220, 0.15);
}
.login-card .login-greeting {
  text-align: center;
  padding: 16px 8px;
}
.login-card .login-greeting .greeting-name {
  font-weight: 700;
  color: var(--gold-deep);
  margin: 8px 0;
}
.login-foot {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--fg-muted);
  text-align: center;
}

/* ============================================================ */
/*  Server status                                                 */
/* ============================================================ */

.status-row {
  display: flex; flex-direction: column;
  gap: 6px;
}
.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: white;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.status-pill.up   { border-color: rgba(46, 168, 105, 0.4); }
.status-pill.down { border-color: rgba(210, 69, 69, 0.4); }

.status-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--fg-dim);
  flex: 0 0 9px;
}
.status-pill.up   .status-dot { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-pill.down .status-dot { background: var(--danger);  box-shadow: 0 0 6px var(--danger);  }

.status-name {
  font-weight: 600;
  flex: 1;
  color: var(--fg);
}
.status-state {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-pill.up   .status-state { color: var(--success); }
.status-pill.down .status-state { color: var(--danger); }

.status-foot {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--fg-muted);
  text-align: center;
}

/* ============================================================ */
/*  News feed (center column)                                    */
/* ============================================================ */

.news-list { display: grid; gap: 12px; }
.news-card {
  background: white;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  display: flex;
  overflow: hidden;
  transition: transform 0.12s, box-shadow 0.15s;
}
.news-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.news-thumb {
  flex: 0 0 160px;
  background: var(--panel-soft);
  background-size: cover;
  background-position: center;
  border-right: 1px solid var(--panel-border);
}
.news-body {
  padding: 12px 14px;
  flex: 1;
  min-width: 0;
}
.news-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  margin-bottom: 6px;
  color: var(--fg-muted);
}
.news-meta time { font-variant-numeric: tabular-nums; }
.news-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--fg);
}
.news-title a { color: var(--fg); }
.news-title a:hover { color: var(--blue-deep); text-decoration: none; }
.news-excerpt {
  margin: 0;
  font-size: 0.88rem;
  color: var(--fg-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--panel-soft);
  border: 1px solid var(--panel-border);
  color: var(--fg-muted);
}
.news-tag.tag-announcement {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold-deep);
}
.news-tag.tag-patch,
.news-tag.tag-update {
  background: rgba(46, 168, 105, 0.12);
  border-color: var(--success);
  color: var(--success);
}
.news-tag.tag-event {
  background: rgba(46, 134, 220, 0.12);
  border-color: var(--blue);
  color: var(--blue-deep);
}
.news-tag.tag-news {
  background: var(--panel-soft);
  border-color: var(--fg-dim);
  color: var(--fg-soft);
}
.news-tag.tag-maintenance {
  background: rgba(244, 184, 48, 0.18);
  border-color: var(--gold-deep);
  color: var(--gold-deep);
}
.news-tag.tag-maintenance-unscheduled {
  background: rgba(210, 69, 69, 0.15);
  border-color: var(--danger);
  color: var(--danger);
}
.news-tag.tag-new {
  background: rgba(200, 120, 220, 0.15);
  border-color: #b35fc5;
  color: #92419f;
}

/* ============================================================ */
/*  Compact news list (used in Updates / Events sidebar panels) */
/* ============================================================ */

.mini-news { display: grid; gap: 8px; }
.mini-news-item {
  background: white;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 0.85rem;
}
.mini-news-item .news-tag { font-size: 0.62rem; padding: 1px 7px; }
.mini-news-title {
  margin: 4px 0 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--fg);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mini-news-title a { color: var(--fg); }
.mini-news-title a:hover { color: var(--blue-deep); text-decoration: none; }
.mini-news-date {
  font-size: 0.72rem;
  color: var(--fg-muted);
}

/* ============================================================ */
/*  Top 10 / leaderboard                                         */
/* ============================================================ */

.leaderboard { display: grid; gap: 4px; }
.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: white;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  font-size: 0.88rem;
}
.lb-rank {
  flex: 0 0 24px;
  font-weight: 800;
  color: var(--gold-deep);
  text-align: center;
}
.lb-name {
  flex: 1;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lb-stat {
  flex: 0 0 auto;
  font-size: 0.78rem;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}

/* ============================================================ */
/*  Vote / Community links                                        */
/* ============================================================ */

.vote-links { display: grid; gap: 6px; }
.vote-link {
  display: block;
  padding: 8px 12px;
  background: white;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  text-align: center;
  font-weight: 600;
  font-size: 0.88rem;
  transition: background 0.15s, border-color 0.15s;
}
.vote-link:hover {
  background: var(--gold-soft);
  border-color: var(--gold);
  text-decoration: none;
}
.vote-link small {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--fg-muted);
  margin-top: 2px;
}

.discord-block {
  text-align: center;
  padding: 4px;
}
.discord-block p {
  margin: 6px 0 12px;
  font-size: 0.88rem;
  color: var(--fg-soft);
}
.discord-btn {
  display: inline-block;
  padding: 12px 20px;
  background: #5865f2; /* discord brand color */
  color: white;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: 2px solid #4752c4;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  transition: transform 0.08s, background 0.15s;
}
.discord-btn:hover {
  background: #4752c4;
  color: white;
  text-decoration: none;
}
.discord-btn:active { transform: translateY(1px); }

/* ============================================================ */
/*  Gallery                                                       */
/* ============================================================ */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 600px) {
  .gallery-grid { grid-template-columns: 1fr; }
}
.gallery-item {
  display: block;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--gold-deep);
  aspect-ratio: 3 / 2;
  background: var(--panel-soft);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
}
.gallery-item:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow);
}
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(0deg, rgba(14, 34, 64, 0.9), transparent);
  color: white;
  padding: 16px 10px 6px;
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.15s;
}
.gallery-item:hover .gallery-caption { opacity: 1; }

/* ============================================================ */
/*  Generic cards / forms / buttons (inner pages)                */
/* ============================================================ */

.card {
  background: white;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.card h1 { margin-top: 0; color: var(--fg); }
.card h2 { color: var(--fg); }

.lede {
  color: var(--fg-soft);
  font-size: 1.05rem;
}
.caveat {
  color: var(--fg-muted);
  font-size: 0.9rem;
  font-style: italic;
  margin-top: 12px;
}

form { margin: 0; }
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 0.92rem;
  color: var(--fg);
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field textarea,
.field select {
  width: 100%;
  padding: 10px 12px;
  background: white;
  color: var(--fg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(46, 134, 220, 0.15);
}
.field small {
  display: block;
  color: var(--fg-muted);
  font-size: 0.85rem;
  margin-top: 4px;
}
.field-error {
  color: var(--danger);
  font-size: 0.9rem;
  margin-top: 6px;
}
.form-error {
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 0.95rem;
}
.field-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 8px;
}
.link-quiet { color: var(--fg-muted); font-size: 0.9rem; }

.btn {
  display: inline-block;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: filter 0.15s, transform 0.05s, box-shadow 0.15s;
  font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: var(--bg-darker);
  border-color: var(--gold-deep);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.4);
}
.btn-primary:hover { filter: brightness(1.08); color: var(--bg-darker); text-decoration: none; }

.btn-secondary {
  background: white;
  color: var(--fg);
  border-color: var(--panel-border);
}
.btn-secondary:hover {
  background: var(--panel-soft);
  color: var(--fg);
  text-decoration: none;
}
.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover { filter: brightness(1.05); }
.btn-lg { padding: 12px 26px; font-size: 1rem; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-block { display: block; width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }

/* ============================================================ */
/*  Flash messages                                                */
/* ============================================================ */

.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  border: 1px solid;
  font-weight: 600;
}
.flash-success { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.flash-error   { background: var(--danger-bg);  border-color: var(--danger);  color: var(--danger);  }

/* ============================================================ */
/*  Tables / KV (account dashboard etc.)                          */
/* ============================================================ */

table.kv {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 0;
}
table.kv th, table.kv td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--panel-border);
  vertical-align: top;
}
table.kv th {
  font-weight: 700;
  color: var(--fg-soft);
  width: 30%;
  white-space: nowrap;
}
table.kv tr:last-child th,
table.kv tr:last-child td { border-bottom: 0; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
  border: 1px solid;
}
.badge-ok    { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.badge-warn  { background: var(--danger-bg);  border-color: var(--danger);  color: var(--danger);  }

.card.notice {
  border-color: var(--danger);
  background: linear-gradient(180deg, var(--danger-bg) 0%, white 60%);
}
.card.notice h2 { color: var(--danger); margin-top: 0; }

.action-list {
  list-style: none; padding: 0; margin: 16px 0 0;
}
.action-list li {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--panel-border);
  flex-wrap: wrap;
}
.action-list li:last-child { border-bottom: 0; }
.action-list .btn { min-width: 180px; text-align: center; }
.action-list small {
  color: var(--fg-muted); font-size: 0.9rem;
  flex: 1; min-width: 200px;
}

/* ============================================================ */
/*  Donate page tiers                                            */
/* ============================================================ */

.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 20px 0;
}
.tier-card {
  background: white;
  border: 2px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
  position: relative;
  transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s;
}
.tier-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: var(--shadow);
}
.tier-card.tier-featured {
  border-color: var(--gold);
  background: linear-gradient(180deg, white 0%, var(--gold-soft) 100%);
}
.tier-card.tier-featured::before {
  content: 'Best value';
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: var(--bg-darker);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tier-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--fg);
  margin: 0 0 4px;
  line-height: 1;
}
.tier-points {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold-deep);
  margin: 8px 0;
}
.tier-bonus {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--gold-soft);
  color: var(--gold-deep);
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.tier-tagline {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin: 8px 0 14px;
}

/* ============================================================ */
/*  Footer                                                        */
/* ============================================================ */

.site-footer {
  background: var(--bg-dark);
  border-top: 3px solid var(--gold-deep);
  padding: 18px 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
  margin-top: 24px;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--gold-bright); }

/* ============================================================ */
/*  404 page                                                      */
/* ============================================================ */

.not-found {
  text-align: center;
  padding: 48px 24px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
.not-found-num {
  font-size: 5rem;
  font-weight: 800;
  color: var(--gold-deep);
  margin: 0;
  line-height: 1;
  letter-spacing: -2px;
  text-shadow: 0 4px 14px rgba(244, 184, 48, 0.3);
}
.not-found h1 { margin: 12px 0 16px; }
.not-found-actions {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  margin-top: 24px;
}

/* ============================================================ */
/*  Admin pages                                                   */
/* ============================================================ */

.admin-select,
.admin-textarea {
  width: 100%;
  padding: 10px 12px;
  background: white;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  color: var(--fg);
}
.admin-select:focus,
.admin-textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(46, 134, 220, 0.15);
}
.admin-textarea {
  resize: vertical;
  min-height: 220px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9rem;
}

.admin-post-list { display: grid; gap: 12px; }
.admin-post-row {
  background: white;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
}
.admin-post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--fg-muted);
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.admin-post-meta time { font-variant-numeric: tabular-nums; }
.admin-post-author { font-style: italic; }
.admin-post-id {
  margin-left: auto;
  color: var(--fg-dim);
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
}
.admin-post-title {
  margin: 4px 0 6px;
  font-size: 1.05rem;
  color: var(--fg);
}
.admin-post-excerpt {
  color: var(--fg-soft);
  margin: 0 0 10px;
  font-size: 0.9rem;
}
.admin-post-actions { display: flex; gap: 8px; }
.admin-post-actions form { margin: 0; }

/* ============================================================ */
/*  Misc utility                                                  */
/* ============================================================ */

code {
  background: var(--panel-soft);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  color: var(--gold-deep);
  border: 1px solid var(--panel-border);
}

.card ol, .card ul { line-height: 1.7; }
.card ol li, .card ul li { margin-bottom: 4px; }

/* ============================================================ */
/*  Mobile tweaks                                                 */
/* ============================================================ */

@media (max-width: 600px) {
  .topbar-inner { flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
  .brand-mark img { height: 36px; }
  .topnav { gap: 0; }
  .topnav-link { padding: 8px 10px; font-size: 0.78rem; letter-spacing: 0.5px; }

  .hero { min-height: 260px; }
  .hero-inner { padding: 16px; min-height: 260px; }

  .body-panel { padding: 12px; border-radius: var(--radius); }

  .news-card { flex-direction: column; }
  .news-thumb { flex: 0 0 140px; border-right: 0; border-bottom: 1px solid var(--panel-border); }

  table.kv th { width: 40%; }
  .action-list li { flex-direction: column; align-items: stretch; }

  .tier-grid { grid-template-columns: repeat(2, 1fr); }
}
