/* Take Turns theme. Full direction: THEME.md
   Modern type everywhere. Warez color only on cards, borders, headers, and dividers. */

:root {
  --cga-black: #000000;
  --cga-blue: #0000aa;
  --cga-green: #00aa00;
  --cga-cyan: #1565c0;
  --cga-red: #aa0000;
  --cga-magenta: #aa00aa;
  --cga-brown: #aa5500;
  --cga-gray: #aaaaaa;
  --cga-dk: #555555;
  --cga-ltblue: #5555ff;
  --cga-ltgreen: #55ff55;
  --cga-ltcyan: #64b5f6;
  --cga-ltred: #ff5555;
  --cga-ltmagenta: #ff55ff;
  --cga-yellow: #ffff55;
  --cga-white: #ffffff;
  --bg: #050510;
  --ink: #d8d8e4;
  --ink-bright: #ffffff;
  --muted: #8a8a9a;
  --amber: #ffff55;
  --cyan: #64b5f6;
  --frame: #1565c0;
  --tile-correct: #1e88e5;
  --tile-correct-ink: #ffffff;
  --tile-present: #e8941a;
  --tile-present-ink: #1a1000;
  --tile-absent: #3e4c5c;
  --key: #d0d0d8;
  --key-ink: #111111;
  --font-body: system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-tile: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: dark;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid #64b5f6;
  outline-offset: 2px;
}

h1,
h2,
.pixel {
  font-family: var(--font-body);
  font-weight: 750;
  color: var(--ink-bright);
  letter-spacing: -0.02em;
}

.frame,
.game-btn {
  position: relative;
  border: 0;
  border-radius: 16px;
  background-color: #0a0a18;
  background-image:
    radial-gradient(circle, rgba(30, 136, 229, 0.22) 0.45px, transparent 0.6px),
    radial-gradient(ellipse at 50% -10%, rgba(30, 136, 229, 0.09), transparent 42%),
    radial-gradient(ellipse at 50% 120%, rgba(0, 0, 50, 0.72), transparent 58%);
  background-size: 4px 4px, 100% 100%, 100% 100%;
  box-shadow: 5px 5px 0 #000040;
}

