:root {
  --bg: #151426;
  --panel: #242136;
  --panel-2: #302c48;
  --ink: #fff7df;
  --muted: #cfc5b7;
  --line: #696b89;
  --pink: #ff4fa3;
  --cyan: #32e6ff;
  --green: #9bff6a;
  --yellow: #ffd84d;
  --orange: #ff8a3d;
  --violet: #9d6bff;
  --blue: #4d8dff;
  --shadow: #0b0c12;
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    var(--bg);
  background-size: 18px 18px;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  line-height: 1.5;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    radial-gradient(circle at 10% 14%, rgba(255, 79, 163, 0.26), transparent 26%),
    radial-gradient(circle at 88% 12%, rgba(50, 230, 255, 0.22), transparent 24%),
    radial-gradient(circle at 70% 72%, rgba(155, 255, 106, 0.12), transparent 28%),
    linear-gradient(135deg, rgba(157, 107, 255, 0.18), transparent 36%),
    linear-gradient(180deg, rgba(11, 12, 18, 0.04), rgba(11, 12, 18, 0.38));
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(16px, 4vw, 48px);
  border-bottom: 4px solid var(--yellow);
  background:
    linear-gradient(90deg, rgba(255, 79, 163, 0.22), rgba(50, 230, 255, 0.16), rgba(255, 216, 77, 0.16)),
    rgba(20, 19, 34, 0.95);
  backdrop-filter: blur(8px);
}

.brand,
.main-nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: uppercase;
  color: var(--yellow);
  text-shadow: 2px 2px 0 var(--shadow);
}

.brand-mark {
  width: 34px;
  height: 34px;
  background:
    linear-gradient(var(--pink) 0 0) 4px 4px / 8px 8px no-repeat,
    linear-gradient(var(--cyan) 0 0) 16px 4px / 8px 8px no-repeat,
    linear-gradient(var(--yellow) 0 0) 22px 10px / 8px 8px no-repeat,
    linear-gradient(var(--green) 0 0) 4px 22px / 8px 8px no-repeat,
    linear-gradient(var(--violet) 0 0) 16px 22px / 8px 8px no-repeat,
    var(--panel);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--shadow);
  image-rendering: pixelated;
}

.main-nav {
  flex-wrap: wrap;
  gap: 8px;
}

.main-nav a {
  padding: 8px 10px;
  border: 2px solid transparent;
  text-decoration: none;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: #101117;
  border-color: var(--ink);
  background: var(--cyan);
  outline: none;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.7fr);
  gap: 28px;
  align-items: end;
  min-height: 390px;
  padding: clamp(40px, 7vw, 84px) 0 30px;
}

.intro-copy h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 5.2rem);
  line-height: 0.96;
  text-wrap: balance;
  text-shadow: 4px 4px 0 var(--shadow);
}

.intro-copy p:not(.kicker) {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.05rem;
}

.kicker {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stats-panel,
.toolbox,
.games-grid article,
.review-grid article,
.top-grid article {
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 42%),
    var(--panel);
  box-shadow: 7px 7px 0 var(--shadow);
}

.stats-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.stats-panel div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 12px;
  background: var(--panel-2);
  border-left: 6px solid var(--cyan);
}

.stats-panel div:nth-child(2) {
  border-left-color: var(--pink);
}

.stats-panel div:nth-child(3) {
  border-left-color: var(--green);
}

.stats-panel strong {
  color: var(--yellow);
  font-size: 1.5rem;
}

.stats-panel span {
  color: var(--muted);
}

.toolbox {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) repeat(3, minmax(160px, 0.7fr));
  gap: 12px;
  margin: 8px 0 42px;
  padding: 16px;
}

label {
  display: grid;
  gap: 6px;
}

label span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  color: var(--ink);
  background: #141326;
  border: 3px solid var(--line);
  border-radius: 0;
  padding: 8px 10px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--cyan);
  outline: none;
}

textarea {
  resize: vertical;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 3rem);
}

.catalog-heading {
  font-size: clamp(2.8rem, 8vw, 5.4rem);
  line-height: 0.9;
  text-shadow: 4px 4px 0 var(--shadow);
}

.result-count {
  color: var(--yellow);
  font-weight: 900;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat( auto-fit, minmax(250px, 1fr) );
  gap: 20px;
}

