:root {
  color-scheme: light;
  --bg: #f2f4f5;
  --bg-elevated: #ffffff;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --line: #e3e3e3;
  --line-strong: #ced3d6;
  --text: #000000;
  --muted: #666666;
  --accent: #00a2ff;
  --accent-strong: #0084ff;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --radius-xl: 12px;
  --radius-lg: 8px;
  --radius-md: 6px;
  --radius-sm: 4px;
  --sidebar-width: 72px;
  font-family: "Sora", "Inter", "Segoe UI", sans-serif;
}

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

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 0.9rem 1rem;
  outline: none;
}

input::placeholder {
  color: #8391b5;
}

input:focus {
  border-color: rgba(104, 214, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(104, 214, 255, 0.12);
}

.page-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: #ffffff;
  border-right: 1px solid #e3e3e3;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  z-index: 100;
}

.sidebar-profile,
.content-panel,
.main-header,
.auth-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.sidebar-profile {
  border-radius: var(--radius-xl);
  padding: 18px;
  display: grid;
  gap: 14px;
}

.sidebar-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, rgba(104, 214, 255, 0.8), rgba(126, 224, 129, 0.72));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

.sidebar-avatar-img,
.sidebar-avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.sidebar-avatar-img {
  object-fit: cover;
  background: #18243f;
}

.sidebar-avatar-fallback {
  background: linear-gradient(180deg, #192845, #111a31);
  color: #d7e2ff;
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: 0.03em;
}

.sidebar-profile-copy,
.main-header,
.section-header,
.auth-panel,
.auth-form,
.auth-switch {
  display: grid;
  gap: 10px;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--muted);
}

.sidebar-username,
.main-header h1,
.section-header h2,
.auth-panel h2,
.game-copy h3 {
  margin: 0;
  line-height: 1.05;
}

.sidebar-username {
  font-size: 1.25rem;
}

.sidebar-status,
.main-subtitle,
.section-header p,
.game-copy p,
.auth-error {
  margin: 0;
  color: var(--muted);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 0;
  border: 0;
  background: transparent;
  color: #393b3d;
  font-size: 11px;
  font-weight: 600;
  gap: 4px;
}

.nav-item-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: brightness(0) saturate(100%); display: block;
}

.nav-item span {
  text-align: center;
}

.nav-item:hover {
  background: #f2f4f5;
}

.nav-item.active {
  background: #ffffff;
  color: #000;
}

.sidebar-logo {
  margin-top: auto;
  padding: 16px 0;
  width: 32px;
  height: 32px;
  filter: grayscale(1);
  opacity: 0.6;
}

.sidebar-logo img {
  width: 100%;
  height: 100%;
}

.sidebar-actions {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.button,
.link-button,
.auth-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.button {
  min-height: 46px;
  border-radius: 15px;
  padding: 0.85rem 1rem;
  font-weight: 700;
}

.button-primary {
  color: #07111f;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 12px 28px rgba(104, 214, 255, 0.18);
}

.button-ghost {
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
  background: #ffffff;
  color: #000;
  opacity: 1;
}

.nav-item:not(.active) {
  opacity: 0.7;
}

.nav-item:hover {
  background: #f2f4f5;
  opacity: 1;
}

.main {
  min-width: 0;
  padding: 28px;
  margin-left: var(--sidebar-width);
  display: grid;
  gap: 20px;
}

.nexus-logo-square {
  width: 32px;
  height: 32px;
  background-color: #393b3d;
  transform: rotate(20deg);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nexus-logo-square::after {
  content: "";
  width: 12px;
  height: 12px;
  background-color: #fff;
  border-radius: 2px;
}

.main-header {
  grid-template-columns: 1fr auto;
  align-items: start;
  border-radius: var(--radius-xl);
  padding: 26px 28px;
}

.main-header h1 {
  margin-top: 0.35rem;
  font-size: clamp(2rem, 3vw, 3.5rem);
}

.header-chip {
  align-self: start;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: #cfd9f4;
  font-size: 0.9rem;
}

.content-panel {
  border-radius: var(--radius-xl);
  padding: 24px;
  display: grid;
  gap: 18px;
}

.section-header {
  grid-template-columns: 1fr auto;
  align-items: end;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.game-card {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.game-media {
  aspect-ratio: 16 / 9;
  border-radius: 20px;
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(104, 214, 255, 0.14), rgba(126, 224, 129, 0.1)),
    radial-gradient(circle at top, rgba(255, 255, 255, 0.06), transparent 48%),
    linear-gradient(180deg, #1a2746, #0e1629);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}

.game-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(5, 9, 19, 0.44));
}

.game-media span {
  position: relative;
  z-index: 1;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #dbe7ff;
  text-transform: uppercase;
  font-size: 0.86rem;
}

.game-copy h3 {
  font-size: 1rem;
}

.game-copy p {
  font-size: 0.92rem;
}

.auth-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 50;
}

.auth-modal[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 14, 0.66);
  backdrop-filter: blur(10px);
}

.auth-panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  border-radius: 28px;
  padding: 24px;
}

.auth-panel-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.auth-close {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  font-size: 1.1rem;
}

.auth-error:empty {
  display: none;
}

.auth-error {
  min-height: 1.2em;
  color: #ff9ba8;
}

.auth-form {
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
  color: #d8e2ff;
}

.auth-submit {
  margin-top: 4px;
}

.auth-switch {
  grid-template-columns: 1fr 1fr;
  margin-top: 4px;
}

.link-button {
  border-radius: 999px;
  padding: 0.75rem 0.95rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
}

.link-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 1120px) {
  .games-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main {
    padding: 18px;
  }

  .main-header,
  .section-header {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .sidebar,
  .main {
    padding-left: 14px;
    padding-right: 14px;
  }

  .games-grid {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    padding: 20px;
  }

  .auth-switch {
    grid-template-columns: 1fr;
  }
}
