@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* Root Theme Variables */
:root {
  --primary: #162033;
  --secondary: #c9982b;
  --background: #e8edf3;
  --card: #ffffff;
  --surface: #f7f9fc;
  --surface-border: #d7dee8;
  --text: #1f2937;
  --text-muted: #5b6678;
  --text-subtle: #334155;
  --focus-ring: #1d4ed8;
  --focus-ring-offset: #ffffff;
  --site-header-height: 72px;
  --chat-collapsed-peek: 46px;
}

/* Global Reset and Box Sizing */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: auto;
  min-height: 100vh;
  font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
  background-color: var(--background) !important;
  color: var(--text);
  background-image:
    radial-gradient(circle at 8% 12%, rgba(22, 32, 51, 0.12) 0%, transparent 38%),
    radial-gradient(circle at 92% 88%, rgba(201, 152, 43, 0.12) 0%, transparent 36%),
    linear-gradient(180deg, #edf1f7 0%, #e4eaf2 100%);
  line-height: 1.5;
  letter-spacing: 0.01em;
}

html.mobile-gameplay-active,
body.mobile-gameplay-active {
  overflow: hidden !important;
  overscroll-behavior: none;
  touch-action: none;
}

html.sza-gameplay-locked,
body.sza-gameplay-locked {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.sza-gameplay-controls {
  display: flex;
  gap: 0.55rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin: 0.65rem auto 0.45rem;
}

.sza-gameplay-controls .sza-gameplay-btn {
  min-width: 104px;
}

.sza-mini-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin: 0 auto 0.75rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(186, 230, 253, 0.22);
  border-radius: 0.65rem;
  background: rgba(2, 6, 23, 0.72);
  color: #f8fafc;
  font-size: 0.84rem;
  max-width: min(680px, 96%);
}

.sza-mini-score {
  font-weight: 700;
  color: #bfdbfe;
}

.sza-mini-status {
  color: #fef08a;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--focus-ring-offset);
}

.sza-mobile-gamepad {
  position: fixed;
  left: max(0.65rem, env(safe-area-inset-left));
  bottom: calc(0.75rem + env(safe-area-inset-bottom));
  z-index: 1400;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.32rem;
  width: min(220px, calc(100vw - 1.3rem));
  padding: 0.5rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(30, 58, 138, 0.25);
  background: rgba(15, 23, 42, 0.64);
  backdrop-filter: blur(6px);
}

.sza-mobile-gamepad button {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 0.56rem 0;
  min-height: 2.4rem;
  touch-action: none;
}

.sza-mobile-lock-status {
  position: fixed;
  right: max(0.65rem, env(safe-area-inset-right));
  bottom: calc(0.75rem + env(safe-area-inset-bottom));
  z-index: 1401;
  border: 1px solid rgba(30, 58, 138, 0.3);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.68);
  color: #e2e8f0;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.46rem 0.7rem;
  backdrop-filter: blur(6px);
  min-height: 2.2rem;
  touch-action: none;
}

.sza-mobile-lock-status.is-locked {
  color: #bbf7d0;
  border-color: rgba(22, 163, 74, 0.55);
}

.sza-mobile-gamepad button:focus-visible,
.sza-mobile-lock-status:focus-visible {
  outline: 2px solid #bfdbfe;
  outline-offset: 2px;
}

body.mobile-gameplay-active #gameContainer,
body.mobile-gameplay-active .game-wrapper {
  padding-bottom: clamp(6.5rem, 18vh, 9.5rem);
}

/* Layout Wrappers */
.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

.main-content {
  flex-grow: 1;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0.9rem 1.1rem 2.6rem calc(1.1rem + var(--chat-collapsed-peek) + 10px);
  overflow: visible;
  height: auto;
}

#spa-view {
  display: block;
  width: 100%;
  min-height: 100vh;
  overflow: visible;
}

/* Header Styles */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 999;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.68rem 1rem;
  background: rgba(22, 32, 51, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  backdrop-filter: blur(10px);
  font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  pointer-events: auto;
}

body.has-site-header {
  padding-top: var(--site-header-height);
}

.site-header-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.site-header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.site-logo-link {
  display: inline-flex;
  align-items: center;
}

