/* A second visual layer keeps the original layout intact. */
:root {
  --glow: #a56dff;
  --edge-glow: #a87aff42;
  --lift-shadow: 0 18px 46px #05030f45;
  --soft-ease: cubic-bezier(.2,.75,.3,1);
}
:root[data-theme=light] {
  --glow: #7944d8;
  --edge-glow: #8b58dd4d;
  --lift-shadow: 0 16px 38px #5637901c;
}
html { scroll-behavior: smooth; scrollbar-color: #7956a9 var(--bg); }
body {
  background: radial-gradient(ellipse 1000px 520px at 62% -170px, #6f3ebc1c, transparent 74%),
              radial-gradient(ellipse 700px 600px at 100% 54%, #6751c00c, transparent 74%), var(--bg);
  background-attachment: fixed;
}
:root[data-theme=light] body {
  background: radial-gradient(ellipse 1000px 520px at 63% -170px, #d8baff53, transparent 75%),
              radial-gradient(ellipse 800px 600px at 100% 50%, #c4d4fa3b, transparent 76%), var(--bg);
  background-attachment: fixed;
}
::selection { background: #9c67ff66; color: #fff; }
:root[data-theme=light] ::selection { color: #24143b; }
:focus-visible { outline: 2px solid var(--accent) !important; outline-offset: 3px; }

/* Navigation, search and page position. */
.topbar {
  border-bottom-color: var(--edge-glow);
  box-shadow: 0 8px 30px #08041218;
}
.topbar::after {
  content: '';
  position: absolute;
  inset: auto 0 -1px;
  height: 2px;
  background: linear-gradient(90deg, #5f55e7, #b570ff 63%, #e6a1ff);
  box-shadow: 0 0 12px #9b61f3aa;
  transform: scaleX(var(--page-progress, 0));
  transform-origin: left;
  pointer-events: none;
}
.sidebar {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 30%, var(--bg));
  border-right-color: var(--edge-glow);
}
.nav-link { position: relative; overflow: hidden; border: 1px solid transparent; }
.nav-link:hover:not(.active) { transform: translateX(3px); border-color: var(--border); }
.nav-link.active {
  background: linear-gradient(110deg, #7040dc, #985aef 74%, #ac72f5);
  box-shadow: 0 7px 23px #7945e849, inset 0 1px #ffffff35;
}
.nav-link.active::before {
  content: '';
  position: absolute;
  inset: 9px auto 9px 0;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: #fff;
  box-shadow: 0 0 13px #fff;
}
.nav-link .pill { box-shadow: inset 0 1px #ffffff12; }
.global-search input { border-radius: 12px; transition: border-color .24s, box-shadow .24s, background-color .24s; }
.global-search:focus-within input {
  border-color: var(--accent);
  background: var(--surface-2);
  box-shadow: 0 0 0 4px #9c68ff1c, 0 8px 22px #140a3425;
  outline: none;
}
.global-search:focus-within > .icon { color: var(--accent); }
.icon-button:hover { transform: translateY(-2px); box-shadow: 0 5px 16px #8d57c722; }
.online-total .dot, .live-badge .dot { animation: presence-pulse 2.8s ease-in-out infinite; }

/* Hero artwork and page banners. The light follows the pointer on hover. */
.hero, .page-banner, .profile-cover { --spot-x: 75%; --spot-y: 38%; }
.hero {
  border-radius: 22px;
  border-color: #b383ef69;
  box-shadow: 0 21px 64px #14072e58, inset 0 1px #ffffff35;
}
.hero::before, .page-banner::before, .profile-cover::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle 340px at var(--spot-x) var(--spot-y), #ffffff24, transparent 75%);
  opacity: .7;
}
.hero::before { z-index: 0; }
.hero-copy { position: relative; z-index: 1; }
.hero-image { transition: transform .9s var(--soft-ease), filter .7s ease; }
.hero:hover .hero-image { transform: scale(1.035); filter: saturate(1.09); }
.hero .eyebrow, .page-banner .eyebrow {
  width: max-content;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid #ffffff37;
  border-radius: 999px;
  background: #1b103b6b;
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px #ffffff19;
}
.hero h1 { text-shadow: 0 3px 24px #1506287d; }
.hero h1 span { color: #e4baff; text-shadow: 0 0 28px #a25df07a; }
.hero-label { border-radius: 9px; box-shadow: 0 6px 18px #12062138; }
.hero-pager span:first-child { box-shadow: 0 0 12px #d1a9ff88; }
.hero-features span { transition: color .22s, transform .22s; }
.hero-features span:hover { color: var(--text); transform: translateY(-2px); }
.page-banner {
  border-radius: 20px;
  border-color: #ae79eb68;
  box-shadow: 0 16px 46px #1008293d, inset 0 1px #ffffff20;
  background: linear-gradient(115deg, #422566, #251d46 75%);
}
.page-banner::before { z-index: 1; }
.page-banner h1 { max-width: 670px; letter-spacing: -1.1px; text-wrap: balance; text-shadow: 0 3px 23px #14092672; }
.page-banner::after { opacity: .59; transition: transform .8s var(--soft-ease); }
.page-banner:hover::after { transform: scale(1.04); }
.profile-cover { overflow: hidden; box-shadow: 0 18px 45px #1c0d3730; }
.profile-cover::before { background: radial-gradient(circle 370px at var(--spot-x) var(--spot-y), #ffffff2e, transparent 75%); }

/* Buttons and selection controls. */
.button { position: relative; overflow: hidden; border-radius: 11px; transition: transform .22s var(--soft-ease), background-color .22s, border-color .22s, box-shadow .22s, color .22s; }
.button:not(:disabled):hover { transform: translateY(-2px); }
.button.primary { box-shadow: 0 7px 22px #8144ed36, inset 0 1px #ffffff48; }
.button.primary::before, .floating-chat::before {
  content: '';
  position: absolute;
  inset: -20% auto -20% -70%;
  width: 42%;
  background: linear-gradient(90deg, transparent, #ffffff55, transparent);
  transform: skewX(-24deg);
  transition: left .55s ease;
  pointer-events: none;
}
.button.primary:hover::before, .floating-chat:hover::before { left: 135%; }
.button.outline:hover { border-color: var(--accent); box-shadow: 0 6px 18px #8050d321; }
/* Keep hover movement and shadows inside the horizontal scroller. */
.categories { margin-block: 18px 9px; padding-block: 8px 20px; }
.category { flex-shrink: 0; border-radius: 11px; transition: transform .22s var(--soft-ease), border-color .22s, background-color .22s, box-shadow .22s, color .22s; }
.category:hover { transform: translateY(-2px); box-shadow: 0 7px 17px #8055cb22; }
.category.active { box-shadow: inset 0 1px #ffffff19, 0 5px 16px #854de023; }
/* Rating HUD: chamfered neon panel; --level drives the lit tiles, the signal bars and the readout. */
.rating-hud {
  --cut: 14px;
  --hud-edge: linear-gradient(135deg, #a874ff, #6b4bd8 40%, #3a2a66 70%, #39d5ff);
  --hud-fill: radial-gradient(circle at 100% 0%, #8a55ff26, transparent 55%), linear-gradient(160deg, #18132a, #0d0b16);
  --tile-fill: linear-gradient(160deg, #241a3d, #130f22);
  --tile-off: #3a3648;
  --tile-off-fill: linear-gradient(160deg, #1d1b26, #15141c);
  --cyan: #39d5ff;
  --neon: #b17cff;
  --level: 0;
  position: relative;
  isolation: isolate;
  margin-top: 18px;
  padding: 16px 14px 14px;
  background: var(--hud-edge);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
.rating-hud::before {
  content: '';
  position: absolute;
  inset: 1px;
  z-index: -1;
  background: var(--hud-fill);
  clip-path: inherit;
}
:root[data-theme=light] .rating-hud {
  --hud-edge: linear-gradient(135deg, #8a55f0, #c3a8f7 45%, #e2d6fb 70%, #2fb6e0);
  --hud-fill: radial-gradient(circle at 100% 0%, #8a55ff1c, transparent 55%), linear-gradient(160deg, #fbf9ff, #f1ecfc);
  --tile-fill: linear-gradient(160deg, #f4ecff, #e7dafd);
  --tile-off: #d9d4e6;
  --tile-off-fill: linear-gradient(160deg, #f6f5fa, #eeedf4);
  --cyan: #1aa6d6;
  --neon: #7741dc;
}
.rating-field { display: flex; flex-direction: column; margin: 0 0 14px; padding: 0; border: 0; min-width: 0; }
.rating-field legend {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  margin-bottom: 14px;
  padding: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.3px;
  color: var(--text);
}
.rating-field legend span span { color: var(--neon); text-shadow: 0 0 14px #a874ff66; }
.rating-slashes {
  width: 20px;
  height: 13px;
  flex-shrink: 0;
  background: linear-gradient(90deg, #7c4dff 0 45%, transparent 45% 55%, var(--cyan) 55%);
  transform: skewX(-32deg);
  clip-path: polygon(0 0, 40% 0, 40% 100%, 0 100%, 0 0, 60% 0, 100% 0, 100% 100%, 60% 100%, 60% 0);
}
.rating-controls { display: flex; gap: 6px; }
.rating-option { position: relative; flex: 1; min-width: 0; cursor: pointer; transition: transform .35s var(--ease-spring, ease), filter .35s ease; }
.rating-option input { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.rating-control {
  --chamfer: 7px;
  --lit: clamp(0, var(--level) - var(--s) + 1, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 64px;
  padding: 8px 0 7px;
  color: var(--faint);
  background: var(--tile-off);
  clip-path: polygon(var(--chamfer) 0, calc(100% - var(--chamfer)) 0, 100% var(--chamfer), 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, var(--chamfer) 100%, 0 calc(100% - var(--chamfer)), 0 var(--chamfer));
  pointer-events: none;
  transition: color .3s ease, background .3s ease;
}
.rating-control::before {
  content: '';
  position: absolute;
  inset: 1.5px;
  z-index: 0;
  background: var(--tile-off-fill);
  clip-path: inherit;
  transition: opacity .3s ease;
}
.rating-control::after {
  content: '';
  position: absolute;
  top: 0;
  left: 26%;
  right: 26%;
  height: 2px;
  z-index: 1;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  transform: scaleX(var(--lit));
  transition: transform .45s var(--ease-out-expo, ease);
}
.rating-control > * { position: relative; z-index: 1; }
.rating-control .icon { width: 31px; height: 31px; stroke-width: 1.9; transition: transform .45s var(--ease-spring, ease), filter .3s ease; }
.rating-value { font-family: 'Outfit', sans-serif; font-size: 15px; font-weight: 700; line-height: 1; color: var(--muted); }
.rating-value::after { content: ''; display: block; width: 12px; height: 2px; margin: 4px auto 0; border-radius: 2px; background: currentColor; opacity: .45; }

/* Selected value, then the hovered one wins while the pointer is over the row. */
.rating-field:has(input[value='1']:checked) { --level: 1; }
.rating-field:has(input[value='2']:checked) { --level: 2; }
.rating-field:has(input[value='3']:checked) { --level: 3; }
.rating-field:has(input[value='4']:checked) { --level: 4; }
.rating-field:has(input[value='5']:checked) { --level: 5; }
.rating-field:has(.rating-option:nth-child(1):hover) { --level: 1; }
.rating-field:has(.rating-option:nth-child(2):hover) { --level: 2; }
.rating-field:has(.rating-option:nth-child(3):hover) { --level: 3; }
.rating-field:has(.rating-option:nth-child(4):hover) { --level: 4; }
.rating-field:has(.rating-option:nth-child(5):hover) { --level: 5; }
.rating-option:hover { transform: translateY(-3px); }
.rating-option:hover .rating-control .icon { transform: scale(1.12) rotate(-6deg); }
/* Each tile lights when its score is at or below --level (1 or 0, via clamp). */
.rating-option .rating-control {
  color: color-mix(in srgb, var(--neon) calc(var(--lit) * 100%), var(--faint));
  background: color-mix(in srgb, var(--neon) calc(var(--lit) * 100%), var(--tile-off));
}
.rating-option .rating-control::before { box-shadow: inset 0 0 18px color-mix(in srgb, var(--neon) calc(var(--lit) * 45%), transparent); }
.rating-control .icon, .rating-value { filter: drop-shadow(0 0 calc(var(--lit) * 7px) color-mix(in srgb, var(--neon) calc(var(--lit) * 90%), transparent)); }
.rating-control .rating-value { color: color-mix(in srgb, var(--text) calc(var(--lit) * 100%), var(--faint)); }
.rating-option { filter: drop-shadow(0 0 10px color-mix(in srgb, #9b5cff calc(clamp(0, var(--level) - var(--s) + 1, 1) * 55%), transparent)); }
.rating-option:has(input:checked) .rating-control { animation: rate-pop .55s var(--ease-spring, ease); }
.rating-option input:focus-visible + .rating-control { outline: none; }
.rating-option:has(input:focus-visible) { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }
@keyframes rate-pop { 0% { transform: scale(1); } 35% { transform: scale(.88); } 100% { transform: scale(1); } }

/* Readout: a chamfered pill whose notch slides under the active tile. */
.rating-readout {
  position: relative;
  display: flex;
  align-items: center;
  order: 2;
  gap: 12px;
  padding: 11px 14px;
  background: linear-gradient(90deg, var(--neon), #5b47c8 50%, var(--cyan));
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
}
.rating-readout::before {
  content: '';
  position: absolute;
  inset: 1.5px;
  background: var(--hud-fill);
  clip-path: inherit;
}
.rating-readout > * { position: relative; }
.rating-field::after {
  content: '';
  display: block;
  width: 12px;
  height: 7px;
  order: 1;
  margin: 8px 0 -1px calc((var(--level) - .5) * 20% - 6px);
  background: var(--neon);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  opacity: clamp(0, var(--level), 1);
  transition: margin .45s var(--ease-out-expo, ease), opacity .3s;
  position: relative;
  z-index: 1;
}
.rating-bars { display: flex; align-items: flex-end; gap: 2px; height: 16px; padding-right: 12px; border-right: 1px solid var(--border); }
.rating-bars i {
  width: 3px;
  height: calc(var(--b) * 3px + 1px);
  border-radius: 1px;
  background: linear-gradient(var(--cyan), var(--neon));
  opacity: clamp(.18, (var(--level) - var(--b) + 1) * 999, 1);
  transform-origin: bottom;
  transform: scaleY(clamp(.55, (var(--level) - var(--b) + 1) * 999, 1));
  transition: opacity .3s calc(var(--b) * 40ms), transform .45s calc(var(--b) * 40ms) var(--ease-spring, ease);
}
.rating-readout-text { position: relative; display: grid; flex: 1; min-width: 0; font-size: 13px; color: var(--text); }
.rating-readout-text > * {
  grid-area: 1 / 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity .3s ease, transform .4s var(--ease-out-expo, ease), filter .3s ease;
}
.rating-readout-text > [style] {
  --off: clamp(0, max(var(--level) - var(--s), var(--s) - var(--level)), 1);
  opacity: calc(1 - var(--off));
  transform: translateY(calc(clamp(-1, var(--s) - var(--level), 1) * 10px));
  filter: blur(calc(var(--off) * 4px));
}
.rating-readout-text strong { font-family: 'Outfit', sans-serif; font-size: 16px; font-weight: 700; color: var(--neon); }
.rating-readout-hint { color: var(--muted); opacity: calc(1 - clamp(0, var(--level), 1)); }
.rating-hud > small { display: block; margin-top: 0; font-size: 11px; color: var(--muted); text-align: center; }
.play-panel > .rating-hud { grid-column: 1 / -1; }
.rating-hud.is-saving .rating-controls { pointer-events: none; }
.rating-hud.is-saving .rating-readout { animation: readout-sync .7s ease-in-out infinite alternate; }
@keyframes readout-sync { to { filter: brightness(1.45) drop-shadow(0 0 8px #a874ff99); } }

/* Neon life: lit tiles hum, flicker like gas tubes and get scanned. Every keyframe scales with
   --lit, so unlit tiles stay still; durations differ per tile so they never pulse in sync. */
.rating-option { animation: neon-breathe calc(2.6s + var(--s) * .3s) calc(var(--s) * -.45s) ease-in-out infinite; }
@keyframes neon-breathe {
  50% { filter: drop-shadow(0 0 17px color-mix(in srgb, #a06bff calc(clamp(0, var(--level) - var(--s) + 1, 1) * 80%), transparent)); }
}
.rating-control .icon { animation: neon-hum calc(2.3s + var(--s) * .47s) calc(var(--s) * -.9s) linear infinite; }
@keyframes neon-hum {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 calc(var(--lit) * 5px) color-mix(in srgb, var(--neon) calc(var(--lit) * 80%), transparent)); }
  40% { filter: drop-shadow(0 0 calc(var(--lit) * 11px) color-mix(in srgb, var(--neon) calc(var(--lit) * 100%), transparent)) brightness(calc(1 + var(--lit) * .3)); }
  70%, 73.5%, 77% { opacity: 1; }
  71.5% { opacity: calc(1 - var(--lit) * .6); }
  75% { opacity: calc(1 - var(--lit) * .35); }
  76% { opacity: calc(1 - var(--lit) * .7); }
}
.rating-option .rating-control::before {
  background:
    linear-gradient(180deg, transparent 42%, color-mix(in srgb, var(--neon) calc(var(--lit) * 30%), transparent) 50%, transparent 58%) 0 100% / 100% 320% no-repeat,
    var(--tile-off-fill);
  animation: neon-scan 3.4s calc(var(--s) * .14s) cubic-bezier(.45, 0, .55, 1) infinite;
}
@keyframes neon-scan { 55%, 100% { background-position: 0 0, 0 0; } }
.rating-control::after {
  background: linear-gradient(90deg, var(--cyan) 30%, #e6fbff 50%, var(--cyan) 70%) 100% 0 / 300% 100%;
  animation: neon-sheen 2.4s calc(var(--s) * .12s) linear infinite;
}
@keyframes neon-sheen { 60%, 100% { background-position: 0 0; } }
.rating-field::after { animation: neon-blink 1.8s ease-in-out infinite; }
@keyframes neon-blink { 50% { filter: drop-shadow(0 0 6px var(--neon)) brightness(1.4); } }
.rating-bars i { animation: bar-signal 1.4s calc(var(--b) * .12s) ease-in-out infinite; }
@keyframes bar-signal { 50% { filter: brightness(1.6) drop-shadow(0 0 4px var(--cyan)); } }
.rating-readout-text strong { animation: text-neon 3.1s linear infinite; }
@keyframes text-neon {
  0%, 100% { text-shadow: 0 0 10px #a874ff88; }
  50% { text-shadow: 0 0 16px #a874ffcc, 0 0 2px #fff6; }
  83%, 86% { opacity: 1; }
  84% { opacity: .55; }
}

/* Standby: unlit tiles catch a slow neon wave from left to right, inviting a pick. */
.rating-option .rating-control { animation: neon-standby 3.2s calc(var(--s) * .16s) ease-in-out infinite; }
@keyframes neon-standby {
  0%, 30%, 100% { background: color-mix(in srgb, var(--neon) calc(var(--lit) * 100%), var(--tile-off)); }
  12% { background: color-mix(in srgb, var(--neon) calc((var(--lit) + (1 - var(--lit)) * .7) * 100%), var(--tile-off)); }
}
.rating-option .rating-value { animation: standby-text 3.2s calc(var(--s) * .16s) ease-in-out infinite; }
@keyframes standby-text {
  0%, 30%, 100% { color: color-mix(in srgb, var(--text) calc(var(--lit) * 100%), var(--faint)); }
  12% { color: color-mix(in srgb, var(--text) calc((var(--lit) + (1 - var(--lit)) * .65) * 100%), var(--faint)); }
}

/* Choosing a score powers the row up from the left like a neon sign being switched on. */
.rating-controls.is-charging .rating-option .rating-control { animation: neon-ignite .7s calc((var(--s) - 1) * 75ms) steps(1, end) backwards; }
.rating-controls.is-charging .rating-option:has(input:checked) .rating-control {
  animation: neon-ignite .7s calc((var(--s) - 1) * 75ms) steps(1, end) backwards, rate-pop .55s calc((var(--s) - 1) * 75ms + .25s) var(--ease-spring, ease) backwards;
}
@keyframes neon-ignite {
  0% { filter: brightness(calc(1 - var(--lit) * .75)); }
  15% { filter: brightness(calc(1 + var(--lit) * .9)); }
  25% { filter: brightness(calc(1 - var(--lit) * .55)); }
  40% { filter: brightness(calc(1 + var(--lit) * .5)); }
  55% { filter: brightness(calc(1 - var(--lit) * .2)); }
  70%, 100% { filter: none; }
}
.rating-option::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid var(--neon);
  border-radius: 10px;
  box-shadow: 0 0 14px var(--neon), inset 0 0 10px var(--neon);
  opacity: 0;
  pointer-events: none;
}
.rating-controls.is-charging .rating-option:has(input:checked)::after { animation: neon-ring .75s calc((var(--s) - 1) * 75ms + .2s) var(--ease-out-expo, ease-out); }
@keyframes neon-ring { from { opacity: .9; transform: scale(.92); } to { opacity: 0; transform: scale(1.45, 1.3); } }
.tabs { border-radius: 12px; box-shadow: 0 5px 18px #10092113; }
.tabs button.active { box-shadow: inset 0 1px #ffffff25, 0 3px 10px #7344c425; }
.theme-choice:hover { transform: translateY(-2px); border-color: var(--accent); }
.theme-choice.active { box-shadow: 0 6px 17px #8850db1e; }
.switch { transition: background-color .22s, border-color .22s, box-shadow .22s; }
.switch[aria-checked=true] { box-shadow: 0 0 0 3px #995bf226; }
.text-link:hover .icon, .rail-footer:hover .icon { transform: translateX(3px); }

/* Game cards keep artwork prominent and make their destination clearer. */
.game-card, .popular-card .game-art, .room-card, .tournament-card { box-shadow: 0 8px 27px #09051324; }
.game-card { border-radius: 15px; }
.game-card:hover, .game-card:focus-within {
  transform: translateY(-6px);
  border-color: #aa78ec9c;
  box-shadow: var(--lift-shadow), 0 0 0 1px #965cdf26;
}
.game-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 35%, #ffffff19 50%, transparent 65%);
  transform: translateX(-135%);
  transition: transform .7s ease;
  pointer-events: none;
}
.game-card:hover::after, .game-card:focus-within::after { transform: translateX(135%); }
.game-card .game-art::before {
  content: 'Explorar ↗';
  position: absolute;
  right: 11px;
  bottom: 10px;
  z-index: 1;
  padding: 5px 8px;
  border-radius: 7px;
  background: #160d2acc;
  border: 1px solid #ffffff46;
  color: #fff;
  font-size: 10px;
  font-weight: 650;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .22s, transform .22s;
}

html[lang='en'] .game-card .game-art::before { content: 'Explore ↗'; }
@media (max-width: 680px) {
  .categories { margin-block: 15px 6px; }
  .topbar .logo { width: 136px; flex-shrink: 0; }
  .topbar .logo .brand-logo { width: 100%; }
}
@media (max-width: 360px) {
  .topbar { padding-inline: 10px; gap: 7px; }
  .topbar .logo { width: 115px; }
  .header-right > .icon-button[data-action='theme'] { display: none; }
}
.game-card:hover .game-art::before, .game-card:focus-within .game-art::before { opacity: 1; transform: translateY(0); }
.game-card .game-art, .popular-card .game-art, .room-card .game-art, .tournament-card .game-art { filter: saturate(1.03); }
.game-card:hover .game-art, .popular-card:hover .game-art, .room-card:hover .game-art, .tournament-card:hover .game-art { filter: saturate(1.18) contrast(1.03); }
.favorite-button { border-radius: 9px; box-shadow: 0 5px 14px #10071e36; }
.favorite-button:hover { transform: scale(1.1); }
.favorite-button.active { background: #341b36d9; border-color: #f495b67a; }
.popular-card .game-art { border-radius: 12px; }
.popular-card:hover .game-art { transform: translateY(-4px) scale(1.02); box-shadow: 0 15px 33px #09051343; }
.section-heading h2 { letter-spacing: -.55px; }
.section-heading h2 > .icon { filter: drop-shadow(0 0 8px #f5b9605e); }
.trending-banner {
  position: relative;
  overflow: hidden;
  border-color: #9660d975;
  background: linear-gradient(110deg, #7751d22b, var(--surface) 72%);
  box-shadow: 0 9px 28px #43287d1a;
}
.trending-banner::before {
  content: '';
  position: absolute;
  width: 230px;
  height: 230px;
  left: -80px;
  top: -130px;
  background: #a77aff30;
  filter: blur(44px);
  pointer-events: none;
}
.trending-banner > * { position: relative; }

/* Dashboard panels, rankings, community and rewards. */
.panel { border-color: color-mix(in srgb, var(--border) 75%, var(--accent) 25%); box-shadow: 0 9px 31px #09051316; }
.daily-panel { background: radial-gradient(ellipse at 95% -10%, #a36fff33, transparent 67%), var(--surface); }
.guest-card { background: radial-gradient(circle at 95% 0%, #a45bff48, transparent 51%), var(--surface); }
.guest-card .guest-icon { box-shadow: 0 8px 20px #8a4ee133; }
.tournament-mini { box-shadow: 0 14px 34px #452a7935; }
.tournament-mini .trophy-art { filter: drop-shadow(0 8px 13px #d9966255); transition: transform .35s var(--soft-ease); }
.tournament-mini:hover .trophy-art { transform: rotate(-3deg) translateY(-4px); }
.streak-tag { border: 1px solid #f5bd7236; }
.day.current > span { box-shadow: 0 0 0 3px #e9ad5321; }
.room-card:hover, .tournament-card:hover, .podium-card:hover { box-shadow: var(--lift-shadow); }
.progress-track { height: 7px; box-shadow: inset 0 1px 3px #0002; }
.progress-track > span { box-shadow: 0 0 12px #ad71f77a; }
.workspace.route-enter .progress-track > span { transform-origin: left; animation: progress-fill .85s var(--soft-ease) both; }
.podium-card.winner { box-shadow: 0 17px 39px #bd8e2730, inset 0 1px #ffe5a044; }
.podium-card.winner .crown { filter: drop-shadow(0 0 10px #ffd3768f); }
.table-wrap { box-shadow: 0 8px 28px #09051318; }
.rank-table tbody tr { transition: background-color .2s; }
.rank-table tbody tr:hover { background: var(--accent-soft); }
.post { transition: transform .25s var(--soft-ease), border-color .25s, box-shadow .25s; }
.post:hover { transform: translateY(-2px); border-color: var(--edge-glow); box-shadow: 0 15px 35px #08051325; }
.post-actions button:hover { color: var(--accent); transform: translateY(-1px); }
.mission-card { transition: transform .26s var(--soft-ease), border-color .26s, box-shadow .26s; }
.mission-card:hover { transform: translateY(-4px); border-color: var(--edge-glow); box-shadow: var(--lift-shadow); }
.mission-card > .icon { box-shadow: 0 6px 16px #8152c92b; }
.reward-item, .achievement, .stat-card { transition: transform .25s var(--soft-ease), box-shadow .25s, border-color .25s; }
.reward-item:hover, .achievement:hover, .stat-card:hover { transform: translateY(-3px); box-shadow: 0 11px 27px #6c42aa22; }
.reward-item.claimed { border-color: #4bdba376; }
.game-cover { box-shadow: 0 17px 44px #10072236; }
.game-cover .game-art { transition: transform .6s var(--soft-ease); }
.game-cover:hover .game-art { transform: scale(1.025); }
.play-panel { background: radial-gradient(circle at 100% 0%, #925dff19, transparent 53%), var(--surface); }

/* Dialogs, notifications and the small screen dock. */
dialog { border-color: var(--edge-glow); box-shadow: 0 26px 100px #07030b9c, 0 0 0 1px #ffffff0b; }
dialog::backdrop { background: #070311c9; }
.toast { border-color: var(--edge-glow); box-shadow: 0 15px 45px #10072067; backdrop-filter: blur(14px); }
.chat-drawer { border-color: var(--edge-glow); box-shadow: 0 20px 75px #09051370; }
.floating-chat { overflow: hidden; box-shadow: 0 9px 30px #6941cb83, inset 0 1px #ffffff5c; transition: transform .25s var(--soft-ease), box-shadow .25s; }
.floating-chat:hover { transform: translateY(-4px); box-shadow: 0 15px 37px #6941cb9e; }
.mobile-bottom { box-shadow: 0 -9px 27px #0905131a; }
.mobile-bottom a.active { background: var(--accent-soft); border-radius: 10px; }

/* Auth screens share the same finish as the product. */
.auth-layout { border-color: var(--edge-glow); box-shadow: 0 28px 85px #10082740; }
.floating-chat::after { content: none; }
.auth-showcase { isolation: isolate; }
.auth-showcase::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 72% 32%, #b47cff2c, transparent 44%);
  pointer-events: none;
  z-index: 0;
}
.auth-showcase-copy { z-index: 1; }
.auth-showcase > img { transition: transform 1.1s var(--soft-ease); }
.auth-showcase:hover > img { transform: scale(1.035); }
.auth-showcase-benefits span { box-shadow: inset 0 1px #ffffff24; }
.auth-form-panel { background: radial-gradient(circle at 100% 0%, #9362ed0e, transparent 47%), var(--surface); }
.auth-field input:focus { box-shadow: 0 0 0 4px #9c68ff22; outline: none; border-color: var(--accent); }
.auth-google:not(:disabled):hover { box-shadow: 0 10px 28px #6843b52d; }

/* Reveal only offscreen content; if scripts or motion are unavailable, content stays visible. */
.scroll-reveal { transition: opacity .52s ease, transform .52s var(--soft-ease), border-color .25s, box-shadow .25s; }
.scroll-reveal:not(.is-visible) { opacity: 0; transform: translateY(19px); }
.scroll-reveal.is-visible.game-card:hover { transform: translateY(-6px); }
.scroll-reveal.is-visible.room-card:hover, .scroll-reveal.is-visible.tournament-card:hover,
.scroll-reveal.is-visible.mission-card:hover, .scroll-reveal.is-visible.podium-card:hover { transform: translateY(-4px); }
@keyframes presence-pulse { 50% { box-shadow: 0 0 0 5px #4bdba322, 0 0 14px #4bdba386; } }
@keyframes progress-fill { from { transform: scaleX(.08); } to { transform: scaleX(1); } }

@media (max-width: 680px) {
  .hero { border-radius: 17px; box-shadow: 0 14px 37px #14072e4d; }
  .hero .eyebrow { padding: 5px 8px; }
  .hero::before, .page-banner::before { opacity: .4; }
  .page-banner { border-radius: 17px; box-shadow: 0 12px 30px #10082930; }
  .page-banner h1 { letter-spacing: -.8px; }
  .nav-link:hover:not(.active) { transform: none; }
  .game-card .game-art::before { display: none; }
  .mobile-bottom a { min-width: 55px; transition: background-color .2s, color .2s, transform .2s; }
  .mobile-bottom a.active { color: var(--accent); }
  .trending-banner { background: linear-gradient(115deg, #7751d22d, var(--surface)); }
}
@media (max-width: 360px) {
  .categories { margin-inline: -12px; padding-inline: 12px; }
}
@media (hover: none) {
  .hero:hover .hero-image, .page-banner:hover::after, .auth-showcase:hover > img,
  .game-cover:hover .game-art, .favorite-button:hover, .floating-chat:hover,
  .post:hover, .mission-card:hover, .reward-item:hover, .achievement:hover,
  .stat-card:hover, .category:hover, .theme-choice:hover { transform: none; }
  .game-card:hover::after { transform: translateX(-135%); }
}
