/* ====================== Tripjini – style (mobile-first, motyw podróżny) ====================== */
:root {
  /* turkus/morze zamiast granatu; złoto/piasek zostaje jako akcent */
  --navy-1: #14889b;
  --navy-2: #0a5b6b;
  --navy-3: #073f4a;
  --gold: #f6c945;
  --gold-deep: #d99a2b;
  --cream: #fff6e2;
  --ink: #4a2c12;
  --ans-yes: #3fb24f;
  --ans-probyes: #8ec540;
  --ans-idk: #f4c430;
  --ans-probno: #f0913c;
  --ans-no: #e23b3b;
  --shadow: 0 8px 22px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; margin: 0; overflow-x: hidden; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--cream);
  background: #0a3f73 url('../assets/bg.jpg') center top / cover no-repeat fixed;
  overflow-x: hidden;
}

/* Lekkie przyciemnienie tła, by treść była czytelna na wzorze ikon */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 32%, rgba(10, 10, 15, .25) 0%, rgba(0, 0, 0, .62) 100%);
  pointer-events: none;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  max-width: 560px;
  margin: 0 auto;
  padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

/* ----------------------------- Przełączanie ekranów ----------------------------- */
.screen { display: none; flex: 1; flex-direction: column; animation: fade .35s ease; }
.screen.active { display: flex; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ----------------------------- Logo ----------------------------- */
.logo {
  display: block;
  width: min(72%, 300px);
  height: auto;
  margin: 2px auto 6px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .35));
}

/* ----------------------------- Genie ----------------------------- */
/* Dżin – wolnostojąca postać z lampą (przezroczyste PNG) */
.genie {
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: contain;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .45));
  flex-shrink: 0;
  width: 100%;
  margin: 0 auto;
  animation: floaty 3.6s ease-in-out infinite;
}
.genie--start { background-image: url('../assets/genie-start.png'); }
.genie--think { background-image: url('../assets/genie-think.png'); }
.genie--happy { background-image: url('../assets/genie-happy.png'); }
.genie--lg { height: clamp(150px, 25vh, 290px); max-width: 340px; }
.genie--game { height: clamp(190px, 27vh, 270px); max-width: 330px; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ----------------------------- Ekran START ----------------------------- */
#screen-start { justify-content: flex-start; text-align: center; }
.start-main {
  flex: 1 0 auto; width: 100%;
  min-height: calc(100svh - 60px);   /* pierwszy ekran wypełniony; stopka poniżej */
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.hero { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 2px 0 14px; }
.bubbles { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }

.speech {
  color: #6a4a1e;
  font-weight: 800;
  font-size: clamp(19px, 5.6vw, 25px);
  line-height: 1.15;
  white-space: pre-line;
  text-align: center;
  background: url('../assets/bubble.png') center / 100% 100% no-repeat;
  padding: clamp(40px, 11vw, 56px) clamp(40px, 11vw, 54px);
  filter: drop-shadow(0 6px 9px rgba(0, 0, 0, .3));
}

.scroll {
  color: #5a3d18;
  font-weight: 700;
  font-size: clamp(13px, 4vw, 16px);
  line-height: 1.3;
  white-space: pre-line;
  text-align: center;
  background: url('../assets/scroll.png') center / 100% 100% no-repeat;
  padding: clamp(26px, 7vw, 34px) clamp(62px, 17vw, 96px);
  filter: drop-shadow(0 6px 9px rgba(0, 0, 0, .3));
}

/* ----------------------------- Przyciski CTA ----------------------------- */
.btn-cta {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  padding: 18px 24px;
  font-size: clamp(20px, 5.5vw, 24px);
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--ink);
  background: linear-gradient(180deg, #ffe08a 0%, var(--gold) 55%, var(--gold-deep) 100%);
  border: 3px solid #fff2c4;
  border-radius: 40px;
  box-shadow: var(--shadow);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: transform .08s ease, filter .15s ease;
}
.btn-cta:active { transform: translateY(2px) scale(.99); filter: brightness(1.05); }

/* Przycisk startu jako grafika (PL/EN) */
.btn-play {
  display: block;
  width: min(82%, 340px);
  margin: 0 auto;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .35));
  transition: transform .08s ease, filter .15s ease;
}
.btn-play img { display: block; width: 100%; height: auto; }
.btn-play:active { transform: translateY(2px) scale(.98); filter: brightness(1.05); }
.btn-play:disabled { opacity: .55; cursor: default; }

/* ----------------------------- Ekran ROZGRYWKA ----------------------------- */
#screen-game { justify-content: flex-start; align-items: center; gap: 12px; }
.game-panel { display: flex; flex-direction: column; gap: 16px; width: 100%; flex: 1; }
.game-panel .answers { margin-top: auto; }
.game-top { display: flex; flex-direction: column; gap: 10px; }
.counter { text-align: center; font-weight: 800; font-size: 20px; text-shadow: 0 2px 0 rgba(0,0,0,.25); }