.game-card {
  cursor: pointer;
  overflow: hidden;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.game-card:nth-child(3n + 1) {
  border-color: var(--cyan);
}

.game-card:nth-child(3n + 2) {
  border-color: var(--pink);
}

.game-card:nth-child(3n + 3) {
  border-color: var(--yellow);
}

.game-card:hover,
.game-card:focus-visible {
  box-shadow: 10px 10px 0 var(--shadow);
  outline: 3px solid var(--yellow);
  transform: translate(-2px, -2px);
}

.pixel-cover {
  position: relative;
  height: 150px;
  border-bottom: 3px solid var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 216, 77, 0.16), transparent 34%),
    linear-gradient(225deg, rgba(50, 230, 255, 0.18), transparent 38%),
    var(--cover-bg, #282a36);
  image-rendering: pixelated;
}

.card-cover-image {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: auto;
}

.pixel-cover::before,
.pixel-cover::after {
  position: absolute;
  content: "";
  image-rendering: pixelated;
}

.game-card .pixel-cover::before {
  left: 18%;
  right: 18%;
  bottom: 30px;
  height: 58px;
  background:
    linear-gradient(var(--cyan) 0 0) 0 36px / 100% 12px no-repeat,
    linear-gradient(var(--yellow) 0 0) 18% 14px / 18px 18px no-repeat,
    linear-gradient(var(--pink) 0 0) 48% 0 / 22px 22px no-repeat,
    linear-gradient(var(--green) 0 0) 76% 20px / 18px 18px no-repeat;
}

