/* ============================================================
   KROBIA 1558 — main.css (zaktualizowany)
   Podmień: gra/game/css/main.css
   ============================================================ */

/* ----------------------------------------
   ZMIENNE CSS
   ---------------------------------------- */
:root {
  --color-bg:           #0d0a07;
  --color-surface:      #1a1208;
  --color-surface-2:    #241a0d;
  --color-border:       #5c3d1e;
  --color-border-dim:   #3a2610;

  --color-gold:         #c8922a;
  --color-gold-light:   #e8b84b;
  --color-gold-dim:     #7a5518;
  --color-gold-glow:    rgba(200, 146, 42, 0.35);

  --color-text:         #e8d5b0;
  --color-text-dim:     #8a7355;
  --color-text-faint:   #4a3a26;

  --color-red:          #8b1a1a;
  --color-red-light:    #c44040;
  --color-green-dim:    #2a4a1a;

  --color-overlay:      rgba(13, 10, 7, 0.85);
  --color-overlay-med:  rgba(13, 10, 7, 0.70);
  --color-overlay-light:rgba(13, 10, 7, 0.50);

  --font-display:       'Cinzel Decorative', serif;
  --font-ui:            'Cinzel', serif;
  --font-body:          'IM Fell English', serif;

  --hud-height:         54px;
  --panel-radius:       1px;

  /* ULEPSZONE cienie — głębsze, bardziej dramatyczne */
  --shadow-panel:       0 8px 48px rgba(0, 0, 0, 0.9),
                        inset 0 0 32px rgba(0, 0, 0, 0.5);
  --shadow-gold:        inset 0 0 20px rgba(200, 146, 42, 0.14);
  --shadow-btn:         0 2px 12px rgba(0, 0, 0, 0.6);
  --shadow-btn-hover:   0 0 24px rgba(200, 146, 42, 0.6),
                        0 2px 12px rgba(0, 0, 0, 0.6);

  --transition-fast:    0.15s ease;
  --transition-med:     0.3s ease;
  --transition-slow:    0.5s ease;
}

/* ----------------------------------------
   RESET
   ---------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
  height: -webkit-fill-available;
}

body {
  width: 100%;
  height: 100%;
  height: -webkit-fill-available;
  min-height: 100dvh;
  overflow: hidden;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--color-surface); }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-gold-dim); }
::selection { background: var(--color-gold-dim); color: var(--color-text); }

ul, ol { list-style: none; }
button { background: none; border: none; cursor: pointer; font-family: inherit; color: inherit; }
button:disabled { cursor: not-allowed; }
.hidden { display: none !important; }

/* ----------------------------------------
   EKRANY
   ---------------------------------------- */
.screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; height: 100dvh;
  overflow: hidden;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  z-index: 10;
}

.screen-active {
  opacity: 1;
  pointer-events: all;
  animation: screenEnter 0.5s ease forwards;
}

.screen-overlay {
  z-index: 100;
  background: transparent;
}

.screen-overlay.screen-active {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ----------------------------------------
   TŁO
   ---------------------------------------- */
.bg-image {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: 0;
  background-color: var(--color-surface);
  /* Powolny zoom — efekt kinowy */
  animation: bgZoomIn 8s ease-out forwards;
}

.bg-image::after {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-repeat: repeat;
  pointer-events: none;
  z-index: 1;
}

/* ----------------------------------------
   WINIETY
   ---------------------------------------- */
.bg-vignette {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(13,10,7,0.6) 100%),
    linear-gradient(to bottom, rgba(13,10,7,0.5) 0%, transparent 20%, transparent 70%, rgba(13,10,7,0.8) 100%);
  /* Oddech świecy */
  animation: vignetteBreath 6s ease-in-out infinite;
}

.bg-vignette--heavy {
  background:
    radial-gradient(ellipse at center, transparent 20%, rgba(13,10,7,0.75) 100%),
    linear-gradient(to bottom, rgba(13,10,7,0.6) 0%, transparent 15%, transparent 60%, rgba(13,10,7,0.95) 100%);
  animation: vignetteBreath 5s ease-in-out infinite;
}

/* ----------------------------------------
   HUD
   ---------------------------------------- */
#hud {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--hud-height);
  z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  background: linear-gradient(to bottom, rgba(8,5,2,0.98), rgba(13,10,7,0.85));
  border-bottom: 1px solid var(--color-border-dim);
  box-shadow: 0 1px 0 var(--color-gold-dim), 0 2px 20px rgba(0,0,0,0.7);
  animation: hudReveal 0.5s ease-out 0.2s both;
}

.hud-left, .hud-right {
  display: flex; align-items: center; gap: 10px; flex: 1;
}
.hud-center {
  flex: 2; display: flex; align-items: center;
  justify-content: center; gap: 12px;
}
.hud-right { justify-content: flex-end; }

/* Linie po bokach nazwy lokacji */
.hud-center::before,
.hud-center::after {
  content: '';
  display: block; height: 1px; width: 28px;
  background: linear-gradient(to right, transparent, var(--color-gold-dim));
}
.hud-center::after {
  background: linear-gradient(to left, transparent, var(--color-gold-dim));
}

.hud-text {
  font-family: var(--font-ui); font-size: 12px; font-weight: 500;
  color: var(--color-text-dim); letter-spacing: 0.1em; text-transform: uppercase;
}
.hud-time { color: var(--color-text-faint); }

.hud-day-icon {
  font-size: 13px; color: var(--color-gold); line-height: 1;
  animation: candleFlicker 4s ease-in-out infinite;
}

.hud-location {
  font-family: var(--font-ui); font-size: 13px; font-weight: 600;
  color: var(--color-text); letter-spacing: 0.18em; text-transform: uppercase;
}

.hud-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 1px;
  border: 1px solid var(--color-border-dim);
  background: rgba(36, 26, 13, 0.6);
  color: var(--color-text-dim);
  transition: all var(--transition-fast);
  font-size: 14px;
}
.hud-btn:hover {
  border-color: var(--color-gold-dim);
  color: var(--color-gold-light);
  background: rgba(200, 146, 42, 0.12);
  box-shadow: 0 0 10px var(--color-gold-glow);
}

.hud-flags { display: flex; gap: 4px; }
.flag-badge {
  font-size: 12px; color: var(--color-red);
  padding: 2px 4px; border: 1px solid var(--color-red); border-radius: 2px;
  font-family: var(--font-ui);
}

/* ----------------------------------------
   RESPONSYWNOŚĆ
   ---------------------------------------- */
@media (max-width: 480px) {
  :root { --hud-height: 46px; font-size: 16px; }
  .hud-location { font-size: 11px; letter-spacing: 0.05em; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hud-text { font-size: 10px; }
  .hud-time { display: none; }
}
@media (max-width: 768px) {
  :root { --hud-height: 48px; font-size: 17px; }
  .hud-location { font-size: 12px; letter-spacing: 0.06em; }
  .hud-text { font-size: 11px; }
  .hud-center::before, .hud-center::after { display: none; }
}
@media (min-width: 769px) and (max-width: 1024px) { :root { font-size: 18px; } }
@media (min-width: 1280px) { :root { font-size: 22px; } }
@media (max-height: 500px) and (orientation: landscape) {
  :root { --hud-height: 38px; font-size: 14px; }
  .hud-time { display: none; }
}
