:root {
  --bg: #111118;
  --surface: #1a1a24;
  --accent: #5b9cf5;
  --accent-hover: #4a8ae3;
  --text: #cdcdd4;
  --text-dim: #6e6e7a;
  --border: rgba(255, 255, 255, 0.07);
  --card-bg: rgba(255, 255, 255, 0.03);
  --bar-bg: #16161e;
}

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

body {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, 'Segoe UI', sans-serif;
}

#bgCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* account button */
.acct-btn {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 60;
  padding: 0.45rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  cursor: pointer;
}
.acct-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.15); }
.acct-btn.logged-in { color: var(--accent); border-color: var(--accent); }

/* side panel */
.side-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.side-overlay.open { opacity: 1; pointer-events: auto; }

.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 300px;
  z-index: 100;
  background: var(--surface);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}
.side-panel.open { transform: translateX(0); }

.side-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
}
.side-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}
.side-close {
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.side-close:hover { color: var(--text); background: rgba(255,255,255,0.05); }

.side-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem;
}

/* account details */
.acct-detail {
  display: flex;
  justify-content: space-between;
  padding: 0.55rem 0;
  font-size: 0.9rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.acct-label { color: var(--text-dim); }

.acct-action {
  width: 100%;
  margin-top: 1rem;
  padding: 0.55rem;
  font-size: 0.88rem;
  font-weight: 600;
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.25);
  border-radius: 4px;
  color: #f87171;
  cursor: pointer;
}
.acct-action:hover { background: rgba(248,113,113,0.2); }

.save-actions {
  display: flex;
  gap: 6px;
  margin-top: 0.8rem;
}
.save-btn {
  flex: 1;
  padding: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(91,156,245,0.1);
  border: 1px solid rgba(91,156,245,0.25);
  border-radius: 4px;
  color: var(--accent);
  cursor: pointer;
}
.save-btn:hover { background: rgba(91,156,245,0.2); }
.save-status {
  font-size: 0.78rem;
  margin-top: 0.3rem;
  min-height: 1em;
}
.save-status.ok { color: #4ade80; }
.save-status.err { color: #f87171; }
.save-status.info { color: var(--accent); }

/* auth form in side panel */
.auth-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 1rem;
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
  padding: 2px;
}
.auth-tab {
  flex: 1;
  padding: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: transparent;
  border: none;
  border-radius: 3px;
  color: var(--text-dim);
  cursor: pointer;
}
.auth-tab.active {
  background: var(--bg);
  color: var(--text);
}
#authForm {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
#authForm input {
  padding: 0.7rem 0.8rem;
  font-size: 0.9rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  outline: none;
}
#authForm input:focus { border-color: var(--accent); }
#authForm input::placeholder { color: var(--text-dim); }
#authForm button[type="submit"] {
  padding: 0.7rem;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
#authForm button[type="submit"]:hover { background: var(--accent-hover); }
.auth-error {
  color: #f87171;
  font-size: 0.8rem;
  margin-top: 0.3rem;
  min-height: 1em;
}

/* side panel tabs */
.side-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.side-tab {
  flex: 1;
  padding: 0.55rem 0;
  font-size: 0.8rem;
  font-weight: 600;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  cursor: pointer;
}
.side-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.side-tab:hover:not(.active) { color: var(--text); }

.side-section { display: none; }
.side-section.active { display: block; }

/* friends */
.friend-search { margin-bottom: 0.8rem; }
.friend-search input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  font-size: 0.85rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  outline: none;
}
.friend-search input:focus { border-color: var(--accent); }
.friend-search input::placeholder { color: var(--text-dim); }

#friendSearchResults {
  margin-top: 4px;
}
.friend-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.5rem;
  font-size: 0.85rem;
  color: var(--text);
  background: rgba(255,255,255,0.02);
  border-radius: 4px;
  margin-bottom: 2px;
}
.friend-search-item button {
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

.friend-group-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0.8rem 0 0.3rem;
}

