:root {
  --bg: #0b0d10;
  --surface: #111419;
  --surface-2: #171a20;
  --surface-3: #1d2128;
  --text: #f5f7fa;
  --muted: #8f98a5;
  --line: #252a33;
  --accent: #7c9cff;
  --accent-strong: #5f82f5;
  --danger: #ff7070;
  --radius: 10px;
  --shadow: 0 14px 40px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 50% -10%, rgba(124, 156, 255, .08), transparent 34rem),
    var(--bg);
  color: var(--text);
  font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea { font: inherit; }

button { cursor: pointer; }

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a {
  color: inherit;
  text-decoration: none;
}

.main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding-bottom: 72px;
}

/* Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  margin-bottom: 56px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 13, 16, .88);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 13px;
  letter-spacing: -.01em;
}

.brand small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 9px;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(300px, 30vw);
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.search-wrap > span { font-size: 16px; }

.search-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-wrap input::placeholder { color: #66707d; }

.search-wrap kbd {
  color: #66707d;
  font-size: 9px;
  white-space: nowrap;
}

.top-button,
.secondary-button,
.filter,
.player-button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
}

.top-button {
  padding: 8px 11px;
}

.top-button:hover,
.secondary-button:hover,
.filter:hover {
  border-color: #3a414d;
  background: var(--surface-2);
}

/* Hero */
.hero {
  padding: 18px 0 58px;
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.section-label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
}

.hero h1 {
  max-width: 780px;
  margin: 12px 0;
  font-size: clamp(42px, 7vw, 76px);
  line-height: .95;
  letter-spacing: -.065em;
  font-weight: 750;
}

.hero h1 span { color: #697280; }

.hero p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.primary-button,
.danger-button {
  border-radius: 7px;
  padding: 9px 13px;
  font-weight: 700;
}

.primary-button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #0b0d10;
}

.primary-button:hover { background: #91abff; }

.secondary-button {
  padding: 9px 13px;
}

.danger-button {
  border: 1px solid rgba(255, 112, 112, .24);
  background: rgba(255, 112, 112, .08);
  color: var(--danger);
}

.danger-button:hover { background: rgba(255, 112, 112, .13); }

.full { width: 100%; }

.hero-art { display: none; }

/* Sections */
.content-section { padding-top: 58px; }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 15px;
}

.section-heading h2 {
  margin: 5px 0 0;
  font-size: 20px;
  letter-spacing: -.035em;
}

.count,
.section-note {
  color: var(--muted);
  font-size: 11px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.filter {
  padding: 6px 10px;
  color: var(--muted);
  font-size: 11px;
}

.filter.active {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

/* Game cards */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}

.game-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.game-card:hover {
  transform: translateY(-2px);
  border-color: #353c47;
  background: var(--surface-2);
}

.game-thumb,
.game-thumb-fallback {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #15181e;
}

.game-thumb-fallback {
  display: grid;
  place-items: center;
  color: #4c5562;
  font-size: 30px;
  font-weight: 800;
}

.game-card-body { padding: 10px 11px 11px; }

.game-card-body h3 {
  margin: 0 0 2px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.game-card-body span {
  color: var(--muted);
  font-size: 10px;
}

.favorite-button {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 7px;
  background: rgba(8, 10, 13, .72);
  color: #fff;
}

.favorite-button:hover,
.favorite-button.active {
  border-color: rgba(124,156,255,.55);
  color: var(--accent);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 30px 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(17, 20, 25, .45);
  text-align: center;
}

.empty-state strong { display: block; }

.empty-state p {
  margin: 5px 0 0;
  color: var(--muted);
}

/* Tools / settings */
.app-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.app-card,
.setting-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.app-card {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
}

.app-card:hover {
  border-color: #353c47;
  background: var(--surface-2);
}

.app-icon {
  flex: 0 0 auto;
  font-size: 18px;
  filter: grayscale(1);
}

.app-card strong,
.app-card small,
.setting-card strong,
.setting-card small {
  display: block;
}

.app-card small,
.setting-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.setting-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 21px;
}

.switch input {
  width: 0;
  height: 0;
  opacity: 0;
}

.switch i {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: #2a3038;
}

.switch i::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #727b87;
  transition: transform .15s ease, background .15s ease;
}

