/* CSS Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Root variables */
:root {
  --primary-color: #000;
  --text-color: #333;
  --background-color: #fff;
  --board-border: 4px solid var(--primary-color);
  --square-size: 48px;
  --small-square-size: 24px;
  --font-size-base: 1rem;
  --font-size-large: 2rem;
  --font-size-small: 0.75rem;
}

/* General styles */
body {
  font-family: Arial, sans-serif;
  color: var(--text-color);
  background: var(--background-color);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header, main, footer {
  text-align: center;
  padding: 1rem;
}

header h1 {
  font-size: var(--font-size-large);
  margin-bottom: 0.5rem;
}

header p, footer a {
  font-size: var(--font-size-small);
}

footer a {
  color: #888;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Board styles */
.board {
  display: grid;
  max-width: min-content;
  grid-template-columns: repeat(8, var(--square-size));
  border: var(--board-border);
  margin: 1rem auto;
}

.rsquare {
  width: var(--square-size);
  height: var(--square-size);
  border: var(--board-border);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.rsquare img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.small .board {
  grid-template-columns: repeat(8, var(--small-square-size));
}

.small .rsquare {
  width: var(--small-square-size);
  height: var(--small-square-size);
}

/* Controls styles */
.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.player-info {
  display: flex;
  gap: 2rem;
}

.player {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--font-size-base);
}

.player-label {
  cursor: pointer;
}

.pointer {
  font-size: 1.5rem;
}

.computer {
  font-size: var(--font-size-small);
  display: block;
}

button {
  padding: 0.5rem 1rem;
  font-size: var(--font-size-base);
  cursor: pointer;
  border: 1px solid var(--primary-color);
  background: var(--background-color);
  transition: background 0.2s;
}

button:hover:not(:disabled) {
  background: #f0f0f0;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Responsive design */
@media (max-width: 600px) {
  :root {
    --square-size: 36px;
    --small-square-size: 18px;
    --font-size-base: 0.875rem;
    --font-size-large: 1.5rem;
  }

  .player-info {
    flex-direction: column;
    gap: 1rem;
  }
}

.no-text header, .no-text footer {
  display: none;
}