/* Novium — Classic ~2017 Roblox-inspired UI
   Independent branding. Not affiliated with Roblox Corporation.
   References: 2016–2018 site (blue header #00A2FF / #0074BD era),
   ROBLOX2016stylus, archived layouts, Source Sans Pro. */

:root {
  --nv-bg: #e3e3e3;
  --nv-header: #00a2ff;
  --nv-header-dark: #0074bd;
  --nv-blue: #00a2ff;
  --nv-link: #0055b3;
  --nv-green: #00b06f;
  --nv-green-hover: #02b757;
  --nv-play: #02b757;
  --nv-white: #ffffff;
  --nv-text: #191919;
  --nv-text-secondary: #606162;
  --nv-muted: #b8b8b8;
  --nv-border: #b8b8b8;
  --nv-border-light: #ccc;
  --nv-panel: #ffffff;
  --nv-shadow: 0 1px 4px 0 rgba(25, 25, 25, 0.3);
  --nv-radius: 3px;
  --nv-font: "Source Sans Pro", Arial, Helvetica, sans-serif;
  --nv-nav-h: 36px;
  --nv-content-w: 970px;
}

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

html, body {
  min-height: 100%;
  font-family: var(--nv-font);
  font-size: 16px;
  font-weight: 400;
  color: var(--nv-text);
  background: var(--nv-bg);
  line-height: 1.428;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--nv-link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; vertical-align: middle; }
ul, ol { list-style: none; }
button, input, select, textarea { font-family: inherit; }

/* ========== HEADER (classic blue bar ~36px) ========== */
.nv-header {
  background: var(--nv-header);
  height: var(--nv-nav-h);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10000;
  border-bottom: 1px solid rgba(0,0,0,0.12);
}
.nv-header-inner {
  max-width: 1170px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 0;
}
.nv-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.4px;
  margin-right: 12px;
  flex-shrink: 0;
  height: 100%;
  padding: 0 4px;
}
.nv-logo:hover { opacity: 0.92; text-decoration: none !important; }
.nv-logo-mark {
  width: 30px; height: 30px;
  background: #fff;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: var(--nv-header-dark);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
}
.nv-nav {
  display: flex;
  align-items: stretch;
  height: 100%;
  flex: 1;
  min-width: 0;
}
.nv-nav a {
  color: #fff !important;
  text-decoration: none !important;
  padding: 0 11px;
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 16px;
  font-weight: 400;
  white-space: nowrap;
}
.nv-nav a:hover,
.nv-nav a.active {
  background: rgba(25, 25, 25, 0.1);
  text-decoration: none !important;
}

