/* ============================================================
   Tiles – styly hry
   ============================================================ */

:root {
  --theme-color: #7a2e2e;
  --theme-color-light: #8c3535;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--theme-color);
}

/* ---- LOGO (nahoře uprostřed, 5× tap → menu) ---- */
.logo-container {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  pointer-events: all;
}

.logo {
  width: 90px;
  height: auto;
  display: block;
  cursor: pointer;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
  transition: transform 0.1s ease;
}

.logo:active {
  transform: scale(0.9);
}

/* ---- AKČNÍ TLAČÍTKO (vlevo nahoře) ---- */
.action-btn {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 50;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 40px;
  cursor: pointer;
  touch-action: manipulation;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.action-btn:active {
  transform: scale(0.9);
}

/* ---- HERNÍ OBLAST ---- */
.game {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.game canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* ---- ZOOM OVERLAY ---- */
.zoom-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
  cursor: pointer;
}

.zoom-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.zoom-image {
  max-width: 85%;
  max-height: 85%;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  object-fit: contain;
}

/* ---- SETTINGS MODAL ---- */
.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.settings-modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.settings-content {
  background: #2d2d2d;
  border-radius: 20px;
  padding: 30px;
  max-width: 90%;
  width: 440px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

/* ---- SETTINGS TABS ---- */
.settings-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
}

.settings-tab {
  flex: 1;
  padding: 10px 6px;
  border: none;
  border-radius: 8px 8px 0 0;
  background: #444;
  color: #aaa;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.settings-tab.active {
  background: var(--theme-color);
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ---- NASTAVENÍ – formulářové prvky ---- */
.setting-item {
  margin-bottom: 20px;
}

.setting-item label {
  display: block;
  color: #ddd;
  margin-bottom: 8px;
  font-size: 14px;
}

.setting-item input[type="range"] {
  width: 100%;
  accent-color: #6c63ff;
}

.setting-item input[type="number"] {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #555;
  background: #1a1a1a;
  color: #fff;
  font-size: 16px;
}

.settings-select {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #555;
  background: #1a1a1a;
  color: #fff;
  font-size: 16px;
  appearance: auto;
}

.range-value {
  display: block;
  text-align: right;
  color: #aaa;
  font-size: 13px;
  margin-top: 4px;
}

.setting-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.setting-toggle label {
  margin-bottom: 0;
}

.toggle-btn {
  padding: 8px 18px;
  border: none;
  border-radius: 8px;
  background: #555;
  color: #aaa;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.toggle-btn.active {
  background: #2e7d32;
  color: #fff;
}

/* ---- TLAČÍTKA ---- */
.settings-btn {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  border: none;
  border-radius: 8px;
  background: var(--theme-color);
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease;
}

.settings-btn:active {
  background: var(--theme-color-light);
}

.settings-btn-secondary {
  background: #444;
}

.settings-btn-secondary:active {
  background: #555;
}

/* ---- ANALYTICS TABULKA ---- */
.analytics-table-wrap {
  overflow-x: auto;
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.analytics-table th,
.analytics-table td {
  padding: 8px 6px;
  text-align: center;
  color: #ddd;
  border-bottom: 1px solid #444;
}

.analytics-table th {
  color: #fff;
  font-size: 12px;
  text-transform: uppercase;
  background: #6b2424;
}

.analytics-table td:first-child {
  text-align: left;
  font-size: 13px;
  word-break: break-word;
}

/* ---- SAFE-AREA (notch/iPad) ---- */
@supports (padding-top: env(safe-area-inset-top)) {
  .action-btn {
    top: max(16px, env(safe-area-inset-top));
    left: max(16px, env(safe-area-inset-left));
  }
  .logo-container {
    top: max(0px, env(safe-area-inset-top));
  }
}