.game-card .pixel-cover::after {
  left: 50%;
  bottom: 46px;
  width: 30px;
  height: 42px;
  transform: translateX(-50%);
  background:
    linear-gradient(var(--ink) 0 0) 8px 0 / 14px 14px no-repeat,
    linear-gradient(#101117 0 0) 0 14px / 30px 20px no-repeat,
    linear-gradient(var(--yellow) 0 0) 6px 34px / 18px 8px no-repeat;
}

.game-card[data-art="knight"] .pixel-cover::before {
  left: 36%;
  bottom: 22px;
  width: 64px;
  height: 64px;
  background:
    linear-gradient(var(--ink) 0 0) 12px 0 / 40px 18px no-repeat,
    linear-gradient(var(--ink) 0 0) 0 18px / 64px 16px no-repeat,
    linear-gradient(#101117 0 0) 18px 22px / 8px 8px no-repeat,
    linear-gradient(#101117 0 0) 38px 22px / 8px 8px no-repeat,
    linear-gradient(var(--cyan) 0 0) 22px 42px / 20px 18px no-repeat;
}

.game-card[data-art="mountain"] .pixel-cover::before {
  inset: auto 20px 20px 20px;
  height: 86px;
  background:
    linear-gradient(135deg, transparent 0 48%, #8bd4ff 49% 52%, transparent 53%) center / 100% 100%,
    linear-gradient(135deg, transparent 0 49%, var(--pink) 50%) left bottom / 55% 75% no-repeat,
    linear-gradient(45deg, transparent 0 49%, #6d5dfc 50%) right bottom / 56% 100% no-repeat;
}

.game-card[data-art="farm"] .pixel-cover::before {
  inset: 68px 18px 18px;
  background:
    repeating-linear-gradient(90deg, #6fbf4b 0 18px, #478d35 18px 36px);
}

.game-card[data-art="farm"] .pixel-cover::after {
  left: 28px;
  bottom: 62px;
  width: 82px;
  height: 54px;
  background:
    linear-gradient(#e35b5b 0 0) 8px 0 / 66px 22px no-repeat,
    linear-gradient(#d9a35f 0 0) 0 22px / 82px 32px no-repeat,
    linear-gradient(#563728 0 0) 34px 34px / 14px 20px no-repeat;
}

.game-card[data-art="under"] .pixel-cover::before {
  left: 50%;
  top: 48px;
  width: 78px;
  height: 62px;
  transform: translateX(-50%);
  background:
    linear-gradient(var(--pink) 0 0) 26px 0 / 26px 18px no-repeat,
    linear-gradient(var(--pink) 0 0) 12px 14px / 54px 22px no-repeat,
    linear-gradient(var(--pink) 0 0) 24px 34px / 30px 28px no-repeat;
}

.game-card[data-art="hades"] .pixel-cover::before {
  left: 52%;
  bottom: 22px;
  width: 72px;
  height: 90px;
  transform: translateX(-50%);
  background:
    linear-gradient(var(--green) 0 0) 24px 0 / 24px 18px no-repeat,
    linear-gradient(#f0d0a0 0 0) 18px 18px / 36px 28px no-repeat,
    linear-gradient(#542b3a 0 0) 8px 46px / 56px 34px no-repeat,
    linear-gradient(var(--yellow) 0 0) 22px 80px / 28px 10px no-repeat;
}

.game-card[data-art="elysium"] .pixel-cover::before {
  left: 28px;
  right: 28px;
  bottom: 26px;
  height: 86px;
  background:
    linear-gradient(#9aa0ad 0 0) 0 32px / 100% 10px no-repeat,
    linear-gradient(#5e6574 0 0) 8px 42px / 86% 14px no-repeat,
    linear-gradient(#252a36 0 0) 18px 56px / 68% 28px no-repeat,
    linear-gradient(var(--yellow) 0 0) 14px 0 / 10px 18px no-repeat,
    linear-gradient(var(--pink) 0 0) 44px 8px / 10px 18px no-repeat,
    linear-gradient(var(--cyan) 0 0) 74px 2px / 10px 18px no-repeat;
}

.game-card[data-art="cup"] .pixel-cover::before {
  left: 50%;
  bottom: 24px;
  width: 72px;
  height: 82px;
  transform: translateX(-50%);
  background:
    linear-gradient(var(--ink) 0 0) 18px 0 / 36px 34px no-repeat,
    linear-gradient(#cf3d3d 0 0) 8px 34px / 56px 24px no-repeat,
    linear-gradient(var(--ink) 0 0) 16px 58px / 12px 24px no-repeat,
    linear-gradient(var(--ink) 0 0) 44px 58px / 12px 24px no-repeat,
    linear-gradient(#101117 0 0) 24px 12px / 7px 7px no-repeat,
    linear-gradient(#101117 0 0) 42px 12px / 7px 7px no-repeat;
}

.game-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.game-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.game-title-row h3 {
  margin: 0;
  font-size: 1.28rem;
}

.score {
  flex: 0 0 auto;
  min-width: 46px;
  padding: 4px 6px;
  color: #101117;
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  border: 2px solid var(--ink);
  text-align: center;
  font-weight: 900;
}

.meta,
.tags,
.platform-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta span,
.tags span {
  padding: 4px 7px;
  background: #17152a;
  border: 2px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.platforms-block {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.platforms-block strong {
  color: var(--yellow);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.platform-tag {
  padding: 5px 8px;
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--shadow);
  font-size: 0.8rem;
  font-weight: 900;
}

.platform-playstation {
  background: #255fe8;
}

.platform-xbox {
  background: #1c8f3a;
}

.platform-switch {
  background: #e44343;
}

.platform-pc {
  background: #5f6675;
}

.platform-other {
  background: var(--violet);
}

.game-body p {
  margin: 0;
  color: var(--muted);
}

.details-toggle {
  min-height: 40px;
  color: var(--ink);
  background: #17152a;
  border: 3px solid var(--cyan);
  box-shadow: 4px 4px 0 var(--shadow);
  cursor: pointer;
  font-weight: 900;
}

.game-link,
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 38px;
  padding: 7px 10px;
  color: #101117;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--shadow);
  font-weight: 900;
  text-decoration: none;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.game-link:hover,
.game-link:focus-visible,
.back-link:hover,
.back-link:focus-visible {
  background: linear-gradient(135deg, var(--yellow), var(--pink));
  outline: none;
}

.details-toggle:hover,
.details-toggle:focus-visible {
  color: #101117;
  background: var(--cyan);
  outline: none;
}

.details {
  display: none;
  padding-top: 4px;
  color: var(--ink);
}

.game-card.is-open .details {
  display: block;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 24px;
  color: var(--muted);
  border: 3px dashed var(--line);
  text-align: center;
}

.reviews,
.tops {
  padding: 64px 0 0;
}

.review-grid,
.top-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.review-grid article,
.top-grid article {
  padding: 18px;
}

.review-grid h3,
.top-grid h3 {
  margin: 0 0 10px;
}

.review-grid p,
.top-grid li {
  color: var(--muted);
}

.top-grid ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(1180px, calc(100% - 32px));
  margin: 72px auto 0;
  padding: 24px 0 32px;
  color: var(--muted);
  border-top: 3px solid var(--line);
}

.site-footer span:first-child {
  color: var(--ink);
  font-weight: 900;
}

.game-page {
  padding-top: 42px;
}

.game-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.55fr);
  gap: 28px;
  align-items: end;
  min-height: 320px;
}

.game-hero h1 {
  margin: 10px 0 12px;
  font-size: clamp(2.6rem, 8vw, 6rem);
  line-height: 0.92;
}

.game-hero p:not(.kicker) {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.08rem;
}

.game-facts,
.detail-panel,
.screenshot-card {
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 79, 163, 0.09), transparent 50%),
    var(--panel);
  box-shadow: 7px 7px 0 var(--shadow);
}

.game-facts {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.game-facts div {
  display: grid;
  gap: 2px;
  padding: 12px;
  background: var(--panel-2);
  border-left: 6px solid var(--pink);
}

.game-facts div:nth-child(2) {
  border-left-color: var(--cyan);
}

.game-facts div:nth-child(3) {
  border-left-color: var(--yellow);
}

.game-facts strong {
  color: var(--yellow);
  font-size: 1.35rem;
}

.game-facts span {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}

.screenshots-section,
.details-layout {
  padding-top: 58px;
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.screenshot-card {
  margin: 0;
  overflow: hidden;
}

.pixel-scene {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    var(--cover-bg);
  background-size: 14px 14px, 14px 14px, auto;
  border-bottom: 3px solid var(--ink);
  image-rendering: pixelated;
}

.pixel-scene::before,
.pixel-scene::after {
  position: absolute;
  content: "";
  image-rendering: pixelated;
}

.pixel-scene::before {
  left: 12%;
  right: 12%;
  bottom: 18%;
  height: 16%;
  background: var(--cyan);
  box-shadow:
    28px -34px 0 -2px var(--yellow),
    74px -18px 0 -4px var(--pink),
    128px -48px 0 -3px var(--green);
}

.pixel-scene::after {
  left: 46%;
  bottom: 34%;
  width: 34px;
  height: 48px;
  background:
    linear-gradient(var(--ink) 0 0) 8px 0 / 18px 16px no-repeat,
    linear-gradient(var(--pink) 0 0) 4px 16px / 26px 22px no-repeat,
    linear-gradient(#101117 0 0) 0 38px / 34px 10px no-repeat;
}

.screenshot-card[data-scene="2"] .pixel-scene {
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.14) 0 14px, transparent 14px 28px),
    var(--cover-bg);
}

.screenshot-card[data-scene="2"] .pixel-scene::before {
  left: 20%;
  right: 20%;
  bottom: 20%;
  height: 48%;
  background:
    linear-gradient(var(--yellow) 0 0) 10% 18% / 20% 14% no-repeat,
    linear-gradient(var(--pink) 0 0) 48% 0 / 18% 18% no-repeat,
    linear-gradient(var(--cyan) 0 0) 70% 28% / 18% 18% no-repeat,
    linear-gradient(#101117 0 0) center bottom / 100% 18% no-repeat;
  box-shadow: none;
}

.screenshot-card[data-scene="3"] .pixel-scene {
  background:
    linear-gradient(180deg, rgba(255, 209, 102, 0.12), transparent 45%),
    var(--cover-bg);
}

.screenshot-card[data-scene="3"] .pixel-scene::before {
  left: 10%;
  right: 10%;
  bottom: 18%;
  height: 40%;
  background:
    linear-gradient(var(--line) 0 0) 0 66% / 100% 14% no-repeat,
    linear-gradient(var(--green) 0 0) 12% 44% / 18% 16% no-repeat,
    linear-gradient(var(--cyan) 0 0) 42% 22% / 16% 18% no-repeat,
    linear-gradient(var(--pink) 0 0) 74% 48% / 18% 14% no-repeat;
  box-shadow: none;
}

.screenshot-card figcaption {
  display: grid;
  gap: 4px;
  padding: 14px;
}

.real-screenshot {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 3px solid var(--ink);
  background: #101117;
}

.screenshot-card figcaption span,
.detail-panel p,
.player-reviews blockquote {
  color: var(--muted);
}

.details-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.8fr);
  gap: 20px;
}

.detail-panel {
  padding: 20px;
}

.detail-panel h2 {
  margin: 0 0 14px;
}

.detail-panel p {
  margin: 0 0 14px;
}

.player-reviews {
  display: grid;
  gap: 12px;
}

.player-reviews blockquote {
  margin: 0;
  padding: 12px;
  background: #151720;
  border-left: 6px solid var(--cyan);
}

.admin-page {
  padding-top: 42px;
}

.auth-panel {
  width: min(520px, 100%);
  margin: 48px auto 0;
  padding: 22px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 7px 7px 0 var(--shadow);
}

.auth-panel h1 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 0.95;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-message {
  min-height: 24px;
  margin: 0;
  color: var(--yellow);
  font-weight: 900;
}

.admin-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.35fr);
  gap: 24px;
  align-items: end;
  margin-bottom: 30px;
}

.admin-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(2.4rem, 7vw, 5rem);
  line-height: 0.94;
}

.admin-hero p:not(.kicker) {
  max-width: 740px;
  color: var(--muted);
}

.admin-status,
.admin-list,
.admin-form {
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(50, 230, 255, 0.08), transparent 42%),
    var(--panel);
  box-shadow: 7px 7px 0 var(--shadow);
}

.admin-status {
  padding: 16px;
  color: var(--yellow);
  font-weight: 900;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.34fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.admin-list,
.admin-form {
  padding: 18px;
}

.admin-list {
  position: sticky;
  top: 92px;
}

.admin-game-list {
  display: grid;
  gap: 8px;
  max-height: 620px;
  margin-top: 14px;
  overflow: auto;
  padding-right: 6px;
}

.admin-game-list button,
.admin-button {
  min-height: 40px;
  color: var(--ink);
  background: #17152a;
  border: 3px solid var(--line);
  box-shadow: 4px 4px 0 var(--shadow);
  cursor: pointer;
  font-weight: 900;
  text-align: left;
}

.admin-game-list button {
  padding: 8px 10px;
}

.admin-game-list button:hover,
.admin-game-list button:focus-visible,
.admin-game-list button.is-active {
  color: #101117;
  background: var(--yellow);
  border-color: var(--ink);
  outline: none;
}

.admin-form {
  display: grid;
  gap: 16px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 12px;
}

.screenshot-editor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.screenshot-edit-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 3px dashed var(--line);
  background: #151720;
}

.screenshot-edit-card input {
  min-height: auto;
  padding: 8px;
}

.screenshot-edit-preview {
  overflow: hidden;
  border: 3px solid var(--ink);
  background: #101117;
}

.screenshot-edit-preview img,
.screenshot-edit-preview .pixel-scene {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 0;
}

.screenshot-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 4px;
}

.admin-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  text-decoration: none;
  text-align: center;
}

.admin-button.primary {
  color: #101117;
  background: linear-gradient(135deg, var(--green), var(--yellow));
  border-color: var(--ink);
}

.admin-button:hover,
.admin-button:focus-visible {
  color: #101117;
  background: linear-gradient(135deg, var(--cyan), var(--pink));
  border-color: var(--ink);
  outline: none;
}

.play-page {
  padding-top: 42px;
}

.play-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.35fr);
  gap: 24px;
  align-items: end;
  margin-bottom: 28px;
}

.play-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2.6rem, 8vw, 6rem);
  line-height: 0.92;
  text-shadow: 4px 4px 0 var(--shadow);
}

.play-hero p:not(.kicker) {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.08rem;
}

.play-controls-note,
.tetris-panel,
.leaderboard-panel {
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 216, 77, 0.1), transparent 52%),
    var(--panel);
  box-shadow: 7px 7px 0 var(--shadow);
}

.play-controls-note {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.play-controls-note strong {
  color: var(--yellow);
  font-size: 1.2rem;
}

.play-controls-note span {
  color: var(--muted);
}

.play-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(280px, 0.48fr);
  gap: 22px;
  align-items: start;
}

.tetris-panel,
.leaderboard-panel {
  padding: 18px;
}

.tetris-panel {
  position: relative;
  padding-top: 62px;
  border-width: 5px;
  background:
    linear-gradient(180deg, rgba(255, 216, 77, 0.18), transparent 18%),
    linear-gradient(90deg, rgba(255, 79, 163, 0.12), rgba(50, 230, 255, 0.1)),
    #201d31;
}

.tetris-panel::before {
  position: absolute;
  top: 14px;
  left: 18px;
  right: 18px;
  content: "TERMINUS ARCADE";
  padding: 8px 12px;
  color: #101117;
  background:
    linear-gradient(90deg, var(--yellow), var(--pink), var(--cyan), var(--green));
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--shadow);
  font-size: 0.95rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.tetris-topbar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.tetris-topbar div {
  display: grid;
  gap: 2px;
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(255, 216, 77, 0.1), transparent),
    #17152a;
  border: 3px solid var(--ink);
  box-shadow: inset 0 0 0 3px #0d0e1a;
}

.tetris-topbar span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.tetris-topbar strong {
  color: var(--yellow);
  font-size: 1.35rem;
}

.tetris-stage {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(104px, 0.35fr);
  gap: 16px;
  align-items: start;
}

#tetrisCanvas,
#softCanvas,
#nextCanvas {
  width: 100%;
  height: auto;
  background: #111225;
  border: 5px solid var(--ink);
  box-shadow:
    0 0 0 6px #0d0e1a,
    8px 8px 0 var(--shadow),
    0 0 28px rgba(50, 230, 255, 0.16);
  image-rendering: pixelated;
}

