@import './styles/tokens.css';

:root {
  --home-prism: linear-gradient(90deg, #ff5454 0%, #ffad42 16%, #ffe45e 32%, #53e879 48%, #42d9ff 64%, #5475ff 82%, #cf79ff 100%);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 32px 24px;
  background: var(--ui-bg);
  color: var(--ui-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
main { width: min(100%, 340px); container-type: inline-size; }
h1 {
  width: fit-content;
  margin: 0 auto 48px;
  text-align: center;
  font-size: 42px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ui-text);
  background: var(--home-prism);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
h1 span { font-weight: 400; }
nav { display: grid; gap: 24px; }
.game-option p {
  margin: 10px 0 0;
  color: var(--ui-text);
  font-size: min(12px, 3.4cqi);
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
}
a {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 62px;
  padding: 18px 22px;
  border: 1px solid var(--ui-border-soft);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  color: var(--ui-text);
  font-size: 16px;
  text-decoration: none;
  transition: border-color 150ms, background 150ms;
}
a::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--home-prism);
  opacity: 0;
  transition: opacity 180ms;
}
a span {
  background: var(--home-prism);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
a:hover, a:focus-visible {
  border-color: transparent;
  background: linear-gradient(var(--ui-surface), var(--ui-surface)) padding-box, var(--home-prism) border-box;
}
a:hover::before, a:focus-visible::before { opacity: .1; }
a:active::before { opacity: .2; }
a:focus-visible { outline: 2px solid var(--ui-text); outline-offset: 5px; }
@media (prefers-reduced-motion: reduce) { a, a::before { transition: none; } }
@media (forced-colors: active) {
  h1, a span { background: none; -webkit-text-fill-color: currentColor; }
  a::before { display: none; }
  a:hover, a:focus-visible { border-color: LinkText; }
}
