:root {
  color-scheme: light;
  --ink: #3b2a22;
  --ink-soft: #6a5044;
  --cream: rgba(255, 250, 244, 0.88);
  --line: rgba(255, 255, 255, 0.7);
  --accent: #c47a55;
  --accent-deep: #9a5538;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background: radial-gradient(circle at 30% 20%, #fff6e8, #f3d5b5 45%, #e8b89a 100%);
}

a { color: var(--accent-deep); }
a:hover { color: #6e321c; }

.wrap {
  width: min(1100px, calc(100% - 2rem));
  min-height: 640px;
  margin: 1.8rem auto 2.2rem;
  padding: 1.1rem;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr 1.6fr 0.9fr;
  grid-template-areas:
    "header header header"
    "marquee marquee marquee"
    "stats main nav"
    "updates updates updates"
    "foot foot foot";
  background: rgba(255, 250, 244, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 1.6rem;
  box-shadow: 0 18px 50px rgba(90, 50, 30, 0.12);
}

.floaty {
  background: var(--cream);
  border-radius: 1.1rem;
  border: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(90, 50, 30, 0.14);
}

.header {
  grid-area: header;
  text-align: center;
  padding: 1.4rem 1rem 1.1rem;
}

.header h1 {
  margin: 0;
  font-weight: normal;
  font-size: 2rem;
  letter-spacing: 0.02em;
}

.header p {
  margin: 0.35rem 0 0;
  opacity: 0.8;
}

.marquee-box {
  grid-area: marquee;
  padding: 0.35rem 0.6rem;
  overflow: hidden;
}

.marquee-box p {
  margin: 0;
  white-space: nowrap;
  animation: drift 18s linear infinite;
}

@keyframes drift {
  from { transform: translateX(100%); }
  to { transform: translateX(-100%); }
}

.stats { grid-area: stats; padding: 0.85rem 1rem; }
.main { grid-area: main; padding: 1.1rem 1.15rem 1.2rem; }
.nav { grid-area: nav; padding: 0.85rem 0.9rem 1rem; }
.updates { grid-area: updates; padding: 0.85rem 1rem 1rem; }
.foot {
  grid-area: foot;
  text-align: center;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  opacity: 0.8;
}

.box-title {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.main h2 {
  margin: 0 0 0.45rem;
  font-weight: normal;
  font-size: 1.25rem;
}

.main p, .updates p { margin: 0.35rem 0; line-height: 1.5; }

.nav-links, .stat-list, .update-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links li,
.stat-list li,
.update-list li {
  padding: 0.35rem 0;
  border-bottom: 1px dotted rgba(155, 105, 80, 0.35);
}

.nav-links li:last-child,
.stat-list li:last-child,
.update-list li:last-child { border-bottom: 0; }

.nav-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0.5rem 0.2rem;
  border-radius: 0.35rem;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 250, 244, 0.15) 0 2px,
    rgba(155, 105, 80, 0.10) 2px 3px
  );
}

.nav-links a:hover {
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 236, 220, 0.55) 0 2px,
    rgba(155, 105, 80, 0.14) 2px 3px
  );
}

.stat-list li { display: flex; justify-content: space-between; gap: 0.6rem; }
.stat-list span { opacity: 0.75; }

.update-list time {
  display: block;
  font-size: 0.8rem;
  opacity: 0.65;
}

.bit { margin-top: 0.9rem; opacity: 0.7; font-size: 0.95rem; }

.admin-shell {
  width: min(520px, calc(100% - 2rem));
  margin: 12vh auto;
  padding: 1.4rem 1.3rem 1.3rem;
}

.admin-shell h1 { margin: 0 0 0.4rem; font-weight: normal; font-size: 1.6rem; }
.admin-shell p { margin: 0.35rem 0 0.9rem; line-height: 1.45; }

label { display: block; font-size: 0.9rem; margin-bottom: 0.35rem; }

input[type="password"] {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(155, 105, 80, 0.35);
  background: #fffaf6;
  color: var(--ink);
  font: inherit;
}

button, .btn {
  appearance: none;
  border: 0;
  background: var(--accent);
  color: #fffaf6;
  font: inherit;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

button:hover, .btn:hover { background: var(--accent-deep); }

.row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.err { color: #9a2f2f; min-height: 1.2em; }
.locked {
  text-align: center;
  padding: 2rem 1rem;
}

.page-list { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.page-list li {
  padding: 0.55rem 0;
  border-bottom: 1px dotted rgba(155, 105, 80, 0.35);
}
.page-list small { display: block; opacity: 0.65; }

@media (max-width: 760px) {
  .wrap {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "marquee"
      "main"
      "nav"
      "stats"
      "updates"
      "foot";
  }
}
