@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap");

/* ========= ROOT / GLOBAL ========= */

:root {
  --bg: #000000;
  --bg-soft: #050505;
  --panel: #080808;
  --panel-alt: #101010;
  --fg: #f5f5f5;
  --fg-dim: #7f7f7f;
  --accent: #00ff7f;
  --accent-soft: rgba(0, 255, 127, 0.12);
  --border-hard: #262626;
  --header-h: 56px;
}

/* ============================================================
   ACCOUNT PAGE FIXES — clean inputs, correct font, normal size
   ============================================================ */

/* container around each section */
.account-box {
  padding: 18px;
  border: 1px solid #262626;
  background: rgba(0,0,0,0.35);
  margin-bottom: 22px;
}

/* labels */
.account-box label {
  font-family: "Spectral", serif;
  font-size: 11px;
  color: var(--fg);
  display: block;
  margin-bottom: 4px;
}

/* input fields */
.account-input {
  width: 100%;
  padding: 8px 10px;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  border: 2px solid var(--accent);
  background: #0d0d0d;
  color: #ffffff;
  outline: none;
  border-radius: 4px;
  margin-bottom: 10px;
}

.account-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

/* login/signup buttons */
.account-btn {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
  background: #002e1d;
  color: var(--accent);
  border: 2px solid var(--accent);
  cursor: pointer;
  transition: 0.2s ease;
}

.account-btn:hover {
  background: #004f31;
  transform: translateY(-1px);
}


/* NAVIGATION FIXES — ALIGN ICON WITH TEXT */
.site-nav a.account-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  height: 22px;
  margin: 0;
}

/* Actual icon element */
#account-icon {
  width: 18px;
  height: 18px;
  display: block;
  filter: grayscale(1) brightness(0.75);  /* gray inactive */
  transition: filter 0.2s ease, transform 0.2s ease;
  transform: translateY(1px); /* perfect vertical alignment */
}

/* Hover slightly brightens */
.site-nav a.account-link:hover #account-icon {
  filter: grayscale(0.6) brightness(1);
}

/* ACTIVE PAGE → ACCENT ICON */
html[data-accent="green"]   .site-nav a.account-link.active #account-icon {
  content: url("thumbs/acc/green.png");
  filter: none;
}

html[data-accent="violet"]  .site-nav a.account-link.active #account-icon {
  content: url("thumbs/acc/purple.png");
  filter: none;
}

html[data-accent="amber"]   .site-nav a.account-link.active #account-icon {
  content: url("thumbs/acc/amber.png");
  filter: none;
}

html[data-accent="white"]   .site-nav a.account-link.active #account-icon {
  content: url("thumbs/acc/white.png");
  filter: none;
}

/* inactive ALWAYS gray */
.site-nav a.account-link:not(.active) #account-icon {
  content: url("thumbs/acc/gray.png"); /* your gray version */
}


/* === ACCOUNT ICON BASE === */
.account-icon-link img {
  width: 18px;
  height: 18px;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 4px var(--accent));
  transition: 0.15s ease;
}

.account-icon-link:hover img {
  filter: drop-shadow(0 0 6px var(--accent)) brightness(1.3);
}

/* ACCENT VARIATIONS */
html[data-accent="green"] #account-icon {
  content: url("thumbs/acc/green.png");
}

html[data-accent="violet"] #account-icon {
  content: url("thumbs/acc/purple.png");
}

html[data-accent="amber"] #account-icon {
  content: url("thumbs/acc/amber.png");
}

html[data-accent="white"] #account-icon {
  content: url("thumbs/acc/white.png");
}


/* ================================
   ACCOUNT PAGE OVERRIDES
   Makes buttons normal-sized,
   fixes font, proper spacing
================================ */

.account-panel,
#loggedin-section .home-panel {
  font-size: 12px !important;
}

/* Inputs */
.account-block input {
  font-size: 12px !important;
  padding: 10px !important;
  height: 38px;
}

/* Buttons */
.account-btn,
.account-actions .proxy-btn {
  font-size: 12px !important;
  padding: 10px 14px !important;
  height: 40px;
  line-height: 1;
  font-family: "Press Start 2P", sans-serif !important;
}

/* Full-width login/create buttons */
.account-btn {
  width: 100% !important;
}

/* Account action row */
.account-actions {
  gap: 12px;
}

.account-actions .proxy-btn {
  min-width: 140px;
  text-align: center;
}