.nv-search {
  position: relative;
  width: 200px;
  margin: 0 10px;
  flex-shrink: 0;
}
.nv-search input {
  width: 100%;
  height: 28px;
  border: none;
  border-radius: 3px;
  padding: 0 28px 0 10px;
  font-size: 14px;
  outline: none;
  background: #fff;
  color: #191919;
}
.nv-search input::placeholder { color: #999; }
.nv-search-btn {
  position: absolute;
  right: 2px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  width: 28px; height: 28px;
  cursor: pointer;
  color: #666;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}

.nv-header-right {
  display: flex;
  align-items: stretch;
  height: 100%;
  margin-left: auto;
  flex-shrink: 0;
}
.nv-header-right > a,
.nv-header-right > button,
.nv-header-right .nv-user-menu > button {
  color: #fff !important;
  background: transparent;
  border: none;
  padding: 0 10px;
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none !important;
  gap: 6px;
}
.nv-header-right > a:hover,
.nv-header-right > button:hover,
.nv-header-right .nv-user-menu > button:hover {
  background: rgba(25, 25, 25, 0.1);
  text-decoration: none !important;
}
.nv-user-menu { position: relative; height: 100%; display: flex; align-items: center; }
.nv-avatar-sm {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #d0d8e0;
  border: 2px solid rgba(255,255,255,0.55);
  object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #4a6070;
}
.nv-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  border: 1px solid var(--nv-border);
  border-radius: 0 0 3px 3px;
  min-width: 160px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  z-index: 11000;
  padding: 4px 0;
}
.nv-dropdown.open { display: block; }
.nv-dropdown a {
  display: block;
  padding: 8px 14px;
  color: var(--nv-text) !important;
  font-size: 14px;
  text-decoration: none !important;
}
.nv-dropdown a:hover {
  background: #f2f2f2;
  box-shadow: inset 4px 0 0 0 var(--nv-blue);
  text-decoration: none !important;
}

.nv-mobile-toggle {
  display: none;
  background: none; border: none;
  color: #fff; font-size: 20px;
  padding: 0 8px; height: 100%; cursor: pointer;
}

/* ========== PAGE SHELL ========== */
.nv-page {
  padding-top: calc(var(--nv-nav-h) + 12px);
  min-height: 100vh;
  padding-bottom: 48px;
}
.nv-container {
  max-width: var(--nv-content-w);
  margin: 0 auto;
  padding: 0 10px;
}
.nv-container-wide {
  max-width: 1170px;
  margin: 0 auto;
  padding: 0 10px;
}
.nv-layout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.nv-main { flex: 1; min-width: 0; }
.nv-ad {
  width: 160px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--nv-border-light);
  text-align: center;
  padding: 6px;
  font-size: 11px;
  color: var(--nv-text-secondary);
  min-height: 400px;
}
.nv-ad-label {
  font-size: 10px;
  color: #999;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ========== PANELS (white cards, soft shadow) ========== */
.nv-panel {
  background: var(--nv-panel);
  border-radius: var(--nv-radius);
  box-shadow: var(--nv-shadow);
  margin-bottom: 12px;
  overflow: hidden;
}
.nv-panel-header {
  padding: 8px 12px;
  border-bottom: 1px solid #e1e1e1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
}
.nv-panel-header h2,
.nv-panel-header h3 {
  font-size: 20px;
  font-weight: 300;
  color: var(--nv-text);
  margin: 0;
  line-height: 1.2;
}
.nv-panel-body { padding: 12px; }
.nv-section-title {
  font-size: 24px;
  font-weight: 300;
  margin-bottom: 10px;
  color: var(--nv-text);
}

/* ========== BUTTONS (classic flat) ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--nv-font);
  font-size: 16px;
  font-weight: 400;
  border-radius: 3px;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 7px 16px;
  text-decoration: none !important;
  line-height: 1.2;
  transition: background 0.1s, border-color 0.1s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none !important; }
.btn-primary {
  background: var(--nv-green);
  border-color: var(--nv-green);
  color: #fff !important;
}
.btn-primary:hover { background: var(--nv-green-hover); border-color: var(--nv-green-hover); color: #fff !important; }
.btn-secondary {
  background: var(--nv-blue);
  border-color: var(--nv-blue);
  color: #fff !important;
}
.btn-secondary:hover { background: #32b5ff; border-color: #32b5ff; color: #fff !important; }
.btn-control {
  background: #fff;
  border: 1px solid var(--nv-border);
  color: var(--nv-text) !important;
}
.btn-control:hover { background: #f2f2f2; color: var(--nv-text) !important; }
.btn-lg { padding: 10px 28px; font-size: 18px; }
.btn-sm { padding: 4px 12px; font-size: 14px; }
.btn-block { display: flex; width: 100%; }
.btn-play {
  background: var(--nv-play);
  border-color: var(--nv-play);
  color: #fff !important;
  font-size: 18px;
  font-weight: 600;
  padding: 10px 32px;
  border-radius: 3px;
}
.btn-play:hover { background: #3fc679; color: #fff !important; }

/* ========== FORMS ========== */
.nv-form-group { margin-bottom: 12px; }
.nv-form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--nv-text);
}
.nv-input, .nv-select, .nv-textarea {
  width: 100%;
  height: 38px;
  border: 1px solid var(--nv-border);
  border-radius: 3px;
  padding: 0 12px;
  font-size: 16px;
  background: #fff;
  color: var(--nv-text);
  outline: none;
}
.nv-input:focus, .nv-select:focus, .nv-textarea:focus {
  border-color: var(--nv-blue);
  box-shadow: 0 0 0 1px var(--nv-blue);
}
.nv-textarea {
  height: auto;
  min-height: 80px;
  padding: 8px 12px;
  resize: vertical;
}
.nv-form-error {
  color: #e2231a;
  font-size: 13px;
  margin-top: 4px;
  display: none;
}
.nv-form-error.show { display: block; }

/* ========== GAME CARDS (150×150 thumbs era) ========== */
.nv-games-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.nv-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.nv-game-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 3px;
  overflow: hidden;
  width: 150px;
  flex-shrink: 0;
  cursor: pointer;
  text-decoration: none !important;
  color: inherit !important;
  display: block;
  transition: box-shadow 0.12s;
}
.nv-game-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.14);
  text-decoration: none !important;
}
.nv-game-card-thumb {
  width: 100%;
  height: 150px;
  background: #c5d0da;
  object-fit: cover;
  display: block;
}
.nv-game-card-body { padding: 6px 8px 8px; }
.nv-game-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--nv-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.nv-game-card-meta { font-size: 12px; color: var(--nv-text-secondary); }
.nv-game-card-players { color: var(--nv-green); font-weight: 600; }

/* ========== AVATARS ========== */
.nv-avatar { border-radius: 50%; background: #d5dde5; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #4a6070; }
.nv-avatar-xs { width: 24px; height: 24px; font-size: 10px; }
.nv-avatar-sm { width: 36px; height: 36px; font-size: 12px; }
.nv-avatar-md { width: 60px; height: 60px; font-size: 18px; }
.nv-avatar-lg { width: 120px; height: 120px; font-size: 36px; }
.nv-avatar-xl { width: 150px; height: 150px; font-size: 48px; }

.nv-friends-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 0;
}
.nv-friend-item {
  text-align: center;
  width: 72px;
  flex-shrink: 0;
  text-decoration: none !important;
  color: inherit !important;
}
.nv-friend-item:hover { text-decoration: none !important; }
.nv-friend-item .nv-avatar { margin-bottom: 4px; border: 2px solid transparent; }
.nv-friend-item:hover .nv-avatar { border-color: var(--nv-blue); }
.nv-friend-name {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--nv-text);
}

