/* Wspólne poprawki pod telefony (ładowane po stylach strony) */
html { -webkit-text-size-adjust: 100%; }
button, a, .uno-card, .c-btn, .tool-btn, .color-btn, .word-btn { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* Urządzenia dotykowe: bez efektów hover, które "przyklejają się" po dotknięciu */
@media (hover: none) {
  .btn:hover:not(:disabled), .btn-outline:hover { transform: none; }
  .uno-card:hover, .deck-area:hover { transform: none; }
  .hand-container .uno-card:hover { margin-top: 0; z-index: auto; }
  .hand-container .uno-card:active { transform: translateY(-10px); z-index: 10; }
  body.easy-mode .uno-card.dimmed:hover { transform: scale(0.95); }
}

@media (max-width: 768px) {
  body { padding: 10px !important; padding-left: max(10px, env(safe-area-inset-left)) !important; padding-right: max(10px, env(safe-area-inset-right)) !important; padding-bottom: max(10px, env(safe-area-inset-bottom)) !important; background-attachment: scroll !important; }
  .neo-panel { padding: 14px; border-radius: 14px; }
  header { margin-bottom: 12px; }
  .brand { font-size: 19px !important; }
  .btn { padding: 12px 18px; }
  .btn-outline { padding: 9px 12px; font-size: 12px; }
  input, select, textarea { font-size: 16px !important; } /* iOS nie zoomuje przy fokusie */

  #toastContainer { top: 10px !important; left: 10px !important; right: 10px !important; }
  .toast { max-width: none; }

  .main-layout { flex-direction: column; gap: 12px; }
  .rules-sidebar { flex: none !important; width: 100%; order: 2; }

  /* Karty ONU */
  .board { gap: 18px; min-height: 170px; }
  .direction-indicator { width: 120px; height: 120px; margin-top: -60px; margin-left: -60px; }
  .uno-card { width: 58px; height: 86px; font-size: 28px; border-width: 3px; }
  .uno-card.black span { font-size: 16px; }
  .uno-card.back span { font-size: 14px; }
  .cb-shape { font-size: 13px; }
  .hand-container { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; overflow-y: visible; width: 100%; padding: 18px 12px 10px; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
  .hand-container .uno-card { flex: 0 0 auto; margin: 0 -4px; scroll-snap-align: start; }
  #btnCallUno { top: -46px; padding: 10px 24px; }
  .opponents { padding: 8px; gap: 6px; }
  .opp-card img { width: 36px; height: 36px; }
  .game-logs { position: static; width: 100%; order: 10; }
  #turnTimerDisplay { font-size: 20px; top: 4px; }
  .c-btn { width: 62px; height: 62px; }
  #colorPickerOverlay { width: calc(100% - 20px); max-width: 320px; }
  .win-title { font-size: 34px !important; }
  .win-name { font-size: 22px; }

  /* Kalambury */
  #gameScreen { gap: 10px; }
  .left-panel { flex: none !important; height: auto !important; max-height: none; flex-direction: row !important; overflow-x: auto; overflow-y: hidden; order: 2; }
  .player-box { flex: 0 0 auto; padding: 6px 10px; }
  .player-box img { width: 30px; height: 30px; }
  .center-panel { order: 1; }
  .game-top-bar { padding: 8px 12px; flex-wrap: wrap; gap: 6px; }
  .hidden-word-display { font-size: 22px; letter-spacing: 3px; }
  .canvas-wrapper { flex: none; min-height: 0; aspect-ratio: 8 / 5; }
  .toolbar { gap: 6px; padding: 8px; }
  .color-btn { width: 28px; height: 28px; }
  .right-panel { flex: none !important; height: 320px !important; order: 3; }
  .word-btn { font-size: 18px; padding: 14px 22px; }
  .win-modal-box { padding: 22px 18px; }
  .pause-text { font-size: 40px; }

  /* Tabele i panele (profil, admin) */
  table { display: block; overflow-x: auto; white-space: nowrap; }
  .tab-bar { overflow-x: auto; flex-wrap: nowrap; }
}