.switch input:checked + i { background: var(--accent-strong); }

.switch input:checked + i::before {
  transform: translateX(17px);
  background: #fff;
}

/* Game player */
.player-modal,
.small-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, .78);
}

.player-modal.open,
.small-modal.open { display: grid; }

.player-window {
  display: grid;
  grid-template-rows: 44px minmax(0, 1fr);
  width: min(1220px, 100%);
  height: min(820px, 94vh);
  overflow: hidden;
  border: 1px solid #2a3038;
  border-radius: 10px;
  background: #000;
  box-shadow: var(--shadow);
}

.player-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  background: #12151a;
  color: #fff;
}

.player-status {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: #7ee2a8;
}

.player-actions {
  display: flex;
  gap: 5px;
}

.player-button {
  width: 30px;
  height: 30px;
  background: #1b1f25;
  color: #fff;
}

.player-button:hover { background: #272d35; }

#gameFrame,
#ruffleFrame {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
}

#ruffleFrame { display: none; }

.player-error {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 20px;
  color: #fff;
  text-align: center;
}

.player-error p { color: #9aa3ae; }

/* Small modals */
.small-modal-box {
  position: relative;
  width: min(430px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.small-modal-box h2 {
  margin: 0 0 18px;
  font-size: 20px;
  letter-spacing: -.03em;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.modal-close:hover { color: var(--text); }

#notesArea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  background: #0c0f13;
  color: var(--text);
}

#notesArea:focus { border-color: #465061; }

.timer-display {
  margin: 24px 0;
  text-align: center;
  font-size: 42px;
  font-variant-numeric: tabular-nums;
}

.timer-controls {
  display: flex;
  gap: 7px;
}

/* Auth */
.auth-button { white-space: nowrap; }

.auth-box { max-width: 430px; }

.auth-heading h2 {
  margin: 7px 0 5px;
  font-size: 27px;
  letter-spacing: -.04em;
}

.auth-heading p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
}

.auth-field {
  display: block;
  margin-top: 12px;
}

.auth-field span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
}

.auth-field input {
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  background: #0c0f13;
  color: var(--text);
}

.auth-field input:focus { border-color: #465061; }

.auth-switch {
  width: 100%;
  margin-top: 9px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: #9ca9ba;
  font-size: 12px;
}

.auth-switch:hover {
  color: var(--text);
  text-decoration: underline;
}

/* Toast */
#toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 200;
  transform: translateX(-50%);
  padding: 9px 13px;
  border: 1px solid #303640;
  border-radius: 7px;
  background: #171b21;
  color: #fff;
  box-shadow: var(--shadow);
}

/* Settings */
body.compact .game-grid {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

body.no-animations *,
body.no-animations *::before,
body.no-animations *::after {
  transition: none !important;
  animation: none !important;
  scroll-behavior: auto !important;
}

/* Responsive */
@media (max-width: 800px) {
  .main { width: min(100% - 20px, 680px); }

  .topbar {
    flex-wrap: wrap;
    padding: 8px 0;
    margin-bottom: 42px;
  }

  .brand { margin-right: auto; }

  .search-wrap {
    order: 3;
    width: 100%;
  }

  .hero h1 { font-size: 48px; }

  .app-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .main { width: min(100% - 16px, 680px); }

  .auth-button { display: none; }

  .hero h1 { font-size: 41px; }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .game-card-body { padding: 9px; }
}

/* Ghostez Arcade refresh */
:root {
  --bg: #080b12;
  --surface: #101621;
  --surface-2: #151e2b;
  --surface-3: #1b2635;
  --text: #f5f7fb;
  --muted: #929eaf;
  --line: rgba(166, 187, 214, .13);
  --accent: #b8f36b;
  --accent-strong: #a5e653;
  --danger: #ff7e8a;
  --radius: 16px;
  --shadow: 0 24px 72px rgba(0, 0, 0, .42);
}

html { background: var(--bg); }

body {
  background:
    radial-gradient(ellipse at 78% 6%, rgba(101, 125, 255, .17), transparent 34rem),
    radial-gradient(ellipse at 8% 28%, rgba(184, 243, 107, .075), transparent 28rem),
    var(--bg);
  font-size: 14px;
}

.main { width: min(1260px, calc(100% - 48px)); }

.topbar {
  top: 12px;
  min-height: 72px;
  gap: 22px;
  margin: 12px 0 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(12, 17, 26, .82);
  box-shadow: 0 12px 38px rgba(0, 0, 0, .2);
}

.brand { gap: 11px; }

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--accent);
  color: #11170c;
  font-size: 18px;
  box-shadow: 0 0 28px rgba(184, 243, 107, .2);
}

