/* Ortak alt bilgi, istek / öneri düğmesi ve paneli (landing/site-alt.js). Her sayfaya eklenir; oyunların
 * kendi stilleriyle çakışmasın diye bütün sınıflar "sa-" ile başlar ve temel özellikler açıkça verilir. */

.sa,
.sa *,
.sa *::before,
.sa *::after {
  box-sizing: border-box;
}
.sa,
.sa-foot {
  --sa-cream: #fff8ec;
  --sa-paper: #fffdf8;
  --sa-leaf: #4f9a58;
  --sa-leaf-dark: #3d7d45;
  --sa-text: #3e3a35;
  --sa-soft: #6f675d;
  --sa-line: #eadfcd;
  --sa-error: #b5452f;
}
.sa {
  font-family: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: normal;
  text-transform: none;
  color: var(--sa-text);
  -webkit-user-select: text;
  user-select: text;
  -webkit-tap-highlight-color: transparent;
}
/* Özgüllük tek sınıf kadar: aşağıdaki .sa-* kuralları bunu ezer, oyunların genel button kuralları ezemez */
.sa :where(button, input, select, textarea) {
  font: inherit;
  color: inherit;
  margin: 0;
}
.sa :where(button) {
  cursor: pointer;
}
.sa :focus-visible {
  outline: 3px solid #5aa7d3;
  outline-offset: 2px;
}

/* ---------- Sabit düğme ---------- */

.sa-fab {
  position: fixed;
  z-index: 9000;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
}
.sa-fab__open {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px 10px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--sa-leaf);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 3px 0 rgba(30, 60, 30, 0.25), 0 8px 22px rgba(60, 50, 30, 0.22);
}
.sa-fab__open:hover {
  background: var(--sa-leaf-dark);
}
.sa-fab__icon {
  font-size: 18px;
  line-height: 1;
}
.sa-fab__hide {
  position: absolute;
  top: -13px;
  left: -13px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 2px solid var(--sa-line);
  border-radius: 50%;
  background: var(--sa-paper);
  color: var(--sa-soft);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(60, 50, 30, 0.18);
}
/* Dokunmatik ekranda gizleme düğmesine rahat dokunulsun; simgenin üstüne taşmadan */
.sa-fab__hide::after {
  content: "";
  position: absolute;
  inset: -4px;
}

/* Telefonda ve oyunlarda: sağ kenarda yalnızca simge görünür, arada bir (is-peek) dışarı çıkar */
.sa-fab--edge {
  right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 96px);
  transform: translateX(calc(100% - 42px));
  transition: transform 0.4s cubic-bezier(0.3, 1.3, 0.5, 1);
}
.sa-fab--edge .sa-fab__open {
  min-height: 42px;
  padding: 9px 16px 9px 11px;
  border-radius: 21px 0 0 21px;
  opacity: 0.92;
}
.sa-fab--edge.is-peek,
.sa-fab--edge:has(:focus-visible) {
  transform: none;
}
.sa-fab--edge.is-peek .sa-fab__open,
.sa-fab--edge:has(:focus-visible) .sa-fab__open {
  opacity: 1;
}
.sa-fab--edge:not(.is-peek):not(:has(:focus-visible)) .sa-fab__hide {
  visibility: hidden;
}
@media (prefers-reduced-motion: reduce) {
  .sa-fab--edge {
    transition: none;
  }
}
@media print {
  .sa-fab {
    display: none;
  }
}

/* ---------- Panel ---------- */