.site-logo {
  height: 42px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  transition: transform 0.3s ease-in-out;
}

.site-logo:hover {
  transform: scale(1.05);
}

.header-quick-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
}

.header-nav-link {
  color: #e5edf8;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.38rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
}

.header-nav-link:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
}

.header-nav-link.active {
  color: #ffffff;
  background: rgba(201, 152, 43, 0.24);
  border-color: rgba(201, 152, 43, 0.5);
}

.site-user-info {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.site-auth-link {
  color: #f8fafc;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.9rem;
}

.site-auth-link:hover {
  text-decoration: underline;
}

.site-auth-sep {
  color: rgba(248, 250, 252, 0.6);
}

.user-dropdown {
  position: relative;
}

.dropdown-toggle {
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 0.6rem;
  padding: 0.45rem 0.7rem;
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.dropdown-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  min-width: 220px;
  background: #ffffff;
  border: 1px solid #d4dbe8;
  border-radius: 0.72rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.2);
  padding: 0.35rem;
  z-index: 1200;
  display: none;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  width: 100%;
  display: block;
  border: 0;
  background: transparent;
  color: #111827;
  padding: 0.48rem 0.56rem;
  border-radius: 0.5rem;
  text-align: left;
  text-decoration: none;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.dropdown-item:hover {
  background: #eef2f8;
}

.dropdown-item.static {
  cursor: default;
  font-weight: 700;
  color: #334155;
}

.dropdown-item.static:hover {
  background: transparent;
}

.auth-header {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1001;
  display: flex;
  gap: 0.5rem;
}

.auth-btn {
  background: linear-gradient(180deg, #f3d590 0%, #d6a847 100%);
  border: 1px solid #a77a20;
  padding: 0.52rem 1rem;
  border-radius: 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #2a2f3a;
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
  transition: background-color 0.3s ease, transform 0.2s ease;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.auth-btn:hover {
  background: linear-gradient(180deg, #f7ddb0 0%, #e0b45c 100%);
  color: #111827;
  transform: translateY(-1px);
}

/* Home Page Styling */
#homeBanner {
  width: min(1200px, 100%);
  min-height: 118px;
  margin: 0.8rem auto 1rem;
  padding: 0.9rem;
  background: linear-gradient(120deg, rgba(22, 32, 51, 0.9) 0%, rgba(45, 63, 95, 0.88) 60%, rgba(62, 88, 129, 0.8) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  box-sizing: border-box;
  position: relative;
  z-index: 10;
  box-shadow: 0 16px 34px rgba(8, 15, 30, 0.24);
}

#homeBanner .home-banner-logo-link {
  position: absolute;
  inset: 0;
  display: block;
  z-index: 0;
  overflow: hidden;
  border-radius: 1rem;
}

#homeBanner .home-banner-logo-link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(15, 23, 42, 0.12) 0%, rgba(30, 41, 59, 0.08) 100%);
  pointer-events: none;
  z-index: 1;
}

#homeBanner .home-banner-logo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

#homeBanner .banner-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover; /* full width without stretching */
}

#homeBanner .banner-overlay-buttons {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  display: flex;
  gap: 0.65rem;
}

@media (max-width: 760px) {
  #homeBanner {
    min-height: 104px;
  }
}

#homeBanner .banner-overlay-buttons button {
  padding: 0.5rem 1rem;
  background-color: #fff;
  border: none;
  border-radius: 1rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}


.home-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  display: block;
  pointer-events: none;
}

.home-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 100vh;
  padding: 2rem;
  box-sizing: border-box;
}

.home-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 1300px; /* or slightly larger than 8-column grid */
  margin: 0 auto;
  box-sizing: border-box;
}

.home-header {
  text-align: center;
  max-width: 1240px;
  margin: 0 auto 0.95rem;
  padding: 1rem 1rem 1.05rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--surface-border);
  border-radius: 1rem;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.08);
  backdrop-filter: blur(4px);
}

.home-layout {
  width: min(1360px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 0.85rem;
  align-items: start;
}

.home-main-col {
  min-width: 0;
}

.home-side-rail {
  position: sticky;
  top: calc(var(--site-header-height) + 12px);
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
}

.home-rail-card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #d7dee8;
  border-radius: 0.8rem;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.1);
  padding: 0.68rem;
}

