/* ===========================================================
   UNEMPLOYABLE — a Gmail-flavored endless inbox of rejection
   Satire. Not affiliated with Google. See disclaimer.
   =========================================================== */

:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --line: #e8eaed;
  --text: #202124;
  --text-soft: #5f6368;
  --text-faint: #80868b;
  --accent: #c5221f;        /* rejection red */
  --accent-soft: #fce8e6;
  --blue: #1a73e8;
  --unread: #202124;
  --read: #5f6368;
  --hover: #f5f5f5;
  --shadow: 0 1px 2px rgba(60,64,67,.3), 0 2px 6px 2px rgba(60,64,67,.15);
  --radius: 16px;
  --sidebar-w: 256px;
  --topbar-h: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Roboto", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

svg { fill: currentColor; }

.icon-btn {
  background: none;
  border: none;
  color: var(--text-soft);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s;
  flex: none;
}
.icon-btn:hover { background: rgba(60,64,67,.08); }

/* ===== Top bar ===== */
.topbar {
  height: var(--topbar-h);
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar-left { display: flex; align-items: center; gap: 4px; min-width: var(--sidebar-w); }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; padding-left: 8px; }
.logo-mark { display: block; flex: none; }
.logo-word { font-size: 22px; color: var(--text-soft); font-weight: 400; letter-spacing: -.5px; align-self: center; }
.logo-sub { font-size: 11px; color: var(--text-faint); font-style: italic; align-self: center; }

.topbar-search {
  flex: 1;
  max-width: 720px;
  display: flex;
  align-items: center;
  background: #eaf1fb;
  border-radius: 8px;
  padding: 2px 6px;
  height: 48px;
  transition: background .15s, box-shadow .15s;
}
.topbar-search:focus-within { background: #fff; box-shadow: var(--shadow); }
.topbar-search input {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: 16px; color: var(--text); padding: 0 8px;
}
/* Readable placeholder in both themes (Chrome's default fails AA on dark). */
.topbar-search input::placeholder { color: var(--text-soft); opacity: 1; }
.search-icon { color: var(--text-soft); }

/* Visible keyboard focus everywhere interactive (WCAG 2.4.7). */
a:focus-visible, button:focus-visible, input:focus-visible,
.tab:focus-visible, .email-row:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
  border-radius: 4px;
}
.email-row:focus-visible { outline-offset: -2px; z-index: 2; }

.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.shop-cta {
  background: var(--text); color: #fff; text-decoration: none;
  font-weight: 700; font-size: 13px; letter-spacing: .3px;
  padding: 9px 16px; border-radius: 20px; white-space: nowrap;
  transition: transform .12s, background .15s;
}
.shop-cta:hover { background: var(--accent); transform: translateY(-1px); }
.avatar-me {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}

