/* app.ganter.cz – jednoduchy tmavy vzhled, mobil nejdriv.
   Neutralni tmava + oranzove akcenty (neonova zarovka). */
:root {
  --bg: #0f1113;
  --bg-raise: #181a1d;
  --surface: #1d2024;
  --surface-glass: rgba(24, 26, 29, 0.82);
  --border: #2e3237;
  --field-border: #4a4f57;
  --text: #ececec;
  --muted: #9a9ea5;
  --accent: #ff6a1a;
  --accent-hot: #ffb020;
  --accent-ink: #0f1113;
  --danger: #ff7b7b;
  --glow: 0 0 0 1px var(--accent), 0 0 18px rgba(255, 106, 26, 0.5), inset 0 0 14px rgba(255, 176, 32, 0.12);
  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* sdilene pozadi: jemny tmavy sivy prechod */
body.page,
body.stage {
  background: var(--bg) linear-gradient(135deg, #2a2d31 0%, #17191c 45%, #0f1113 100%) fixed;
}

body.page {
  display: grid;
  place-items: center;
  padding: 1rem;
}

.card {
  width: 100%;
  max-width: 26rem;
  background: var(--surface-glass);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

h1 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.lead { margin: 0 0 1.25rem; color: var(--muted); }

label {
  display: block;
  margin: 1rem 0 0.375rem;
  font-weight: 500;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  display: block;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-size: 1rem; /* 16 px: iOS nepriblizuje pri zadavani */
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--field-border);
  border-radius: 8px;
}

input[aria-invalid="true"] { border-color: var(--danger); }

label.check {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  margin: 0.75rem 0 0;
  font-weight: 400;
  cursor: pointer;
}

input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--accent);
}

button {
  display: block;
  width: 100%;
  min-height: 2.75rem;
  margin-top: 1.25rem;
  padding: 0.5rem 1rem;
  font: inherit;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s;
}

button:hover {
  background: var(--accent-hot);
  box-shadow: 0 0 16px rgba(255, 106, 26, 0.45);
}

:focus-visible {
  outline: 3px solid var(--accent-hot);
  outline-offset: 2px;
}

.alert,
.field-error {
  margin: 0 0 1rem;
  padding: 0.625rem 0.75rem;
  color: var(--danger);
  background: rgba(255, 123, 123, 0.1);
  border: 1px solid rgba(255, 123, 123, 0.45);
  border-radius: 8px;
}

.field-error { margin: 0.375rem 0 0; font-size: 0.9375rem; }

/* Prihlaseny uzivatel: animace a po kliknuti menu */
.stage-main {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

/* Uvodni animace: cerna pres celou obrazovku, klik/dotyk/Enter ji nahradi prihlasenim nebo menu */
body.page.is-intro { background: #000; }

.intro {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: #000;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.intro:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -6px;
}

/* obal formulare: stred obrazovky; schovany, dokud ho klik neodkryje */
#gate-card {
  width: 100%;
  display: grid;
  place-items: center;
}

#gate-card[hidden] { display: none; }

#gate-card.is-revealed,
.menu.is-revealed { animation: gate-in 0.35s ease both; }

@keyframes gate-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Menu: mrizka 3x3 */
.menu {
  width: 100%;
  max-width: 34rem;
}

.menu[hidden] { display: none; }

.menu:focus { outline: none; }

.menu__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.5rem, 2.5vw, 1rem);
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  aspect-ratio: 1;
  padding: 0.5rem;
  color: var(--text);
  text-align: center;
  text-decoration: none;
  background: linear-gradient(180deg, #23262b, var(--bg-raise));
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.tile__num {
  font-size: clamp(1.75rem, 8vw, 2.75rem);
  font-weight: 200;
  line-height: 1;
  color: var(--muted);
  transition: color 0.2s;
}

.tile__title {
  font-size: 0.9375rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere; /* nazev se zobrazi presne tak, jak je zadan (velikost pismen) */
}

/* obsazena dlazdice: oranzova neonova zare pri najeti a zamereni */
a.tile:hover,
a.tile:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--glow);
  transform: translateY(-2px);
}

a.tile:hover .tile__num,
a.tile:focus-visible .tile__num { color: var(--accent-hot); }

a.tile:focus-visible { outline: none; }

/* neobsazena dlazdice: tlumena, carkovana, neklikaci */
.tile.is-empty {
  cursor: default;
  border-style: dashed;
  opacity: 0.75;
}

.logout {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 20;
}

.logout button {
  width: auto;
  min-height: 2.75rem;
  margin: 0;
  padding: 0.25rem 0.875rem;
  font-weight: 400;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
}

.logout button:hover {
  color: var(--accent-hot);
  background: transparent;
  border-color: var(--accent);
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