.home-rail-card h4 {
  margin: 0 0 0.45rem;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1f2937;
}

.home-rail-list {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.home-rail-item {
  display: block;
  text-decoration: none;
  background: #f8fafc;
  color: #1f2937;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.45rem 0.5rem;
  font-size: 0.8rem;
  line-height: 1.25;
}

.home-rail-item:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
}

.home-rail-item-meta {
  display: block;
  margin-top: 0.15rem;
  color: var(--text-subtle);
  font-size: 0.72rem;
}


.home-page h2 {
  font-size: clamp(1.9rem, 3.2vw, 2.35rem);
  color: #0f172a;
  margin-bottom: 0.4rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-shadow: none;
}


.home-page p {
  font-style: normal;
  color: var(--text-muted);
  margin-bottom: 1.4rem;
  font-size: 0.97rem;
}

/* Buttons & Navigation */
.nav-button {
  display: block;
  background: linear-gradient(180deg, #ffffff 0%, #f4f7fb 100%);
  border: 1px solid #d8e0eb;
  padding: 0.74rem 1rem;
  border-radius: 0.75rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  color: #1f2937;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
  line-height: 1.3;
}

.nav-button:hover {
  background: linear-gradient(180deg, #ffffff 0%, #edf3fa 100%);
  color: #0f172a;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.13);
}

/* Game Container & Layout */
#spa-view {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  flex-grow: 1;
  overflow: visible;
  height: auto;
}

#gameContainer,
.game-wrapper {
  width: min(100%, 1360px);
  max-width: 1360px;
  margin: 0 auto;
  padding: 1rem 1rem 1.3rem;
  flex-grow: 1;
  overflow: visible;
  height: auto;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.72rem;
  width: 100%;
  max-width: 1220px;
  justify-content: center;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 0.35rem;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 0.42rem;
  flex-wrap: wrap;
  background: rgba(17, 24, 39, 0.96);
  padding: 0.48rem;
  border-top: 2px solid #2d3e60;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.85rem;
}

.main-nav-link {
  color: #f8fafc;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 0.52rem;
  padding: 0.42rem 0.54rem;
  border: 1px solid transparent;
}

.main-nav-link:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
}

.main-nav-link.active {
  color: #0f172a;
  background: linear-gradient(180deg, #f3d590 0%, #d6a847 100%);
  border-color: #a77a20;
}

.page-utility-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0 0 0.9rem;
}

.page-utility-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.78rem;
  border-radius: 999px;
  background: #1e3a8a;
  border: 1px solid #1d4ed8;
  color: #f8fafc;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.page-utility-link:hover {
  background: #1d4ed8;
}

.page-utility-link.active {
  background: linear-gradient(180deg, #f3d590 0%, #d6a847 100%);
  border-color: #a77a20;
  color: #0f172a;
}

/* Footer Login Sentence Styling (Theme-Matched) */
.login-footer {
  text-align: center;
  font-size: 0.8rem;
  color: #334155;
  margin-top: 1.3rem;
  margin-bottom: 1.1rem;
}

.login-footer a {
  color: #6b4f18;
  text-decoration: underline;
  font-weight: 600;
  transition: color 0.3s ease;
}

.login-footer a:hover {
  color: #1e293b;
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid rgba(15, 23, 42, 0.1);
  background: #f8fafc;
  color: #334155;
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.05);
}

.site-footer-inner {
  max-width: 1500px;
  margin: 0 auto;
  padding: 1.1rem 1.2rem 0.95rem;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(0, 2fr);
  gap: 1rem 1.3rem;
}

.site-footer-brand p {
  margin: 0.35rem 0 0;
  font-size: 0.86rem;
  line-height: 1.45;
}

.site-footer-brand-head {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: inherit;
}

.site-footer-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
  background: #0f172a;
}

.site-footer-logo-link {
  color: #0f172a;
  text-decoration: none;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.015em;
}

.site-footer-brand-head:hover .site-footer-logo-link,
.site-footer-logo-link:hover {
  text-decoration: underline;
}

