:root {
  --bg-color: #f4f4f4;
  --sidebar-bg: #1e2939;
  --accent-color: #fb6d3a;
  --text-dark: #333;
  --tile-bg: #fff;

  --field-size: min(400px, 90vw);
}

body {
  font-family: "Montserrat", sans-serif;
  background-color: var(--bg-color);
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  background-color: var(--sidebar-bg);
  color: white;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  gap: 30px;
  flex: 1;
}

@media (min-width: 900px) {
  .container {
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    padding: 40px;
  }
}

.info-panel {
  width: 100%;
  max-width: 350px;
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
}

.info-panel h3 {
  margin-top: 0;
  color: var(--sidebar-bg);
  border-bottom: 2px solid var(--accent-color);
  display: inline-block;
  padding-bottom: 5px;
}

.game-area {
  display: flex;
  justify-content: center;
}

.field {
  width: var(--field-size);
  height: var(--field-size);
  background-color: var(--sidebar-bg);
  border: 6px solid var(--sidebar-bg);
  border-radius: 12px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.cell {
  box-sizing: border-box;
  background-color: var(--tile-bg);
  border: 2px solid var(--bg-color);
  border-radius: 8px;
  position: absolute;
  font-weight: bold;
  color: var(--sidebar-bg);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition:
    left 0.2s,
    top 0.2s,
    background-color 0.2s,
    transform 0.1s;
}

.cell:hover {
  background-color: var(--accent-color);
  color: white;
  transform: scale(0.97);
  z-index: 10;
}

footer {
  background: white;
  text-align: center;
  padding: 20px;
  font-size: 14px;
  border-top: 1px solid #ddd;
  color: #777;
}

footer strong {
  color: var(--sidebar-bg);
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(30, 41, 57, 0.8); /* Колір сайдбару з прозорістю */
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: #fff;
  margin: 15% auto;
  padding: 30px;
  border-radius: 15px;
  width: 80%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
  animation: slideDown 0.4s ease;
}

@keyframes slideDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-content h2 {
  color: var(--sidebar-bg);
  margin-top: 0;
}

#closeModal {
  background-color: var(--accent-color);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 25px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
}

#closeModal:hover {
  background-color: #e65a2b;
}
