/*
 * Copyright (c) 2022 Subhomoy Haldar (@hungrybluedev)
 * 
 * This source file is available under the MIT License. Refer to the LICENSE
 * file for more information.
 */

/* Reset CSS to standadise across all platforms */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  /* Dimension definitions */
  --cell-size: 3.5rem;
  --board-size: 12rem;
  --border-radius: 2px;
  --border-width: 2px;

  /* Colour palette */
  --background-colour: #f5fcfd;
  --primary-colour: #3892a8;
  --secondary-colour: #85c6d6;
  --text-colour-dark: #0b0a07;
  --text-colour-grey: #41413e;
  --text-colour-light: #f7f6f3;
  --accent-colour: #d04539;
}

body {
  font-size: 16px;
  background-color: var(--background-colour);
  color: var(--text-colour-dark);
  font-family: "Barlow", sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Alata", sans-serif;
}

header {
  height: 20vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.title {
  font-size: 2.5rem;
}

.subtitle {
  font-size: 1.2rem;
  color: var(--text-colour-grey);
}

main {
  height: 75vh;
}

footer {
  height: 5vh;
  background-color: var(--text-colour-dark);
  color: var(--text-colour-light);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

#game-container {
  height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  font-size: 1.2rem;
}

#game-board {
  width: var(--board-size);
  height: var(--board-size);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
}

button {
  cursor: pointer;
  background-color: transparent;
  border: var(--border-width) solid transparent;
  font-family: inherit;
  outline: none;
  transition: all 85ms ease-in-out;
}

button:disabled {
  cursor: not-allowed;
  background-color: initial;
}

button:hover {
  filter: brightness(1.2);
}

button:focus {
  border: var(--border-width) solid var(--accent-colour);
}

button:active {
  filter: brightness(0.9);
  transform: scale(0.95);
}

button.cell {
  width: var(--cell-size);
  height: var(--cell-size);
  background-color: var(--secondary-colour);
  border-radius: var(--border-radius);
}

button.control {
  padding: 8px;
  border: var(--border-width) solid var(--primary-colour);
  border-radius: var(--border-radius);
}

button.control:focus {
  border: var(--border-width) solid var(--accent-colour);
}

button.primary {
  background-color: var(--secondary-colour);
}

#game-controls {
  width: var(--board-size);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
