@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --radius-lg: 2px;
  --radius-md: 2px;
  --radius-sm: 1px;

  /* Vice City palette */
  --frame: #070a1e;
  --bg: #0b0f2b;
  --surface: #12173a;
  --surface-2: #171d46;
  --line: rgba(255, 255, 255, 0.16);
  --text: #f3f3f8;
  --text-dim: #9aa0d4;
  --accent: #ff5ca8;
  --accent-2: #00f0ff;
  --accent-soft: rgba(255, 92, 168, 0.16);
  --on-accent: #0b0f2b;

  /* Themed surfaces (built from the palette above) */
  --main-bg: var(--bg);          /* page background */
  --paper: var(--surface);       /* cards, buttons */
  --field: var(--surface-2);     /* inputs */
  --ink: var(--text);            /* borders + text */
  --on-ink: var(--bg);           /* text on top of --ink */
  --shadow: var(--accent-2);     /* hard offset shadows */
  --sidebar: var(--accent-2);    /* side panel */
  --sidebar-ink: #0b0f2b;
  --nav-active-bg: var(--bg);
  --nav-active-ink: var(--text);
}

:root[data-theme="gta"] {
  /* GTA V palette */
  --frame: #131417;
  --bg: #1a1b1f;
  --surface: #202226;
  --surface-2: #26282d;
  --line: rgba(255, 255, 255, 0.16);
  --text: #f3f3f1;
  --text-dim: #b2b1a9;
  --accent: #ffd07a;
  --accent-2: #4e6b3d;
  --accent-soft: rgba(255, 208, 122, 0.18);
  --on-accent: #1a1b1f;

  --sidebar-ink: #f3f3f1;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--frame);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  padding: 28px;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, input, textarea { font-family: inherit; }
button { cursor: pointer; color: inherit; }

.page-shell {
  width: min(1220px, 100%);
  min-height: calc(100vh - 56px);
  margin: 0 auto;
  background: var(--main-bg);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 8px 8px 0 var(--shadow);
  display: grid;
  grid-template-columns: 230px 1fr;
  overflow: hidden;
}

.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-ink);
  border-right: 2px solid var(--ink);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px 22px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  letter-spacing: .03em;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border: 2px solid var(--ink);
  display: grid;
  place-items: center;
  background: var(--paper);
  color: var(--ink);
  font-size: .75rem;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-link {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  color: var(--sidebar-ink);
  font-family: 'IBM Plex Mono', monospace;
  font-size: .75rem;
  font-weight: 700;
  border: 1px solid transparent;
  transition: .18s ease;
}

.nav-link:hover,
.nav-link.active {
  background: var(--nav-active-bg);
  color: var(--nav-active-ink);
  border-color: var(--nav-active-bg);
}

.nav-icon {
  width: 18px;
  text-align: center;
  font-size: .85rem;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 20px;
}

.sidebar-note {
  border-top: 1px solid currentColor;
  padding-top: 14px;
  font-size: .7rem;
  opacity: .75;
}

.main {
  min-width: 0;
  background: var(--main-bg);
  padding: 28px 30px 36px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 18px;
  margin-bottom: 24px;
}

.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.page-title {
  margin-top: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: .98;
  font-weight: 700;
  letter-spacing: -.05em;
}

.page-subtitle {
  margin-top: 10px;
  max-width: 670px;
  font-size: .9rem;
  line-height: 1.6;
}

.theme-toggle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  padding: 7px 10px;
  box-shadow: 3px 3px 0 var(--shadow);
  font-family: 'IBM Plex Mono', monospace;
  font-size: .7rem;
  font-weight: 700;
}

.theme-toggle:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--shadow);
}

.theme-toggle-track {
  width: 34px;
  height: 18px;
  border: 2px solid var(--ink);
  background: var(--accent-soft);
  position: relative;
}

.theme-toggle-thumb {
  width: 12px;
  height: 12px;
  background: var(--accent);
  position: absolute;
  top: 1px;
  left: 2px;
  transition: transform .22s ease;
}

