/* ── Variables ─────────────────────────────────────────────── */
:root {
  /* Blue — buttons */
  --btn-gradient:         linear-gradient(180deg, #38bdf8 0%, #0ea5e9 100%);
  --btn-gradient-hover:   linear-gradient(180deg, #2cb3eb 0%, #0d95d8 100%);
  --btn-blue:             #0ea5e9;

  /* Green — play/action buttons */
  --btn-green-gradient:       linear-gradient(180deg, #4ade80 0%, #16a34a 100%);
  --btn-green-gradient-hover: linear-gradient(180deg, #22c55e 0%, #15803d 100%);

  /* Neutrals — dark theme */
  --bg:             #ededed;
  --surface:        #ffffff;
  --text:           #111111;
  --text-muted:     #555555;
  --border:         #d0d0d0;
  --border-subtle:  #e0e0e0;

  /* Semantic */
  --green:          #22c55e;
  --green-dark:     #16a34a;
  --red:            #ef4444;
  --red-bg:         rgba(239, 68, 68, 0.12);
  --red-border:     rgba(239, 68, 68, 0.3);

  /* Chrome */
  --nav-bg:     #212121;
  --footer-bg:  #212121;

  /* Sizes */
  --radius-sm:  5px;
  --radius:     8px;
  --radius-lg:  12px;
  --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow:     0 4px 16px rgba(0, 0, 0, 0.10);
  --shadow-md:  0 8px 32px rgba(0, 0, 0, 0.13);
  --nav-height: 54px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

/* ── Navbar ────────────────────────────────────────────────── */
.navbar {
  height: var(--nav-height);
  background: var(--nav-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.6rem;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 1rem;
}

.navbar-brand {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 1.7rem;
  color: #ffffff;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.02em;
  transition: opacity 0.15s;
}

.navbar-brand:hover { opacity: 0.8; }

.navbar-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 0.125rem;
}

.navbar-links a {
  padding: 0.25rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.01em;
}

.navbar-links a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.navbar-user-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.9rem 0.2rem 0.25rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #ffffff;
}

.navbar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--btn-gradient);
  flex-shrink: 0;
}

.btn-nav-login {
  padding: 0.3rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  color: var(--btn-blue);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  border: 1.5px solid rgba(14, 165, 233, 0.45);
  background: rgba(14, 165, 233, 0.08);
}

.btn-nav-login:hover {
  background: rgba(14, 165, 233, 0.15);
  border-color: var(--btn-blue);
}

.btn-nav-register {
  padding: 0.3rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  background: var(--btn-gradient);
  transition: background 0.15s, transform 0.1s;
}

.btn-nav-register:hover {
  background: var(--btn-gradient-hover);
  transform: translateY(-1px);
}

.navbar-links .btn-nav-create {
  padding: 0.3rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  background: var(--btn-gradient);
  transition: background 0.15s, transform 0.1s;
}

.navbar-links .btn-nav-create:hover {
  background: var(--btn-gradient-hover);
  color: #fff;
  transform: translateY(-1px);
}

.btn-nav-logout {
  padding: 0.25rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.btn-nav-logout:hover {
  border-color: #f87171;
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
}

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
  background: var(--footer-bg);
  color: #71717a;
  padding: 3rem 2rem 1.5rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-brand {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.6rem;
  color: #ffffff;
  font-weight: 700;
  margin-bottom: 0.6rem;
  letter-spacing: 0.02em;
}

.footer-tagline {
  font-size: 0.875rem;
  line-height: 1.75;
  max-width: 260px;
  margin: 0;
}

.footer-col h4 {
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 1rem;
}

.footer-col a {
  display: block;
  color: #71717a;
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  transition: color 0.15s;
  font-weight: 500;
}

.footer-col a:hover { color: var(--btn-blue); }

.footer-bottom {
  max-width: 1100px;
  margin: 1.5rem auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

/* ── World grid (shared: explore + create) ──────────────────── */
.world-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem 1rem;
}

.world-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.world-card:hover .world-thumb { opacity: 0.85; }
.world-card:hover .world-card-name { color: var(--btn-blue); }

.world-thumb {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 0.6rem;
  transition: opacity 0.15s;
}

.world-card:nth-child(6n+1) .world-thumb { background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%); }
.world-card:nth-child(6n+2) .world-thumb { background: linear-gradient(135deg, #fb923c 0%, #dc2626 100%); }
.world-card:nth-child(6n+3) .world-thumb { background: linear-gradient(135deg, #34d399 0%, #059669 100%); }
.world-card:nth-child(6n+4) .world-thumb { background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%); }
.world-card:nth-child(6n+5) .world-thumb { background: linear-gradient(135deg, #f472b6 0%, #be185d 100%); }
.world-card:nth-child(6n+0) .world-thumb { background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%); }

.world-thumb-letter {
  font-family: 'Fredoka', sans-serif;
  font-size: 3rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  user-select: none;
  line-height: 1;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.15);
}

.world-card-name {
  font-weight: 800;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  transition: color 0.15s;
  margin-bottom: 0.15rem;
}

/* ── Alert ─────────────────────────────────────────────────── */
.alert {
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.alert-error {
  background: var(--red-bg);
  color: var(--red);
  border: 1.5px solid var(--red-border);
}
