@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@700;900&family=Nunito+Sans:wght@400;600;700;800&display=swap");

:root {
  --bg: #e9f0ff;
  --panel: #ffffff;
  --panel-soft: #edf3ff;
  --line: #b7c7e3;
  --text: #092550;
  --muted: #35527b;
  --accent: #245cbd;
  --accent-strong: #0f3f8c;
  --gold: #f2bf45;
  --gold-deep: #cf9300;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Nunito Sans", "Segoe UI", "Trebuchet MS", Helvetica, Arial, sans-serif;
  background:
    radial-gradient(circle at top right, #dce9ff 0%, transparent 42%),
    radial-gradient(circle at bottom left, #dbe8ff 0%, transparent 40%),
    var(--bg);
  display: flex;
  flex-direction: column;
}

body[data-page="home"] {
  position: relative;
  background:
    radial-gradient(1400px 700px at -10% -20%, rgba(255, 225, 120, 0.56), transparent 62%),
    radial-gradient(1200px 560px at 110% -18%, rgba(44, 99, 201, 0.5), transparent 58%),
    linear-gradient(180deg, #f5f9ff, #dfe9ff 65%, #d4e2ff);
}

body[data-page="home"]::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.52) 0 2px, transparent 2px),
    radial-gradient(circle at 24px 24px, rgba(36, 92, 189, 0.08) 0 2px, transparent 2px);
  background-size: 48px 48px, 48px 48px;
  opacity: 0.45;
}

body[data-page="home"] .site-header,
body[data-page="home"] .page-main,
body[data-page="home"] .site-footer {
  position: relative;
  z-index: 1;
}

.shell {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(10, 38, 81, 0.18);
  backdrop-filter: blur(12px);
  background: rgba(240, 247, 255, 0.9);
}

.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
}

.site-title {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-size: 1.05rem;
}

body[data-page="home"] .site-title {
  font-family: "Cinzel", Georgia, "Times New Roman", serif;
  font-weight: 900;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  letter-spacing: 0.045em;
  color: #0b3170;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.72);
}