[data-theme="gta"] .theme-toggle-thumb {
  transform: translateX(14px);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .8fr);
  gap: 20px;
}

.profile-card,
.info-card,
.stat-card,
.section-card,
.game-card,
.social-card,
.wall-card {
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--shadow);
}

.profile-card {
  background: var(--accent);
  color: var(--on-accent);
  padding: 20px;
  display: grid;
  grid-template-columns: 155px 1fr;
  gap: 20px;
  min-height: 265px;
}

.avatar {
  width: 155px;
  aspect-ratio: 1;
  border: 2px solid var(--ink);
  background:
    radial-gradient(circle at 50% 36%, rgba(255,255,255,.85) 0 17%, transparent 18%),
    linear-gradient(145deg, var(--accent-2), var(--accent));
  display: grid;
  place-items: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 4rem;
  font-weight: 700;
}

.avatar-slider {
  position: relative;
  overflow: hidden;
}

.avatar-slider .slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .8s ease;
}

.avatar-slider .slide.active {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .avatar-slider .slide { transition: none; }
}

.profile-card h2 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.45rem;
  margin-bottom: 5px;
}

.profile-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.profile-bio {
  margin-top: 15px;
  max-width: 530px;
  font-size: .82rem;
  line-height: 1.65;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 17px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  padding: 9px 14px;
  font-size: .72rem;
  font-weight: 700;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--shadow);
  transition: .16s ease;
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--shadow);
}

.btn-primary {
  background: var(--ink);
  color: var(--on-ink);
}

.btn-theme {
  background: var(--accent);
  color: var(--on-accent);
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.stat-card {
  padding: 15px;
  min-height: 125px;
}

.stat-number {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.8rem;
  font-weight: 700;
}

.stat-label {
  margin-top: 3px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.stat-note {
  margin-top: 13px;
  font-size: .68rem;
  opacity: .7;
}

.section-heading {
  margin: 28px 0 13px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 15px;
}

.section-heading h2 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.35rem;
}

.section-heading p {
  font-size: .72rem;
  opacity: .65;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.link-card {
  display: block;
  padding: 17px;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--shadow);
  transition: .17s ease;
}

.link-card:hover {
  transform: translate(-2px, -2px);
  background: var(--accent-soft);
}

.link-card .mini-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  background: var(--accent);
  color: var(--on-accent);
  margin-bottom: 13px;
  font-weight: 700;
}

.link-card h3 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .95rem;
}

.link-card p {
  margin-top: 5px;
  font-size: .76rem;
  opacity: .72;
}

.quick-note {
  margin-top: 14px;
  padding: 12px 14px;
  border: 2px dashed var(--ink);
  font-size: .72rem;
}

.inner {
  max-width: 940px;
}

.page-card {
  margin-top: 20px;
  padding: 22px;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 5px 5px 0 var(--shadow);
}

.inner > .page-card:first-child { margin-top: 0; }

.page-card h2 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.25rem;
  margin-bottom: 9px;
}

.page-card > p {
  font-size: .84rem;
  line-height: 1.7;
}

.about-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.about-box {
  border: 2px solid var(--ink);
  padding: 17px;
  min-height: 140px;
}

.about-box h3 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .9rem;
  margin-bottom: 8px;
}

.about-box p,
.about-box li {
  font-size: .77rem;
  line-height: 1.65;
}

.about-box ul {
  padding-left: 18px;
}

.game-layout {
  max-width: 650px;
  margin: 0 auto;
}

.game-hud {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .72rem;
  font-weight: 700;
}

.game-hud .val {
  color: var(--accent);
}

#gameCanvas {
  display: block;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  border: 2px solid var(--ink);
  background: var(--surface);
  touch-action: none;
}

.touch-controls {
  max-width: 520px;
  margin: 10px auto 0;
  display: flex;
  justify-content: space-between;
}

.touch-controls button {
  width: 58px;
  height: 42px;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 2px 2px 0 var(--shadow);
  font-weight: 700;
}

.game-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 15px;
}