.frame::before,
.game-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 3px;
  background: linear-gradient(
    108deg,
    #ffffff 0 5%,
    #e3f2fd 5% 10%,
    #90caf9 10% 16%,
    #64b5f6 16% 24%,
    #1e88e5 24% 33%,
    #1565c0 33% 44%,
    #0d47a1 44% 55%,
    #0055aa 55% 66%,
    #0000aa 66% 78%,
    #000077 78% 88%,
    #000044 88% 100%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.frame::after,
.game-btn::after {
  content: "";
  position: absolute;
  top: 10px;
  left: -5px;
  width: 8px;
  height: 26px;
  background: linear-gradient(
    #ffffff 0 16%,
    #bbdefb 16% 30%,
    #64b5f6 30% 46%,
    #1565c0 46% 64%,
    #0000aa 64% 82%,
    #000044 82% 100%
  );
  pointer-events: none;
}

.taper {
  position: relative;
  height: 14px;
  margin: 0.2rem 0 0.45rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='14' viewBox='0 0 480 14'%3E%3Cg shape-rendering='crispEdges'%3E%3Crect x='0' y='5' width='16' height='3' fill='%23ffffff'/%3E%3Crect x='16' y='5' width='16' height='3' fill='%23e7f2ff'/%3E%3Crect x='32' y='5' width='16' height='3' fill='%23c5dffc'/%3E%3Crect x='48' y='5' width='16' height='3' fill='%238ec5f6'/%3E%3Crect x='64' y='5' width='16' height='3' fill='%231e88e5'/%3E%3Crect x='80' y='5' width='16' height='3' fill='%231976d2'/%3E%3Crect x='96' y='5' width='16' height='3' fill='%231565c0'/%3E%3Crect x='112' y='5' width='16' height='3' fill='%230d47a1'/%3E%3Crect x='128' y='5' width='16' height='3' fill='%230b3d73'/%3E%3Crect x='144' y='5' width='16' height='3' fill='%230a3a78'/%3E%3Crect x='160' y='5' width='16' height='3' fill='%230055aa'/%3E%3Crect x='176' y='5' width='16' height='3' fill='%230033aa'/%3E%3Crect x='192' y='5' width='16' height='3' fill='%230000aa'/%3E%3Crect x='208' y='5' width='16' height='3' fill='%23000088'/%3E%3Crect x='224' y='5' width='12' height='3' fill='%23000066'/%3E%3Crect x='242' y='5' width='9' height='3' fill='%230d47a1'/%3E%3Crect x='255' y='5' width='5' height='3' fill='%230a3a78'/%3E%3Crect x='264' y='5' width='2' height='3' fill='%230000aa'/%3E%3Crect x='272' y='5' width='9' height='3' fill='%231565c0'/%3E%3Crect x='285' y='5' width='5' height='3' fill='%230044aa'/%3E%3Crect x='294' y='5' width='2' height='3' fill='%23000088'/%3E%3Crect x='302' y='5' width='9' height='3' fill='%230b3d73'/%3E%3Crect x='315' y='5' width='5' height='3' fill='%23002288'/%3E%3Crect x='324' y='5' width='2' height='3' fill='%23000055'/%3E%3C/g%3E%3Cg shape-rendering='geometricPrecision'%3E%3Ccircle cx='348' cy='6.5' r='2.2' fill='%231e88e5'/%3E%3Ccircle cx='364' cy='6.5' r='1.7' fill='%231565c0'/%3E%3Ccircle cx='378' cy='6.5' r='1.2' fill='%231565c0'/%3E%3Ccircle cx='390' cy='6.5' r='0.8' fill='%230044aa'/%3E%3Ccircle cx='400' cy='6.5' r='0.5' fill='%230000aa'/%3E%3Ccircle cx='408' cy='6.5' r='0.28' fill='%23000066'/%3E%3C/g%3E%3C/svg%3E") left center / 100% 14px no-repeat;
}

.taper::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 22%;
  height: 14px;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.92), transparent);
  mix-blend-mode: screen;
  opacity: 0;
  transform: translate3d(-140%, 0, 0);
  animation: taper-once 0.9s ease-out 0.4s 1, taper-loop 7.2s ease-in-out 4.6s infinite;
  pointer-events: none;
}

.glint-host,
.btn.primary {
  position: relative;
}

.glint {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.glint::before {
  content: "";
  position: absolute;
  top: -40%;
  bottom: -40%;
  left: 0;
  width: 42%;
  background: linear-gradient(
    112deg,
    transparent 0%,
    rgba(255, 255, 255, 0.05) 36%,
    rgba(255, 255, 255, 0.72) 50%,
    rgba(255, 255, 255, 0.05) 64%,
    transparent 100%
  );
  mix-blend-mode: screen;
  opacity: 0;
  transform: translate3d(-150%, 0, 0);
  pointer-events: none;
  animation: glint-once 0.85s ease-out 1, glint-loop 7s ease-in-out 1.1s infinite;
}

.title-block .glint::before {
  animation-delay: 0.15s, 3.3s;
  animation-duration: 0.85s, 7.6s;
}

header.top > h1 .glint::before {
  animation-delay: 0.2s, 3.6s;
  animation-duration: 0.85s, 7.4s;
}

.game-btn .glint::before {
  animation-delay: 0.35s, 2.1s;
  animation-duration: 0.9s, 8s;
}

@keyframes taper-once {
  0% { opacity: 0; transform: translate3d(-160%, 0, 0); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(640%, 0, 0); }
}

@keyframes taper-loop {
  0%,
  84% { opacity: 0; transform: translate3d(-160%, 0, 0); }
  90% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(640%, 0, 0); }
}

@keyframes glint-once {
  0% { opacity: 0; transform: translate3d(-150%, 0, 0); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(340%, 0, 0); }
}

@keyframes glint-loop {
  0%,
  84% { opacity: 0; transform: translate3d(-150%, 0, 0); }
  90% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(340%, 0, 0); }
}

html.scene-paused .taper::before,
html.scene-paused .glint::before {
  animation-play-state: paused;
}

.legal-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.45rem;
  margin: 0;
  padding: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

.legal-foot a {
  color: var(--muted);
  text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
