/* =========================================================
   Befuddlebug — Professional Game Studio Theme
   ========================================================= */

:root {
  --bg: #0b1020;
  --bg-elev: #11172a;
  --brand: #8b5cf6;
  --accent: #22d3ee;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --border: #233045;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
}

/* =========================================================
   Base Styles
   ========================================================= */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  opacity: .9;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* =========================================================
   Top Utility Bar
   ========================================================= */

.topbar {
  background: linear-gradient(90deg, rgba(139,92,246,0.2), rgba(34,211,238,0.15));
  border-bottom: 1px solid var(--border);
  font-size: .95rem;
}

.topbar .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
}

.brand {
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--text);
}

.brand span {
  color: var(--brand);
}

.auth a {
  margin-left: 18px;
  color: var(--text);
  opacity: .85;
}

.auth a.btn {
  background: var(--brand);
  padding: 8px 14px;
  border-radius: 10px;
}

/* =========================================================
   Primary Navigation
   ========================================================= */

.navbar {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.navbar .row {
  display: flex;
  align-items: center;
  height: 64px;
}

.navbar nav a {
  margin-right: 26px;
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--text);
  font-weight: 600;
  opacity: .9;
}

.navbar nav a.active,
.navbar nav a:hover {
  background: rgba(139,92,246,.15);
  outline: 1px solid rgba(139,92,246,.35);
}

/* =========================================
   NEW HERO SLIDESHOW (works 100%)
   ========================================= */
.hero-slideshow {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #0e1428;
  margin: 24px 0;
  height: 420px;
  box-shadow: var(--shadow);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .7s ease;
}

.hero-slide.active {
  opacity: 1;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Navigation buttons */
.hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.35);
  border: 1px solid var(--border);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  z-index: 5;
}
.hero-nav.prev { left: 12px; }
.hero-nav.next { right: 12px; }

/* Dots */
.hero-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 5;
}

.hero-dots div {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: rgba(255,255,255,0.3);
  border: 1px solid rgba(255,255,255,0.5);
  cursor: pointer;
}

.hero-dots div.active {
  background: var(--brand);
}

/* =========================================================
   Hero Slideshow
   ========================================================= */

#content {
  min-height: 60vh;
}

.slideshow {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #0e1428;
  box-shadow: var(--shadow);
  margin: 0px 0;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .8s ease;
}

.slide.active {
  opacity: 1;
}

.slideshow img {
  width: 100%;
  height: 520px;
  object-fit: cover;
  display: block;
}

.slideshow .navbtn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.35);
  border: 1px solid var(--border);
  backdrop-filter: blur(6px);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
}

.slideshow .prev { left: 12px; }
.slideshow .next { right: 12px; }

.dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.35);
  border: 1px solid rgba(255,255,255,.5);
  cursor: pointer;
}

.dot.active {
  background: var(--brand);
}

/* =========================================================
   Generic Sections
   ========================================================= */

.section {
  margin: 0px 0;
  padding: 18px;
}

.section h2 {
  margin: 0 0 12px;
  font-size: 2rem;
  letter-spacing: .3px;
}

.lede {
  color: var(--muted);
  max-width: 70ch;
}

/* =========================================================
   Gallery
   ========================================================= */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px,1fr));
  gap: 18px;
  margin: 24px 0;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.card .body {
  padding: 14px;
}

.card h3 {
  margin: 6px 0 8px;
  font-size: 1.2rem;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.card .actions {
  margin-top: auto;
  padding: 14px;
  display: flex;
  justify-content: flex-end;
}

/* =========================================================
   Modal
   ========================================================= */

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3,6,14,.75);
  z-index: 100;
}

.modal.open {
  display: flex;
}

.modal .panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 18px;
  max-width: 960px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow);
}

.modal header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.modal header h3 {
  margin: 0;
}

.modal .content {
  padding: 0px 0px;
}

.modal .close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}

/* =========================================================
   Mini-Slideshow in Modal
   ========================================================= */

.mini-show {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #0e1428;
  margin: 10px 0 16px;
}

.mini-show img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  transition: transform .25s ease;
}

.mini-show img.zoomed {
  transform: scale(1.7);
  cursor: zoom-out;
}

.mini-show .prev,
.mini-show .next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.35);
  border: 1px solid var(--border);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
}

.mini-show .prev { left: 10px; }
.mini-show .next { right: 10px; }

/* =========================================================
   Contact Form
   ========================================================= */

.formwrap {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  max-width: 760px;
  margin: 20px auto;
}

.formrow {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.input {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin: 8px 0;
}

label {
  font-weight: 600;
  margin-bottom: 6px;
}

input,
textarea {
  background: #0f162c;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
}

textarea {
  min-height: 160px;
  resize: vertical;
}

button.primary {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  border: 0;
  color: #0b1020;
  font-weight: 800;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
}

button.primary:hover {
  filter: saturate(1.05);
}

/* =========================================================
   Footer
   ========================================================= */

footer {
  margin-top: 32px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,.2);
}

.footergrid {
  display: grid;
  grid-template-columns: 160px 1fr 1fr;
  gap: 12px;
  align-items: center;
}

.footergrid img {
  width: 140px;
  height: 60px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.footergrid .legal {
  text-align: center;
  color: var(--muted);
}

.footergrid .links {
  justify-self: end;
}

.footergrid .links a {
  margin-left: 18px;
  color: var(--muted);
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 720px) {
  .navbar .row { height: 56px; }
  .slideshow img { height: 360px; }
  .footergrid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footergrid .links {
    justify-self: center;
  }
}

/* =========================================================
   Void Invaders UI Styles
   ========================================================= */

#invaders-root {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.invaders-header {
  margin-bottom: 4px;
}

.invaders-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.invaders-title-row h3 {
  margin: 0;
  font-size: 1.2rem;
}

.invaders-hint {
  margin: 0;
  font-size: .85rem;
  color: var(--muted);
}

.invaders-main {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: radial-gradient(circle at top, #020617 0%, #020617 60%);
}

#invaders-canvas {
  display: block;
  width: 100%;
  height: auto;
}

.invaders-hud {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: .9rem;
  color: var(--muted);
}

.invaders-message {
  margin-top: 6px;
  font-size: .9rem;
  color: var(--text);
}

@media (max-width: 600px) {
  .invaders-title-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
