/* Layout and Base Styles */
body {
  margin: 0;
  height: 100vh;
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 40px;
}

h1 {
  font-family: 'Trebuchet MS', sans-serif;
  font-size: 3rem;
  font-weight: bold;
  text-align: center;
  color: #444;
  background: linear-gradient(to right, #ff5e5e, #ffb347, #8ac926, #1982c4, #6a4c93);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
}

/* Board Layout */
.game-wrapper {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
}

.board-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.board-row {
  display: flex;
  gap: 4px;
}

.board-cell {
  width: 120px;
  height: 120px;
  position: relative;
}

/* Shape Display */
.shape {
  width: 100%;
  height: 100%;
  position: relative;
}

.svg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.svg-layer.fade-out {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.segment {
  fill-rule: evenodd;
}

/* Tracker */
.tracker {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0;
}

.tracker-col {
  width: 100%;
  margin-bottom: 20px;
  text-align: center;
}

.tracker-title {
  font: 1.25em Helvetica, sans-serif;
  font-weight: bold;
  margin-block-end: 0.5em;
}

.tracker-count {
  font: 2.5em Helvetica, sans-serif;
  margin: 0;
}

/* Window Message */
.message {
  min-height: 1.5em;
  background: #333;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
  margin-bottom: 1rem;
  text-align: center;
  font-family: Helvetica, sans-serif;
  font-size: 2em;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hidden {
  display: block;
}

@media (max-width: 600px) {
  .message {
    font-size: 1.5em;
    padding: 8px 16px;
  }
}

.message:not(.hidden) {
  opacity: 1;
  transform: translateY(0);
}

.board-cell.selected {
  box-shadow: 0 0 10px 3px #ffa500;
  outline: 4px solid #ffa500;
  outline-offset: -4px;
  border-radius: 10px;
  transition: outline 0.2s ease;
}

.board-cell.celebration {
  position: relative;
  box-shadow: 0 0 10px 4px gold;
  outline: 3px solid gold;
  border-radius: 12px;
  transition: all 1s ease;
}

.board-cell.celebration::after {
  content: '★';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.5rem;
  color: gold;
  pointer-events: none;
  opacity: 0;
  animation: popStar 2s ease forwards;
}

@keyframes popStar {
  0% { transform: translate(-50%, -50%) scale(0.1); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0.75; }
}

.controls {
  text-align: center;
  margin-top: 1rem;
  position: relative;
  bottom: 1.5rem;
  right: 1.5rem;
}

.controls button {
  display: inline;
  padding: 0.5rem 1rem;
  font-size: 1.2rem;
  background-color: #1982c4;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.controls .hidden {
  display: none;
}
