/* ScaryLearner mode (assets/js/scary.js): only applies while <html class="tl-scary">. Nothing here changes the normal look. */
html.tl-scary {
  --bg: #070203; --panel: #160607; --panel2: #24090b; --ink: #f6e9e9; --soft: #c9a3a3; --line: #4a1416;
  --pink: #ff3b3b; --teal: #c1121f; --yellow: #ffb3b3; --red: #ff5c5c; --focus: #ffe066;
}
html.tl-scary body {
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(160, 10, 20, .55), transparent 60%),
    radial-gradient(80% 50% at 50% 115%, rgba(90, 0, 10, .6), transparent 70%),
    #070203;
  background-attachment: fixed;
}
html.tl-scary body::before { background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, .85) 100%); animation: scary-breathe 7s ease-in-out infinite; }
@keyframes scary-breathe { 0%, 100% { opacity: .85; } 50% { opacity: 1; } }

/* title: dripping, shaky letters */
html.tl-scary .logo {
  font-family: 'Creepster', system-ui, sans-serif; font-weight: 400; letter-spacing: .08em;
  font-size: clamp(34px, 8vw, 64px); color: #e01e2b; background: none; -webkit-background-clip: initial; background-clip: initial;
  text-shadow: 0 0 12px rgba(255, 0, 20, .55), 0 3px 0 #4a0005; position: relative; animation: scary-flicker 9s infinite;
}
html.tl-scary .logo::after {
  content: ""; position: absolute; left: 8%; right: 30%; top: 88%; height: 26px; pointer-events: none;
  background:
    radial-gradient(4px 14px at 10% 0, #b00012 60%, transparent 62%),
    radial-gradient(3px 22px at 34% 0, #b00012 60%, transparent 62%),
    radial-gradient(4px 10px at 58% 0, #b00012 60%, transparent 62%),
    radial-gradient(3px 18px at 81% 0, #b00012 60%, transparent 62%);
  animation: scary-drip 6s ease-in infinite;
}
@keyframes scary-drip { 0% { transform: scaleY(.3); transform-origin: top; } 70%, 100% { transform: scaleY(1.2); transform-origin: top; } }
/* slow dim-and-back, never a bright flash */
@keyframes scary-flicker { 0%, 88%, 92%, 96%, 100% { opacity: 1; } 90% { opacity: .35; } 94% { opacity: .6; } }
html.tl-scary .tagline { color: #d98c8c; font-family: 'Special Elite', system-ui, sans-serif; letter-spacing: .06em; text-transform: none; font-size: 15px; }
html.tl-scary .bar { background: rgba(10, 2, 3, .94); }
html.tl-scary .grade[aria-pressed="true"] { color: #fff; }
html.tl-scary section.subject > h2, html.tl-scary .shelf h3 { font-family: 'Creepster', system-ui, sans-serif; font-weight: 400; letter-spacing: .06em; }
html.tl-scary section.subject > h2 { color: #e01e2b; font-size: 34px; }
html.tl-scary .shelf.new { background: rgba(120, 0, 10, .18); border-color: rgba(224, 30, 43, .6); }
html.tl-scary .tile { box-shadow: 0 6px 18px rgba(0, 0, 0, .6); }
html.tl-scary .tile:hover, html.tl-scary .tile:focus-visible { border-color: #e01e2b; box-shadow: 0 0 22px rgba(224, 30, 43, .45); }
html.tl-scary .tile:not(.is-scary) .pic img { filter: grayscale(.75) sepia(.4) hue-rotate(-30deg) brightness(.75) contrast(1.15); }
html.tl-scary .badge { background: #e01e2b; color: #fff; }
html.tl-scary footer { font-family: 'Special Elite', system-ui, sans-serif; }

/* buttons: creepy music + make it normal */
.scary-bar { display: none; }
html.tl-scary .scary-bar { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.scary-btn { font: inherit; font-weight: 700; color: #f6e9e9; background: #24090b; border: 2px solid #7a1a1e; border-radius: 999px; padding: 8px 14px; min-height: 44px; cursor: pointer; }
.scary-btn[aria-pressed="true"] { background: #7a0c14; border-color: #e01e2b; }
.scary-btn:hover { border-color: #e01e2b; }
.scary-normal { background: #f6e9e9; color: #2a0608; border-color: #f6e9e9; }
.scary-normal:hover { background: #fff; }

/* the Scariest Games shelf */
.scary-feature { margin-top: 22px; padding: 16px; border-radius: 18px; border: 2px solid rgba(224, 30, 43, .7);
  background: linear-gradient(180deg, rgba(120, 0, 12, .35), rgba(20, 2, 4, .6)); box-shadow: 0 0 40px rgba(224, 30, 43, .18) inset; }
.scary-h { margin: 0; font-family: 'Creepster', system-ui, sans-serif; font-weight: 400; font-size: clamp(30px, 6vw, 46px); letter-spacing: .06em; color: #ff2d3a; text-shadow: 0 0 14px rgba(255, 0, 20, .5); }
.scary-sub { margin: 2px 0 12px; color: #d98c8c; font-family: 'Special Elite', system-ui, sans-serif; }
.grid.scary-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.tile.scary-top { grid-column: 1 / -1; flex-direction: row; border-color: #e01e2b; box-shadow: 0 0 28px rgba(224, 30, 43, .35); }
.tile.scary-top .pic { flex: 0 0 60%; }
.tile.scary-top .info { align-content: center; padding: 16px 18px; gap: 8px; }
.tile.scary-top .info b { font-size: clamp(26px, 3.4vw, 40px); font-family: 'Creepster', system-ui, sans-serif; font-weight: 400; letter-spacing: .05em; color: #ff2d3a; }
.tile.scary-top .info span { font-size: 17px; -webkit-line-clamp: 4; }
.scary-rank { position: absolute; right: 8px; top: 8px; background: #e01e2b; color: #fff; font-weight: 900; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; border-radius: 8px; padding: 3px 8px; box-shadow: 0 0 12px rgba(224, 30, 43, .7); }
@media (max-width: 640px) { .tile.scary-top { flex-direction: column; } .tile.scary-top .pic { flex: none; } }

/* fog + blinking eyes behind everything */
.scary-fx { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.scary-fog { position: absolute; inset: -20% -50%; background:
  radial-gradient(40% 30% at 30% 60%, rgba(180, 160, 160, .07), transparent 70%),
  radial-gradient(35% 25% at 70% 40%, rgba(180, 160, 160, .06), transparent 70%);
  animation: scary-fog 38s linear infinite alternate; }
.scary-fog2 { animation-duration: 55s; animation-direction: alternate-reverse; top: 10%; }
@keyframes scary-fog { from { transform: translateX(-12%); } to { transform: translateX(12%); } }
.scary-eyes { position: absolute; display: flex; gap: 14px; opacity: 0; animation: scary-blink 11s infinite; }
.scary-eyes i { width: 14px; height: 7px; border-radius: 50%; background: #ff2030; box-shadow: 0 0 10px 3px rgba(255, 20, 40, .6); }
@keyframes scary-blink { 0%, 60% { opacity: 0; } 64%, 72% { opacity: .85; } 68% { opacity: .1; } 76%, 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  html.tl-scary .logo, html.tl-scary .logo::after, html.tl-scary body::before, .scary-fog, .scary-eyes { animation: none; }
  .scary-eyes { opacity: .5; }
}
html.tl-scary .scary-score { display: inline-block; margin-left: 6px; font-style: normal; font-weight: 800; font-size: 13px; color: #ffb3b8; }
