/* ==========================================================================
   boredatwork.fun — shared styles
   Used by the landing page, privacy page, and future /games/<name>/ pages.
   Mobile-first. Dark theme is the default; [data-theme="light"] overrides.
   ========================================================================== */

:root {
  --bg: #0e1116;
  --bg-card: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --text: #e9ecf2;
  --muted: #98a2b5;
  --accent: #ffc233;          /* sticky-note amber */
  --accent-2: #ff7a3d;        /* gradient partner: orange */
  --accent-soft: rgba(255, 194, 51, 0.12);
  --glow-a: rgba(255, 176, 46, 0.09);   /* warm corner glow */
  --glow-b: rgba(128, 96, 255, 0.08);   /* cool corner glow */
  --glow-c: rgba(45, 212, 191, 0.05);   /* teal floor glow */
  --dot: rgba(255, 255, 255, 0.030);    /* dot-grid texture */
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  --kbd-top: rgba(255, 255, 255, 0.10);
  --kbd-bottom: rgba(255, 255, 255, 0.22);
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 18px;
}

[data-theme="light"] {
  --bg: #f7f4ee;              /* warm off-white */
  --bg-card: rgba(255, 255, 255, 0.66);
  --border: rgba(25, 35, 60, 0.10);
  --text: #1c2230;
  --muted: #5d6573;
  --accent: #e0a312;
  --accent-2: #e0641f;
  --accent-soft: rgba(224, 163, 18, 0.12);
  --glow-a: rgba(255, 170, 30, 0.13);
  --glow-b: rgba(128, 96, 255, 0.10);
  --glow-c: rgba(20, 184, 166, 0.07);
  --dot: rgba(25, 35, 60, 0.05);
  --shadow: 0 12px 32px rgba(20, 30, 60, 0.12);
  --kbd-top: rgba(255, 255, 255, 0.9);
  --kbd-bottom: rgba(25, 35, 60, 0.28);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Ambient backdrop: big soft corner glows + dot-grid texture, fixed to the
   viewport so content scrolls over the light rather than carrying it along. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: -2;
  background:
    radial-gradient(900px 620px at 12% -8%, var(--glow-a), transparent 65%),
    radial-gradient(1000px 700px at 108% 12%, var(--glow-b), transparent 65%),
    radial-gradient(900px 600px at 45% 112%, var(--glow-c), transparent 65%);
}

body::after {
  z-index: -1;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.5px);
  background-size: 26px 26px;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

a { color: var(--accent); }

/* --------------------------------------------------------------------------
   Header (shared across all pages — keep markup identical on game pages)
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

.logo {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--text);
}

.logo span { color: var(--accent); }
.logo .tld { color: var(--muted); font-weight: 600; }

.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 2.4rem;
  height: 2.4rem;
  font-size: 1.1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover { transform: scale(1.08); border-color: var(--accent); }

.theme-icon::before { content: "☀️"; }
[data-theme="light"] .theme-icon::before { content: "🌙"; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  padding: 5rem 0 4rem;
  text-align: center;
  overflow: hidden;
}

.hero-art {
  position: absolute;
  top: 50%;
  right: -8%;
  width: clamp(260px, 38vw, 460px);
  height: auto;
  transform: translateY(-52%) rotate(8deg);
  color: var(--accent);
  opacity: 0.05;
  pointer-events: none;
  user-select: none;
}

[data-theme="light"] .hero-art { opacity: 0.07; }

.hero .container { position: relative; }

.hero h1 {
  font-size: clamp(2rem, 6.2vw, 3.7rem);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  text-wrap: balance;
}

.grad {
  background: linear-gradient(92deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-br { display: none; }

.hero-sub {
  color: var(--muted);
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  margin: 0 0 1.6rem;
}

/* "quick sync" gets struck through shortly after load */
.sync { position: relative; white-space: nowrap; }

.sync::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  top: 55%;
  height: 2px;
  border-radius: 2px;
  background: var(--accent-2);
  transform: scaleX(0);
  transform-origin: left center;
  animation: strike 0.45s cubic-bezier(0.65, 0, 0.35, 1) 1.1s forwards;
}

@keyframes strike { to { transform: scaleX(1); } }

.boss-hint {
  display: inline-block;
  background: var(--accent-soft);
  border: 1px dashed color-mix(in srgb, var(--accent) 60%, transparent);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  font-size: 0.9rem;
  color: var(--text);
  margin: 0;
  box-shadow: 0 0 22px var(--accent-soft), inset 0 0 14px rgba(255, 194, 51, 0.05);
}