.confidence-bar {
  height: 12px; width: 100%;
  background: rgba(255, 255, 255, .15);
  border-radius: 999px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .25);
}
.confidence-bar span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--ans-yes), var(--gold));
  border-radius: 999px;
  transition: width .4s ease;
}

.question {
  color: #5a3d18;
  font-weight: 800;
  font-size: clamp(19px, 5.4vw, 25px);
  line-height: 1.2;
  text-align: center;
  background: url('../assets/bubble.png') center / 100% 100% no-repeat;
  padding: clamp(46px, 12vw, 60px) clamp(40px, 11vw, 54px);
  width: 100%;
  overflow-wrap: anywhere;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .3));
}

/* Okrągłe przyciski odpowiedzi (kółka + podpis pod spodem) */
.answers {
  display: flex; flex-direction: row; flex-wrap: wrap;
  justify-content: center; align-items: flex-start;
  gap: clamp(5px, 2vw, 14px);
}
.ans {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  width: clamp(52px, 15.5vw, 74px);
  background: none; border: none; padding: 0; cursor: pointer;
  transition: transform .08s ease;
}
.ans:active { transform: translateY(2px) scale(.95); }
.ans-circle {
  width: clamp(50px, 15vw, 68px); height: clamp(50px, 15vw, 68px);
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: clamp(20px, 6.5vw, 28px); font-weight: 800; color: #fff;
  border: 3px solid rgba(255, 255, 255, .5);
  box-shadow: var(--shadow), inset 0 -4px 8px rgba(0, 0, 0, .18), inset 0 3px 6px rgba(255, 255, 255, .35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  transition: filter .15s ease;
}
.ans:active .ans-circle { filter: brightness(1.12); }
.ans-label {
  font-size: clamp(10px, 2.8vw, 12px); font-weight: 700; color: var(--cream);
  text-align: center; line-height: 1.15; min-height: 2.3em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .4);
}
.ans--yes .ans-circle { background: var(--ans-yes); }
.ans--probyes .ans-circle { background: var(--ans-probyes); }
.ans--idk .ans-circle { background: var(--ans-idk); color: var(--ink); text-shadow: none; }
.ans--probno .ans-circle { background: var(--ans-probno); }
.ans--no .ans-circle { background: var(--ans-no); }

/* ----------------------------- Ekran WYNIK ----------------------------- */
#screen-result { justify-content: center; align-items: center; gap: 12px; }
.result-card {
  display: flex; flex-direction: column; align-items: center;
  gap: clamp(8px, 1.6vh, 14px);
  text-align: center;
  color: #5a3d18;
  background: url('../assets/scroll-result.png') center / 100% 100% no-repeat;
  padding: clamp(70px, 13vh, 104px) clamp(46px, 12vw, 70px);
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .4));
}
.result-lead { font-size: 17px; font-weight: 700; margin: 0; }
.result-dish { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.result-emoji { font-size: 58px; line-height: 1; }
.result-name {
  font-size: clamp(28px, 8vw, 40px); font-weight: 800;
  color: #6a3410;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .45);
}
.result-prob { font-size: 14px; color: #7a5a2e; margin-bottom: 4px; }

.btn-order { margin-top: 6px; }
.btn-link {
  margin-top: 4px; background: none; border: none;
  color: #6a4a1e; font-size: 15px; font-weight: 600;
  text-decoration: underline; cursor: pointer;
}

/* ----------------------------- Przełącznik języka ----------------------------- */
.lang-switch {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top));
  right: 12px;
  z-index: 5;
  display: flex;
  gap: 4px;
}
.lang-btn {
  width: 38px; height: 30px;
  border-radius: 8px;
  font-weight: 800; font-size: 13px;
  color: var(--cream);
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .3);
  cursor: pointer;
  transition: filter .15s ease;
}
.lang-btn.active {
  background: var(--gold);
  color: var(--ink);
  border-color: #fff2c4;
}
.lang-select {
  height: 30px;
  border-radius: 8px;
  padding: 0 6px;
  font-weight: 700; font-size: 13px;
  color: var(--ink);
  background: var(--gold);
  border: 1px solid #fff2c4;
  cursor: pointer;
  max-width: 42vw;
}