.brand strong { font-size: 13px; letter-spacing: .12em; }
.brand small { color: var(--accent); font-size: 9px; letter-spacing: .22em; }

.top-nav { display: flex; align-items: center; gap: 22px; }

.top-nav a {
  color: #aab5c5;
  font-size: 12px;
  font-weight: 650;
  transition: color .16s ease;
}

.top-nav a:hover { color: var(--accent); }

.search-wrap {
  width: min(260px, 24vw);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .035);
}

.search-wrap:focus-within { border-color: rgba(184, 243, 107, .55); }
.search-wrap input { font-size: 12px; }
.search-wrap kbd { border: 1px solid var(--line); border-radius: 5px; padding: 2px 4px; }

.top-button, .secondary-button, .filter, .player-button {
  border-color: var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .045);
}

.top-button { padding: 10px 13px; font-size: 12px; font-weight: 700; }
.top-button:hover, .secondary-button:hover, .filter:hover { border-color: rgba(184, 243, 107, .42); background: rgba(184, 243, 107, .07); }
.auth-button { color: var(--accent); }

.hero {
  position: relative;
  min-height: 390px;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 52px clamp(28px, 6vw, 78px);
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    radial-gradient(circle at 82% 50%, rgba(184, 243, 107, .15), transparent 11rem),
    radial-gradient(circle at 76% 36%, rgba(105, 126, 255, .22), transparent 20rem),
    linear-gradient(115deg, #121a26 4%, #101723 56%, #171c2a 100%);
  box-shadow: var(--shadow);
}

.hero::before, .hero::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.hero::before {
  top: -150px;
  right: 5%;
  width: 500px;
  height: 500px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
  box-shadow: 0 0 0 38px rgba(255,255,255,.018), 0 0 0 86px rgba(255,255,255,.014);
}

.hero::after {
  top: 50%;
  right: 15%;
  width: 130px;
  height: 130px;
  border: 1px solid rgba(184, 243, 107, .42);
  border-radius: 34px;
  background: linear-gradient(145deg, rgba(184, 243, 107, .22), rgba(120, 142, 255, .16));
  box-shadow: 0 0 80px rgba(184, 243, 107, .16), inset 0 0 38px rgba(255,255,255,.06);
  transform: translateY(-50%) rotate(18deg);
}

.hero > div:first-child { position: relative; z-index: 1; max-width: 660px; }
.eyebrow, .section-label { color: var(--accent); font-size: 10px; letter-spacing: .2em; }

.hero h1 {
  max-width: 670px;
  margin: 18px 0 14px;
  font-size: clamp(48px, 6.8vw, 82px);
  line-height: .98;
  letter-spacing: -.075em;
  font-weight: 790;
}

.hero h1 span {
  color: var(--accent);
  text-shadow: 0 0 34px rgba(184, 243, 107, .2);
}

.hero p { max-width: 470px; color: #aab5c5; font-size: 15px; line-height: 1.7; }
.hero-buttons { gap: 10px; margin-top: 28px; }

.primary-button, .danger-button {
  border-radius: 11px;
  padding: 12px 16px;
  font-weight: 750;
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #11170c;
  box-shadow: 0 8px 26px rgba(184, 243, 107, .17);
}

.primary-button:hover { background: #c8ff83; transform: translateY(-1px); }
.secondary-button { padding: 12px 16px; color: var(--text); }

.content-section { padding-top: 66px; scroll-margin-top: 112px; }

.section-heading { margin-bottom: 20px; }
.section-heading h2 { margin-top: 7px; font-size: 26px; letter-spacing: -.05em; }
.count, .section-note { color: #9ba8ba; font-size: 12px; }

.filters { gap: 8px; margin-bottom: 16px; }
.filter { padding: 8px 13px; color: #aab5c5; font-size: 12px; font-weight: 650; }
.filter.active { border-color: var(--accent); background: var(--accent); color: #11170c; }

.game-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 15px; }

.game-card {
  border-color: var(--line);
  border-radius: 15px;
  background: linear-gradient(160deg, rgba(22, 30, 43, .95), rgba(14, 20, 30, .96));
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: rgba(184, 243, 107, .42);
  background: linear-gradient(160deg, #192333, #111923);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .25);
}

.game-thumb, .game-thumb-fallback { aspect-ratio: 16 / 10; background: #151d29; }
.game-thumb-fallback { color: var(--accent); font-size: 42px; }
.game-card-body { padding: 13px 14px 15px; }
.game-card-body h3 { font-size: 13px; }
.game-card-body span { color: #94a1b3; font-size: 11px; }

.favorite-button {
  top: 9px;
  right: 9px;
  width: 32px;
  height: 32px;
  border-color: rgba(255,255,255,.22);
  border-radius: 10px;
  background: rgba(8, 11, 18, .76);
  font-size: 16px;
}

.favorite-button:hover, .favorite-button.active { border-color: var(--accent); color: var(--accent); }

.empty-state, .app-card, .setting-card {
  border-color: var(--line);
  border-radius: 15px;
  background: rgba(16, 22, 33, .86);
}

.app-grid, .settings-grid { gap: 14px; }
.app-card, .setting-card { padding: 18px; }
.app-card strong, .setting-card strong { font-size: 13px; }
.app-card small, .setting-card small { font-size: 11px; }
.app-card:hover { border-color: rgba(184, 243, 107, .42); background: var(--surface-2); }
.app-icon { filter: none; font-size: 21px; }

.player-window, .small-modal-box {
  border-color: var(--line);
  border-radius: 17px;
  background: var(--surface);
}

.player-topbar { background: #101722; }
.modal-close { width: 32px; height: 32px; border-radius: 9px; }
.modal-close:hover { background: rgba(255,255,255,.07); }
#notesArea, .auth-field input { border-color: var(--line); border-radius: 10px; background: #0b111a; }
.auth-field input:focus, #notesArea:focus { border-color: rgba(184, 243, 107, .55); }
#toast { border-color: var(--line); border-radius: 11px; background: #172130; }

body.compact .game-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); }

@media (max-width: 800px) {
  .main { width: min(100% - 28px, 680px); }
  .topbar { gap: 12px; margin-bottom: 30px; padding: 10px 12px; }
  .top-nav { order: 3; width: 100%; justify-content: center; padding: 8px 0 2px; border-top: 1px solid var(--line); }
  .search-wrap { order: 4; width: 100%; }
  .hero { min-height: 350px; padding: 38px 28px; }
  .hero::after { right: 8%; width: 90px; height: 90px; opacity: .55; }
  .hero h1 { font-size: clamp(46px, 9vw, 64px); }
}

@media (max-width: 520px) {
  .main { width: calc(100% - 20px); }
  .topbar { top: 5px; margin-top: 5px; border-radius: 15px; }
  .top-nav { gap: 28px; }
  .top-nav a { font-size: 11px; }
  .hero { min-height: 370px; padding: 30px 22px; border-radius: 20px; }
  .hero::before { right: -60%; }
  .hero::after { top: 78%; right: 11%; width: 54px; height: 54px; }
  .hero h1 { font-size: 43px; }
  .hero p { max-width: 320px; font-size: 13px; }
  .hero-buttons { flex-direction: column; align-items: stretch; max-width: 260px; }
  .content-section { padding-top: 48px; }
  .section-heading h2 { font-size: 23px; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .game-card-body { padding: 10px; }
  .game-card-body h3 { font-size: 11px; }
  .game-card-body span { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}


/* 2026 Arcade UI — bright game-grid refresh */
:root {
  --bg: #ff7a00;
  --surface: rgba(255,255,255,.94);
  --surface-2: #fff8e9;
  --surface-3: #ffe7b5;
  --text: #171717;
  --muted: #6d6257;
  --line: rgba(35, 28, 18, .16);
  --accent: #ffe100;
  --accent-strong: #ffc400;
  --danger: #e5484d;
  --radius: 22px;
  --shadow: 0 16px 34px rgba(75, 37, 0, .18);
}

html {
  background: #ff7a00;
}

body {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 85% 0%, rgba(255,235,0,.9), transparent 24rem),
    radial-gradient(circle at 12% 20%, rgba(255,177,0,.8), transparent 26rem),
    linear-gradient(135deg, #ff6500 0%, #ff8500 48%, #ffc400 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.main {
  width: min(1440px, calc(100% - 36px));
  padding-bottom: 80px;
}

.topbar {
  top: 10px;
  min-height: 72px;
  margin: 10px 0 26px;
  padding: 10px 14px;
  border: 2px solid #171717;
  border-radius: 22px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 9px 0 rgba(23,23,23,.16), 0 18px 35px rgba(67,31,0,.14);
  backdrop-filter: blur(18px);
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #171717;
  color: #ffe100;
  box-shadow: none;
}

.brand strong { color: #171717; font-size: 14px; letter-spacing: .12em; }
.brand small { color: #8a5c00; font-size: 9px; letter-spacing: .22em; }

.search-wrap {
  width: min(330px, 30vw);
  padding: 10px 12px;
  border: 2px solid rgba(23,23,23,.14);
  border-radius: 14px;
  background: #fff;
  color: #6d6257;
}

.search-wrap:focus-within {
  border-color: #171717;
  box-shadow: 0 0 0 3px rgba(255,225,0,.55);
}

.search-wrap input { color: #171717; }
.search-wrap input::placeholder { color: #9a8c7c; }

.search-wrap kbd {
  border: 1px solid rgba(23,23,23,.14);
  border-radius: 6px;
  padding: 2px 5px;
  color: #75685c;
  background: #fffaf0;
}

.top-button, .secondary-button, .filter, .player-button {
  border: 2px solid #171717;
  border-radius: 13px;
  background: #fff;
  color: #171717;
  box-shadow: 0 3px 0 rgba(23,23,23,.12);
}

.top-button { padding: 10px 13px; font-weight: 800; }
.top-button:hover, .secondary-button:hover, .filter:hover {
  background: #fff5c8;
  border-color: #171717;
  transform: translateY(-1px);
}
.auth-button { background: #ffe100; }

.simple-intro {
  position: relative;
  overflow: hidden;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 36px clamp(24px, 5vw, 64px);
  border: 3px solid #171717;
  border-radius: 30px;
  background:
    radial-gradient(circle at 88% 35%, rgba(255,255,255,.8), transparent 10rem),
    linear-gradient(125deg, #fffdf4 0%, #fff4a9 58%, #ffe100 100%);
  box-shadow: 0 12px 0 #171717, 0 24px 38px rgba(72,34,0,.16);
}

.simple-intro::after {
  content: "PLAY";
  position: absolute;
  right: 7%;
  bottom: -20px;
  font-size: clamp(90px, 15vw, 190px);
  line-height: 1;
  font-weight: 950;
  letter-spacing: -.1em;
  color: rgba(255,255,255,.5);
  transform: rotate(-8deg);
  pointer-events: none;
}

.simple-intro > * { position: relative; z-index: 1; }

.simple-intro .section-label {
  color: #a54c00;
  font-size: 11px;
  letter-spacing: .22em;
}

.simple-intro h1 {
  margin: 7px 0 4px;
  font-size: clamp(48px, 8vw, 86px);
  line-height: .9;
  letter-spacing: -.08em;
  font-weight: 950;
}

.simple-intro p {
  margin: 0;
  color: #6e5c43;
  font-size: 15px;
  font-weight: 650;
}

.content-section {
  padding-top: 54px;
  scroll-margin-top: 110px;
}

.section-heading {
  margin-bottom: 17px;
}

.section-heading h2 {
  margin-top: 5px;
  color: #171717;
  font-size: 27px;
  font-weight: 900;
  letter-spacing: -.055em;
}

.section-label {
  color: #8d4200;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .2em;
}

.count, .section-note {
  color: #6d5d4e;
  font-weight: 650;
}

.filters {
  gap: 8px;
  margin-bottom: 17px;
}

.filter {
  padding: 8px 13px;
  font-size: 12px;
  font-weight: 850;
}

.filter.active {
  border-color: #171717;
  background: #171717;
  color: #ffe100;
  box-shadow: 0 3px 0 rgba(23,23,23,.25);
}

.game-grid {
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 15px;
}

.game-card {
  overflow: hidden;
  border: 3px solid #171717;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 7px 0 rgba(23,23,23,.92), 0 14px 25px rgba(75,37,0,.15);
  transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s ease;
}

.game-card:hover {
  transform: translateY(-6px) rotate(-.35deg);
  border-color: #171717;
  background: #fff;
  box-shadow: 0 12px 0 #171717, 0 24px 35px rgba(75,37,0,.2);
}

.game-thumb, .game-thumb-fallback {
  aspect-ratio: 1 / 1;
  background: #f2eadc;
}

.game-thumb {
  transition: transform .25s ease;
}

.game-card:hover .game-thumb {
  transform: scale(1.035);
}

.game-thumb-fallback {
  color: #171717;
  font-size: 44px;
  background: linear-gradient(135deg, #ffe100, #ff9b00);
}

.game-card-body {
  padding: 12px 13px 14px;
  background: #fff;
}

.game-card-body h3 {
  color: #171717;
  font-size: 13px;
  font-weight: 900;
}

.game-card-body span {
  color: #8a7665;
  font-size: 10px;
  font-weight: 700;
}

.favorite-button {
  top: 9px;
  right: 9px;
  width: 34px;
  height: 34px;
  border: 2px solid #171717;
  border-radius: 11px;
  background: rgba(255,255,255,.94);
  color: #171717;
  box-shadow: 0 3px 0 rgba(23,23,23,.18);
}

.favorite-button:hover, .favorite-button.active {
  border-color: #171717;
  background: #ffe100;
  color: #171717;
}

.empty-state {
  padding: 38px 18px;
  border: 3px dashed rgba(23,23,23,.35);
  border-radius: 22px;
  background: rgba(255,255,255,.55);
}

.app-grid, .settings-grid {
  gap: 13px;
}

.app-card, .setting-card {
  padding: 16px;
  border: 3px solid #171717;
  border-radius: 20px;
  background: #fff;
  color: #171717;
  box-shadow: 0 5px 0 rgba(23,23,23,.88);
}

.app-card:hover {
  border-color: #171717;
  background: #fff9df;
  transform: translateY(-3px);
}

.app-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: #ffe100;
  filter: none;
}

.app-card small, .setting-card small {
  color: #806f60;
}

.switch i { background: #d5c9bc; }
.switch input:checked + i { background: #171717; }
.switch input:checked + i::before { background: #ffe100; }

.primary-button {
  border: 2px solid #171717;
  background: #ffe100;
  color: #171717;
  box-shadow: 0 4px 0 #171717;
}

.primary-button:hover {
  background: #fff36c;
  transform: translateY(-2px);
}

.danger-button {
  border: 2px solid #e5484d;
  background: #fff0f0;
  color: #c62f36;
}

.player-modal, .small-modal {
  background: rgba(19,12,5,.76);
  backdrop-filter: blur(7px);
}

.player-window {
  border: 3px solid #171717;
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(0,0,0,.45);
}

.player-topbar {
  background: #171717;
}

.small-modal-box {
  border: 3px solid #171717;
  border-radius: 22px;
  background: #fff;
  color: #171717;
  box-shadow: 0 16px 50px rgba(0,0,0,.28);
}

#notesArea, .auth-field input {
  border: 2px solid rgba(23,23,23,.18);
  background: #fffaf0;
  color: #171717;
}

#notesArea:focus, .auth-field input:focus { border-color: #171717; }

.auth-field span { color: #6d6257; }
.auth-switch { color: #6d6257; }
.auth-switch:hover { color: #171717; }

#toast {
  border: 2px solid #171717;
  border-radius: 12px;
  background: #171717;
  color: #ffe100;
  font-weight: 800;
  box-shadow: 0 8px 0 rgba(23,23,23,.2);
}

@media (max-width: 800px) {
  .main { width: min(100% - 20px, 720px); }
  .topbar { margin-bottom: 22px; }
  .search-wrap { width: 100%; }
  .simple-intro { min-height: 200px; }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); }
}

@media (max-width: 520px) {
  .main { width: calc(100% - 14px); }
  .topbar { border-radius: 17px; }
  .simple-intro { border-radius: 23px; box-shadow: 0 8px 0 #171717; }
  .simple-intro h1 { font-size: 48px; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .game-card { border-radius: 18px; }
  .game-card-body { padding: 9px 10px 11px; }
  .favorite-button { width: 30px; height: 30px; }
}


/* Game player controls — screenshot-inspired */
.player-window:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  border-radius: 0;
  border: 0;
}

.player-window:fullscreen .player-topbar {
  height: 56px;
}

.player-actions {
  gap: 8px;
}

.player-button {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  width: 38px;
  height: 38px;
  border: 2px solid rgba(255,255,255,.2);
  border-radius: 11px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  box-shadow: none;
}

.player-button:hover {
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.42);
  transform: translateY(-1px);
}

.player-close-button {
  background: #ff2424;
  border-color: #ff2424;
  color: #fff;
  border-radius: 11px;
}

.player-close-button:hover {
  background: #ff4545;
  border-color: #ff4545;
}

.player-window:fullscreen .player-close-button {
  position: relative;
}

@media (max-width: 520px) {
  .player-actions { gap: 6px; }
  .player-button {
    min-width: 34px;
    width: 34px;
    height: 34px;
  }
}


/* New-tab player control */
#openNewTab {
  position: relative;
}

#openNewTab::after {
  content: "↗";
  font-size: 19px;
  line-height: 1;
}

#openNewTab {
  font-size: 0;
}

#openNewTab:hover {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.48);
}

@media (max-width: 520px) {
  #openNewTab { font-size: 0; }
}


/* Minimal all-games homepage */
.games-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 30px 0 18px;
  padding: 0 2px;
}

.games-toolbar h1 {
  margin: 0;
  color: #171717;
  font-size: clamp(34px, 5vw, 52px);
  line-height: .95;
  letter-spacing: -.07em;
  font-weight: 950;
}

.games-toolbar .count {
  padding-bottom: 5px;
}

#gamesSection {
  padding-top: 0;
}

@media (max-width: 520px) {
  .games-toolbar {
    margin-top: 20px;
    align-items: center;
  }

  .games-toolbar h1 {
    font-size: 34px;
  }
}

/* Full-screen in-page game player */
.player-modal {
  padding: 0;
  place-items: stretch;
  background: #000;
}

.player-window {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  grid-template-rows: 0 minmax(0, 1fr);
}

.player-topbar {
  position: absolute;
  top: 10px;
  right: 10px;
  left: 10px;
  z-index: 10;
  height: 44px;
  border-radius: 12px;
  background: rgba(23,23,23,.82);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.player-topbar > strong {
  display: none;
}

.player-actions {
  margin-left: auto;
  pointer-events: auto;
}

#gameFrame,
#ruffleFrame {
  width: 100vw;
  height: 100vh;
  min-width: 100%;
  min-height: 100%;
}

#gameFrame {
  display: block;
}

#ruffleFrame {
  position: absolute;
  inset: 0;
}

#ruffleFrame ruffle-player {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

@media (max-width: 520px) {
  .player-topbar {
    top: 8px;
    right: 8px;
    left: 8px;
  }
}


/* Transparent game controls with fullscreen support */
.player-window {
  position: relative;
}

.player-topbar {
  background: transparent !important;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: none;
}

.player-actions {
  gap: 7px;
}

.player-button {
  background: rgba(0, 0, 0, .18);
  border-color: rgba(255, 255, 255, .24);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.player-button:hover {
  background: rgba(0, 0, 0, .28);
  border-color: rgba(255, 255, 255, .5);
}

.player-close-button {
  background: rgba(255, 36, 36, .32);
  border-color: rgba(255, 80, 80, .5);
}

.player-close-button:hover {
  background: rgba(255, 36, 36, .48);
  border-color: rgba(255, 120, 120, .72);
}

.player-window:fullscreen .player-topbar {
  background: transparent !important;
}


/* Account modal */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, .65);
  backdrop-filter: blur(6px);
}
.auth-modal[aria-hidden="false"] { display: grid; }
.auth-box {
  position: relative;
  width: min(100%, 430px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.auth-box #authSubmit,
.auth-box #authLogout {
  width: 100%;
  margin-top: 16px;
  justify-content: center;
}
