/* Base styles extracted from BKstyle.css */

:root {
  --board-cell-size: 35px;
  --piece-size: 30px;
  --board-gap: 2px;
  --primary-font: 'M PLUS Rounded 1c', sans-serif;
  --text-color-dark: #424242;
  --text-color-light: #ffffff;

  /* Bottom nav gradients */
  --grad-1-start: #FF512F;
  --grad-1-end: #DD2476;
  --grad-2-start: #2193b0;
  --grad-2-end: #6dd5ed;
  --grad-3-start: #38ef7d;
  --grad-3-end: #11998e;
  --grad-4-start: #FFD700;
  --grad-4-end: #FFA500;

  /* Pastel colors for popup buttons */
  --pastel-grad-start: #FFC0CB;
  --pastel-grad-end: #ADD8E6;

  /* Generic button variables (previously missing) */
  --button-bg-color: #3498db;
  --button-text-color: #ffffff;
  --button-hover-bg-color: #2980b9;
}

body {
  font-family: var(--primary-font);
  text-align: center;
  margin: 0;
  padding: 0;
  color: var(--text-color-dark);
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}

/* Responsive board sizing via CSS variables */
@media (min-width: 375px) {
  :root { --board-cell-size: 40px; --piece-size: 35px; }
}
@media (min-width: 414px) {
  :root { --board-cell-size: 45px; --piece-size: 40px; }
}
@media (min-width: 480px) {
  :root { --board-cell-size: 52px; --piece-size: 47px; }
}
@media (min-width: 600px) {
  :root { --board-cell-size: 60px; --piece-size: 55px; }
}

#main-container {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  padding: 10px;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 100vh;
}

.hidden { display: none; }

/* Generic Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 5000;
}

.modal-content {
  background-color: #fff;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  text-align: center;
  max-width: 400px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.modal-content h2 { font-size: 1.6em; margin-bottom: 20px; color: var(--text-color-dark); }
.modal-content p { font-size: 1.1em; color: #555; line-height: 1.5; margin-bottom: 0; text-align: left; }
.modal-content img { max-width: 80%; height: auto; border-radius: 5px; margin-bottom: 15px; }

.modal-close-button {
  background-color: var(--button-bg-color);
  color: var(--button-text-color);
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
  transition: background-color 0.2s ease;
}

.modal-close-button:hover { background-color: var(--button-hover-bg-color); }

.loading-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Shared action buttons (OK, Close, etc.) */
.game-over-button,
#alert-ok-button {
  width: 100%;
  max-width: 280px;
  padding: 12px;
  margin-top: 10px;
  background: linear-gradient(to bottom, #FF8C00, #D2691E, #8B4513);
  color: white;
  border: 4px solid #d2691e;
  border-radius: 9999px;
  font-size: 23px;
  font-weight: bolder;
  cursor: pointer;
  transition: background 0.3s ease;
}

.game-over-button:hover,
#alert-ok-button:hover {
  background: linear-gradient(to bottom, #FFA500, #CD5C5C, #A0522D);
}

/* --- Toast Notification Styles --- */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.toast {
    background-color: #333;
    color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.toast--error {
    background-color: #D32F2F; /* Red for errors */
}

.toast.toast--success {
    background-color: #4CAF50; /* Green for success */
}

.toast.toast--info {
    background-color: #2196F3; /* Blue for info */
}