:root {
  --bg: #121212;
  --fg: #ffffff;
  --accent: #00bcd4;
  --hover: #1de9b6;
  --danger: #ff4d4d;
}
* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow-x: hidden;
}
h1 {
  text-align: center;
  line-height: 1.3;
  margin-bottom: 10px;
}
h1 span:first-child {
  font-family: 'Pacifico', cursive;
  font-size: 3rem;
  color: white;
  text-shadow: 2px 2px 5px #000;
}
h1 a {
  color: #ffffffaa;
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 1px;
  display: inline-block;
  margin-top: 5px;
}

.controls {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.scoreboard {
  font-family: 'Pacifico', cursive;
  display: flex;
  gap: 20px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.scoreboard div {
  background: #1f1f1f;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
}
button {
  font-family: 'Poppins', sans-serif;
  padding: 8px 16px;
  background-color: var(--accent);
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  transition: transform .06s ease;
}
button:active { transform: scale(0.98); }
button[disabled] { opacity: .6; cursor: not-allowed; }

.game {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 80px);
  grid-gap: 10px;
  touch-action: manipulation;
  user-select: none;
}
.cell {
  width: 80px;
  height: 80px;
  background: #1f1f1f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, transform 0.08s;
}
.cell:hover { background: var(--hover); }
.cell.disabled { pointer-events: none; opacity: 0.9; }
.cell.win {
  background: #2a0000;
  color: var(--danger);
  box-shadow: 0 0 0 2px var(--danger) inset, 0 0 12px rgba(255,77,77,.4);
  animation: pulse 0.8s ease-out 2;
}
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.win-line {
  position: absolute;
  left: 0; top: 0;
  height: 3px;
  background: var(--danger);
  border-radius: 999px;
  box-shadow: 0 0 16px rgba(255,77,77,.5);
  transform-origin: 0 50%;
  pointer-events: none;
}

.info {
  margin-top: 15px;
  font-size: 1.2rem;
  min-height: 40px;
  opacity: 0;
  animation: fadein 0.5s forwards;
  text-align: center;
}
.trophy {
  margin-top: 10px;
  display: none;
  animation: fadein 0.8s forwards;
}
@keyframes fadein {
  from { opacity: 0; }
  to { opacity: 1; }
}