kbd {
  display: inline-block;
  min-width: 1.7em;
  text-align: center;
  background: linear-gradient(180deg, var(--kbd-top), transparent 70%), var(--bg-card);
  border: 1px solid var(--border);
  border-bottom: 3px solid var(--kbd-bottom);
  border-radius: 6px;
  padding: 0.08rem 0.4rem 0.05rem;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.95em;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

/* --------------------------------------------------------------------------
   Arcade grid
   -------------------------------------------------------------------------- */

.arcade { padding: 1.5rem 0 4rem; }

.arcade h2 {
  font-size: 1.6rem;
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
}

.arcade-sub {
  color: var(--muted);
  margin: 0 0 1.75rem;
  font-size: 0.95rem;
}

.game-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.game-card {
  --ac: var(--accent);        /* per-card accent, set inline in the HTML */
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.9rem 1.7rem 1.6rem;
  cursor: default;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

/* thin accent line across the top */
.game-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 5%, var(--ac), transparent 95%);
  opacity: 0.45;
  transition: opacity 0.22s ease;
}

/* soft accent glow tucked into the top-right corner */
.game-card::after {
  content: "";
  position: absolute;
  top: -55px;
  right: -55px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--ac), transparent);
  opacity: 0.07;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.game-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.3rem;
  letter-spacing: -0.015em;
}

.game-card p {
  margin: 0 0 1.7rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.card-icon {
  display: inline-block;
  margin-bottom: 0.85rem;
  color: var(--ac);
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--ac) 35%, transparent));
}

.card-icon svg {
  display: block;
  width: 44px;
  height: 44px;
}

/* player-count tag, top-right corner */
.players {
  position: absolute;
  top: 1.2rem;
  right: 1.3rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
}

/* CTA row pinned to the card's bottom; holds the coming-soon badge now,
   a .play-btn link once the game ships */
.card-cta { margin-top: auto; }

.play-btn {
  display: inline-block;
  background: var(--ac);
  color: #10131a;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.45rem 1.4rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.play-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--ac) 35%, transparent);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  background: color-mix(in srgb, var(--ac) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--ac) 25%, transparent);
  border-radius: 999px;
  padding: 0.22rem 0.7rem;
  transition: color 0.22s ease;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ac);
  animation: badge-pulse 2.2s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(0.8); }
}

.game-card:hover,
.game-card:focus-within {
  transform: translateY(-6px) rotate(-0.5deg);
  border-color: color-mix(in srgb, var(--ac) 55%, transparent);
  box-shadow: var(--shadow), 0 0 28px color-mix(in srgb, var(--ac) 14%, transparent);
}

.game-card:hover::before { opacity: 1; }
.game-card:hover::after  { opacity: 0.15; }

.game-card:hover .card-icon {
  animation: card-bounce 0.45s ease;
}

.game-card:hover .badge { color: var(--text); }

@keyframes card-bounce {
  0%   { transform: translateY(0); }
  40%  { transform: translateY(-7px) rotate(8deg); }
  100% { transform: translateY(0); }
}

/* Scroll-in reveal: js/main.js adds .reveal-ready to the grid (only when
   IntersectionObserver exists), sets --i per card, then adds .in-view once. */
