/* -------------------- Global Design -------------------- */
:root {
  --font-sans: "Segoe UI", sans-serif;
  --color-primary: var(--indigo-6);
  --color-bg: var(--gray-1);
  --color-fg: var(--gray-9);
  --color-neutral: white;
  --color-border: var(--gray-4);
  --color-hover: var(--gray-2);
  --radius: var(--radius-2);
  --cell-bg: var(--gray-4);
  --shadow: var(--shadow-2);
  --shadow-hover: var(--shadow-5);
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  min-height: 100vh;
  padding: var(--size-3);
  background-color: var(--color-bg);
  font-family: var(--font-sans);
  color: var(--color-fg);
}

@media screen and (max-width: 600px) {
  .grid {
    grid-template-columns: repeat(10, 35px);
    grid-template-rows: repeat(10, 35px);
  }

  .cell {
    width: 35px;
    height: 35px;
    font-size: var(--font-size-1);
  }
}

/* -------------------- Layout -------------------- */
.container {
  width: 100%;
  max-width: 600px;
  text-align: center;
  --grid-size: 100%;
}

.top-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--size-4);
  flex-wrap: wrap;
}

.game-title {
  font-size: var(--font-size-5);
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
  text-align: left;
}

.game-message {
  display: none;
  margin-bottom: var(--size-3);
  font-size: var(--font-size-3);
  font-weight: bold;
  padding: var(--size-2) var(--size-3);
  border-radius: var(--radius);
  background-color: var(--yellow-1);
  color: var(--color-fg);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.game-message.visible {
  display: block;
  animation: fadeInPop 0.4s ease-out;
}

@keyframes fadeInPop {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.scoreboard {
  padding: var(--size-2);
  background-color: var(--color-neutral);
  border: 1px solid var(--color-border);
  font-size: var(--font-size-2);
  font-weight: bold;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s ease;
}

.scoreboard span {
  transition: font-size 0.2s ease;
}

.scoreboard span.changed {
  font-size: var(--font-size-4);
}

.instructions {
  font-size: var(--font-size-2);
  color: var(--gray-6);
  margin-bottom: var(--size-4);
}

/* -------------------- Game Grid -------------------- */
.button-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--size-3);
  flex-wrap: wrap;
  margin-bottom: var(--size-4);
}

.grid {
  width: var(--grid-size);
  height: var(--grid-size);
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(10, 1fr);
  border: 1px solid var(--color-border);
  margin-bottom: var(--size-3);
  box-sizing: border-box;
}

.cell {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--gray-3);
  background-color: var(--cell-bg);
  font-size: var(--font-size-2);
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.cell:hover {
  background-color: var(--color-hover);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.cell.selected {
  background-color: rgba(0, 0, 255, 0.6);
}

.cell.valid-move {
  background-color: rgba(0, 255, 0, 0.5);
}

.game-card {
  background-color: var(--color-neutral);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--size-6);
  margin: var(--size-4);
  width: 100%;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: box-shadow 0.3s ease;
}

.scoreboard:hover,
.game-card:hover {
  box-shadow: var(--shadow-hover);
}

/* -------------------- How to play -------------------- */
.how-to-play-btn {
  font-size: 1rem;
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.drawer-content {
  line-height: 1.6;
}

.drawer-content h2,
.drawer-content h3 {
  margin-top: 1em;
}

/* -------------------- Shoelace Customizations -------------------- */
sl-button::part(base) {
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

sl-button::part(base):hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}