#tetrisCanvas,
#softCanvas {
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0 2px, transparent 2px 6px),
    #111225;
}

.arcade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}

.arcade-card {
  display: grid;
  gap: 12px;
  min-height: 360px;
  padding: 18px;
  color: inherit;
  text-decoration: none;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 79, 163, 0.1), transparent 46%),
    var(--panel);
  box-shadow: 7px 7px 0 var(--shadow);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.arcade-card:hover,
.arcade-card:focus-visible {
  outline: 3px solid var(--yellow);
  transform: translate(-2px, -2px);
  box-shadow: 10px 10px 0 var(--shadow);
}

.arcade-card strong {
  color: var(--yellow);
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 0.95;
}

.arcade-card span:last-child {
  color: var(--muted);
}

.arcade-preview {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 3px solid var(--ink);
  background: #111225;
  image-rendering: pixelated;
}

.tetris-preview {
  aspect-ratio: 10 / 16;
  min-height: 340px;
  background:
    #111225;
  border-width: 5px;
  box-shadow:
    inset 0 0 0 5px #17152a,
    inset 0 0 0 9px var(--ink),
    5px 5px 0 var(--shadow);
}

.arcade-card .tetris-preview,
.arcade-card .soft-tetris-preview {
  min-height: 340px;
}

.tetris-board-preview,
.piece {
  position: absolute;
  image-rendering: pixelated;
}