@media (prefers-reduced-motion: no-preference) {
  .reveal-ready .game-card { opacity: 0; }

  .reveal-ready .game-card.in-view {
    opacity: 1;
    animation: card-rise 0.6s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
    animation-delay: calc(var(--i, 0) * 50ms);
  }

  @keyframes card-rise {
    from { opacity: 0; transform: translateY(18px); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-card, .theme-toggle { transition: none; }
  .game-card:hover { transform: none; }
  .game-card:hover .card-icon { animation: none; }
  .badge::before { animation: none; }
  .sync::after { animation: none; transform: scaleX(1); }
}

@media (min-width: 540px) {
  .hero-br { display: inline; }
}

/* three featured cards: stacked on mobile, one row on desktop */
@media (min-width: 880px) {
  .game-grid { grid-template-columns: repeat(3, 1fr); }
}

/* --------------------------------------------------------------------------
   Ad slot — collapses to nothing while empty so the page never shows a hole
   -------------------------------------------------------------------------- */

.ad-slot { margin: 0 0 2.5rem; }

.ad-slot-inner:not(:empty) {
  min-height: 90px;
  display: flex;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}

.ad-slot:has(.ad-slot-inner:empty) { display: none; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.4rem 0 1.6rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.footer-inner p { margin: 0.15rem 0; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
.footer-tag { opacity: 0.8; }

/* --------------------------------------------------------------------------
   Generic prose page (privacy policy, etc.)
   -------------------------------------------------------------------------- */

.prose { padding: 2.5rem 0 3rem; max-width: 680px; }
.prose h1 { letter-spacing: -0.02em; }
.prose h2 { font-size: 1.15rem; margin-top: 2rem; }
.prose p, .prose li { color: var(--muted); font-size: 0.95rem; }
.prose .updated { font-size: 0.8rem; }

/* ==========================================================================
   BOSS MODE — the fake spreadsheet. Deliberately NOT themed: real
   spreadsheets are white no matter what your taste is.
   ========================================================================== */

#boss-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #ffffff;
  color: #222222;
  font-family: Calibri, "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  cursor: cell;
}

#boss-screen[hidden] { display: none; }

.xl-ribbon {
  background: #f3f2f1;
  border-bottom: 1px solid #d4d2d0;
  padding: 4px 8px 0;
  user-select: none;
}

.xl-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 6px;
  font-size: 12px;
  color: #444;
}

.xl-logo {
  background: #107c41;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  border-radius: 3px;
  padding: 2px 5px;
}

.xl-menus {
  display: flex;
  gap: 2px;
  font-size: 12.5px;
  color: #333;
  overflow-x: auto;
  scrollbar-width: none;
}

.xl-menus span {
  padding: 5px 10px 7px;
  border-radius: 4px 4px 0 0;
  white-space: nowrap;
}

.xl-menus span:hover { background: #e6e4e2; }

.xl-menus .active {
  background: #ffffff;
  border: 1px solid #d4d2d0;
  border-bottom: none;
  color: #107c41;
  font-weight: 600;
}

.xl-formulabar {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #d4d2d0;
  background: #ffffff;
  font-size: 12px;
  user-select: none;
}

.xl-namebox {
  width: 72px;
  padding: 4px 8px;
  border-right: 1px solid #d4d2d0;
  color: #333;
  flex-shrink: 0;
}

.xl-fx {
  padding: 4px 8px;
  color: #888;
  border-right: 1px solid #e8e6e4;
  font-style: italic;
  font-family: Georgia, serif;
  flex-shrink: 0;
}

.xl-formula {
  padding: 4px 8px;
  font-family: Calibri, "Segoe UI", sans-serif;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
}

.xl-grid-wrap { flex: 1; overflow: auto; background: #ffffff; }

.xl-grid { border-collapse: collapse; table-layout: fixed; }

.xl-grid th,
.xl-grid td {
  border: 1px solid #e2e0de;
  padding: 2px 6px;
  height: 20px;
  white-space: nowrap;
  overflow: hidden;
  font-weight: normal;
  text-align: left;
}

.xl-grid th {
  background: #f3f2f1;
  border-color: #d4d2d0;
  color: #555;
  text-align: center;
  font-size: 11.5px;
  user-select: none;
  position: sticky;
}

.xl-grid thead th { top: 0; z-index: 2; }
.xl-grid tbody th { left: 0; z-index: 1; width: 36px; }
.xl-grid thead th:first-child { left: 0; z-index: 3; }

.xl-grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
.xl-grid td.neg { color: #c00000; }
.xl-grid td.head { font-weight: 700; background: #f8f8f8; }
.xl-grid tr.total td { font-weight: 700; border-top: 2px solid #555; }

.xl-grid td.selected {
  outline: 2px solid #107c41;
  outline-offset: -2px;
}

.xl-tabs {
  display: flex;
  align-items: center;
  gap: 1px;
  background: #f3f2f1;
  border-top: 1px solid #d4d2d0;
  padding: 0 6px;
  font-size: 12px;
  user-select: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.xl-tabs span {
  padding: 4px 12px;
  border: 1px solid #d4d2d0;
  border-top: none;
  background: #eae8e6;
  color: #444;
  white-space: nowrap;
}

.xl-tabs .active {
  background: #ffffff;
  color: #107c41;
  font-weight: 600;
  border-bottom: 2px solid #107c41;
}

.xl-status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: #107c41;
  color: #ffffff;
  font-size: 11.5px;
  padding: 3px 12px;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
}
