
:root {
  --bg: #160b24;
  --panel: #251332;
  --pink: #ff75b5;
  --pink-light: #ffd2e7;
  --purple: #9c6cff;
  --blue: #78d8ff;
  --text: #fff1fa;
  --muted: #c5afce;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(ellipse at 85% 8%, #612c76 0%, transparent 35%),
    radial-gradient(ellipse at 5% 55%, #4b193c 0%, transparent 38%),
    var(--bg);
  font-family: "Segoe UI", Arial, sans-serif;
  overflow-x: hidden;
}

button, select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.background-symbols {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.symbol {
  position: absolute;
  font-size: clamp(100px, 19vw, 280px);
  font-weight: 900;
  opacity: .055;
  animation: float 9s ease-in-out infinite;
}

.symbol-one { top: 7%; left: -3%; color: var(--pink); }
.symbol-two { top: 24%; right: -4%; color: var(--blue); animation-delay: -3s; }
.symbol-three { bottom: 7%; left: 7%; color: var(--purple); animation-delay: -5s; }
.symbol-four { bottom: 0; right: 5%; color: var(--pink); animation-delay: -2s; }

.topbar {
  width: min(1180px, 92%);
  margin: 24px auto;
  padding: 18px 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border: 1px solid #ffffff30;
  border-radius: 22px;
  background: #ffffff0d;
  backdrop-filter: blur(18px);
}

.back-link {
  color: var(--pink-light);
  font-size: 14px;
}

.brand {
  font-family: Georgia, serif;
  font-size: 23px;
  font-weight: bold;
}

.brand span {
  color: var(--pink);
}

.hero {
  width: min(1180px, 92%);
  min-height: 580px;
  margin: 40px auto 100px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 45px;
}

.eyebrow {
  display: inline-block;
  color: var(--pink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
}

.hero h1 {
  font-family: Georgia, serif;
  font-size: clamp(56px, 7vw, 104px);
  line-height: 1.05;
  margin: 22px 0;
}

h1 em, h2 em {
  color: var(--pink);
  font-weight: normal;
}

.dot {
  color: var(--blue);
}

.hero p, .section-heading p {
  color: var(--muted);
  line-height: 1.9;
  font-size: 16px;
  max-width: 540px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  margin-top: 30px;
}

.primary-btn, .secondary-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 15px 23px;
  border-radius: 15px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: transform .2s, box-shadow .2s;
}

.primary-btn {
  background: linear-gradient(120deg, #ff76b7, #a478ff);
  color: #1c1026;
  box-shadow: 0 10px 35px #ff67b73d;
}

.secondary-btn {
  border-color: #ffffff40;
  background: #ffffff0b;
}

.primary-btn:hover, .secondary-btn:hover {
  transform: translateY(-3px);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 28px;
}

.hero-tags span {
  font-size: 12px;
  color: #e9cce7;
  padding: 9px 12px;
  border: 1px solid #ffffff25;
  border-radius: 30px;
}

.hero-art {
  position: relative;
  min-height: 430px;
  display: grid;
  place-items: center;
  isolation: isolate;
  border: 1px solid #ffffff2b;
  border-radius: 35px;
  background:
    radial-gradient(circle at center, #823b8a55, transparent 65%),
    linear-gradient(140deg, #301b48, #180d29);
  box-shadow: inset 0 0 65px #b95aff16, 0 30px 80px #00000050;
  overflow: hidden;
}

.art-glow {
  position: absolute;
  width: 300px;
  height: 300px;
  background: #fa63ba;
  filter: blur(110px);
  opacity: .28;
}

.floating-x, .floating-o {
  position: absolute;
  font-size: 125px;
  font-weight: 900;
  text-shadow: 0 0 35px currentColor;
  animation: float 5s ease-in-out infinite;
}

.floating-x {
  color: var(--pink);
  top: 15px;
  left: 35px;
  transform: rotate(-16deg);
}

.floating-o {
  color: var(--blue);
  bottom: 35px;
  right: 28px;
  animation-delay: -2s;
}

.controller {
  position: relative;
  z-index: 2;
  width: 310px;
  height: 145px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  border: 3px solid #ffd4f0;
  border-radius: 75px 75px 95px 95px;
  background: linear-gradient(155deg, #5c366f, #24152f);
  box-shadow: 0 0 45px #ff73b95c, inset 0 8px 25px #ffffff17;
  transform: rotate(-12deg);
  animation: controllerFloat 5s ease-in-out infinite;
}

.dpad {
  font-size: 58px;
  color: var(--blue);
  text-shadow: 0 0 20px #78d8ff;
}

.controller-buttons {
  color: var(--pink);
  font-size: 29px;
  line-height: 1.2;
  font-weight: bold;
  text-align: center;
}

.controller-middle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.controller-light {
  width: 45px;
  height: 7px;
  border-radius: 10px;
  background: var(--blue);
  box-shadow: 0 0 17px var(--blue);
}

.controller-lines {
  width: 50px;
  height: 25px;
  border: 2px solid #ffffff60;
  border-radius: 8px;
}

.art-caption {
  position: absolute;
  bottom: 25px;
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--pink-light);
}

.section {
  width: min(1180px, 92%);
  margin: 0 auto 110px;
}

.section-heading {
  margin-bottom: 35px;
}

.section-heading h2 {
  font-family: Georgia, serif;
  font-size: clamp(40px, 5vw, 67px);
  margin: 15px 0;
}

.centered {
  text-align: center;
}

.centered p {
  margin-inline: auto;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.showcase-card {
  min-width: 0;
  border: 1px solid #ffffff29;
  border-radius: 25px;
  background: #ffffff09;
  overflow: hidden;
  transition: transform .3s, border-color .3s;
}

.showcase-card:hover {
  transform: translateY(-5px);
  border-color: #ff80bd88;
}

.image-frame {
  position: relative;
  min-height: 310px;
  padding: 20px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, #693c7355, #1f1233);
  overflow: hidden;
}

.image-frame img {
  display: block;
  max-width: 100%;
  overflow: visible;
  width: auto;
  min-height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 15px 40px #00000050;
}

.card-caption {
  padding: 20px 23px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-caption span {
  font-size: 11px;
  color: var(--pink);
  letter-spacing: 1.5px;
  font-weight: 700;
}

.card-caption h3 {
  margin: 8px 0 0;
  font-size: 19px;
}

.win-preview .win-overlay {
  position: absolute;
  width: 65%;
  max-height: 60%;
  inset: 0;
  margin: auto;
  object-fit: contain;
  opacity: 0;
  transform: scale(.75);
  pointer-events: none;
  transition: opacity .4s, transform .4s;
  z-index: 2;
  filter: drop-shadow(0 15px 35px #00000090);
}

.win-preview.show-result .win-overlay {
  opacity: 1;
  transform: scale(1);
}

.small-btn {
  flex-shrink: 0;
  padding: 10px 14px;
  border: 1px solid #ff83c070;
  border-radius: 12px;
  color: var(--pink-light);
  background: #ff72b91a;
}

.game-section {
  padding-top: 25px;
}

.game-shell {
  position: relative;
  max-width: 660px;
  margin: 0 auto;
  padding: 30px;
  border: 1px solid #ff9dd84a;
  border-radius: 30px;
  background: linear-gradient(150deg, #352043, #1c102d);
  box-shadow: 0 30px 90px #00000055, 0 0 55px #ff70b215;
}

.game-settings {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
}

.settings-group {
  flex: 1 1 155px;
}

.settings-group label {
  display: block;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--pink-light);
  margin-bottom: 9px;
}

.settings-group select {
  width: 100%;
  padding: 12px;
  color: white;
  background: #1a1129;
  border: 1px solid #ffffff35;
  border-radius: 12px;
}

.reset-scores {
  padding: 13px;
  border: 1px solid #ffffff35;
  border-radius: 12px;
  background: #ffffff0c;
  color: white;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 28px 0;
}

.score-item {
  text-align: center;
  padding: 15px 8px;
  border-radius: 17px;
  background: #ffffff0c;
  border: 1px solid #ffffff1e;
}

.score-item span {
  display: block;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .6px;
}

.score-item strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  color: var(--pink-light);
}

.game-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: bold;
  margin: 18px 0;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 14px var(--pink);
}

.game-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  width: min(100%, 390px);
  margin: 0 auto;
}

.cell {
  aspect-ratio: 1;
  min-width: 0;
  border: 1px solid #ff9ed44b;
  border-radius: 18px;
  background: linear-gradient(145deg, #493052, #291837);
  color: white;
  font-size: clamp(45px, 9vw, 75px);
  font-weight: 900;
  transition: transform .18s, background .18s;
}

.cell:not(:disabled):hover {
  background: #6c3a70;
  transform: scale(1.04);
}

.cell:disabled {
  cursor: default;
}

.cell.x {
  color: var(--pink);
  text-shadow: 0 0 22px #ff76b788;
}

.cell.o {
  color: var(--blue);
  text-shadow: 0 0 22px #78d8ff88;
}

.cell.winning {
  background: #70436f;
  box-shadow: inset 0 0 25px #ff85c344, 0 0 18px #ff85c355;
  animation: winPulse 1s ease-in-out infinite alternate;
}

.game-bottom {
  margin-top: 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.timer span {
  display: block;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted);
}

.timer strong {
  font-size: 25px;
  font-variant-numeric: tabular-nums;
}

.result-panel {
  margin-top: 22px;
  padding: 25px;
  border: 1px solid #ff9bce65;
  border-radius: 20px;
  background: #ff77b514;
  text-align: center;
}

.result-panel[hidden] {
  display: none;
}

.result-sparkle {
  font-size: 35px;
  color: var(--pink);
}

.result-panel h3 {
  font-family: Georgia, serif;
  font-size: 30px;
  margin: 10px 0;
}

.result-panel p {
  color: var(--muted);
}

footer {
  border-top: 1px solid #ffffff20;
  padding: 25px 5%;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

@keyframes float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -20px; }
}

@keyframes controllerFloat {
  0%, 100% { transform: rotate(-12deg) translateY(0); }
  50% { transform: rotate(-8deg) translateY(-15px); }
}

@keyframes winPulse {
  to { box-shadow: 0 0 30px #ff86ca88; }
}

@media (max-width: 800px) {
  .hero {
    grid-template-columns: 1fr;
    margin-bottom: 75px;
    gap: 25px;
  }

  .hero-art {
    min-height: 350px;
  }

  .showcase-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .topbar {
    padding: 15px;
  }

  .back-link {
    font-size: 12px;
  }

  .brand {
    font-size: 19px;
  }

  .hero h1 {
    font-size: 58px;
  }

  .controller {
    transform: scale(.78) rotate(-12deg);
    animation: none;
  }

  .floating-x, .floating-o {
    font-size: 85px;
  }

  .hero-art {
    min-height: 300px;
  }

  .image-frame {
    height: 240px;
  }

  .game-shell {
    padding: 18px;
  }

  .cell {
    border-radius: 12px;
  }

  .card-caption {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}