.friend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text);
}
.friend-item-name { flex: 1; }
.friend-item-actions { display: flex; gap: 4px; }
.friend-item-actions button {
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
}
.friend-item-actions button:hover { color: var(--text); }
.friend-item-actions .accept-btn { color: #4ade80; border-color: rgba(74,222,128,0.3); }
.friend-item-actions .decline-btn { color: #f87171; border-color: rgba(248,113,113,0.3); }
.friend-item-actions .msg-btn { color: var(--accent); border-color: rgba(91,156,245,0.3); }
.friend-item-actions .remove-btn { color: #f87171; border-color: rgba(248,113,113,0.3); }
.friend-item .online-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; margin-right: 6px; flex-shrink: 0; }
.friend-item .offline-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-dim); margin-right: 6px; flex-shrink: 0; }

.friend-login-msg {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 2rem 0;
}

/* chat */
.chat-channels {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.chat-ch-btn {
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-dim);
  cursor: pointer;
  position: relative;
}
.chat-ch-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.chat-ch-btn:hover:not(.active) { border-color: rgba(255,255,255,0.15); }
.chat-ch-btn .unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  font-size: 0.65rem;
  font-weight: 700;
  background: #f87171;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-online {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}

.chat-messages {
  height: 280px;
  overflow-y: auto;
  padding: 0.4rem 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(0,0,0,0.15);
  margin-bottom: 0.5rem;
}

.chat-msg {
  padding: 0.2rem 0.6rem;
  font-size: 0.82rem;
  line-height: 1.45;
}
.chat-msg-user { font-weight: 700; color: var(--accent); margin-right: 4px; }
.chat-msg-text { color: var(--text); word-break: break-word; }
.chat-msg-time { font-size: 0.65rem; color: var(--text-dim); margin-left: 4px; }

.chat-input-row {
  display: flex;
  gap: 6px;
}
.chat-input-row input {
  flex: 1;
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  outline: none;
}
.chat-input-row input:focus { border-color: var(--accent); }
.chat-input-row input::placeholder { color: var(--text-dim); }
.chat-input-row button {
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.chat-input-row button:hover { background: var(--accent-hover); }

/* suggest */
.suggest-box { margin-bottom: 1rem; }
.suggest-title { font-size: 0.95rem; font-weight: 700; color: #fff; margin-bottom: 0.3rem; }
.suggest-desc { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 0.8rem; }
.suggest-box input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  font-size: 0.85rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  outline: none;
  margin-bottom: 0.5rem;
}
.suggest-box input:focus { border-color: var(--accent); }
.suggest-box input::placeholder { color: var(--text-dim); }
.suggest-box button {
  width: 100%;
  padding: 0.6rem;
  font-size: 0.88rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.suggest-box button:hover { background: var(--accent-hover); }
.suggest-status { font-size: 0.8rem; margin-top: 0.4rem; min-height: 1em; }
.suggest-status.ok { color: #4ade80; }
.suggest-status.err { color: #f87171; }

.notif-clear {
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-dim);
  cursor: pointer;
  margin-bottom: 0.5rem;
}
.notif-clear:hover { color: var(--text); }

.notif-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}
.notif-item-from { font-weight: 600; color: var(--accent); }
.notif-item-link { color: var(--text); word-break: break-all; }
.notif-item-note { color: var(--text-dim); font-size: 0.78rem; margin-top: 2px; }
.notif-item-time { color: var(--text-dim); font-size: 0.7rem; }

@media (max-width: 400px) {
  .side-panel { width: 100%; }
}

/* homepage */

#homepage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  position: relative;
  z-index: 2;
}
#homepage.hidden { display: none; }

header { text-align: center; padding: 3rem 1rem 1rem; }

h1 {
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: -2px;
  color: #fff;
}

.tagline {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.discord-link {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  background: #5865F2;
  border-radius: 4px;
  text-decoration: none;
  letter-spacing: 0.5px;
}
.discord-link:hover { background: #4752c4; }

/* tabs */
.page-tabs {
  display: flex;
  gap: 2px;
  margin: 1.5rem auto 0;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  padding: 3px;
}

.page-tab-btn {
  padding: 0.55rem 1.6rem;
  font-size: 0.9rem;
  font-weight: 600;
  background: transparent;
  color: var(--text-dim);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.page-tab-btn.active {
  background: var(--surface);
  color: var(--text);
}

/* page content */
.page-content {
  flex: 1;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
}

.page-section { display: none; }
.page-section.active { display: block; }

/* search */
.search-bar { display: flex; margin-top: 1.5rem; }
.search-bar input {
  flex: 1;
  padding: 0.7rem 1rem;
  font-size: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  outline: none;
}
.search-bar input:focus { border-color: var(--accent); }
.search-bar input::placeholder { color: var(--text-dim); }

/* section labels */
.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 1.2rem;
  margin-bottom: 0.3rem;
}
.fav-section { margin-bottom: 0.5rem; }

/* game context menu */
.game-menu {
  position: fixed;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 0;
  min-width: 150px;
}
.game-menu button {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  text-align: left;
  font-size: 0.85rem;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
}
.game-menu button:hover { background: rgba(255,255,255,0.05); }

/* games */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px;
  margin-top: 1rem;
}

.game-card {
  position: relative;
  padding: 0.8rem 1rem;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  overflow: hidden;
}
.game-card:hover { border-color: rgba(255, 255, 255, 0.15); }

.game-card.has-logo {
  padding: 0;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.game-card.has-logo .game-name {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.15s;
}
.game-card.has-logo:hover .game-name { opacity: 1; }

.no-games {
  text-align: center;
  color: var(--text-dim);
  padding: 3rem 1rem;
}
.no-games code {
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9rem;
}

/* movies */
.movies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
  margin-top: 1rem;
}

.movie-card {
  position: relative;
  text-decoration: none;
  color: var(--text);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
}
.movie-card:hover { border-color: rgba(255, 255, 255, 0.15); }

.movie-poster {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
}

.movie-no-poster {
  width: 100%;
  aspect-ratio: 2/3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--text-dim);
  font-size: 0.8rem;
  text-align: center;
  padding: 0.5rem;
}

.movie-info {
  padding: 0.4rem 0.5rem;
}

.movie-title {
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movie-year {
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* pagination */
.page-nav {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 1rem 0;
}
.page-nav button {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
  cursor: pointer;
}
.page-nav button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.page-nav button:hover:not(.active) { border-color: rgba(255,255,255,0.15); }

/* apps */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 1.5rem;
}
.app-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 1.2rem 0.8rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s;
}
.app-card:hover { border-color: rgba(255,255,255,0.15); }
.app-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
}
.app-name {
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
}