.site-nav {
  display: flex;
  justify-content: flex-end;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link {
  text-decoration: none;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-size: 0.94rem;
  transition: 120ms ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  border-color: var(--line);
  background: var(--panel);
}

.nav-link.active {
  background: linear-gradient(135deg, #174ca0, #0e3a7f);
  border-color: #0e3a7f;
  color: #f8fbff;
}

.future-menu {
  position: relative;
}

.future-menu > summary {
  list-style: none;
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #eef4ff);
  padding: 0.45rem 0.85rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-size: 0.94rem;
}

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

.future-list {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 220px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  box-shadow: 0 12px 36px rgba(8, 20, 36, 0.16);
  padding: 0.65rem;
}

.future-list p {
  margin: 0.3rem 0;
  font-size: 0.92rem;
}

.add-game-link {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--accent-strong);
  font-size: 0.9rem;
  text-decoration: none;
  font-weight: 600;
}

.page-main {
  width: min(1100px, 92vw);
  margin: 1.2rem auto 2.5rem;
}

.hero-card {
  border: 1px solid #c3d3ef;
  background:
    linear-gradient(125deg, rgba(16, 63, 145, 0.98), rgba(33, 86, 179, 0.94) 42%, rgba(238, 181, 43, 0.95));
  border-radius: 1.1rem;
  padding: 1.35rem;
  box-shadow:
    0 14px 40px rgba(14, 40, 85, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 248, 223, 0.95);
  font-size: 0.76rem;
  font-weight: 700;
}

.hero-card h1 {
  margin: 0.3rem 0;
  font-size: clamp(1.8rem, 3.8vw, 2.8rem);
  font-family: "Cinzel", Georgia, serif;
  color: #fffef8;
  letter-spacing: 0.03em;
  text-shadow: 0 4px 18px rgba(5, 25, 58, 0.38);
}

.hero-copy {
  margin: 0;
  color: rgba(255, 255, 255, 0.93);
  max-width: 64ch;
  font-size: 1.01rem;
}

.card-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.game-card {
  border: 1px solid #c3d3ee;
  background: linear-gradient(180deg, #ffffff, #f2f7ff);
  border-radius: 1rem;
  padding: 1rem;
  display: grid;
  gap: 0.8rem;
  box-shadow: 0 10px 22px rgba(17, 52, 103, 0.12);
}

.game-card h2 {
  margin: 0;
  font-size: 1.15rem;
  color: #113f84;
}

.game-card p {
  margin: 0;
  color: #355a8f;
}

.card-link {
  width: fit-content;
  text-decoration: none;
  font-weight: 700;
  color: #f8fbff;
  background: linear-gradient(135deg, #245fbe, #103f8e);
  border-radius: 0.7rem;
  padding: 0.45rem 0.9rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

body[data-page="home"] .card-link {
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: 0 8px 18px rgba(8, 33, 75, 0.2);
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.page-panel {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(12, 28, 48, 0.1);
  overflow: hidden;
}

.page-head {
  border-bottom: 1px solid var(--line);
  padding: 1rem 1.2rem;
  background: var(--panel-soft);
}

.page-head h1 {
  margin: 0;
  font-size: 1.4rem;
}

.page-head p {
  margin: 0.3rem 0 0;
  color: var(--muted);
}

/* Time Arena */
.time-arena-page {
  background:
    radial-gradient(1000px 500px at 50% 0%, rgba(10, 10, 10, 0.5), transparent 60%),
    radial-gradient(1200px 700px at 50% 100%, rgba(0, 0, 0, 0.75), transparent 62%),
    url("../games/time-arena/assets/wall.jpg") center / cover fixed no-repeat;
  color: #f5eeff;
}

.time-arena-page .site-header {
  background: rgba(13, 10, 18, 0.85);
  border-bottom-color: rgba(231, 212, 255, 0.18);
}

.time-arena-page .site-title,
.time-arena-page .nav-link,
.time-arena-page .future-menu > summary {
  color: #f5eeff;
}

.time-arena-page .nav-link.active {
  color: #151023;
  background: #e8dcff;
  border-color: #e8dcff;
}

.time-arena-page .future-menu > summary {
  border-color: rgba(232, 220, 255, 0.35);
  background: rgba(15, 12, 22, 0.55);
}

.time-arena-page .future-list {
  background: rgba(14, 11, 20, 0.95);
  border-color: rgba(232, 220, 255, 0.3);
}

.time-arena-main {
  width: min(1100px, 92vw);
  margin: 1.4rem auto 2.6rem;
}

.time-arena-card {
  border: 1px solid rgba(233, 214, 255, 0.24);
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(16, 12, 24, 0.88), rgba(8, 6, 14, 0.88));
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.time-arena-head {
  padding: 1.2rem;
  border-bottom: 1px solid rgba(233, 214, 255, 0.2);
}

.time-arena-head h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.5rem, 3.1vw, 2.2rem);
}

.time-arena-head p {
  margin: 0.35rem 0 0;
  color: rgba(245, 238, 255, 0.77);
}

.time-arena-candles {
  width: min(380px, 72%);
  margin: 0.8rem auto 0.2rem;
  display: block;
}

.time-arena-core {
  padding: 1rem;
}

.time-arena-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
}

.status-chip {
  border: 1px solid rgba(223, 194, 255, 0.35);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  background: rgba(103, 51, 160, 0.24);
  color: #f8f2ff;
  font-size: 0.88rem;
}

.time-arena-timer {
  font-size: 0.95rem;
  color: rgba(245, 238, 255, 0.8);
}

.time-arena-messages {
  border: 1px solid rgba(233, 214, 255, 0.22);
  border-radius: 0.75rem;
  background: rgba(5, 3, 9, 0.62);
  min-height: 245px;
  max-height: 360px;
  overflow: auto;
  padding: 0.85rem;
  white-space: pre-wrap;
  line-height: 1.55;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.time-arena-hint {
  margin-top: 0.75rem;
  color: rgba(214, 185, 250, 0.92);
}

.time-arena-form {
  margin-top: 0.85rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.time-arena-input {
  flex: 1;
  min-width: 220px;
  border-radius: 0.7rem;
  border: 1px solid rgba(214, 185, 250, 0.45);
  background: rgba(0, 0, 0, 0.45);
  color: #f5eeff;
  padding: 0.7rem;
}

.time-arena-btn {
  border: 1px solid rgba(214, 185, 250, 0.5);
  border-radius: 0.7rem;
  background: linear-gradient(135deg, rgba(140, 80, 199, 0.45), rgba(102, 58, 146, 0.45));
  color: #fcf8ff;
  padding: 0.7rem 1rem;
  font-weight: 700;
  cursor: pointer;
}

.time-arena-btn--danger {
  border-color: rgba(250, 151, 151, 0.45);
  background: rgba(194, 63, 63, 0.42);
}

.time-arena-foot {
  border-top: 1px solid rgba(233, 214, 255, 0.2);
  padding: 0.9rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.time-arena-foot p {
  margin: 0;
  color: rgba(245, 238, 255, 0.66);
  font-size: 0.9rem;
}

.time-arena-page .site-footer {
  border-top-color: rgba(233, 214, 255, 0.18);
  background: rgba(5, 4, 9, 0.78);
}

.time-arena-page .footer-content {
  color: rgba(245, 238, 255, 0.7);
}

/* Presidents */
.presidents-page {
  background:
    linear-gradient(180deg, rgba(12, 39, 88, 0.18), rgba(178, 34, 52, 0.1)),
    repeating-linear-gradient(
      180deg,
      rgba(178, 34, 52, 0.08) 0,
      rgba(178, 34, 52, 0.08) 24px,
      rgba(255, 255, 255, 0.64) 24px,
      rgba(255, 255, 255, 0.64) 48px
    ),
    #f8f8f8;
}

.presidents-page .site-header {
  background: rgba(252, 252, 252, 0.9);
}

.presidents-main {
  width: min(980px, 92vw);
  margin: 1.3rem auto 2.5rem;
}

.presidents-card {
  border: 1px solid #c6cfde;
  border-radius: 1rem;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff, #f4f7fb);
  box-shadow: 0 16px 42px rgba(10, 29, 58, 0.12);
}

.presidents-head {
  position: relative;
  padding: 1.1rem 1.2rem;
  border-bottom: 1px solid #d9e1ef;
  background:
    radial-gradient(circle at 0.5rem 0.5rem, rgba(12, 39, 88, 0.14) 0 2px, transparent 2px),
    radial-gradient(circle at 1.4rem 1.4rem, rgba(12, 39, 88, 0.14) 0 2px, transparent 2px),
    linear-gradient(90deg, rgba(12, 39, 88, 0.06), rgba(178, 34, 52, 0.08));
  background-size: 22px 22px, 22px 22px, auto;
}

.presidents-head h1 {
  margin: 0;
  color: #102e5a;
  font-size: clamp(1.4rem, 2.8vw, 2rem);
}

.presidents-head p {
  margin: 0.35rem 0 0;
  color: #304f7d;
}

.presidents-core {
  padding: 1rem;
}

.presidents-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.presidents-chip {
  border: 1px solid #d4ddec;
  border-radius: 999px;
  padding: 0.32rem 0.7rem;
  background: #f8fbff;
  color: #1f4274;
  font-size: 0.87rem;
}

.presidents-question {
  margin: 0;
  font-size: 1.1rem;
  color: #122f58;
  font-weight: 700;
}

.presidents-subtext {
  margin: 0.35rem 0 0.9rem;
  color: #39577f;
}

.presidents-choices {
  display: grid;
  gap: 0.6rem;
}

.presidents-choice {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid #d3dcec;
  border-radius: 0.75rem;
  background: #fdfefe;
  padding: 0.65rem;
}

.presidents-choice label {
  cursor: pointer;
  color: #122f58;
}

.presidents-controls {
  margin-top: 0.9rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.presidents-btn {
  border-radius: 0.65rem;
  border: 1px solid #bfd0e8;
  background: #ffffff;
  color: #13396d;
  padding: 0.6rem 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.presidents-btn--primary {
  border-color: #1c4f94;
  background: linear-gradient(135deg, #1c4f94, #143f79);
  color: #ffffff;
}

.presidents-result {
  margin-top: 0.85rem;
  border: 1px solid #d6deeb;
  border-radius: 0.75rem;
  background: #f8fbff;
  padding: 0.75rem;
  color: #143f79;
}

.presidents-result:empty {
  display: none;
}

.presidents-foot {
  border-top: 1px solid #d7dfec;
  padding: 0.9rem 1rem;
  font-size: 0.9rem;
  color: #3d587c;
}

@media (max-width: 720px) {
  .shell,
  .page-main,
  .time-arena-main,
  .presidents-main {
    width: min(1120px, 95vw);
  }

  .site-header .shell {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.72rem 0;
    gap: 0.62rem;
  }

  .site-nav {
    width: 100%;
  }

  .nav-tabs {
    width: 100%;
    justify-content: flex-start;
    gap: 0.36rem;
  }

  .future-list {
    right: auto;
    left: 0;
  }

  .nav-link,
  .future-menu > summary {
    padding: 0.5rem 0.8rem;
    font-size: 0.88rem;
  }

  .hero-card {
    padding: 1rem;
  }

  .hero-card h1 {
    font-size: clamp(1.45rem, 8vw, 2rem);
  }

  .hero-copy {
    font-size: 0.94rem;
  }

  .time-arena-candles {
    width: min(320px, 82%);
  }

  .time-arena-status,
  .presidents-status {
    align-items: flex-start;
  }

  .footer-content {
    font-size: 0.84rem;
  }
}

@media (max-width: 520px) {
  .nav-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .nav-link,
  .future-menu > summary {
    width: 100%;
    justify-content: center;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 0.72rem;
  }
}