/* Powrót do huba (lewy górny róg) + restart w trakcie gry */
.hub-link {
  position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 12px; z-index: 5;
  padding: 6px 12px; border-radius: 8px; font-weight: 800; font-size: 13px;
  color: var(--cream); background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .3); text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.hub-link:hover { background: var(--gold); color: var(--ink); border-color: #fff2c4; }
.game-top-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.btn-restart {
  padding: 6px 12px; border-radius: 16px; font-size: 12px; font-weight: 700;
  color: var(--cream); background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .28); cursor: pointer; white-space: nowrap;
}
.btn-restart:active { transform: translateY(1px); }

/* ----------------------------- Stopka ----------------------------- */
.site-footer {
  width: 100%;
  margin-top: 8px;
  padding: 18px 14px calc(16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  background: rgba(5, 18, 50, .62);
  border-top: 1px solid rgba(255, 255, 255, .12);
  border-radius: 18px 18px 0 0;
}
.social { display: flex; gap: 14px; }
.social-ico {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--cream);
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .22);
  transition: background .15s ease, color .15s ease, transform .08s ease;
}
.social-ico svg { width: 20px; height: 20px; fill: currentColor; }
.social-ico:hover { background: var(--gold); color: var(--ink); }
.social-ico:active { transform: translateY(1px) scale(.95); }
.footer-links {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center;
  font-size: 14px;
}
.footer-links a { color: var(--cream); opacity: .85; text-decoration: none; }
.footer-links a:hover { opacity: 1; text-decoration: underline; }
.footer-links .sep { opacity: .4; }
.copyright { font-size: 13px; opacity: .6; margin: 0; }

/* ----------------------------- Baner cookies ----------------------------- */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: rgba(7, 25, 66, .97);
  border-top: 2px solid var(--gold);
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 12px 18px;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, .35);
}
.cookie-banner[hidden] { display: none; }   /* nadpisuje display:flex, gdy baner ukryty */
.cookie-text { margin: 0; font-size: 14px; line-height: 1.4; color: var(--cream); max-width: 640px; }
.cookie-text a { color: var(--gold); }
.cookie-actions { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-btn {
  padding: 10px 18px; border-radius: 22px; font-weight: 800; font-size: 14px;
  cursor: pointer; border: 2px solid transparent;
}
.cookie-btn--primary {
  background: linear-gradient(180deg, #ffe08a, var(--gold), var(--gold-deep));
  color: var(--ink); border-color: #fff2c4;
}
.cookie-btn--ghost { background: rgba(255, 255, 255, .1); color: var(--cream); border-color: rgba(255, 255, 255, .3); }
.cookie-btn:active { transform: translateY(1px); }

/* ----------------------------- Strony prawne (FAQ/Regulamin/Polityka) ----------------------------- */
.legal {
  position: relative; z-index: 1;
  width: calc(100% - 24px); max-width: 760px;
  margin: 16px auto 28px;
  padding: 26px 24px 40px;
  color: #eef2fd; line-height: 1.6;
  background: rgba(5, 17, 46, .82);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 18px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .4);
  backdrop-filter: blur(3px);
}
.lang-block { display: none; }
.lang-block.active { display: block; }
.legal-back { display: inline-block; margin-bottom: 14px; color: var(--gold); font-weight: 700; text-decoration: none; }
.legal-back:hover { text-decoration: underline; }
.legal h1 { font-size: clamp(26px, 7vw, 38px); margin: 6px 0 2px; color: var(--cream); }
.legal h2 { font-size: clamp(19px, 5vw, 24px); margin: 26px 0 8px; color: #ffe4a3; }
.legal h3 { font-size: 17px; margin: 18px 0 6px; color: #ffe4a3; }
.legal p, .legal li { font-size: 16px; }
.legal a { color: var(--gold); }
.legal ul, .legal ol { padding-left: 22px; }
.legal li { margin: 4px 0; }
.legal-updated { opacity: .6; font-size: 13px; margin-top: 0; }
.legal .card {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 14px; padding: 12px 18px; margin: 10px 0;
}
.legal details { margin: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, .12); padding-bottom: 8px; }
.legal summary { cursor: pointer; font-weight: 700; font-size: 17px; color: var(--cream); padding: 6px 0; }
.legal-footer {
  margin-top: 40px; padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .15);
  font-size: 13px; opacity: .75; text-align: center;
}
.legal-footer a { color: var(--cream); }

/* ----------------------------- Ekran ładowania (motyw sieci = magenta) ----------------------------- */
.loader {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  background: radial-gradient(circle at 50% 42%, rgba(40, 6, 30, .30), rgba(40, 6, 30, .68)),
              #7a1550 url('../assets/bg-magenta.jpg') center / cover no-repeat;
  transition: opacity .5s ease, visibility .5s ease;
}
.loader.hide { opacity: 0; visibility: hidden; }
.loader-logo { width: min(76%, 400px); height: auto; margin-bottom: 2px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .5)); }
.loader-genies { position: relative; display: flex; align-items: center; justify-content: center; width: min(86%, 420px); height: clamp(280px, 72vw, 440px); }
.lg-genie { width: clamp(240px, 70vw, 400px); height: auto; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .5)); will-change: opacity, transform; }
.lg-solo { animation: lg-solo-cycle 3s ease-in-out infinite; }
@keyframes lg-solo-cycle {
  0%   { opacity: 0; transform: translateY(20px) scale(.9); }
  16%  { opacity: 1; transform: translateY(0) scale(1); }
  68%  { opacity: 1; transform: translateY(-12px) scale(1.05); }
  90%  { opacity: 0; transform: translateY(-24px) scale(.95); }
  100% { opacity: 0; transform: translateY(20px) scale(.9); }
}
.lg-emoji { font-size: clamp(62px, 17vw, 100px); line-height: 1; display: flex; align-items: center; justify-content: center; }
@keyframes lg-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-28px); } }
.loader-text { font-size: clamp(20px, 5.5vw, 28px); font-weight: 800; letter-spacing: .5px; color: var(--cream); text-shadow: 0 2px 6px rgba(0, 0, 0, .5); margin: 0; text-align: center; padding: 0 16px; }
.loader-bar { width: min(80%, 380px); height: 14px; border-radius: 999px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28); overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--gold-deep), var(--gold), #ffe08a); animation: lg-load 1.9s ease forwards; }
@keyframes lg-load { to { width: 100%; } }

