/* =================================================================
 * BLOOKET1 - STEALTH MODE MODAL
 * Sidebar + panes. Flat (no shadows), Nunito, theme variables.
 * Pairs with stealth.js (load after script.js).
 * ================================================================= */

.sm-overlay {
  --sm-accent: var(--accent-color, #ff7a1a);
  --sm-accent-soft: var(--accent-soft, rgba(255, 122, 26, 0.14));
  --sm-base: var(--bg-base, #0b0c13);
  --sm-surface: var(--bg-surface, #12131d);
  --sm-card: var(--bg-card, #181926);
  --sm-card-hover: var(--bg-card-hover, #222436);
  --sm-text: var(--text-primary, #f4f5fa);
  --sm-text-2: var(--text-secondary, #a4a7bf);
  --sm-text-3: var(--text-muted, #6d7090);
  --sm-line: var(--border-subtle, rgba(255, 255, 255, 0.06));
  --sm-line-strong: var(--border-strong, rgba(255, 255, 255, 0.12));
  --sm-font: var(--font-display, 'Nunito', system-ui, sans-serif);
  --sm-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --sm-spring: cubic-bezier(0.34, 1.4, 0.64, 1);

  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 24px;
  background: rgba(4, 5, 10, 0.78);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  font-family: var(--sm-font);
  color: var(--sm-text);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

.sm-overlay.active { opacity: 1; visibility: visible; transition: opacity 0.25s ease, visibility 0s; }

.sm-overlay *, .sm-overlay *::before, .sm-overlay *::after { box-sizing: border-box; }
.sm-overlay :focus-visible { outline: 3px solid var(--sm-accent); outline-offset: 2px; }
.sm-overlay .sm-modal:focus { outline: none; }

.sm-modal {
  position: relative;
  width: min(920px, 100%);
  height: min(640px, calc(100dvh - 48px));
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  border-radius: 26px;
  border: 1px solid var(--sm-line-strong);
  background: var(--sm-surface);
  overflow: hidden;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.45s var(--sm-spring);
}

.sm-overlay.active .sm-modal { transform: none; }

/* --- Sidebar ------------------------------------------------------ */
.sm-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 14px 14px;
  background: var(--sm-base);
  border-right: 1px solid var(--sm-line);
  min-height: 0;
}

.sm-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.sm-brand-icon {
  width: 42px; height: 42px; flex: 0 0 42px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: var(--sm-accent);
  color: #fff;
  font-size: 18px;
}
.sm-brand h2 { margin: 0; font-size: 1.15rem; font-weight: 900; letter-spacing: -0.02em; line-height: 1.15; }
.sm-brand p { margin: 1px 0 0; font-size: 0.8rem; font-weight: 700; color: var(--sm-text-3); }

.sm-nav { display: flex; flex-direction: column; gap: 3px; }

.sm-nav-btn {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 8px 10px 8px 8px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--sm-text-2);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sm-nav-btn > i {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--sm-card);
  font-size: 14px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sm-nav-btn b { display: block; font-size: 0.94rem; font-weight: 900; color: var(--sm-text); letter-spacing: -0.01em; }
.sm-nav-btn small { display: block; font-size: 0.76rem; font-weight: 700; color: var(--sm-text-3); line-height: 1.3; }

.sm-nav-btn:hover { background: var(--sm-card); }
.sm-nav-btn.is-active { background: var(--sm-accent-soft); }
.sm-nav-btn.is-active > i { background: var(--sm-accent); color: #fff; }

.sm-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }

.sm-status {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 11px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: var(--sm-card);
}
.sm-status small { display: block; font-size: 0.74rem; font-weight: 700; color: var(--sm-text-3); }
.sm-status b { display: block; font-size: 0.9rem; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sm-leave-btn {
  height: 46px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: 1px solid rgba(255, 77, 106, 0.35);
  border-radius: 14px;
  background: rgba(255, 77, 106, 0.1);
  color: #ff6b84;
  font: 900 0.95rem/1 var(--sm-font);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.sm-leave-btn:hover { background: #ff4d6a; border-color: #ff4d6a; color: #fff; }

/* Favicon tile (real site icons sit on white, like in a browser) */
.sm-fav {
  width: 44px; height: 44px; flex: 0 0 44px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: #fff;
  overflow: hidden;
}
.sm-fav img { width: 26px; height: 26px; object-fit: contain; display: block; }
.sm-fav b { font-size: 18px; font-weight: 900; color: #1b1e2b; }
.sm-fav--sm { width: 36px; height: 36px; flex-basis: 36px; border-radius: 11px; }
.sm-fav--sm img { width: 22px; height: 22px; }

/* --- Main --------------------------------------------------------- */
.sm-main { position: relative; min-height: 0; overflow-y: auto; scrollbar-width: thin; }

.sm-close {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 3;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--sm-card);
  color: var(--sm-text-2);
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.25s var(--sm-spring);
}
.sm-close:hover { background: var(--sm-card-hover); color: #fff; transform: rotate(90deg); }

.sm-pane { padding: 26px 30px 30px; }
.sm-pane.is-active { animation: smPaneIn 0.35s var(--sm-ease); }
@keyframes smPaneIn { from { opacity: 0; transform: translateY(8px); } }

.sm-pane-head { padding-right: 52px; margin-bottom: 20px; }
.sm-pane-head h3 { margin: 0; font-size: 1.6rem; font-weight: 900; letter-spacing: -0.03em; line-height: 1.1; }
.sm-pane-head p { margin: 6px 0 0; max-width: 54ch; font-size: 0.95rem; font-weight: 700; line-height: 1.5; color: var(--sm-text-2); }

.sm-sub { margin: 26px 0 10px; font-size: 1rem; font-weight: 900; letter-spacing: -0.01em; }

/* --- Buttons & inputs --------------------------------------------- */
.sm-btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

.sm-btn {
  height: 42px;
  padding: 0 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0;
  border-radius: 999px;
  background: var(--sm-card);
  color: #fff;
  font: 900 0.9rem/1 var(--sm-font);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.2s var(--sm-spring);
}
.sm-btn:hover { background: var(--sm-card-hover); }
.sm-btn:active { transform: scale(0.96); }
.sm-btn i { font-size: 0.85em; }
.sm-btn--primary { background: var(--sm-accent); }
.sm-btn--primary:hover { background: var(--accent-hover, #ff9142); }
.sm-btn--ghost { background: transparent; color: var(--sm-text-2); }
.sm-btn--ghost:hover { color: #fff; }
.sm-btn--lg { height: 50px; padding: 0 24px; font-size: 1rem; }

.sm-field { display: grid; gap: 6px; }
.sm-field span { font-size: 0.8rem; font-weight: 800; color: var(--sm-text-2); }

.sm-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--sm-line-strong);
  background: var(--sm-base);
  color: #fff;
  font: 700 0.92rem var(--sm-font);
  transition: border-color 0.15s ease;
}
.sm-input::placeholder { color: var(--sm-text-3); }
.sm-input:focus { outline: none; border-color: var(--sm-accent); }

.sm-note { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; font-size: 0.85rem; font-weight: 700; color: var(--sm-text-3); }

/* --- Browser preview ---------------------------------------------- */
.sm-browser {
  border-radius: 14px;
  overflow: hidden;
  background: #dee1e6;
  color: #1f1f1f;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  margin-bottom: 18px;
}

.sm-browser-tabs { display: flex; align-items: flex-end; gap: 2px; height: 42px; padding: 8px 10px 0; }

.sm-browser-tab {
  display: flex; align-items: center; gap: 9px;
  width: 210px;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px 10px 0 0;
  font-size: 12.5px;
  font-weight: 500;
  color: #474747;
  white-space: nowrap;
}
.sm-browser-tab > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sm-browser-tab > i { font-size: 11px; color: #6b6b6b; }
.sm-browser-tab.is-current { background: #fff; color: #1f1f1f; }
.sm-browser-tab img { width: 16px; height: 16px; flex: 0 0 16px; object-fit: contain; display: block; transition: transform 0.25s var(--sm-spring); }
.sm-browser-tab.is-swapping img { transform: scale(0.6); }
.sm-browser-plus { width: 28px; height: 28px; margin: 0 0 3px 4px; display: grid; place-items: center; font-size: 12px; color: #5f6368; }

.sm-browser-bar {
  display: flex; align-items: center; gap: 14px;
  height: 44px;
  padding: 0 14px;
  background: #fff;
  color: #5f6368;
  font-size: 13px;
}
.sm-browser-bar > i { font-size: 13px; }
.sm-browser-url {
  flex: 1;
  height: 30px;
  display: flex; align-items: center; gap: 9px;
  padding: 0 14px;
  border-radius: 99px;
  background: #f1f3f4;
  color: #1f1f1f;
  font-size: 13px;
}
.sm-browser-url i { font-size: 11px; color: #5f6368; }

/* --- Disguise grid ------------------------------------------------- */
.sm-cloak-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

.sm-tile {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 10px;
  border: 1.5px solid transparent;
  border-radius: 16px;
  background: var(--sm-card);
  color: var(--sm-text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.2s var(--sm-spring);
}
.sm-tile:hover { background: var(--sm-card-hover); }
.sm-tile:active { transform: scale(0.97); }
.sm-tile b { display: block; font-size: 0.9rem; font-weight: 900; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-tile small { display: block; font-size: 0.76rem; font-weight: 700; color: var(--sm-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sm-tile.is-active { border-color: var(--sm-accent); background: var(--sm-accent-soft); }
.sm-tile-check {
  position: absolute;
  top: -6px; right: -6px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--sm-accent);
  color: #fff;
  font-size: 10px;
  border: 3px solid var(--sm-surface);
  transform: scale(0);
  transition: transform 0.3s var(--sm-spring);
}
.sm-tile.is-active .sm-tile-check { transform: scale(1); }

/* --- Custom disguise ------------------------------------------------ */
.sm-custom { margin-top: 14px; border-radius: 16px; background: var(--sm-card); }
.sm-custom summary {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  list-style: none;
  font-size: 0.92rem; font-weight: 900;
  cursor: pointer;
  border-radius: 16px;
}
.sm-custom summary::-webkit-details-marker { display: none; }
.sm-custom summary > i:first-child { color: var(--sm-accent); font-size: 13px; }
.sm-custom-chev { margin-left: auto; font-size: 12px; color: var(--sm-text-3); transition: transform 0.25s var(--sm-ease); }
.sm-custom[open] .sm-custom-chev { transform: rotate(180deg); }
.sm-custom-body { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; padding: 0 16px 16px; }
.sm-custom-body .sm-btn { height: 44px; }

/* --- Panic key ------------------------------------------------------ */
.sm-panic {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: center;
  padding: 20px;
  border-radius: 20px;
  background: var(--sm-card);
}

.sm-keycap { position: relative; width: 104px; height: 104px; }
.sm-keycap::before {
  content: "";
  position: absolute;
  inset: 10px 0 0;
  border-radius: 24px;
  background: #4a2410;
  background: color-mix(in srgb, var(--sm-accent) 42%, #000);
}
.sm-keycap .sm-keycap-face {
  position: absolute;
  inset: 0 0 12px;
  display: grid; place-items: center;
  border-radius: 24px;
  background: var(--sm-accent);
  color: #fff;
  font: 900 52px/1 var(--sm-font);
  padding: 0 6px 4px;
  margin: 0;
  border: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform 0.15s ease;
}
.sm-keycap.is-long .sm-keycap-face { font-size: 22px; }
.sm-keycap.is-listening .sm-keycap-face { animation: smKeyPulse 1s ease-in-out infinite; }
@keyframes smKeyPulse { 50% { transform: translateY(8px); } }

.sm-panic-state { margin: 0 0 12px; font-size: 1rem; font-weight: 900; }
.sm-listening { display: inline-block; color: var(--sm-accent); }
.sm-keycap.is-listening + .sm-panic-info #smPanicStateText { display: none; }

.sm-dest-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

/* --- Blank tab ------------------------------------------------------ */
.sm-blank-demo {
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 20px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.sm-browser-bar--solo { border-bottom: 1px solid #e8eaed; }
.sm-blank-page { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; padding: 14px; background: var(--sm-base); }
.sm-blank-page span { aspect-ratio: 3 / 2; border-radius: 8px; background: var(--sm-card); }
.sm-blank-page span:first-child { background: var(--sm-accent); opacity: 0.85; }

/* --- Themes --------------------------------------------------------- */
.sm-theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.sm-theme {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 10px 10px 12px;
  border: 1.5px solid transparent;
  border-radius: 18px;
  background: var(--sm-card);
  color: var(--sm-text);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.2s var(--sm-spring);
}
.sm-theme:hover { background: var(--sm-card-hover); }
.sm-theme:active { transform: scale(0.98); }
.sm-theme.is-active { border-color: var(--sm-accent); }
.sm-theme b { padding: 0 4px; font-size: 0.95rem; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.sm-theme b i { margin-left: auto; color: var(--sm-accent); font-size: 0.85rem; opacity: 0; }
.sm-theme.is-active b i { opacity: 1; }

/* Mini site preview painted in the theme's own colours */
.sm-theme-mock {
  display: grid;
  grid-template-columns: 22px 1fr;
  grid-template-rows: 18px 1fr;
  gap: 6px;
  height: 120px;
  padding: 8px;
  border-radius: 12px;
  background: var(--t-base);
}
.sm-theme-mock i { border-radius: 5px; background: var(--t-card); }
.sm-theme-mock .t-bar { grid-column: 1 / -1; display: flex; gap: 6px; background: none; }
.sm-theme-mock .t-bar i { flex: 1; }
.sm-theme-mock .t-bar i:first-child { flex: 0 0 22px; background: var(--t-accent); }
.sm-theme-mock .t-bar i:last-child { flex: 0 0 40px; background: var(--t-accent); opacity: 0.35; border-radius: 99px; }
.sm-theme-mock .t-rail { display: flex; flex-direction: column; gap: 5px; background: none; }
.sm-theme-mock .t-rail i { height: 14px; }
.sm-theme-mock .t-rail i:first-child { background: var(--t-accent); }
.sm-theme-mock .t-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; background: none; }
.sm-theme-mock .t-cards i:first-child { grid-column: span 2; background: linear-gradient(135deg, var(--t-accent), var(--t-card)); }

/* --- Responsive ----------------------------------------------------- */
@media (max-width: 860px) {
  .sm-cloak-grid, .sm-dest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm-custom-body { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .sm-blank-page { grid-template-columns: repeat(3, 1fr); }
  .sm-overlay { padding: 0; place-items: end center; }
  .sm-modal {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    height: 92dvh;
    border-radius: 24px 24px 0 0;
    border-bottom: 0;
    transform: translateY(40px);
  }
  .sm-side { padding: 16px 12px 10px; gap: 12px; border-right: 0; border-bottom: 1px solid var(--sm-line); }
  .sm-brand { padding-right: 52px; }
  .sm-nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; gap: 6px; }
  .sm-nav::-webkit-scrollbar { display: none; }
  .sm-nav-btn { width: auto; flex: 0 0 auto; grid-template-columns: auto; padding: 0 14px; height: 38px; border-radius: 99px; background: var(--sm-card); }
  .sm-nav-btn > i { display: none; }
  .sm-nav-btn small { display: none; }
  .sm-nav-btn b { font-size: 0.86rem; color: var(--sm-text-2); }
  .sm-nav-btn.is-active { background: var(--sm-accent); }
  .sm-nav-btn.is-active b { color: #fff; }
  .sm-side-foot { display: none; }
  .sm-pane { padding: 20px 16px 28px; }
  .sm-pane-head { padding-right: 0; }
  .sm-pane-head h3 { font-size: 1.35rem; }
  .sm-cloak-grid, .sm-dest-grid, .sm-theme-grid { grid-template-columns: 1fr 1fr; }
  .sm-tile { grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 8px 10px 8px 8px; }
  .sm-tile .sm-fav { width: 36px; height: 36px; flex-basis: 36px; border-radius: 11px; }
  .sm-tile .sm-fav img { width: 22px; height: 22px; }
  .sm-browser-tab { width: 170px; }
  .sm-browser-tab:not(.is-current), .sm-browser-plus { display: none; }
  .sm-panic { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .sm-panic .sm-btn-row { justify-content: center; }
  .sm-close { top: 14px; right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .sm-overlay *, .sm-overlay *::before, .sm-overlay *::after { animation: none !important; transition-duration: 0.001s !important; }
}

/* --- Site-wide Soundboard Toast (Alt + 1-9) -------------------------- */
.blooket1-sound-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(24, 25, 38, 0.96);
  border: 1.5px solid var(--accent, #ff7a1a);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 999999;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 122, 26, 0.25);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.blooket1-sound-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.blooket1-sound-toast kbd {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11.5px;
  font-family: inherit;
  font-weight: 800;
  color: #ff9f43;
  margin-left: 4px;
}

