@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;800&display=swap');

:root {
  --bg-color: #121213;
  --text-color: #d7dadc;
  --border-color: #818384;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Open Sans', sans-serif;
  margin: 0;
  box-sizing: border-box;
}

main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: clamp(320px, 100vw, 540px);
  margin: 0 auto;
  min-height: calc(100vh - 3rem);
}

main a {
  color: var(--text-color);
}

main a:hover {
  text-decoration: none;
  color: var(--border-color);
}

h1 {
  font-size: 2.2rem;
  font-weight: 800;
  border-bottom: 1px solid var(--border-color);
  text-align: center;
  width: 100%;
  padding-bottom: 0.4rem;
  margin: 1rem 0;
}

.container {
  flex: 1;
  display: grid;
  align-items: center;
  margin: 0;
  padding: 0;
}

.game-board {
  background-color: var(--border-color);
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  gap: 0.25rem;
  padding: 0.25rem;
  aspect-ratio: 1;
}

.board-cell {
  background-color: var(--bg-color);
  font-size: 5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  aspect-ratio: 1;
}

.dialog-box {
  font-size: 1.2rem;
  margin: 1rem 0;
  text-align: center;
}

footer {
  height: 3rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

footer p, footer a {
  color: var(--border-color);
  margin: 0;
}

footer a {
  text-decoration: none;
}

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

.modal {
  color: var(--bg-color);
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,1);
  justify-content: center;
  align-items: center;
}

.modal h1 {
  border: none;
  margin-top: 0;
}

.modal-content {
  border: 1px solid #888;
  padding: 2rem;
  width: clamp(350px, 60vw, 580px);;
}

.input-group {
  margin-bottom: 0.5rem;
}

.form-label {
  font-weight: 600;
}

.form-control.wide {
  flex: 2;
}

@keyframes shake {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  10% { transform: translate(-1px, -2px) rotate(-1deg); }
  20% { transform: translate(-3px, 0px) rotate(1deg); }
  30% { transform: translate(3px, 2px) rotate(0deg); }
  40% { transform: translate(1px, -1px) rotate(1deg); }
  50% { transform: translate(-1px, 2px) rotate(-1deg); }
  60% { transform: translate(-3px, 1px) rotate(0deg); }
  70% { transform: translate(3px, 1px) rotate(-1deg); }
  80% { transform: translate(-1px, -1px) rotate(1deg); }
  90% { transform: translate(1px, 2px) rotate(0deg); }
  100% { transform: translate(1px, -2px) rotate(-1deg); }
}

@media screen and (max-width: 480px) {
  main {
    min-height: auto;
  }
}