/* =========================
   1) Variables / Base
   ========================= */
:root{
  --bg1:#0b1020;
  --bg2:#0f1a33;

  --card: rgba(255,255,255,.06);
  --border: rgba(255,255,255,.12);

  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.65);

  --accent: #7c5cff;
  --danger:#ff4d6d;

  --shadow: 0 20px 60px rgba(0,0,0,.45);
  --radius: 18px;
}

*{ box-sizing: border-box; }

body{
  margin: 0;
  font-family: system-ui, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1000px 700px at 15% 10%, rgba(124,92,255,.25), transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
}


/* =========================
   2) Layout
   ========================= */
.wrap{
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 18px 50px;
}

.topbar{
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 18px;
}

.subtitle{
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.kbdRow{
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.grid{
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}


/* =========================
   3) Cards
   ========================= */
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.cardHeader{
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .12em;
}

.cardBody{
  padding: 16px;
}


/* =========================
   4) Inputs / Buttons
   ========================= */
textarea{
  width: 100%;
  min-height: 120px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.28);
  color: var(--text);
  outline: none;
}

textarea:focus{
  border-color: rgba(124,92,255,.6);
  box-shadow: 0 0 0 4px rgba(124,92,255,.18);
}

.panel{
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

button{
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: var(--text);
  cursor: pointer;
}

button.primary{
  background: linear-gradient(90deg, var(--accent), #2dd4bf);
}

button:disabled{
  opacity: .55;
  cursor: not-allowed;
}


/* =========================
   5) Stats / Typing display
   ========================= */
.stats{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.pill{
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  font-size: 13px;
}

.hint{
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

#textDisplay{
  font-size: 18px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.ch{ border-radius: 6px; }

.done{ color: rgba(255,255,255,.45); }

.current{
  outline: 2px solid var(--accent);
  background: rgba(124,92,255,.25);
}

.wrong{
  outline: 2px solid var(--danger);
  background: rgba(255,77,109,.25);
}


/* =========================
   6) Language select
   ========================= */
.langSelect{
  padding: 8px 14px;
  border-radius: 14px;
  border: 1px solid rgba(124,92,255,.6);
  background: rgba(18,22,40,.95);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: .2px;
  cursor: pointer;
  outline: none;
}

.langSelect option{
  background-color: #0f1a33;
  color: #ffffff;
  font-weight: 600;
}

.langSelect:hover{
  border-color: rgba(124,92,255,.9);
}

.langSelect:focus{
  box-shadow: 0 0 0 4px rgba(124,92,255,.25);
}


/* =========================
   7) Footer
   ========================= */
.footer{
  margin-top: 40px;
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(10,15,30,.6);
}

.footerInner{
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.footerLeft{
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.65);
  font-size: 13px;
  flex-wrap: wrap; /* pozwala ładnie złamać na mniejszych szerokościach */
}

.footerLogo{
  width: 28px;
  height: 28px;
  object-fit: contain;
  opacity: .9;
}

.footerText strong{
  color: rgba(255,255,255,.9);
  font-weight: 700;
}

/* Links: Privacy / Contact */
.footerLinks{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 10px;
}

.footerLink{
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  color: rgba(255,255,255,.75);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  transition: background .15s ease, transform .12s ease, border-color .15s ease;
}

.footerLink:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.22);
  transform: translateY(-1px);
}

/* Patreon button */
.supportBtn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  color: rgba(255,255,255,.8);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  transition: background .15s ease, transform .12s ease;
}

.supportBtn:hover{
  background: rgba(255,255,255,.12);
  transform: translateY(-1px);
}

/* Mobile footer layout */
@media (max-width: 600px){
  .footerInner{
    flex-direction: column;
    gap: 10px;
  }

  .footerLeft{
    justify-content: center;
  }

  .footerLinks{
    margin-left: 0;
  }

  .footerRight{
    flex-wrap: wrap;
    justify-content: center;
  }
}

.footerRight{
  display: inline-flex;
  align-items: center;
  gap: 10px;
}


/* =========================
   8) Ads toggle (Ads text inside track)
   ========================= */
.adsToggleWrap{
  display: inline-flex;
  align-items: center;
}

.adsToggle{
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.22);
  padding: 6px;
  border-radius: 999px;
  cursor: pointer;
  transition: box-shadow .15s ease, border-color .15s ease, transform .08s ease;
}

.adsToggle:active{ transform: translateY(1px); }

.adsTrack{
  position: relative;
  width: 72px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
  display: block;
}

/* Text "Ads" inside the track */
.adsText{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  pointer-events: none;
}

/* Emoji thumb */
.adsThumb{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 16px;

  left: 1px; /* OFF */
  background: rgba(255,255,255,.12);
  box-shadow:
    0 8px 18px rgba(0,0,0,.35),
    inset 0 0 0 1px rgba(255,255,255,.18);
  transition: left .18s ease, background .18s ease;
}

/* ON state */
.adsOn .adsToggle{
  border-color: rgba(124,92,255,.55);
  box-shadow: 0 0 0 4px rgba(124,92,255,.12);
}

.adsOn .adsThumb{
  left: 43px; /* 72 - 28 - 1 = 43 */
  background: rgba(124,92,255,.25);
}


/* =========================
   9) Side ads
   ========================= */
.sideAd{
  position: fixed;
  top: 110px;
  width: 220px;
  z-index: 5;
  opacity: 1;
  transition: opacity .18s ease, transform .18s ease;
}

.sideAdLeft{ left: 16px; }
.sideAdRight{ right: 16px; }

.adCard{
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
  padding: 14px;
}

.adTitle{
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
  margin-bottom: 8px;
}

.adBody{
  color: rgba(255,255,255,.8);
  font-size: 13px;
}

/* Ads hidden */
.adsOff #adLeft,
.adsOff #adRight{
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  visibility: hidden;
}


/* =========================
   10) Responsive
   ========================= */
@media (min-width: 900px){
  .grid{ grid-template-columns: 1.05fr .95fr; }
  .span2{ grid-column: span 2; }
}

@media (max-width: 1200px){
  #adLeft, #adRight{ display: none; }
}

@media (max-width: 600px){
  .footerInner{
    flex-direction: column;
    gap: 10px;
  }
}
