/* Design tokens and base styles match lastweeksproject.com so Arcadia sits alongside its sister sites. */
:root {
  --bg: #050913;
  --card: rgba(17, 24, 36, .78);
  --card2: rgba(12, 18, 28, .92);
  --line: rgba(255, 255, 255, .085);
  --text: #f4f7fb;
  --muted: #9cabbe;
  --soft: #c8d2df;
  --cyan: #67dcff;
  --blue: #2c8cff;
  --violet: #9d7dff;
  --shadow: 0 24px 80px rgba(0, 0, 0, .45);
  --radius: 24px;
  --max: 1180px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--bg); scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 0%, rgba(58, 170, 255, .24), transparent 27rem),
    radial-gradient(circle at 82% 18%, rgba(174, 112, 255, .20), transparent 31rem),
    radial-gradient(circle at 60% 100%, rgba(81, 121, 255, .11), transparent 24rem),
    linear-gradient(135deg, #07101b 0%, #0b1827 42%, #1d1334 100%);
  background-attachment: fixed;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

body.playing { overflow: hidden; }

#code-rain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .38;
  mix-blend-mode: screen;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, .015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .015) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 72%);
}

.site { position: relative; z-index: 1; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.wrap { width: min(calc(100% - 40px), var(--max)); margin: auto; }

svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(18px);
  background: rgba(7, 10, 16, .72);
  border-bottom: 1px solid var(--line);
}
.nav-inner { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: -.02em; }
.mark {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  position: relative;
  background: linear-gradient(145deg, rgba(104, 224, 255, .18), rgba(168, 137, 255, .18));
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: inset 0 0 18px rgba(104, 224, 255, .08), 0 10px 28px rgba(0, 0, 0, .25);
  overflow: hidden;
}
.mark::before {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid var(--cyan);
  border-radius: 5px;
  transform: rotate(45deg);
  box-shadow: 9px 9px 0 -5px var(--violet);
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: .67rem;
  font-weight: 650;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-top: -2px;
}
.nav-links { display: flex; align-items: center; gap: 26px; color: var(--muted); font-size: .92rem; }
.nav-links a:hover { color: var(--text); }
.nav-links .arrow { color: var(--cyan); }

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: 64px;
  padding: 72px 0 56px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--cyan);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; }