.tetris-board-preview {
  inset: 4%;
  border: 3px solid var(--line);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 10%),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 5%),
    #111225;
}

.piece {
  --cell: 10%;
  --row: 5%;
}

.piece-fall {
  left: calc(var(--cell) * 3);
  top: calc(var(--row) * 4);
  width: calc(var(--cell) * 3);
  height: calc(var(--row) * 2);
  background:
    linear-gradient(var(--orange) 0 0) 0 50% / 33.3% 50% no-repeat,
    linear-gradient(var(--orange) 0 0) 33.3% 50% / 33.3% 50% no-repeat,
    linear-gradient(var(--orange) 0 0) 66.6% 50% / 33.3% 50% no-repeat,
    linear-gradient(var(--orange) 0 0) 66.6% 0 / 33.3% 50% no-repeat;
}

.piece-ghost {
  left: calc(var(--cell) * 3);
  top: calc(var(--row) * 10);
  width: calc(var(--cell) * 3);
  height: calc(var(--row) * 2);
  background:
    linear-gradient(rgba(255, 216, 77, 0.12) 0 0) 0 50% / 33.3% 50% no-repeat,
    linear-gradient(rgba(255, 216, 77, 0.12) 0 0) 33.3% 50% / 33.3% 50% no-repeat,
    linear-gradient(rgba(255, 216, 77, 0.12) 0 0) 66.6% 50% / 33.3% 50% no-repeat,
    linear-gradient(rgba(255, 216, 77, 0.12) 0 0) 66.6% 0 / 33.3% 50% no-repeat;
  outline: 2px dashed var(--yellow);
}