/* Email label */
.account-email {
  font-size: 12px !important;
}

/* ========= THEME VARIANTS (ONLY OVERRIDE COLORS, NOTHING ELSE) ========= */

:root[data-theme="dark"] {
  --bg: #000000;
  --bg-soft: #050505;
  --panel: #080808;
  --panel-alt: #101010;
  --fg: #f5f5f5;
  --fg-dim: #7f7f7f;
  --border-hard: #262626;
}

:root[data-theme="light"] {
  --bg: #f4f4f5;
  --bg-soft: #e4e4e7;
  --panel: #ffffff;
  --panel-alt: #e5e7eb;
  --fg: #020617;
  --fg-dim: #4b5563;
  --border-hard: #cbd5f5;
}

:root[data-theme="baby"] {
  --bg: #021521;
  --bg-soft: #032334;
  --panel: #04243a;
  --panel-alt: #063751;
  --fg: #e0f2ff;
  --fg-dim: #8fb4d9;
  --border-hard: #0f3c5e;
}

:root[data-theme="xmas"] {
  --bg: #050b08;
  --bg-soft: #0a1510;
  --panel: #0f2017;
  --panel-alt: #152b1f;
  --fg: #fefce8;
  --fg-dim: #a3a3a3;
  --border-hard: #14532d;
}

/* ==========================================
   SETTINGS PAGE OVERRIDES (normal sized UI)
========================================== */

.settings-panel,
.settings-panel * {
  font-size: 12px !important;
  font-family: "Press Start 2P", sans-serif !important;
}

/* Buttons inside settings */
.settings-panel .proxy-btn,
#blank-launch,
#btn-reset-settings,
#btn-clear-media {
  font-size: 12px !important;
  padding: 10px 14px !important;
  height: 40px;
  text-align: center;
  line-height: 1;
}

/* Make full-width action buttons cleaner */
#blank-launch {
  width: 100%;
}

/* Inputs */
.settings-panel input,
.settings-panel select {
  font-size: 12px !important;
  padding: 10px !important;
  height: 38px;
}

/* Section labels */
.settings-panel .motd-label {
  font-size: 11px !important;
}

/* SETTINGS PAGE BUTTON FIX */
.settings-panel .proxy-btn {
  font-size: 8px !important;          /* smaller text */
  padding: 4px 10px !important;       /* less vertical height */
  border-width: 2px !important;
  width: auto !important;
  text-align: center;
  letter-spacing: 0.04em;
  font-family: "Press Start 2P", system-ui, sans-serif;
}

.settings-panel input[type="text"],
.settings-panel input[type="password"],
.settings-panel select {
  font-size: 8px !important;
  padding: 5px 8px !important;
  height: auto !important;
}

.settings-panel label {
  font-size: 8px !important;
}

.settings-panel {
  font-size: 8px !important;
}

/* --- SETTINGS PAGE BUTTON FIX --- */
.settings-page .proxy-btn {
  font-size: 8px !important;
  padding: 5px 10px !important;
  height: auto !important;
  border-width: 2px !important;
  font-family: "Press Start 2P", system-ui, sans-serif !important;
  letter-spacing: 0.05em;
  width: auto !important;
}

/* Inputs in settings */
.settings-page input,
.settings-page select {
  font-size: 8px !important;
  padding: 6px 8px !important;
  font-family: "Press Start 2P", system-ui, sans-serif !important;
}

/* Labels and small text */
.settings-page label,
.settings-page .motd-label {
  font-size: 8px !important;
}



/* ========= REST OF YOUR ORIGINAL CSS (UNCHANGED) ========= */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--fg);
  font-family: "Press Start 2P", system-ui, sans-serif;
  font-size: 10px;
  letter-spacing: 0.04em;

  /* dungeon / CRT grid */
  background-image:
    linear-gradient(rgba(10, 10, 10, 0.9), rgba(10, 10, 10, 0.9)),
    repeating-linear-gradient(
      to right,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px,
      transparent 16px
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px,
      transparent 16px
    );

  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
}