.site-footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.site-footer-grid section h4 {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0f172a;
}

.site-footer-grid section a {
  display: block;
  color: #334155;
  text-decoration: none;
  font-size: 0.86rem;
  line-height: 1.6;
}

.site-footer-grid section a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.site-footer-bottom {
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  padding: 0.55rem 1.2rem 0.75rem;
  text-align: center;
  font-size: 0.76rem;
  color: #64748b;
}

.public-page-shell {
  max-width: 980px;
  margin: 1.2rem auto 1.8rem;
  padding: 0 1rem;
}

.public-page-card {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  padding: 1rem 1.1rem;
}

.public-page-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.public-page-top nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.public-page-top a {
  text-decoration: none;
}

.public-page-top .page-utility-link {
  font-size: 0.76rem;
}

.public-page-card h1 {
  margin: 0.1rem 0 0.5rem;
  font-size: 1.5rem;
}

.public-page-card h2 {
  margin-top: 1rem;
  margin-bottom: 0.35rem;
  font-size: 1rem;
}

.public-page-card p,
.public-page-card li {
  color: #334155;
  font-size: 0.92rem;
}

.public-page-card ul {
  margin-top: 0.35rem;
}

@media (max-width: 900px) {
  .site-footer-inner {
    grid-template-columns: 1fr;
  }

  .site-footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .site-footer-grid {
    grid-template-columns: 1fr;
  }

  .site-footer-inner {
    padding: 0.95rem 0.8rem 0.8rem;
  }

  .site-footer-bottom {
    padding-left: 0.8rem;
    padding-right: 0.8rem;
  }
}

.home-section-title {
  text-align: center;
  color: #1e293b;
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section-actions {
  text-align: center;
  margin-top: 0.8rem;
}

.section-create-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  color: #f8fafc;
  border-radius: 0.56rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid transparent;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
  transition: transform 0.18s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.section-create-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 12px 20px rgba(15, 23, 42, 0.2);
}