h1 {
  margin: 0;
  font-size: clamp(3rem, 6vw, 5.6rem);
  line-height: .93;
  letter-spacing: -.068em;
  max-width: 900px;
}
.hero-animated {
  display: block;
  width: 100%;
  min-height: 1.02em;
  background: linear-gradient(90deg, #b5baff 0%, var(--violet) 36%, var(--cyan) 75%, #86baff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 14px rgba(120, 140, 255, .16));
}
.hero-animated::after {
  content: "";
  display: inline-block;
  width: 3px;
  height: .82em;
  margin-left: .05em;
  vertical-align: -.02em;
  border-radius: 2px;
  background: rgba(140, 200, 255, .9);
  box-shadow: 0 0 10px rgba(120, 180, 255, .25);
  animation: caret .85s step-end infinite;
}
@keyframes caret { 50% { opacity: 0; } }

.lead { max-width: 620px; margin: 28px 0 0; color: var(--soft); font-size: clamp(1.06rem, 1.7vw, 1.22rem); }
.hero-actions { display: flex; gap: 13px; flex-wrap: wrap; margin-top: 32px; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 17px;
  color: var(--text);
  background: rgba(255, 255, 255, .035);
  transition: .2s ease;
  font-family: inherit;
  font-weight: 700;
  font-size: .92rem;
  line-height: 1.2;
  cursor: pointer;
}
.button:hover { transform: translateY(-2px); border-color: rgba(104, 224, 255, .35); background: rgba(104, 224, 255, .07); }
.button.primary {
  background: linear-gradient(135deg, rgba(104, 224, 255, .17), rgba(168, 137, 255, .15));
  border-color: rgba(104, 224, 255, .25);
}
.button svg { width: 13px; height: 13px; fill: var(--cyan); stroke: none; }

/* Featured game, framed like the homepage's terminal window */

.terminal {
  display: block;
  background: linear-gradient(180deg, rgba(17, 23, 33, .92), rgba(10, 14, 21, .94));
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: rotate(1.1deg);
  position: relative;
  transition: transform .3s ease, border-color .3s ease;
}
.terminal::after {
  content: "";
  position: absolute;
  inset: auto -20% -50% 15%;
  height: 230px;
  background: radial-gradient(circle, rgba(104, 224, 255, .11), transparent 65%);
  pointer-events: none;
}
.terminal:hover { transform: rotate(0deg) translateY(-4px); border-color: rgba(104, 224, 255, .28); }
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.dot { width: 10px; height: 10px; border-radius: 99px; background: #3a4350; }
.terminal-title { margin-left: 8px; color: #728094; font: 600 .73rem var(--mono); }
.terminal-title b { color: var(--cyan); font-weight: 600; }
.featured-body { padding: 18px 20px 22px; }
.featured .shot { border-radius: 14px; }
.featured h3 { margin: 18px 0 6px; font-size: 1.65rem; letter-spacing: -.035em; line-height: 1.15; }
.featured p { margin: 0; color: var(--muted); font-size: .95rem; }
.featured .foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.featured .tech { margin: 0; }

/* ---------- Sections ---------- */

section { padding: 64px 0; }
.recent { padding: 8px 0 24px; }
.kicker { color: var(--cyan); font: 800 .76rem var(--mono); letter-spacing: .14em; text-transform: uppercase; }
h2 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); line-height: 1.02; letter-spacing: -.045em; margin: 9px 0 0; }
.section-head { display: grid; grid-template-columns: .9fr 1.1fr; gap: 50px; align-items: end; margin-bottom: 34px; }
.section-head p { margin: 0; color: var(--muted); font-size: 1.04rem; max-width: 620px; }

.recent-row { display: flex; gap: 12px; overflow-x: auto; padding: 14px 2px 8px; scrollbar-width: thin; }
.recent-item {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 16px 7px 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(18, 24, 34, .72), rgba(10, 14, 21, .72));
  font-weight: 700;
  font-size: .92rem;
  transition: .2s ease;
}
.recent-item:hover { transform: translateY(-2px); border-color: rgba(104, 224, 255, .3); }
.recent-item .thumb { width: 58px; aspect-ratio: 16 / 10; border-radius: 9px; overflow: hidden; background: var(--card2); }
.recent-item .thumb > * { width: 100%; height: 100%; object-fit: cover; display: block; }
.recent-item .placeholder { font-size: .7rem; }

/* ---------- Toolbar ---------- */

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 14px; }
.search {
  flex: 1;
  min-width: 0;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 12px 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .035);
  transition: border-color .2s, background .2s;
}
.search:focus-within { border-color: rgba(104, 224, 255, .35); background: rgba(104, 224, 255, .05); }
.search svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: .95rem; }
.search input::placeholder { color: #6f7c8e; }
.search kbd { font: 700 .7rem var(--mono); color: #6f7c8e; border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; }

.toolbar-right { display: flex; align-items: center; gap: 14px; }
.count { color: #7f8b9c; font: 600 .78rem var(--mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
select {
  appearance: none;
  height: 44px;
  padding: 0 36px 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  color: var(--text);
  font-family: inherit;
  font-weight: 700;
  font-size: .88rem;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239cabbe' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 12px center / 13px no-repeat,
    rgba(255, 255, 255, .035);
  cursor: pointer;
}
select option { background: #0c121c; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.chip {
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .07);
  background: rgba(255, 255, 255, .03);
  color: var(--muted);
  font: 800 .7rem var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: .2s ease;
}
.chip:hover { color: var(--text); border-color: rgba(104, 224, 255, .25); }
.chip[aria-pressed="true"] { color: var(--cyan); border-color: rgba(104, 224, 255, .3); background: rgba(104, 224, 255, .08); }
.chip .n { opacity: .55; margin-left: 6px; }

/* ---------- Game cards (styled after the homepage's .project cards) ---------- */

.game-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.game {
  display: flex;
  flex-direction: column;
  padding: 12px 12px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(17, 23, 33, .84), rgba(10, 14, 20, .72));
  position: relative;
  overflow: hidden;
  transition: .22s ease;
}
.game::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  right: -110px;
  bottom: -145px;
  background: radial-gradient(circle, rgba(168, 137, 255, .12), transparent 66%);
  pointer-events: none;
}
.game:hover, .game:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(168, 137, 255, .26);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .24);
  outline: none;
}