/* ========= HEADER / NAV ========= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: rgba(0, 0, 0, 0.98);
  border-bottom: 3px solid var(--border-hard);
  box-shadow: 0 0 0 1px #000, 0 6px 0 #000, 0 0 24px rgba(0, 255, 127, 0.2);
  flex-shrink: 0;
}

.site-title {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 0 6px rgba(0, 255, 127, 0.7);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.site-title span {
  font-size: 8px;
  color: var(--fg-dim);
  text-shadow: none;
}

.site-nav {
  display: flex;
  gap: 6px;
  font-size: 8px;
}

.site-nav a {
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 0;
  border: 2px solid transparent;
  color: var(--fg-dim);
  cursor: pointer;
  background: transparent;
  position: relative;
  overflow: hidden;
}

.site-nav a::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 255, 127, 0.2),
    transparent 50%,
    rgba(0, 255, 127, 0.2)
  );
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.site-nav a:hover::before {
  opacity: 1;
}

.site-nav a:hover {
  color: var(--fg);
  border-color: var(--border-hard);
  box-shadow: 0 0 0 1px #000, 0 0 18px rgba(0, 255, 127, 0.4);
}

.site-nav a.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px #000, 0 0 18px rgba(0, 255, 127, 0.6);
}

/* ========= MAIN LAYOUT ========= */

main {
  padding: 18px 12px 32px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
}

/* ========= PAGE HEADER ========= */

.page-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

h1 {
  font-size: 14px;
  margin: 0;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

h1::before,
h1::after {
  content: "█";
  color: var(--accent);
  font-size: 12px;
}

.sub {
  font-size: 8px;
  color: var(--fg-dim);
  max-width: 420px;
  line-height: 1.6;
}

.sub span {
  color: var(--accent);
}

/* ========= HOME ========= */

.home-main {
  flex: 1;
  padding: 18px 12px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.home-center {
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home-logo-title {
  text-align: center;
  padding-bottom: 6px;
}

.home-logo-mark {
  font-size: 26px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--accent);
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(0, 255, 127, 0.8),
    0 0 22px rgba(0, 255, 127, 0.5);
}

.home-logo-sub {
  margin-top: 4px;
  font-size: 8px;
  color: var(--fg-dim);
}

.home-panel {
  border: 2px solid var(--border-hard);
  background: radial-gradient(circle at top left, #101010 0, #050505 60%);
  padding: 12px;
  box-shadow: 0 0 0 1px #000, 0 0 18px rgba(0, 0, 0, 0.9);
}

.home-proxy-panel {
  margin: 0;
}

.home-popular-panel {
  max-width: 1000px;
  margin: 0 auto;
}

.motd-label {
  font-size: 8px;
  color: var(--fg-dim);
  margin-bottom: 6px;
}

/* MOTD */
#motd {
  font-size: 9px;
  line-height: 1.6;
  cursor: pointer;
  padding: 8px;
  border: 2px dashed rgba(60, 60, 60, 0.9);
  background: rgba(0, 0, 0, 0.9);
}

#motd:hover {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(0, 255, 127, 0.4);
}

/* POPULAR STRIP */
.popular-wrap {
  overflow: hidden;
  border: 2px solid var(--border-hard);
  background: #000;
  box-shadow: 0 0 0 1px #000, 0 0 24px rgba(0, 0, 0, 0.9);
}

.popular-track {
  display: flex;
  gap: 10px;
  padding: 10px;
  width: max-content;
  animation: popular-scroll 28s linear infinite;
}

@keyframes popular-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.popular-pill {
  position: relative;
  display: block;
  flex: 0 0 96px;
  height: 96px;
  border: 2px solid var(--border-hard);
  background: #050505;
  overflow: hidden;
  cursor: pointer;
}

.pill-thumb {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: #050505;
  image-rendering: pixelated;
}

.pill-name {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  padding: 4px;
  text-align: center;
  background: rgba(0, 0, 0, 0.82);
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.12s ease;
  text-shadow: 0 0 6px rgba(0, 255, 127, 0.7);
}

.popular-pill:hover .pill-name {
  opacity: 1;
}

@media (max-width: 600px) {
  .popular-pill {
    flex: 0 0 80px;
    height: 80px;
  }
}

/* PROXY FORM */

.proxy-label {
  font-size: 8px;
  color: var(--fg-dim);
  margin-bottom: 6px;
}

#sj-form {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

#sj-address {
  flex: 1;
  padding: 8px 10px;
  border-radius: 0;
  border: 2px solid var(--border-hard);
  background: #000;
  color: var(--fg);
  font-size: 9px;
  font-family: "Press Start 2P", system-ui, sans-serif;
}

#sj-address::placeholder {
  color: #444;
}

#sj-address:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px #000, 0 0 12px rgba(0, 255, 127, 0.5);
}