/* ===== Layout ===== */
.layout { display: flex; height: calc(100vh - var(--topbar-h)); }

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-w);
  flex: none;
  padding: 8px 8px 8px 8px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.compose {
  display: flex; align-items: center; gap: 12px;
  background: #c2e7ff; color: #001d35; border: none;
  border-radius: 16px; padding: 14px 22px 14px 16px;
  font-size: 14px; font-weight: 500; cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.1); margin: 8px 0 12px 0;
  align-self: flex-start; transition: box-shadow .15s, background .15s;
}
.compose:hover { box-shadow: var(--shadow); background: #b3e0ff; }

.folders { display: flex; flex-direction: column; }
.folder {
  display: flex; align-items: center; gap: 16px;
  padding: 0 12px 0 16px; height: 36px; border-radius: 0 16px 16px 0;
  font-size: 14px; color: var(--text); cursor: pointer; text-decoration: none;
  font-weight: 400;
}
.folder:hover { background: #eaeaea; }
.folder.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.f-ic { width: 20px; text-align: center; font-size: 15px; }
.f-count { margin-left: auto; font-size: 12px; font-weight: 700; }
.folder.active .f-count { color: var(--accent); }
.f-note { margin-left: auto; font-size: 11px; color: var(--text-faint); font-style: italic; }

.sidebar-foot { margin-top: auto; padding: 16px 16px 8px; font-size: 11px; color: var(--text-faint); }
.storage-bar { height: 4px; background: #e0e0e0; border-radius: 2px; overflow: hidden; margin: 6px 0; }
.storage-bar span { display: block; height: 100%; width: 99.8%; background: var(--accent); }
.storage-txt { margin: 2px 0 0; }
.copyright { margin: 12px 0 0; font-size: 11px; color: var(--text-faint); }
.about-card .copyright { margin-top: 14px; }
.built-by { margin: 6px 0 0; font-size: 11px; color: var(--text-faint); }
.built-by a { color: var(--blue); text-decoration: none; }
.built-by a:hover { text-decoration: underline; }
.about-credit {
  font-size: 13px; line-height: 1.6; color: var(--text);
  background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; margin: 8px 0 4px;
}
.about-credit a { color: var(--accent); font-weight: 700; text-decoration: none; }
.about-credit a:hover { text-decoration: underline; }

/* ===== Inbox ===== */
.inbox {
  flex: 1;
  background: var(--surface);
  border-radius: var(--radius) 0 0 0;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.inbox-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 16px; height: 48px; flex: none;
  border-bottom: 1px solid transparent;
}
.row-check { width: 18px; height: 18px; accent-color: var(--text-soft); cursor: pointer; }
.toolbar-label { font-size: 13px; color: var(--text-faint); font-style: italic; }
.toolbar-right { margin-left: auto; font-size: 12px; color: var(--text-soft); }

.tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 8px; flex: none; }
.tab {
  display: flex; align-items: center; gap: 10px;
  padding: 0 24px; height: 44px; font-size: 14px; color: var(--text-soft);
  cursor: pointer; border-bottom: 3px solid transparent; max-width: 280px;
}
.tab small { color: var(--text-faint); font-size: 11px; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
.tab:hover:not(.active) { background: var(--hover); }
.tab-ic { font-size: 16px; }

.email-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }

.email-row {
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px; height: 40px; cursor: pointer;
  border-bottom: 1px solid #f1f3f4; position: relative;
  transition: box-shadow .1s;
}
.email-row:hover { box-shadow: inset 1px 0 0 #dadce0, inset -1px 0 0 #dadce0, 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15); z-index: 1; }
.email-row.unread { background: #fff; }
.email-row.read { background: #f2f2f2; }
.email-row.unread .er-sender,
.email-row.unread .er-subject { font-weight: 700; color: var(--unread); }
.email-row.read .er-sender,
.email-row.read .er-subject { font-weight: 400; color: var(--read); }

.er-check { width: 18px; height: 18px; accent-color: var(--text-soft); flex: none; }
.er-star {
  color: #dadce0; font-size: 18px; line-height: 1; cursor: pointer; flex: none;
  width: 20px; text-align: center; user-select: none;
}
.er-star.on { color: #f4b400; }
.er-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 500;
}
.er-sender { width: 200px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.er-main { flex: 1; overflow: hidden; white-space: nowrap; font-size: 14px; min-width: 0; }
.er-subject { color: var(--text); }
.er-snippet { color: var(--text-faint); font-weight: 400; }
.er-snippet::before { content: "— "; }   /* desktop inline dash; removed on mobile */
.er-label {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 6px;
  border-radius: 4px; margin-right: 8px; vertical-align: middle;
}
.lbl-rejected { background: var(--accent-soft); color: var(--accent); }
.lbl-ghosted  { background: #e8eaed; color: #5f6368; }
.lbl-final    { background: #fef7e0; color: #b06000; }
.lbl-promo    { background: #e8f0fe; color: #1a73e8; }
.lbl-social   { background: #e6f4ea; color: #137333; }
.er-date { width: 70px; flex: none; text-align: right; font-size: 12px; color: var(--text-soft); }
.email-row.unread .er-date { font-weight: 700; color: var(--text); }
.er-date .row-hover-ic { display: none; }

/* ===== Loader ===== */
.loader {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 24px; color: var(--text-soft); font-size: 13px;
}
.spinner {
  width: 18px; height: 18px; border: 3px solid #dadce0;
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Email modal ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(32,33,36,.6);
  z-index: 50; display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto;
  animation: fade .15s ease;
}
/* The hidden attribute must win over display:flex, or modals never close. */
.modal-overlay[hidden] { display: none !important; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); width: 100%; max-width: 860px;
  border-radius: 16px; box-shadow: var(--shadow); overflow: hidden;
  animation: pop .18s ease;
}
@keyframes pop { from { transform: translateY(8px) scale(.99); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-toolbar {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-bottom: 1px solid var(--line);
}
.modal-tool-icons { display: flex; gap: 2px; margin-left: 8px; }
.modal-body { padding: 24px 32px 36px; }

.mb-subject { font-size: 22px; font-weight: 400; margin: 0 0 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mb-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.mb-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 500; font-size: 18px;
}
.mb-meta { flex: 1; min-width: 0; }
.mb-from { font-size: 14px; font-weight: 700; color: var(--text); }
.mb-email { font-size: 13px; color: var(--text-soft); font-weight: 400; }
.mb-to { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.mb-date { font-size: 12px; color: var(--text-soft); white-space: nowrap; }
.mb-content { font-size: 14px; line-height: 1.7; color: #3c4043; }
.mb-content p { margin: 0 0 14px; }
.mb-content .sig { color: var(--text-soft); }
.mb-cta {
  margin-top: 28px; padding: 18px 20px; border: 1px dashed var(--accent);
  border-radius: 12px; background: var(--accent-soft); text-align: center;
}
.mb-cta p { margin: 0 0 10px; font-size: 14px; color: var(--accent); font-weight: 500; }
.mb-cta a {
  display: inline-block; background: var(--text); color: #fff; text-decoration: none;
  font-weight: 700; padding: 10px 22px; border-radius: 20px; font-size: 13px;
  letter-spacing: .3px; transition: background .15s;
}
.mb-cta a:hover { background: var(--accent); }
.mb-actions { margin-top: 24px; display: flex; gap: 12px; }
.mb-btn {
  border: 1px solid var(--line); background: #fff; color: var(--text-soft);
  border-radius: 18px; padding: 8px 20px; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; font-family: inherit;
}
.mb-btn:hover { background: var(--hover); }

/* Easter-egg email styling */
.egg .mb-content { font-family: "Courier New", monospace; }

/* ===== About / disclaimer ===== */
.about-card {
  background: #fff; max-width: 540px; width: 100%; border-radius: 18px;
  padding: 40px 36px 32px; position: relative; box-shadow: var(--shadow);
  animation: pop .2s ease; margin: auto;
}
.about-close {
  position: absolute; top: 14px; right: 18px; background: none; border: none;
  font-size: 28px; line-height: 1; color: var(--text-soft); cursor: pointer;
}
.about-card h2 { margin: 0; font-size: 30px; letter-spacing: 1px; }
.about-tag { margin: 4px 0 20px; color: var(--accent); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; font-size: 13px; }
.about-card p { font-size: 14px; line-height: 1.65; color: #3c4043; }
.about-shop {
  display: inline-block; background: var(--text); color: #fff; text-decoration: none;
  font-weight: 700; padding: 12px 26px; border-radius: 22px; margin: 12px 0 20px;
  letter-spacing: .3px; transition: background .15s;
}
.about-shop:hover { background: var(--accent); }
.disclaimer { font-size: 11.5px; color: var(--text-faint); line-height: 1.6; border-top: 1px solid var(--line); padding-top: 16px; }
.disclaimer a, .cvs-egg a { color: var(--blue); }
.cvs-egg { font-size: 12px; color: var(--text-faint); }

/* ===== Mobile (native-app feel) — desktop is untouched ===== */
.mobile-only { display: none; }
.mobile-tabs, .fab-compose, .scrim { display: none; }

@media (max-width: 900px) {
  :root { --topbar-h: 58px; }
  .mobile-only { display: flex; }

  /* --- top bar: hamburger + search pill + avatar --- */
  .topbar { padding: 8px 10px; gap: 8px; }
  .topbar-left { min-width: 0; flex: none; gap: 0; }
  .logo { display: none; }
  .shop-cta, #themeBtn, #aboutBtn { display: none; }
  .topbar-search { flex: 1; height: 44px; max-width: none; }
  .topbar-right { flex: none; margin-left: 0; gap: 4px; }

  /* --- slide-in drawer --- */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 300px; max-width: 86vw;
    background: var(--bg); z-index: 60; transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.2,.8,.2,1); box-shadow: var(--shadow);
    padding-top: 4px; overscroll-behavior: contain;
  }
  .sidebar.open { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.45); animation: fade .2s ease; }
  .scrim[hidden] { display: none; }
  .drawer-brand { align-items: center; gap: 10px; padding: 12px 16px 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
  .drawer-brand .logo-word { display: inline; font-size: 20px; color: var(--text-soft); }
  .drawer-brand .logo-sub { display: inline; font-size: 10.5px; color: var(--text-faint); font-style: italic; }
  .drawer-extra { flex-direction: column; border-top: 1px solid var(--line); margin: 6px 8px 0; padding-top: 6px; }
  .drawer-item {
    display: flex; align-items: center; gap: 6px; padding: 0 16px; height: 46px; width: 100%;
    border: none; background: none; color: var(--text); font-size: 14px; text-align: left;
    cursor: pointer; border-radius: 0 24px 24px 0; text-decoration: none; font-family: inherit;
  }
  .drawer-item:hover, .drawer-item:active { background: var(--hover); }

  .layout { height: calc(100dvh - var(--topbar-h)); }
  .inbox { border-radius: 0; }

  /* --- strip desktop chrome --- */
  .tabs, .inbox-toolbar { display: none; }

  /* --- native multiline rows --- */
  .email-list { padding-bottom: 84px; }
  .email-row {
    display: grid; grid-template-columns: 44px 1fr auto;
    grid-template-areas: "av sender date" "av subject subject" "av snippet snippet";
    column-gap: 12px; row-gap: 1px; height: auto; min-height: 78px;
    padding: 12px 16px; align-items: start;
  }
  .email-row:hover { box-shadow: none; }
  .er-check, .er-star, .er-label { display: none; }
  .er-avatar { grid-area: av; width: 40px; height: 40px; font-size: 17px; align-self: center; }
  .er-sender { grid-area: sender; width: auto; font-size: 15px; align-self: center; }
  .er-date { grid-area: date; width: auto; font-size: 12px; align-self: center; }
  .er-main { display: contents; }
  .er-subject { grid-area: subject; font-size: 14px; white-space: normal; overflow: hidden;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
  .er-snippet { grid-area: snippet; font-size: 13px; white-space: normal; overflow: hidden;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }
  .er-snippet::before { content: ""; }

  /* --- bottom tab bar --- */
  .mobile-tabs {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: 60px;
    background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .mobile-tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: none; background: none; color: var(--text-faint); font-size: 11px; font-weight: 600;
    cursor: pointer; font-family: inherit;
  }
  .mobile-tab span { font-size: 21px; line-height: 1; }
  .mobile-tab.active { color: var(--accent); }

  /* --- compose FAB --- */
  .fab-compose {
    display: flex; align-items: center; justify-content: center; position: fixed;
    right: 16px; bottom: calc(72px + env(safe-area-inset-bottom, 0)); z-index: 52;
    width: 56px; height: 56px; border-radius: 18px; border: none;
    background: var(--accent); box-shadow: var(--shadow); cursor: pointer;
  }
  .fab-compose svg { width: 26px; height: 26px; fill: #fff; }

  /* --- keep the game HUD clear of the FAB + bottom bar --- */
  .game-hud { right: auto; left: 12px; bottom: calc(72px + env(safe-area-inset-bottom, 0)); width: 210px; }
  .game-pill { right: auto; left: 12px; bottom: calc(72px + env(safe-area-inset-bottom, 0)); }
  .game-best { display: none; }
  .game-toasts { bottom: calc(140px + env(safe-area-inset-bottom, 0)); }

  /* full-screen modals */
  .modal-overlay { padding: 0; }
  .modal { max-width: 100%; min-height: 100vh; border-radius: 0; }
  .modal-body { padding: 18px 18px 28px; }
  .mb-subject { font-size: 18px; }
}

@media (max-width: 520px) {
  .er-sender { font-size: 14px; }
  .game-hud { width: 188px; }
}

/* ===========================================================
   Dark mode — Gmail-style. Toggled via <html data-theme="dark">.
   =========================================================== */
:root[data-theme="dark"] {
  --bg: #1b1c1d;
  --surface: #202124;
  --line: #3c4043;
  --text: #e8eaed;
  --text-soft: #bdc1c6;
  --text-faint: #9aa0a6;
  --accent: #f28b82;            /* lighter red, readable on dark */
  --accent-soft: #3a2a2a;
  --blue: #8ab4f8;
  --hover: #2a2b2e;
  --unread: #e8eaed;            /* bright: unread row sender/subject */
  --read: #bdc1c6;              /* legible grey: read row sender/subject */
  --shadow: 0 1px 2px rgba(0,0,0,.6), 0 2px 6px 2px rgba(0,0,0,.35);
}
:root[data-theme="dark"] .topbar-search { background: #2a2b2e; }
:root[data-theme="dark"] .topbar-search:focus-within { background: #303134; }
:root[data-theme="dark"] .compose { background: #004a77; color: #c2e7ff; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
:root[data-theme="dark"] .compose:hover { background: #00598f; }
:root[data-theme="dark"] .folder:hover { background: #2a2b2e; }
:root[data-theme="dark"] .email-row { border-bottom-color: #2d2e30; }
:root[data-theme="dark"] .email-row.unread { background: #2a2b2e; }
:root[data-theme="dark"] .email-row.read { background: #202124; }
:root[data-theme="dark"] .email-row:hover {
  box-shadow: inset 1px 0 0 #5f6368, inset -1px 0 0 #5f6368, 0 1px 2px 0 rgba(0,0,0,.6);
}
:root[data-theme="dark"] .er-star { color: #5f6368; }
:root[data-theme="dark"] .storage-bar { background: #3c4043; }
:root[data-theme="dark"] .shop-cta { background: #e8eaed; color: #202124; }
:root[data-theme="dark"] .shop-cta:hover { background: var(--accent); color: #202124; }
:root[data-theme="dark"] .avatar-me { background: var(--accent); color: #202124; }
:root[data-theme="dark"] .compose,
:root[data-theme="dark"] .icon-btn { color: var(--text-soft); }
:root[data-theme="dark"] .icon-btn:hover { background: rgba(232,234,237,.1); }
:root[data-theme="dark"] .about-card { background: #2a2b2e; }
:root[data-theme="dark"] .mb-content { color: #e8eaed; }
:root[data-theme="dark"] .mb-content .sig { color: var(--text-soft); }
:root[data-theme="dark"] .mb-btn { background: transparent; color: var(--text-soft); border-color: var(--line); }
:root[data-theme="dark"] .mb-btn:hover { background: var(--hover); }
:root[data-theme="dark"] .logo-mark rect { fill: #2a2b2e; stroke: #3c4043; }
/* keep promo/social chips readable on dark */
:root[data-theme="dark"] .lbl-ghosted { background: #3c4043; color: #bdc1c6; }
:root[data-theme="dark"] .lbl-final { background: #3a3320; color: #fdd663; }
:root[data-theme="dark"] .lbl-promo { background: #1f2a3d; color: #8ab4f8; }
:root[data-theme="dark"] .lbl-social { background: #1e2e22; color: #81c995; }
:root[data-theme="dark"] .mb-cta { background: var(--accent-soft); }
:root[data-theme="dark"] .mb-cta a { background: #e8eaed; color: #202124; }
:root[data-theme="dark"] .mb-cta a:hover { background: var(--accent); }
:root[data-theme="dark"] .row-check,
:root[data-theme="dark"] .er-check { accent-color: #8ab4f8; }

/* ===========================================================
   Rejection Training — gamification HUD
   =========================================================== */
.game-hud {
  position: fixed; right: 20px; bottom: 20px; width: 244px; z-index: 45;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 14px 16px 16px; font-family: "Roboto", Arial, sans-serif;
  animation: hudIn .35s cubic-bezier(.2,.8,.2,1);
}
@keyframes hudIn { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.game-hud.hidden { display: none; }
.game-min {
  position: absolute; top: 8px; right: 10px; width: 24px; height: 24px; border: none;
  background: none; color: var(--text-faint); font-size: 20px; line-height: 1; cursor: pointer;
  border-radius: 50%;
}
.game-min:hover { background: var(--hover); color: var(--text); }
.game-title { font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--text-faint); }
.game-rank { font-size: 19px; font-weight: 700; color: var(--text); margin: 6px 0 10px; line-height: 1.15; }
.game-bar { height: 8px; background: var(--line); border-radius: 5px; overflow: hidden; }
.game-bar span {
  display: block; height: 100%; width: 0%; border-radius: 5px;
  background: linear-gradient(90deg, var(--accent), #ef9a93);
  transition: width .5s cubic-bezier(.2,.8,.2,1);
}
.game-stats { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--text-soft); }
.game-stats #gameNext { color: var(--text-faint); white-space: nowrap; }
.game-best { margin-top: 4px; font-size: 11px; color: var(--text-faint); }

.game-pill {
  position: fixed; right: 20px; bottom: 20px; z-index: 45; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); border-radius: 22px; padding: 9px 15px;
  font-size: 14px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow);
  display: inline-flex; align-items: center; gap: 6px; font-family: "Roboto", Arial, sans-serif;
}
.game-pill[hidden] { display: none; }
.game-pill:hover { border-color: var(--accent); }

.game-toasts {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 60; display: flex; flex-direction: column; gap: 10px; align-items: center;
  pointer-events: none; width: max-content; max-width: 90vw;
}
.game-toast {
  background: var(--text); color: var(--surface); padding: 12px 20px; border-radius: 24px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow); font-family: "Roboto", Arial, sans-serif;
  animation: toastIn .3s ease, toastOut .4s ease 3.1s forwards;
  display: flex; align-items: center; gap: 10px; pointer-events: auto;
}
.game-toast .t-emoji { font-size: 20px; }
.game-toast.shop { background: var(--accent); color: #fff; cursor: pointer; }
.game-toast.shop a { color: #fff; text-decoration: underline; font-weight: 800; }
@keyframes toastIn { from { transform: translateY(16px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateY(8px); opacity: 0; } }

.game-share {
  margin-top: 12px; width: 100%; border: 1px solid var(--line); background: var(--hover);
  color: var(--text); border-radius: 10px; padding: 8px; font-size: 12.5px; font-weight: 700;
  cursor: pointer; font-family: "Roboto", Arial, sans-serif;
}
.game-share:hover { border-color: var(--accent); color: var(--accent); }

/* ===== Shareable Rejection Résumé ===== */
.share-wrap {
  background: var(--surface); max-width: 520px; width: 100%; margin: auto; border-radius: 18px;
  padding: 28px 28px 24px; position: relative; box-shadow: var(--shadow); animation: pop .2s ease;
}
.share-h { margin: 0 0 16px; font-size: 22px; color: var(--text); }
.share-card {
  border-radius: 16px; padding: 30px 24px; text-align: center; color: #fff;
  background: radial-gradient(120% 140% at 50% 0%, #2a2b2e 0%, #15171a 72%);
  border: 1px solid #0c0d0f;
}
.sc-top { font-size: 11px; letter-spacing: 2px; color: #9aa0a6; font-weight: 700; }
.sc-emoji { font-size: 62px; line-height: 1; margin: 14px 0 8px; }
.sc-rank { font-size: 26px; font-weight: 800; letter-spacing: .3px; }
.sc-count { font-size: 16px; color: #e8eaed; margin-top: 12px; }
.sc-count span { color: #f28b82; font-weight: 800; }
.sc-sub { font-size: 13px; color: #9aa0a6; margin-top: 4px; }
.sc-url { font-size: 12px; color: #71757c; margin-top: 16px; letter-spacing: 1px; }
.share-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.share-btn {
  flex: 1; min-width: 110px; text-align: center; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); border-radius: 22px; padding: 11px 14px; font-size: 14px; font-weight: 700;
  cursor: pointer; text-decoration: none; font-family: "Roboto", Arial, sans-serif;
}
.share-btn:hover { background: var(--hover); }
.share-btn.primary { background: var(--text); color: var(--surface); border-color: var(--text); }
.share-btn.primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
#shareCanvas { display: none; }

/* sidebar counter reactions */
.f-count.faking { color: #34a853 !important; display: inline-block; transform: scale(1.3); transition: transform .2s; }
.f-count.struck { text-decoration: line-through; opacity: .55; }

@media (max-width: 600px) {
  .game-hud { right: 12px; bottom: 12px; width: 200px; padding: 12px 13px 13px; }
  .game-rank { font-size: 17px; }
  .game-best { display: none; }
  .game-pill { right: 12px; bottom: 12px; }
  .share-wrap { margin: 12px; padding: 22px 18px 18px; }
  .share-actions { flex-direction: column; }
}

/* ===== Final Boss prank ===== */
.offer-prank {
  position: fixed; inset: 0; z-index: 75; display: flex; align-items: center; justify-content: center;
  background: rgba(8,9,10,.72); padding: 24px; animation: fade .2s ease;
}
.offer-prank[hidden] { display: none; }
.offer-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 40px 36px; max-width: 460px; text-align: center; box-shadow: var(--shadow);
  animation: pop .25s ease; transition: background .3s;
}
.offer-emoji { font-size: 72px; line-height: 1; }
.offer-card h2 { margin: 14px 0 8px; font-size: 30px; letter-spacing: .5px; color: #34a853; }
.offer-card p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--text-soft); }
.offer-card.rescinded h2 { color: var(--accent); }
#shareCanvas { display: none; }

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