/* ============================================
   RESPONSIVE STYLES — Tic Tac Toe
   ============================================ */

/* Large desktop */
@media (min-width: 1400px) {
  .board {
    width: 440px;
  }
  .side-panel {
    width: 300px;
  }
}

/* Standard desktop */
@media (max-width: 1024px) {
  .game-layout {
    gap: 24px;
  }
  .board {
    width: clamp(260px, 45vmin, 380px);
  }
  .side-panel {
    width: clamp(180px, 22vw, 260px);
    min-width: 180px;
  }
}

/* Tablet landscape */
@media (max-width: 900px) {
  .game-layout {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .board {
    width: clamp(280px, 55vmin, 380px);
  }

  .side-panel {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    max-width: 500px;
    gap: 10px;
  }

  .panel-card {
    flex: 1;
    min-width: 140px;
  }

  .game-header {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
}

/* Tablet portrait / large phone */
@media (max-width: 640px) {
  .screen {
    padding: 12px;
  }

  .board {
    width: clamp(260px, 75vw, 340px);
  }

  .side-panel {
    flex-direction: row;
    gap: 8px;
  }

  .panel-card {
    padding: 12px;
  }

  .panel-card__title {
    font-size: 0.7rem;
  }

  .panel-card__value {
    font-size: 0.95rem;
  }

  .game-header {
    flex-direction: column;
    gap: 8px;
  }

  .game-header__title {
    font-size: 1rem;
  }

  .mode-cards {
    flex-direction: column;
    align-items: center;
  }

  .mode-card {
    max-width: 280px;
    width: 100%;
    flex-direction: row;
    padding: 16px;
    gap: 12px;
  }

  .difficulty-options {
    flex-direction: column;
    align-items: center;
  }

  .difficulty-card {
    max-width: 280px;
    width: 100%;
    flex-direction: row;
    padding: 16px;
    gap: 12px;
  }

  .btn {
    padding: 12px 24px;
    font-size: 0.9rem;
    min-width: 160px;
  }

  .modal {
    padding: 24px;
    margin: 12px;
  }

  .status-bar {
    font-size: 0.85rem;
    padding: 8px 16px;
  }
}

/* Small mobile */
@media (max-width: 400px) {
  .board {
    width: clamp(240px, 80vw, 300px);
  }

  .game-title__main {
    font-size: 2rem;
  }

  .game-title__sub {
    font-size: 0.7rem;
    letter-spacing: 3px;
  }

  .menu-buttons .btn {
    min-width: 240px;
  }

  .side-panel {
    flex-wrap: wrap;
  }

  .panel-card {
    min-width: 100px;
  }

  .result-score {
    gap: 16px;
  }

  .result-actions {
    flex-direction: column;
    align-items: center;
  }

  .confirm-dialog__buttons {
    flex-direction: column;
    align-items: center;
  }

  .game-actions {
    flex-direction: column;
    align-items: center;
  }
}

/* Landscape phone */
@media (max-height: 500px) and (orientation: landscape) {
  .game-screen {
    min-height: auto;
    padding: 8px;
  }

  .board {
    width: clamp(180px, 40vmin, 260px);
  }

  .game-header {
    margin-bottom: 4px;
  }

  .status-bar {
    margin-bottom: 4px;
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .side-panel {
    flex-direction: row;
    gap: 8px;
  }

  .panel-card {
    padding: 8px 12px;
  }

  .game-actions .btn {
    padding: 8px 16px;
    font-size: 0.8rem;
    min-width: auto;
  }
}

/* Very small screens */
@media (max-width: 320px) {
  .board {
    width: 240px;
    padding: 4px;
    gap: 4px;
  }

  .btn {
    padding: 10px 18px;
    font-size: 0.8rem;
    min-width: 140px;
  }
}

/* Hover media query for touch devices */
@media (hover: none) {
  .cell:hover:not(.cell--occupied):not(.cell--disabled) {
    transform: none;
    background: var(--cell-bg);
  }

  .cell:hover:not(.cell--occupied):not(.cell--disabled) .preview-mark {
    opacity: 0;
  }

  .cell:active:not(.cell--occupied):not(.cell--disabled) {
    background: var(--cell-bg-hover);
    transform: scale(0.96);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print */
@media print {
  body {
    background: white;
    color: black;
  }
  .game-actions, .game-header__actions {
    display: none;
  }
}