.proxy-btn {
  font-size: 8px;
  padding: 0 10px;
  border: 2px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.proxy-btn:hover {
  background: rgba(0, 255, 127, 0.25);
  box-shadow: 0 0 0 1px #000,
    0 0 16px rgba(0, 255, 127, 0.6);
}

/* ERROR */
#sj-error {
  margin-top: 6px;
  font-size: 8px;
  color: #ff6666;
  white-space: pre-wrap;
}

#sj-error-code {
  font-size: 7px;
  color: #ccc;
  font-family: "Courier New";
}

#sj-frame {
  border: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #000;
}

/* SEARCH + GRIDS */

.games-search-wrap,
.app-search-wrap,
.media-search-wrap {
  margin: 10px 0 18px;
  padding: 8px;
  border: 2px solid var(--border-hard);
  background: radial-gradient(circle at top left, #101010 0, #050505 60%);
  box-shadow: 0 0 0 1px #000, 0 0 18px rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-label {
  font-size: 8px;
  color: var(--fg-dim);
}

#game-search,
#app-search,
#media-search {
  flex: 1;
  padding: 7px 10px;
  border-radius: 0;
  border: 2px solid var(--border-hard);
  background: #000;
  color: var(--fg);
  font-size: 9px;
  font-family: "Press Start 2P";
}

.game-grid,
.app-grid,
.media-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

.game-card,
.app-card,
.media-card {
  background: var(--panel);
  border-radius: 0;
  padding: 6px;
  border: 2px solid var(--border-hard);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  text-decoration: none;
  color: var(--fg);
  transition: transform 0.08s ease,
    box-shadow 0.08s ease,
    border-color 0.08s ease,
    background 0.08s ease;
  position: relative;
  overflow: hidden;
}

.game-card::after,
.app-card::after,
.media-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.2) 0,
      rgba(0, 0, 0, 0.2) 2px,
      transparent 2px,
      transparent 4px
    );
  mix-blend-mode: soft-light;
  opacity: 0.2;
}

.game-thumb,
.app-thumb {
  width: 100%;
  aspect-ratio: 1/1;
  background: #000;
  border: 2px solid #151515;
  overflow: hidden;
}

.poster-thumb {
  width: 100%;
  aspect-ratio: 2/3;
  background: #000;
  border: 2px solid #151515;
  overflow: hidden;
}

.game-thumb img,
.app-thumb img,
.poster-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.game-overlay,
.app-overlay,
.media-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: 0.12s ease;
  font-size: 9px;
  color: var(--accent);
  text-shadow: 0 0 6px rgba(0, 255, 127, 0.7);
}

.game-card:hover .game-overlay,
.app-card:hover .app-overlay,
.media-card:hover .media-overlay {
  opacity: 1;
}

.game-card:hover,
.app-card:hover,
.media-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--panel-alt);
  box-shadow: 0 0 0 1px #000,
    0 0 20px rgba(0, 255, 127, 0.45);
}

#game-empty,
#app-empty,
#media-empty {
  display: none;
  font-size: 8px;
  color: var(--fg-dim);
  padding: 6px 8px;
  border: 1px dashed #333;
  background: rgba(0, 0, 0, 0.7);
}

/* PLAYER LAYOUT */

main.player-main {
  flex: 1;
  padding: 12px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  min-height: calc(100vh - var(--header-h));
}

.player-info {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--fg-dim);
}

.player-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.player-actions button,
.player-actions a {
  font-size: 8px;
  border: 2px solid var(--border-hard);
  background: #000;
  color: var(--fg);
  padding: 3px 8px;
}

.player-actions button:hover,
.player-actions a:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 14px rgba(0, 255, 127, 0.5);
}

.player-frame-wrap {
  flex: 1;
  border: 2px solid var(--border-hard);
  overflow: hidden;
  background: #020617;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

#media-frame {
  width: 100%;
  height: 100%;
  border: none;
}

/* RESPONSIVE */

@media (max-width: 1024px) {
  .game-grid,
  .app-grid,
  .media-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 800px) {
  .site-header {
    padding: 0 10px;
  }
  .site-title {
    font-size: 10px;
  }
  .site-nav {
    gap: 4px;
  }
  .site-nav a {
    padding: 3px 6px;
  }
  .game-grid,
  .app-grid,
  .media-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 540px) {
  body {
    font-size: 9px;
  }
  .game-grid,
  .app-grid,
  .media-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