/* ----------------------------- Większe ekrany (desktop) ----------------------------- */
@media (min-width: 760px) {
  #app { max-width: 960px; }
  #screen-start .hero { flex-direction: row; justify-content: center; align-items: center; gap: 34px; }
  #screen-start .genie--lg { width: 320px; height: 380px; }
  .bubbles { width: auto; align-items: flex-start; }

  /* Rozgrywka: duży dżin po lewej, pytanie + odpowiedzi po prawej */
  #screen-game { flex-direction: row; align-items: center; justify-content: center; gap: 40px; }
  #screen-game .genie--game { height: min(68vh, 580px); width: 48%; max-width: 500px; margin: 0; }
  #screen-game .game-panel { flex: 0 1 440px; }
  #screen-game .game-panel .answers { margin-top: 28px; }

  /* Wynik: duży dżin po lewej, treść po prawej */
  #screen-result { flex-direction: row; align-items: center; justify-content: center; gap: 40px; }
  #screen-result .genie--game { height: min(64vh, 560px); width: 46%; max-width: 480px; margin: 0; }
  #screen-result .result-card { flex: 0 1 420px; }
}

/* ===================== Ekran „kraj / zagranica” (Tripjini) ===================== */
#screen-mode { justify-content: center; align-items: center; }
.mode-panel {
  width: min(94%, 460px); text-align: center;
  background: rgba(7, 40, 48, .82); border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 20px; padding: 22px 20px; box-shadow: var(--shadow);
}
.mode-title { margin: 4px 0 16px; font-size: 20px; color: var(--cream); }
.mode-country { display: flex; flex-direction: column; gap: 6px; text-align: left;
  font-size: 14px; color: var(--cream); margin-bottom: 18px; }
#country-select {
  width: 100%; padding: 11px 12px; border-radius: 12px; font-size: 16px;
  border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .1); color: var(--cream);
}
#country-select option { color: #10333b; }
.mode-actions { display: grid; gap: 12px; }
.mode-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 16px; border-radius: 16px; cursor: pointer; color: var(--ink);
  border: 1px solid #fff2c4; background: linear-gradient(180deg, #ffe08a, var(--gold), var(--gold-deep));
  transition: transform .1s;
}
.mode-btn--abroad { color: var(--cream); border-color: rgba(255, 255, 255, .35);
  background: linear-gradient(180deg, var(--navy-1), var(--navy-2)); }
.mode-btn:active { transform: translateY(1px); }
.mode-btn:disabled { opacity: .55; cursor: default; }
.mode-emoji { font-size: 30px; }
.mode-btn-label { font-size: 18px; font-weight: 800; }
.mode-btn-hint { font-size: 12.5px; opacity: .85; }

/* Wynik: kraj + kredyt danych */
.result-country { font-size: 18px; font-weight: 700; color: var(--gold); margin-top: 2px; }
.geo-credit { font-size: 11px; opacity: .6; margin: 6px 0 2px; }

@media (min-width: 760px) {
  #screen-mode { flex-direction: row; gap: 40px; }
  #screen-mode .genie--game { height: min(64vh, 560px); width: 46%; max-width: 480px; margin: 0; }
  #screen-mode .mode-panel { flex: 0 1 440px; }
}