html.sa-lock {
  overflow: hidden;
}
.sa-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 16px;
  background: rgba(45, 38, 30, 0.42);
  animation: sa-fade 0.18s ease-out;
}
.sa-panel {
  width: min(420px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 18px 20px 20px;
  border-radius: 22px;
  background: var(--sa-paper);
  box-shadow: 0 18px 50px rgba(45, 38, 30, 0.3);
  animation: sa-rise 0.22s ease-out;
}
.sa-panel:focus {
  outline: none;
}
@media (max-width: 599px) {
  .sa-overlay {
    padding: 0;
  }
  .sa-panel {
    width: 100%;
    max-height: 92dvh;
    border-radius: 22px 22px 0 0;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
}
@keyframes sa-fade {
  from {
    opacity: 0;
  }
}
@keyframes sa-rise {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sa-overlay,
  .sa-panel {
    animation: none;
  }
}
.sa-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.sa-panel__title {
  margin: 0;
  font-size: 21px;
  font-weight: 900;
  line-height: 1.2;
  color: #3d6b3f;
}
.sa-x {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--sa-cream);
  color: var(--sa-soft);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}
.sa-x:hover {
  background: var(--sa-line);
}
.sa-lead {
  margin: 0 0 14px;
  color: var(--sa-soft);
  font-size: 15px;
}
.sa-steps {
  margin: 0 0 12px;
  padding-left: 22px;
  font-weight: 700;
}
.sa-steps li + li {
  margin-top: 6px;
}

/* ---------- Form (panelde ve /iletisim/ sayfasında) ---------- */

.sa-form {
  display: grid;
  gap: 14px;
}
.sa-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.sa-field > label,
.sa-label {
  font-weight: 800;
  font-size: 15px;
}
.sa-field small {
  font-weight: 600;
  color: var(--sa-soft);
  font-size: 13px;
}
.sa-form input[type="text"],
.sa-form input[type="email"],
.sa-form select,
.sa-form textarea {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 2px solid var(--sa-line);
  border-radius: 12px;
  background: #fff;
  font-size: 16px; /* iPhone'da 16px altı yakınlaştırma yapar */
  font-weight: 600;
  -webkit-appearance: none;
  appearance: none;
}
.sa-form select {
  padding-right: 36px;
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236f675d' stroke-width='2'/%3E%3C/svg%3E")
    no-repeat right 14px center;
}
.sa-form textarea {
  min-height: 120px;
  resize: vertical;
}
.sa-form input::placeholder,
.sa-form textarea::placeholder {
  color: #a39a8e;
  font-weight: 600;
}
.sa-form input:focus,
.sa-form select:focus,
.sa-form textarea:focus {
  border-color: #8cc7e8;
  outline: none;
}
.sa-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 14px;
  align-items: end; /* etiketler farklı uzunlukta olsa da kutular hizalı */
}
.sa-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sa-chip {
  position: relative;
}
.sa-chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.sa-chip span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 2px solid var(--sa-line);
  border-radius: 999px;
  background: #fff;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
}
.sa-chip input:checked + span {
  border-color: var(--sa-leaf);
  background: #e6f3e2;
  color: #2f5f34;
}
.sa-chip input:focus-visible + span {
  outline: 3px solid #5aa7d3;
  outline-offset: 2px;
}
.sa-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.sa-note {
  margin: 0;
  font-size: 13px;
  color: var(--sa-soft);
}
.sa-status {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--sa-soft);
}
.sa-status:empty {
  display: none;
}
.sa-status--error {
  color: var(--sa-error);
}
.sa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--sa-leaf);
  color: #fff;
  font-weight: 900;
  font-size: 16px;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 3px 0 rgba(30, 60, 30, 0.25);
}
.sa-btn:hover {
  background: var(--sa-leaf-dark);
}
.sa-btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.sa-btn--ghost {
  background: #fff;
  color: #2f5f34;
  border: 2px solid var(--sa-leaf);
  box-shadow: none;
}
.sa-btn--ghost:hover {
  background: #e6f3e2;
}
.sa-btn--small {
  min-height: 42px;
  padding: 8px 18px;
  font-size: 15px;
}
.sa-form .sa-btn[type="submit"] {
  justify-self: start;
  min-width: 140px;
}
.sa-done {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 18px 0 6px;
  text-align: center;
}
.sa-done p {
  margin: 0;
}
.sa-done__icon {
  font-size: 40px;
  line-height: 1;
}
.sa-done__title {
  font-size: 19px;
  font-weight: 900;
  color: #3d6b3f;
}
.sa-done .sa-btn {
  margin-top: 8px;
}

/* Panelin altı: kurulum, açıklama, geliştirici */
.sa-app {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 14px;
  border-radius: 16px;
  background: #eaf6f0;
  font-size: 14px;
}
.sa-app p {
  margin: 0;
}
.sa-app .sa-btn {
  justify-self: start;
  min-height: 42px;
  font-size: 15px;
}
.sa-app .sa-btn[hidden] {
  display: none;
}
.sa-meta {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 2px solid var(--sa-line);
  font-size: 13px;
  color: var(--sa-soft);
}
.sa-meta p {
  margin: 0;
}
.sa-meta p + p {
  margin-top: 4px;
}
.sa-meta a,
.sa-link {
  color: #2f6fa0;
  font-weight: 800;
}
.sa-link {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
  text-decoration: underline;
}

/* ---------- Açılış sayfalarının alt bilgisi (build-landing.mjs <!-- SITE-ALT --> yerine yazar) ---------- */

.foot .sa-foot {
  flex: 1 1 100%;
  display: grid;
  gap: 8px;
}
.foot .sa-foot p {
  margin: 0;
  max-width: 72ch;
}
.sa-foot__app {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 6px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #eaf6f0;
  color: #3e3a35;
  font-size: 0.95rem;
}
.sa-foot__app[hidden],
.sa-foot__app .sa-btn[hidden] {
  display: none;
}
.sa-foot__app p {
  flex: 1 1 260px;
}
.sa-foot a {
  color: #2f6fa0;
  font-weight: 800;
}