.stack-a {
  left: calc(var(--cell) * 3);
  top: calc(var(--row) * 12);
  width: calc(var(--cell) * 4);
  height: var(--row);
  background:
    linear-gradient(var(--cyan) 0 0) 0 0 / 25% 100% no-repeat,
    linear-gradient(var(--cyan) 0 0) 25% 0 / 25% 100% no-repeat,
    linear-gradient(var(--cyan) 0 0) 50% 0 / 25% 100% no-repeat,
    linear-gradient(var(--cyan) 0 0) 75% 0 / 25% 100% no-repeat;
}

.stack-b {
  left: calc(var(--cell) * 5);
  top: calc(var(--row) * 13);
  width: calc(var(--cell) * 3);
  height: calc(var(--row) * 3);
  background:
    linear-gradient(var(--orange) 0 0) 33.3% 0 / 33.3% 33.3% no-repeat,
    linear-gradient(var(--orange) 0 0) 0 33.3% / 33.3% 33.3% no-repeat,
    linear-gradient(var(--orange) 0 0) 33.3% 33.3% / 33.3% 33.3% no-repeat,
    linear-gradient(var(--orange) 0 0) 66.6% 33.3% / 33.3% 33.3% no-repeat,
    linear-gradient(var(--orange) 0 0) 33.3% 66.6% / 33.3% 33.3% no-repeat,
    linear-gradient(var(--orange) 0 0) 66.6% 66.6% / 33.3% 33.3% no-repeat;
}