.create-opsint {
  background: linear-gradient(180deg, #0369a1 0%, #075985 100%);
  border-color: #0c4a6e;
}

.create-research {
  background: linear-gradient(180deg, #9a3412 0%, #7c2d12 100%);
  border-color: #6c2a12;
}

.create-livefeed {
  background: linear-gradient(180deg, #9f1239 0%, #881337 100%);
  border-color: #6b1031;
}

.create-game {
  background: linear-gradient(180deg, #059669 0%, #047857 100%);
  border-color: #065f46;
}

.create-marketing {
  background: linear-gradient(180deg, #7c3aed 0%, #6d28d9 100%);
  border-color: #5b21b6;
}

.create-community {
  background: linear-gradient(180deg, #4338ca 0%, #3730a3 100%);
  border-color: #312e81;
}

.tile {
  background-color: white;
  color: black;
  font-weight: bold;
  font-size: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100px;
  height: 100px;
  border: 2px solid #000;
  border-radius: 0.5rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  user-select: none;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.tile:hover {
  transform: scale(1.05);
}

.whack-grid {
  display: grid;
  grid-template-columns: repeat(3, 100px);
  grid-gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

.whack-hole {
  width: 100px;
  height: 100px;
  background-color: #333;
  border-radius: 50%;
  position: relative;
  box-shadow: inset 0 0 10px #000;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.whack-hole.active {
  background-color: #f44336; /* Red mole */
}

.cc-shell{
  /* Layout owned by commandCenter.js injected styles;
     only provide the full-viewport height here. */
  height: 100vh;
  box-sizing: border-box;
}

.cc-nav, .cc-rail{
  background: rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 14px;
}

.cc-main{
  background: rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 14px;
  display:flex;
  flex-direction: column;
}

.cc-header{
  display:flex;
  justify-content: space-between;
  align-items:center;
  margin-bottom: 12px;
}

.cc-title{
  font-size: 18px;
  font-weight: 700;
}

.cc-brand{
  font-weight: 800;
  margin-bottom: 12px;
}

.cc-navbtn{
  width: 100%;
  margin: 6px 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
}

.cc-navbtn:disabled{
  opacity: 0.5;
  cursor: not-allowed;
}

.cc-work{
  flex: 1;
  overflow:auto;
  padding-right: 4px;
}

.cc-card{
  background: rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
}

.cc-primary{
  padding: 10px 12px;
  border-radius: 12px;
  border: 0;
  font-weight: 700;
}

.cc-qa{
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 0;
}

.cc-navfoot{
  margin-top: 14px;
  opacity: 0.9;
  font-size: 14px;
}

/* ================================
   AI AGENT CHAT STYLES
   ================================ */

/* Agent message styling */
.agent-message {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
  border-left: 3px solid #6366f1;
  padding: 8px 12px;
  margin: 6px 0;
  border-radius: 0 8px 8px 0;
  position: relative;
}

.agent-message strong {
  color: #4f46e5;
}

/* Typing indicator */
.agent-typing {
  opacity: 0.7;
  animation: pulse 1.5s ease-in-out infinite;
}

.agent-typing em {
  color: #6366f1;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.9; }
}

/* Error state */
.agent-error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(220, 38, 38, 0.08) 100%);
  border-left-color: #ef4444;
}

.agent-error strong {
  color: #dc2626;
}

.agent-error em {
  color: #991b1b;
}

/* Human message styling (for contrast) */
#chatLog p:not(.agent-message) {
  padding: 6px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Chat log scrolling improvement */
#chatLog {
  scroll-behavior: smooth;
}

/* Agent trigger hint (optional - shows in input placeholder) */
#chatInput::placeholder {
  color: #6b7280;
}

#chatInput:focus::placeholder {
  color: #4b5563;
}

/* Shared utility */
.hidden {
  display: none !important;
}

/* Direct-message side drawer (global chat box) */
#chatBox.chat-container {
  position: fixed;
  top: calc(var(--site-header-height) + 12px);
  bottom: 16px;
  left: 0;
  z-index: 1100;
  width: min(360px, calc(100vw - 20px));
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-left: none;
  border-radius: 0 14px 14px 0;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  transition: transform 0.24s ease;
  overflow: hidden;
}

#chatBox.chat-container.expanded {
  transform: translateX(0);
}

#chatBox.chat-container.collapsed {
  transform: translateX(calc(-100% + 46px));
}

#chatBox .chat-header {
  background: #0f172a;
  color: #f8fafc;
  padding: 10px 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

#chatBox .chat-alert {
  color: #ef4444;
  font-size: 0.9rem;
  margin-left: auto;
}

#chatBox #toggleBtn {
  margin-left: 8px;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.18);
  color: #f8fafc;
  cursor: pointer;
  font-weight: 700;
}

#chatBox .chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  background: #f8fafc;
}

#chatBox #chatInput {
  border: none;
  border-top: 1px solid #e2e8f0;
  padding: 12px;
  font: inherit;
  outline: 2px solid transparent;
  outline-offset: -2px;
  background: #ffffff;
  color: #111827;
}

#chatBox #chatInput:focus-visible {
  border-top-color: #93c5fd;
  outline-color: var(--focus-ring);
}

#chatBox #toggleBtn:focus-visible {
  outline: 2px solid #bfdbfe;
  outline-offset: 2px;
}

#chatBox.collapsed .chat-body,
#chatBox.collapsed #chatInput {
  display: none;
}

@media (max-width: 760px) {
  #chatBox.chat-container {
    top: auto;
    bottom: 0;
    height: min(68vh, 420px);
    width: min(340px, calc(100vw - 12px));
  }
}

/* Agent badge (optional - can be added to group header) */
.agent-enabled-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 9999px;
  margin-left: 8px;
}

.agent-enabled-badge::before {
  content: "🤖";
  font-size: 0.875rem;
}

