/* 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: #00aaaa;
  --cga-red: #aa0000;
  --cga-magenta: #aa00aa;
  --cga-brown: #aa5500;
  --cga-gray: #aaaaaa;
  --cga-dk: #555555;
  --cga-ltblue: #5555ff;
  --cga-ltgreen: #55ff55;
  --cga-ltcyan: #55ffff;
  --cga-ltred: #ff5555;
  --cga-ltmagenta: #ff55ff;
  --cga-yellow: #ffff55;
  --cga-white: #ffffff;
  --bg: #050510;
  --ink: #d8d8e4;
  --ink-bright: #ffffff;
  --muted: #8a8a9a;
  --amber: #ffff55;
  --cyan: #55ffff;
  --frame: #00aaaa;
  --tile-correct: #55ffff;
  --tile-correct-ink: #042226;
  --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);
}

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(85, 255, 255, 0.22) 0.45px, transparent 0.6px),
    radial-gradient(ellipse at 50% -10%, rgba(85, 255, 255, 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%,
    #e4ffff 5% 10%,
    #a8ffff 10% 16%,
    #55ffff 16% 24%,
    #22d4d4 24% 33%,
    #00aaaa 33% 44%,
    #0088aa 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%,
    #c8ffff 16% 30%,
    #55ffff 30% 46%,
    #00aaaa 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='%23e4ffff'/%3E%3Crect x='32' y='5' width='16' height='3' fill='%23c0ffff'/%3E%3Crect x='48' y='5' width='16' height='3' fill='%2394ffff'/%3E%3Crect x='64' y='5' width='16' height='3' fill='%2355ffff'/%3E%3Crect x='80' y='5' width='16' height='3' fill='%2332e8e8'/%3E%3Crect x='96' y='5' width='16' height='3' fill='%2300cccc'/%3E%3Crect x='112' y='5' width='16' height='3' fill='%2300aaaa'/%3E%3Crect x='128' y='5' width='16' height='3' fill='%230096aa'/%3E%3Crect x='144' y='5' width='16' height='3' fill='%230077aa'/%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='%2300aaaa'/%3E%3Crect x='255' y='5' width='5' height='3' fill='%230077aa'/%3E%3Crect x='264' y='5' width='2' height='3' fill='%230000aa'/%3E%3Crect x='272' y='5' width='9' height='3' fill='%230088aa'/%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='%230066aa'/%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='%2355ffff'/%3E%3Ccircle cx='364' cy='6.5' r='1.7' fill='%2300cccc'/%3E%3Ccircle cx='378' cy='6.5' r='1.2' fill='%230088aa'/%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: 5px;
  width: 14%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #ffffff, transparent);
  opacity: 0;
  transform: translateX(0);
  animation: taper-glint 18s linear infinite;
  pointer-events: none;
}

@keyframes taper-glint {
  0%,
  74% {
    opacity: 0;
    transform: translateX(0);
  }
  78% {
    opacity: 0.8;
  }
  92% {
    opacity: 0.28;
    transform: translateX(520%);
  }
  100% {
    opacity: 0;
    transform: translateX(560%);
  }
}

html.scene-paused .taper::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;
  }
}