.game-msg {
  text-align: center;
  margin-top: 11px;
  font-size: .72rem;
  opacity: .65;
}

.socials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.social-card {
  padding: 24px 15px;
  text-align: center;
  transition: .17s ease;
}

.social-card:hover {
  transform: translateY(-3px);
}

.social-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 13px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  background: var(--accent);
  color: var(--on-accent);
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
}

.social-icon svg {
  width: 34px;
  height: 34px;
  display: block;
}

.social-card h3 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .9rem;
}

.social-card p {
  margin-top: 5px;
  font-size: .7rem;
  opacity: .7;
  word-break: break-word;
}

.wall-tabs {
  display: flex;
  gap: 5px;
  border-bottom: 2px solid var(--ink);
  margin: 18px 0 20px;
}

.wall-tab {
  border: 2px solid var(--ink);
  border-bottom: none;
  background: var(--paper);
  padding: 9px 12px;
  font-size: .72rem;
  font-weight: 700;
}

.wall-tab.active {
  background: var(--ink);
  color: var(--on-ink);
}

.wall-view { display: none; }
.wall-view.active { display: block; }

.wall-notice {
  border-left: 4px solid var(--accent);
  padding-left: 10px;
  font-size: .73rem;
  margin-bottom: 18px;
}

.field-label {
  display: block;
  margin: 13px 0 7px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.cat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.cat-chip {
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 7px 10px;
  font-size: .7rem;
}

.cat-chip.active {
  background: var(--accent);
  color: var(--on-accent);
}

.wf-input,
.wf-textarea {
  width: 100%;
  border: 2px solid var(--ink);
  background: var(--field);
  color: var(--ink);
  padding: 10px 12px;
  font-size: .8rem;
  outline: none;
}

.wf-input:focus,
.wf-textarea:focus {
  box-shadow: 3px 3px 0 var(--accent);
}

.wf-textarea {
  min-height: 125px;
  resize: vertical;
}

.char-count {
  text-align: right;
  font-size: .68rem;
  margin: -1px 0 14px;
  opacity: .65;
}

.wall-status {
  margin-top: 12px;
  font-size: .74rem;
  line-height: 1.6;
}

.wall-status:empty { display: none; }

.wall-status.error {
  border-left: 4px solid var(--accent);
  padding-left: 10px;
}

.wall-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.wall-item {
  padding: 16px;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--shadow);
}

.cat-tag {
  display: inline-block;
  padding: 3px 7px;
  background: var(--accent);
  color: var(--on-accent);
  border: 1px solid var(--ink);
  font-family: 'IBM Plex Mono', monospace;
  font-size: .61rem;
  font-weight: 700;
  text-transform: uppercase;
}

.msg {
  margin: 10px 0 13px;
  font-size: .85rem;
}

.meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: .68rem;
}

.author { font-weight: 700; }

.actions {
  display: flex;
  gap: 10px;
}

.like-btn,
.like-btn.liked {
  color: var(--accent);
}

@media (max-width: 900px) {
  body { padding: 15px; }

  .page-shell {
    min-height: calc(100vh - 30px);
    grid-template-columns: 190px 1fr;
  }

  .main { padding: 22px; }

  .profile-card {
    grid-template-columns: 120px 1fr;
  }

  .avatar {
    width: 120px;
  }

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

@media (max-width: 700px) {
  body { padding: 7px; }

  .page-shell {
    min-height: calc(100vh - 14px);
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 2px solid var(--ink);
    padding: 10px;
  }

  .brand { padding-bottom: 10px; }

  .nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
  }

  .nav-link {
    justify-content: center;
    padding: 7px 4px;
    min-height: 36px;
  }

  .nav-link span:last-child { display: none; }
  .sidebar-bottom { display: none; }

  .main { padding: 17px 14px 30px; }

  .topbar { flex-direction: column; }
  .theme-toggle { align-self: flex-start; }

  .profile-card {
    grid-template-columns: 1fr;
  }

  .avatar {
    width: 100px;
  }

  .card-grid,
  .about-grid,
  .socials-grid {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}