.stack-c {
  left: calc(var(--cell) * 8);
  top: calc(var(--row) * 14);
  width: var(--cell);
  height: calc(var(--row) * 5);
  background: var(--cyan);
}

.stack-d {
  left: 0;
  top: calc(var(--row) * 16);
  width: calc(var(--cell) * 2);
  height: calc(var(--row) * 3);
  background:
    linear-gradient(var(--violet) 0 0) 0 0 / 50% 33.3% no-repeat,
    linear-gradient(var(--violet) 0 0) 0 33.3% / 50% 33.3% no-repeat,
    linear-gradient(var(--violet) 0 0) 50% 33.3% / 50% 33.3% no-repeat,
    linear-gradient(var(--violet) 0 0) 0 66.6% / 50% 33.3% no-repeat;
}

.stack-e {
  left: calc(var(--cell) * 2);
  top: calc(var(--row) * 15);
  width: var(--cell);
  height: calc(var(--row) * 5);
  background: var(--cyan);
}

.stack-f {
  left: calc(var(--cell) * 3);
  top: calc(var(--row) * 17);
  width: calc(var(--cell) * 3);
  height: calc(var(--row) * 2);
  background:
    linear-gradient(var(--violet) 0 0) 0 50% / 33.3% 50% no-repeat,
    linear-gradient(var(--violet) 0 0) 33.3% 0 / 33.3% 50% no-repeat,
    linear-gradient(var(--violet) 0 0) 33.3% 50% / 33.3% 50% no-repeat,
    linear-gradient(var(--violet) 0 0) 66.6% 50% / 33.3% 50% no-repeat;
}

.stack-g {
  left: calc(var(--cell) * 5);
  top: calc(var(--row) * 16);
  width: calc(var(--cell) * 2);
  height: calc(var(--row) * 2);
  background: var(--yellow);
}

.stack-h {
  left: 0;
  top: calc(var(--row) * 19);
  width: calc(var(--cell) * 3);
  height: var(--row);
  background: var(--blue);
}

.stack-i {
  left: calc(var(--cell) * 3);
  top: calc(var(--row) * 19);
  width: calc(var(--cell) * 4);
  height: var(--row);
  background: var(--cyan);
}

.stack-j {
  left: calc(var(--cell) * 8);
  top: calc(var(--row) * 18);
  width: calc(var(--cell) * 2);
  height: calc(var(--row) * 2);
  background: var(--blue);
}

.soft-tetris-preview {
  aspect-ratio: 10 / 16;
  min-height: 340px;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0 2px, transparent 2px 8px),
    #111225;
  border-width: 5px;
  box-shadow:
    inset 0 0 0 5px #17152a,
    inset 0 0 0 9px var(--ink),
    5px 5px 0 var(--shadow);
}

.falling-square {
  position: absolute;
  left: 50%;
  top: 38%;
  width: 56px;
  height: 56px;
  transform: translate(-50%, -50%);
  background:
    linear-gradient(var(--yellow) 0 0) 0 0 / 27px 27px no-repeat,
    linear-gradient(var(--yellow) 0 0) 29px 0 / 27px 27px no-repeat,
    linear-gradient(var(--yellow) 0 0) 0 29px / 27px 27px no-repeat,
    linear-gradient(var(--yellow) 0 0) 29px 29px / 27px 27px no-repeat;
  filter: drop-shadow(0 0 10px rgba(255, 216, 77, 0.35));
}