.shot { position: relative; aspect-ratio: 16 / 10; border-radius: 16px; overflow: hidden; background: var(--card2); border: 1px solid rgba(255, 255, 255, .06); }
.shot img, .shot .placeholder { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.game:hover .shot img, .featured:hover .shot img { transform: scale(1.035); }

.game-body { padding: 18px 12px 0; display: flex; flex-direction: column; flex: 1; }
.game-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pill {
  font: 800 .66rem var(--mono);
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--cyan);
  border: 1px solid rgba(104, 224, 255, .18);
  background: rgba(104, 224, 255, .055);
  padding: 6px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.tiny-code { font-family: var(--mono); color: #667385; font-size: .74rem; }
.game h3 { font-size: 1.35rem; margin: 16px 0 6px; letter-spacing: -.035em; line-height: 1.2; overflow-wrap: anywhere; }
.game p {
  margin: 0;
  color: var(--muted);
  font-size: .93rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tech { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.tech span {
  color: #8794a5;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .055);
  padding: 4px 8px;
  border-radius: 8px;
  font-size: .72rem;
}
.linkline { margin-top: auto; padding-top: 16px; color: #d4def3; font-weight: 700; font-size: .92rem; }
.linkline span { color: var(--cyan); display: inline-block; transition: transform .2s ease; }
.game:hover .linkline span { transform: translateX(3px); }

.placeholder {
  display: grid;
  place-items: center;
  font: 800 1.6rem var(--mono);
  letter-spacing: .04em;
  color: rgba(255, 255, 255, .85);
}

.status { color: var(--muted); text-align: center; padding: 48px 16px; }
.status:empty { display: none; }
.status strong { display: block; color: var(--cyan); font: 800 .76rem var(--mono); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 10px; }
.status .button { margin-top: 18px; }

.skeleton {
  aspect-ratio: 16 / 15;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(100deg, rgba(17, 23, 33, .7) 30%, rgba(30, 40, 56, .7) 50%, rgba(17, 23, 33, .7) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -150% 0; } }

footer { padding: 38px 0 48px; color: #7f8b9c; font-size: .84rem; }
.footer-inner { border-top: 1px solid var(--line); padding-top: 25px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
#revision:not(:empty)::before { content: " · "; }

/* ---------- Player ---------- */

.player { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: #03060c; }
.player-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  background: rgba(7, 10, 16, .92);
  border-bottom: 1px solid var(--line);
}
.dots { display: flex; gap: 7px; margin: 0 6px 0 10px; }
.player-title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 14px; padding: 0 4px; }
.player-title strong { font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-title span { color: #728094; font: 600 .75rem var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .09);
  background: rgba(255, 255, 255, .035);
  color: var(--soft);
  cursor: pointer;
  transition: .2s ease;
}
.icon-btn:hover { color: var(--cyan); border-color: rgba(104, 224, 255, .35); background: rgba(104, 224, 255, .07); }
.icon-btn svg { width: 18px; height: 18px; }

.stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.frame-box { width: 100%; height: 100%; }
.frame-box iframe { display: block; width: 100%; height: 100%; border: 0; background: #000; }
.stage:fullscreen { background: #000; }

.player-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  text-align: center;
  color: var(--muted);
  background: #03060c;
  padding: 24px;
}
.player-status:empty { display: none; }
.player-status strong { color: var(--cyan); font: 800 .76rem var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.loading-dots::after { content: ""; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* ---------- Responsive (same breakpoints as the homepage) ---------- */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 56px; }
  .terminal { transform: none; }
  .section-head { grid-template-columns: 1fr; gap: 18px; }
  .game-grid { grid-template-columns: repeat(2, 1fr); }
  .hide-sm { display: none; }
}

@media (max-width: 620px) {
  .wrap { width: min(calc(100% - 26px), var(--max)); }
  .hero { padding: 44px 0 36px; }
  h1 { font-size: clamp(2.7rem, 14vw, 4rem); }
  .hero-animated { min-height: 1.9em; }
  section { padding: 48px 0; }
  .game-grid { grid-template-columns: 1fr; }
  .search { max-width: none; flex-basis: 100%; }
  .toolbar-right { width: 100%; justify-content: space-between; }
  .nav-links { font-size: .84rem; }
  .player-title span, .dots { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  #code-rain { display: none; }
}