/* proxy */
.proxy-box {
  max-width: 560px;
  margin: 2rem auto 0;
  padding: 2rem 1.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.proxy-box form { display: flex; flex-direction: column; gap: 0.8rem; }
.proxy-box input[type="text"] {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1.1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  outline: none;
}
.proxy-box input[type="text"]:focus { border-color: var(--accent); }
.proxy-box input::placeholder { color: var(--text-dim); }

.proxy-box button {
  padding: 0.85rem;
  font-size: 1rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.proxy-box button:hover { background: var(--accent-hover); }

.proxy-info {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
}

footer {
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  position: relative;
  z-index: 2;
}
footer a { color: var(--accent); text-decoration: none; }

/* game view */

#gameView {
  display: none;
  flex-direction: column;
  height: 100vh;
  position: relative;
  z-index: 5;
}
#gameView.active { display: flex; }

.game-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 8px;
  background: var(--bar-bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.game-bar-home {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-bar-home:hover { color: var(--text); }

.game-bar-title {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 500;
}

#gameFrame {
  flex: 1;
  width: 100%;
  border: none;
}

/* browser view */

#browserView {
  display: none;
  flex-direction: column;
  height: 100vh;
  position: relative;
  z-index: 10;
}
#browserView.active { display: flex; }

.browser-tab-bar {
  display: flex;
  align-items: center;
  gap: 1px;
  height: 38px;
  padding: 0 6px;
  background: var(--bar-bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.browser-tab-bar::-webkit-scrollbar { display: none; }

.browser-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 100px;
  max-width: 180px;
  height: 30px;
  padding: 0 12px;
  font-size: 0.78rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  flex-shrink: 0;
}
.browser-tab.active {
  background: var(--surface);
  border-color: var(--border);
  border-bottom-color: transparent;
  color: var(--text);
}
.browser-tab:hover:not(.active) { background: rgba(255, 255, 255, 0.03); }

.browser-tab-title { flex: 1; overflow: hidden; text-overflow: ellipsis; }

.browser-tab-close {
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 3px;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.browser-tab-close:hover { background: rgba(255, 80, 80, 0.25); color: #f87171; }

.tab-bar-new,
.tab-bar-home {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tab-bar-new { font-size: 18px; }
.tab-bar-home { font-size: 15px; margin-left: auto; }
.tab-bar-new:hover,
.tab-bar-home:hover { color: var(--text); }

/* nav bar */
.nav-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  background: var(--bar-bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.nav-btn,
.nav-inspect {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-dim);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-btn:hover,
.nav-inspect:hover { color: var(--text); }
.nav-btn:disabled { opacity: 0.3; cursor: default; }
.nav-inspect.active { color: var(--accent); }

.nav-url {
  flex: 1;
  padding: 5px 10px;
  font-size: 0.88rem;
  font-family: -apple-system, 'Segoe UI', monospace;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  outline: none;
}
.nav-url:focus { border-color: var(--accent); }

.browser-content { flex: 1; display: flex; position: relative; overflow: hidden; }
.frame-container { flex: 1; position: relative; }
.frame-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  z-index: 1;
}
.frame-container iframe.hidden { display: none; }
.frame-container iframe.active-frame { z-index: 2; }

/* inspect panel */

.inspect-panel {
  width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  background: var(--bar-bg);
  border-left: 1px solid var(--border);
  transition: width 0.2s;
}
.inspect-panel.open { width: 380px; }

.inspect-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.inspect-tab {
  padding: 7px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  cursor: pointer;
}
.inspect-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.inspect-tab:hover:not(.active) { color: var(--text); }

.inspect-content { flex: 1; overflow-y: auto; font-size: 0.82rem; }
.inspect-section { display: none; height: 100%; }
.inspect-section.active { display: flex; flex-direction: column; }

.console-output {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  font-family: 'SF Mono', 'Cascadia Code', monospace;
  font-size: 0.8rem;
  line-height: 1.5;
}

.console-line {
  padding: 2px 6px;
  word-break: break-all;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}
.console-line.log   { color: var(--text); }
.console-line.warn  { color: #e2b340; }
.console-line.error { color: #f87171; }
.console-line.info  { color: var(--accent); }

.console-input-row { display: flex; border-top: 1px solid var(--border); flex-shrink: 0; }
.console-prompt {
  padding: 7px;
  color: var(--accent);
  font-family: monospace;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
}
.console-input {
  flex: 1;
  padding: 7px 4px;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: 'SF Mono', 'Cascadia Code', monospace;
  font-size: 0.8rem;
  outline: none;
}

.elements-tree {
  flex: 1;
  overflow: auto;
  padding: 6px;
  font-family: 'SF Mono', 'Cascadia Code', monospace;
  font-size: 0.78rem;
  line-height: 1.7;
  white-space: pre;
}
.el-tag  { color: #e879a8; }
.el-attr { color: #a78bfa; }
.el-val  { color: #e2b340; }
.el-text { color: var(--text-dim); }

.network-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
}
.network-toolbar span { color: var(--text-dim); font-size: 0.78rem; }

.network-list { flex: 1; overflow-y: auto; }

.network-header,
.network-row {
  display: grid;
  grid-template-columns: 55px 1fr 70px 60px;
  gap: 6px;
  padding: 5px 8px;
  font-size: 0.78rem;
  align-items: center;
}
.network-header {
  position: sticky;
  top: 0;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bar-bg);
  border-bottom: 1px solid var(--border);
}
.network-row { border-bottom: 1px solid rgba(255, 255, 255, 0.02); }
.network-row:hover { background: rgba(255, 255, 255, 0.02); }
.network-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.network-status.ok  { color: #4ade80; }
.network-status.err { color: #f87171; }

.network-clear {
  padding: 3px 8px;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-dim);
  cursor: pointer;
}
.network-clear:hover { color: var(--text); }

@media (max-width: 700px) {
  h1 { font-size: 2.4rem; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .inspect-panel.open { width: 100%; position: absolute; inset: 0; z-index: 20; }
}