.sand-layer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  clip-path: polygon(0 60%, 14% 62%, 30% 38%, 42% 18%, 58% 31%, 73% 56%, 88% 63%, 100% 52%, 100% 100%, 0 100%);
}

.sand-layer-cyan {
  height: 35%;
  background: var(--cyan);
  clip-path: polygon(0 62%, 15% 65%, 31% 42%, 43% 22%, 57% 38%, 72% 65%, 86% 70%, 100% 60%, 100% 100%, 0 100%);
}

.sand-layer-yellow {
  height: 34%;
  background: var(--yellow);
  clip-path: polygon(0 68%, 12% 72%, 28% 44%, 41% 14%, 61% 56%, 72% 74%, 86% 48%, 100% 38%, 100% 100%, 0 100%);
}

.sand-layer-pink {
  height: 40%;
  background: var(--pink);
  clip-path: polygon(0 82%, 12% 75%, 26% 50%, 41% 16%, 57% 26%, 73% 50%, 87% 70%, 100% 74%, 100% 100%, 0 100%);
}

.sand-layer-green {
  height: 25%;
  background: var(--green);
  clip-path: polygon(20% 100%, 34% 60%, 48% 20%, 63% 48%, 77% 100%, 100% 100%, 100% 100%, 0 100%, 0 100%);
}

.sand-layer-violet {
  height: 24%;
  background: var(--violet);
  clip-path: polygon(0 42%, 18% 35%, 36% 18%, 50% 42%, 66% 88%, 100% 88%, 100% 100%, 0 100%);
}

.next-piece {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
  padding: 12px;
  border: 3px solid var(--line);
  background: #17152a;
}

.tetris-actions,
.tetris-pad,
.score-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.tetris-pad {
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent),
    #17152a;
  border: 4px solid var(--line);
  box-shadow: inset 0 0 0 3px #0d0e1a;
}

.tetris-pad .admin-button {
  min-width: 54px;
  min-height: 48px;
  border-radius: 999px;
  box-shadow:
    0 5px 0 #090a10,
    0 0 14px rgba(255, 216, 77, 0.12);
}

.tetris-actions .admin-button {
  min-height: 46px;
  text-transform: uppercase;
}

.leaderboard-panel {
  border-width: 5px;
}

.score-form {
  align-items: end;
  padding: 14px;
  background: #17152a;
  border: 3px dashed var(--cyan);
}

.score-form label {
  min-width: 220px;
  flex: 1;
}

.game-message {
  min-height: 26px;
  margin: 14px 0 0;
  color: var(--yellow);
  font-weight: 900;
}

.score-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 10, 18, 0.72);
  backdrop-filter: blur(6px);
}

.score-modal[hidden] {
  display: none;
}

.score-dialog {
  display: grid;
  gap: 14px;
  width: min(460px, 100%);
  padding: 22px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 79, 163, 0.18), rgba(50, 230, 255, 0.12)),
    var(--panel);
  box-shadow: 10px 10px 0 var(--shadow), 0 0 36px rgba(255, 216, 77, 0.2);
}

.score-dialog h2 {
  margin: 0;
  font-size: clamp(1.8rem, 6vw, 3rem);
  line-height: 0.98;
}

.score-dialog p:not(.kicker) {
  margin: 0;
  color: var(--yellow);
  font-weight: 900;
}

.leaderboard-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: players;
}

.leaderboard-list li {
  counter-increment: players;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: center;
  padding: 12px;
  background: #17152a;
  border: 3px solid var(--line);
}

.leaderboard-list li::before {
  content: counter(players);
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #101117;
  background: linear-gradient(135deg, var(--yellow), var(--pink));
  border: 2px solid var(--ink);
  font-weight: 900;
}

.leaderboard-list strong {
  color: var(--ink);
}

.leaderboard-list span {
  color: var(--yellow);
  font-weight: 900;
}

.leaderboard-list small {
  grid-column: 2;
  color: var(--muted);
}

@media (max-width: 860px) {
  .intro,
  .toolbox,
  .review-grid,
  .top-grid,
  .game-hero,
  .screenshot-grid,
  .details-layout,
  .admin-hero,
  .admin-layout,
  .screenshot-editor,
  .play-hero,
  .play-layout,
  .tetris-stage {
    grid-template-columns: 1fr;
  }

  .admin-list {
    position: static;
  }

  .intro {
    min-height: auto;
  }
}

@media (max-width: 620px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .intro-copy h1 {
    font-size: 2.25rem;
  }
}