/* Default group badge */
.default-group-badge {
  display: inline-block;
  background: #065f46;
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
  text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
  html,
  body {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.community-program {
  background: linear-gradient(180deg, #5b4cf0 0%, #4a3ed4 100%) !important;
  border-color: #3f35af !important;
  color: #f8fafc !important;
}

.community-program:hover {
  background: linear-gradient(180deg, #6959f2 0%, #5347df 100%) !important;
}

.opsint-program {
  background: linear-gradient(180deg, #0f8cc4 0%, #0a6f9b 100%) !important;
  border-color: #095a7d !important;
  color: #f8fafc !important;
}

.opsint-program:hover {
  background: linear-gradient(180deg, #169ad3 0%, #0b77a4 100%) !important;
}

.opsint-program.community {
  background: linear-gradient(180deg, #0f766e 0%, #0e615b 100%) !important;
  border-color: #12584f !important;
}

.opsint-program.community:hover {
  background: linear-gradient(180deg, #13847b 0%, #106a63 100%) !important;
}

.research-program {
  background: linear-gradient(180deg, #b45309 0%, #92400e 100%) !important;
  border-color: #7a370d !important;
  color: #fff !important;
}

.research-program:hover {
  background: linear-gradient(180deg, #c25b09 0%, #9f470f 100%) !important;
}

.research-program.community {
  background: linear-gradient(180deg, #7c2d12 0%, #62240f 100%) !important;
  border-color: #4f1d0c !important;
}

.research-program.community:hover {
  background: linear-gradient(180deg, #8a3314 0%, #6d2a12 100%) !important;
}

.livefeed-program {
  background: linear-gradient(180deg, #be123c 0%, #9f1239 100%) !important;
  border-color: #7f1230 !important;
  color: #fff !important;
}

.livefeed-program:hover {
  background: linear-gradient(180deg, #cc1440 0%, #ab143e 100%) !important;
}

.livefeed-program.community {
  background: linear-gradient(180deg, #7f1d1d 0%, #681818 100%) !important;
  border-color: #591616 !important;
}

.livefeed-program.community:hover {
  background: linear-gradient(180deg, #8a2020 0%, #721a1a 100%) !important;
}

.marketing-program {
  background: linear-gradient(180deg, #7c3aed 0%, #6d28d9 100%) !important;
  border-color: #5b21b6 !important;
  color: #fff !important;
}

.marketing-program:hover {
  background: linear-gradient(180deg, #8b5cf6 0%, #7c3aed 100%) !important;
}

.marketing-program.community {
  background: linear-gradient(180deg, #5b21b6 0%, #4c1d95 100%) !important;
  border-color: #3b0f80 !important;
}

.marketing-program.community:hover {
  background: linear-gradient(180deg, #6527c4 0%, #5620a3 100%) !important;
}

@media (max-width: 860px) {
  :root {
    --site-header-height: 64px;
  }

  .site-header {
    padding: 0.6rem 0.75rem;
  }

  .site-logo {
    max-width: 160px;
    height: 36px;
  }

  .header-quick-nav {
    gap: 0.22rem;
  }

  .header-nav-link {
    font-size: 0.72rem;
    padding: 0.3rem 0.42rem;
  }

  .dropdown-toggle {
    max-width: 146px;
    font-size: 0.8rem;
  }

  .home-header {
    padding: 0.8rem;
  }

  .home-layout {
    grid-template-columns: 1fr;
  }

  .home-side-rail {
    position: static;
  }

  #homeBanner {
    min-height: 104px;
    margin-top: 0.7rem;
  }

  #homeBanner .banner-overlay-buttons {
    position: static;
    width: 100%;
    justify-content: flex-end;
  }

  .auth-btn {
    font-size: 0.8rem;
    padding: 0.45rem 0.85rem;
  }

  .grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.62rem;
  }
}

@media (max-width: 1200px) {
  .main-content {
    max-width: 100%;
    padding: 0.8rem 0.8rem 2rem calc(0.8rem + var(--chat-collapsed-peek) + 8px);
  }

  #gameContainer,
  .game-wrapper {
    width: 100%;
    max-width: 100%;
    padding: 0.8rem 0.8rem 1.1rem;
  }
}

@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  .main-content {
    padding: 0.65rem 0.45rem 1.25rem;
  }

  #gameContainer,
  .game-wrapper {
    padding: 0.65rem 0.45rem 1rem;
    border-radius: 0.8rem;
  }

  button,
  .nav-button,
  .header-nav-link,
  .sza-route-btn,
  input[type="button"],
  input[type="submit"] {
    min-height: 40px;
  }
}