/* ========== TABS ========== */
.nv-tabs {
  display: flex;
  border-bottom: 1px solid var(--nv-border);
  margin-bottom: 10px;
  gap: 0;
}
.nv-tab {
  padding: 8px 14px;
  font-size: 14px;
  color: var(--nv-text-secondary);
  cursor: pointer;
  border: none;
  border-bottom: 3px solid transparent;
  background: none;
  font-family: var(--nv-font);
}
.nv-tab:hover { color: var(--nv-text); }
.nv-tab.active {
  color: var(--nv-blue);
  border-bottom-color: var(--nv-blue);
  font-weight: 600;
}
.nv-tnv-panel { display: none; }
.nv-tnv-panel.active { display: block; }

/* ========== CHAT BAR (bottom-right, classic blue header) ========== */
.nv-chat-bar {
  position: fixed;
  bottom: 0;
  right: 16px;
  width: 300px;
  background: #fff;
  border: 1px solid var(--nv-border);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.12);
  z-index: 9000;
}
.nv-chat-header {
  background: var(--nv-blue);
  color: #fff;
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
}
.nv-chat-body {
  display: none;
  height: 260px;
  flex-direction: column;
}
.nv-chat-bar.open .nv-chat-body { display: flex; }
.nv-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  font-size: 13px;
}
.nv-chat-input-row {
  display: flex;
  border-top: 1px solid #e0e0e0;
  padding: 6px;
  gap: 6px;
}
.nv-chat-input-row input {
  flex: 1;
  border: 1px solid var(--nv-border);
  border-radius: 3px;
  padding: 4px 8px;
  font-size: 13px;
  outline: none;
}

/* ========== FOOTER ========== */
.nv-footer {
  background: #fff;
  border-top: 1px solid var(--nv-border);
  padding: 18px 12px;
  margin-top: 32px;
  text-align: center;
  font-size: 12px;
  color: var(--nv-text-secondary);
}
.nv-footer a { color: var(--nv-text-secondary); margin: 0 8px; }
.nv-footer-links { margin-bottom: 6px; }

/* ========== AUTH GATE PAGE ========== */
.nv-auth-page {
  min-height: 100vh;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.nv-auth-top {
  background: var(--nv-header);
  height: 40px;
  display: flex;
  align-items: center;
  padding: 0 16px;
}
.nv-auth-body {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px 60px;
  background: linear-gradient(180deg, #e8f4fc 0%, #e3e3e3 40%, #e3e3e3 100%);
}
.nv-auth-card {
  width: 100%;
  max-width: 400px;
  background: rgba(255,255,255,0.97);
  border: 1px solid #ccc;
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  padding: 20px 24px 24px;
}
.nv-auth-card h1 {
  font-size: 28px;
  font-weight: 300;
  margin-bottom: 4px;
  text-align: center;
}
.nv-auth-card .nv-auth-sub {
  text-align: center;
  font-size: 14px;
  color: var(--nv-text-secondary);
  margin-bottom: 18px;
}
.nv-auth-tabs {
  display: flex;
  margin-bottom: 16px;
  border-bottom: 1px solid #ddd;
}
.nv-auth-tabs button {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  font-size: 16px;
  color: var(--nv-text-secondary);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  font-family: var(--nv-font);
}
.nv-auth-tabs button.active {
  color: var(--nv-blue);
  border-bottom-color: var(--nv-blue);
  font-weight: 600;
}
.nv-auth-panel { display: none; }
.nv-auth-panel.active { display: block; }
.nv-auth-footer {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--nv-text-secondary);
}

/* ========== UTILITY ========== */
.text-muted { color: var(--nv-text-secondary); }
.text-green { color: var(--nv-green); }
.text-blue { color: var(--nv-blue); }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.hidden { display: none !important; }

.nv-placeholder-thumb {
  background: linear-gradient(135deg, #a8c4d8 0%, #6a9ec4 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 600; text-align: center; padding: 8px;
}
.nv-placeholder-avatar {
  background: linear-gradient(145deg, #d8e4ee, #9eb8cc);
  display: flex; align-items: center; justify-content: center;
  color: #3d5a70; font-weight: 700;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 991px) {
  .nv-ad { display: none; }
  .nv-container, .nv-container-wide { max-width: 100%; }
  .nv-nav a { padding: 0 8px; font-size: 15px; }
  .nv-search { width: 140px; }
}
@media (max-width: 767px) {
  .nv-mobile-toggle { display: flex; align-items: center; }
  .nv-nav { display: none; }
  .nv-nav.mobile-open {
    display: flex;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--nv-header-dark);
    flex-direction: column;
    height: auto;
    padding: 4px 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  }
  .nv-nav.mobile-open a { height: 40px; padding: 0 16px; width: 100%; }
  .nv-games-grid { grid-template-columns: repeat(2, 1fr); }
  .nv-game-card { width: 100%; }
  .nv-chat-bar { width: 100%; right: 0; }
  .nv-search { display: none; }
}
