/* ===== Global layout ===== */

:root {
  --bg: #020617;
  --bg-soft: #0b1120;
  --bg-card: #020617;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.15);
  --text: #e5e7eb;
  --muted: #9ca3af;
  --radius: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #1f2937, #020617 55%, #000);
  color: var(--text);
}

body {
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.wrapper {
  width: min(1100px, 100%);
  margin: 0.8rem;
  min-height: calc(100vh - 1.6rem);
  background: linear-gradient(135deg, #020617, #020617, #0b1120);
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.9);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== Header & nav ===== */

header {
  padding: 1rem 1.5rem 0.6rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  background: radial-gradient(circle at top left, #020617, #020617 60%, #000);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

header h1 {
  font-size: 1.35rem;
  margin: 0;
}

.header-sub {
  font-size: 0.85rem;
  color: var(--muted);
}

.badge {
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

nav {
  margin-top: 0.7rem;
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

nav a {
  text-decoration: none;
  font-size: 0.8rem;
  padding: 0.38rem 0.9rem;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  transition: all 0.16s ease-out;
}

nav a:hover {
  background: #020617;
  border-color: rgba(148, 163, 184, 0.7);
  color: var(--text);
}

nav a.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #e0f2fe;
}

/* ===== Main ===== */

main {
  flex: 1;
  padding: 1.3rem 1.5rem 1.4rem;
  overflow-y: auto;
}

.page-header {
  margin-bottom: 1.1rem;
}

.page-header h2 {
  margin: 0 0 0.3rem;
  font-size: 1.3rem;
}

.page-header p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ===== Cards / grids ===== */

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

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 0.9rem 1rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.9);
}

.card h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.card p,
.card li {
  font-size: 0.86rem;
  color: var(--muted);
}

.card-link {
  text-decoration: none;
  color: inherit;
  position: relative;
  cursor: pointer;
}

.card-link::after {
  content: "➜";
  position: absolute;
  right: 0.7rem;
  bottom: 0.7rem;
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.9);
  transition: transform 0.16s ease-out;
}

.card-link:hover::after {
  transform: translateX(3px);
}

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

/* Info grid */

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

/* Toolbars & buttons */

.toolbar {
  margin-bottom: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.toolbar select {
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: #020617;
  color: var(--text);
}

.btn {
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: #e0f2fe;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.16s ease-out;
}

.btn:hover {
  background: var(--accent);
  color: #020617;
}

/* Progress bar (home) */

.progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #020617;
  overflow: hidden;
  margin-top: 0.4rem;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #22c55e, #38bdf8);
  transition: width 0.4s ease-out;
}

/* Quiz */

.quiz-question {
  margin-bottom: 0.7rem;
  font-size: 0.88rem;
}

.quiz-option {
  display: block;
  font-size: 0.85rem;
  margin: 0.2rem 0;
}

.quiz-result {
  margin-top: 0.7rem;
  font-size: 0.9rem;
  color: var(--accent);
}

/* Team */

.team-card {
  cursor: pointer;
}

.team-photo {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.8rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.team-role {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.team-extra {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
  display: none;
}

/* Media */

.media-photo {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.8rem;
  display: block;
}

/* Footer */

footer {
  padding: 0.6rem 1.5rem 0.7rem;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
  background: #020617;
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Responsive */

@media (max-width: 768px) {
  .wrapper {
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
  }

  main {
    padding-inline: 1rem;
  }

  nav ul {
    overflow-x: auto;
  }
}


/* ===== Live space background canvas ===== */

#space-bg{
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

.wrapper{
  position: relative;
  z-index: 1;
  backdrop-filter: blur(6px);
}

.wrapper::before{
  content:"";
  position:absolute;
  inset:-1px;
  border-radius: 22px;
  background: radial-gradient(circle at 20% 10%, rgba(56,189,248,0.12), transparent 40%),
              radial-gradient(circle at 80% 30%, rgba(139,92,246,0.10), transparent 45%);
  pointer-events:none;
  z-index:-1;
}


/* ===== Arcade game styles ===== */

.card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
}

.muted{ color: var(--muted); margin:0.25rem 0 0; font-size:0.85rem; }

.pill{
  font-size:0.75rem;
  padding:0.35rem 0.65rem;
  border-radius:999px;
  border:1px solid rgba(148,163,184,0.35);
  background: rgba(2,6,23,0.6);
  color: rgba(229,231,235,0.9);
  white-space:nowrap;
}

.arcade{
  margin-top: 0.9rem;
  display:flex;
  flex-direction:column;
  gap:0.8rem;
}

#arcade{
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,0.22);
  background: rgba(2,6,23,0.45);
  box-shadow: inset 0 0 0 1px rgba(56,189,248,0.06), 0 14px 34px rgba(0,0,0,0.35);
  touch-action: none;
}

.arcade-ui{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:0.6rem;
}

.stat{
  border:1px solid rgba(148,163,184,0.22);
  border-radius: 16px;
  padding:0.55rem 0.7rem;
  background: rgba(2,6,23,0.45);
}

.stat .label{
  display:block;
  font-size:0.72rem;
  letter-spacing:0.08em;
  text-transform:uppercase;
  color: rgba(156,163,175,0.95);
}

.stat .value{
  display:block;
  margin-top:0.15rem;
  font-size:1.1rem;
  font-weight:700;
  color: rgba(224,242,254,0.95);
}

.arcade-controls{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:0.7rem;
}

.btn-ghost{
  background: rgba(2,6,23,0.35);
}

.btn.is-down{
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 0 26px rgba(56,189,248,0.22);
}

.hint{
  margin:0.2rem 0 0;
  color: rgba(156,163,175,0.95);
  font-size:0.85rem;
}

@media (max-width: 620px){
  .arcade-ui{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  nav ul{ gap:0.3rem; }
  nav a{ padding:0.35rem 0.7rem; }
}
