/* Responsive styles for UNO */

/* ============================================
   TABLET (max-width: 1024px)
   ============================================ */
@media (max-width: 1024px) {
  .game-layout {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-2);
  }
  
  .left-sidebar {
    order: -1;
  }
  
  .right-sidebar {
    order: 1;
  }
  
  .game-info {
    display: flex;
    flex-direction: row;
    gap: var(--space-2);
    flex-wrap: wrap;
  }
  
  .info-card {
    flex: 1;
    min-width: 100px;
  }
  
  .scores-display {
    flex: 1;
    min-width: 150px;
  }
  
  .game-log {
    max-height: 150px;
    width: 100%;
  }
  
  .sidebar-spacer {
    display: none;
  }
  
  .exit-game-btn,
  .share-spectate-btn {
    width: auto;
    flex: 0;
  }
}

/* ============================================
   MOBILE (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
  :root {
    --card-width: 55px;
    --card-height: 80px;
  }
  
  .container {
    padding: var(--space-2);
  }
  
  header h1 {
    font-size: var(--text-2xl);
  }
  
  header p {
    font-size: var(--text-sm);
  }
  
  .status-bar {
    font-size: var(--text-sm);
    padding: var(--space-2) var(--space-3);
  }
  
  .table-area {
    min-height: 300px;
    border-width: 2px;
  }
  
  .center-area {
    gap: var(--space-4);
  }
  
  .draw-pile .card-back {
    width: var(--card-width);
    height: var(--card-height);
  }
  
  .card-back-text {
    font-size: var(--text-sm);
  }
  
  .discard-pile {
    width: var(--card-width);
    height: var(--card-height);
  }
  
  .direction-indicator {
    top: -40px;
    font-size: var(--text-2xl);
  }
  
  .current-color {
    bottom: -40px;
  }
  
  .color-indicator {
    width: 24px;
    height: 24px;
  }
  
  .player-seat {
    transform: scale(0.85);
  }
  
  .player-info {
    min-width: 80px;
    padding: var(--space-1) var(--space-2);
  }
  
  .player-name {
    font-size: var(--text-xs);
  }
  
  .card-back-mini {
    width: 25px;
    height: 35px;
    margin-left: -10px;
  }
  
  .hand {
    padding: var(--space-2);
    gap: var(--space-1);
  }
  
  .uno-card {
    width: var(--card-width);
    height: var(--card-height);
  }
  
  .card-value {
    font-size: var(--text-xl);
  }
  
  .card-corner {
    font-size: 0.6rem;
  }
  
  .uno-button-container {
    bottom: 150px;
    right: 15px;
  }
  
  .uno-btn {
    width: 60px;
    height: 60px;
    font-size: var(--text-lg);
  }
  
  /* Hide sidebars on mobile, show compact versions */
  .left-sidebar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: var(--space-2);
    gap: var(--space-1);
  }
  
  .right-sidebar {
    display: none;
  }
  
  .info-card {
    min-width: 80px;
    padding: var(--space-2);
  }
  
  .info-card .label {
    font-size: 0.65rem;
  }
  
  .info-card .value {
    font-size: var(--text-base);
  }
  
  .scores-display {
    min-width: 120px;
  }
  
  .exit-game-btn {
    padding: var(--space-2);
    font-size: var(--text-sm);
  }
  
  .share-spectate-btn {
    display: none !important;
  }
  
  /* Lobby adjustments */
  .lobby-content {
    padding: var(--space-4);
  }
  
  .game-title {
    font-size: var(--text-4xl);
  }
  
  .mode-btn {
    padding: var(--space-4);
  }
  
  .mode-icon {
    font-size: var(--text-2xl);
  }
  
  .color-picker-modal {
    max-width: 280px;
    padding: var(--space-4);
  }
  
  .color-options {
    gap: var(--space-3);
  }
  
  /* Page footer */
  .page-footer {
    flex-direction: column;
    gap: var(--space-1);
    text-align: center;
    font-size: var(--text-xs);
  }
}

/* ============================================
   SMALL MOBILE (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {
  :root {
    --card-width: 45px;
    --card-height: 65px;
  }
  
  .game-title {
    font-size: var(--text-3xl);
  }
  
  .table-area {
    min-height: 250px;
  }
  
  .center-area {
    gap: var(--space-3);
  }
  
  .card-value {
    font-size: var(--text-lg);
  }
  
  .player-seat {
    transform: scale(0.75);
  }
  
  .hand {
    min-height: 80px;
  }
  
  .uno-btn {
    width: 50px;
    height: 50px;
    font-size: var(--text-base);
  }
  
  .join-input-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  .join-input {
    max-width: none;
  }
}

/* ============================================
   LANDSCAPE MOBILE
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
  .container {
    padding: var(--space-1);
  }
  
  header {
    display: none;
  }
  
  .status-bar {
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
  }
  
  .table-area {
    min-height: 200px;
  }
  
  .hand-area {
    padding: var(--space-1) 0;
  }
  
  .hand {
    min-height: 70px;
    padding: var(--space-1);
  }
  
  .left-sidebar {
    padding: var(--space-1);
  }
  
  .page-footer {
    display: none;
  }
}

/* ============================================
   HIGH DPI DISPLAYS
   ============================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .uno-card {
    border-width: 2px;
  }
}

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

/* ============================================
   DARK MODE ADJUSTMENTS
   ============================================ */
@media (prefers-color-scheme: dark) {
  /* Already dark by default, no changes needed */
}
