/* ALAZ-MOBIL-PWA-01 — "Yan çevir" ekranı ve "Ana ekrana ekle" ipucu.
   Öğeler yalnız dokunmatik telefon/tablette oluşur (pwaShell.mjs); masaüstünde bu kuralların eşleştiği öğe yok.
   Dil: maket v2 "Altın ve Kor" — işlenmiş altın kenar, köşe taşları, kor ışıması. */

.kd-pwa-rotate,
.kd-pwa-hint {
  --pwa-gold-edge: linear-gradient(180deg, #fff3c4 0%, #f0c464 20%, #a8701f 48%, #e2ae4e 70%, #6e4310 100%);
  --pwa-ink: #1a0904;
  --pwa-parchment: #f4e6c8;
  --pwa-ash: #c4ab8a;
  --pwa-gold-100: #f7dc98;
  --pwa-gold-300: #e6b45a;
  font-family: var(--kd-font-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

/* ── Yan çevir: oyunun her katmanının üstünde ── */
.kd-pwa-rotate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  overflow-y: auto;
  box-sizing: border-box;
  padding: calc(20px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right))
    calc(20px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  background:
    radial-gradient(120% 70% at 50% 30%, rgba(168, 54, 26, 0.35), transparent 60%),
    radial-gradient(circle at 50% 50%, #22100a 0%, #0e0504 75%);
  color: var(--pwa-parchment);
  touch-action: none;
}

.kd-pwa-rotate[hidden] {
  display: none;
}

/* ── Altın işlemeli levha: çift çizgi + dört köşe taşı + iç kor ışıması ── */
.kd-pwa-plate {
  position: relative;
  box-sizing: border-box;
  border: 2px solid transparent;
  border-image: var(--pwa-gold-edge) 1;
  background:
    radial-gradient(130% 80% at 50% -10%, rgba(120, 46, 22, 0.55), transparent 60%),
    linear-gradient(180deg, rgba(40, 18, 11, 0.97), rgba(20, 8, 5, 0.97));
  box-shadow:
    0 0 0 1px #0b0302,
    inset 0 0 0 1px #160703,
    inset 0 0 0 2px rgba(247, 220, 152, 0.22),
    inset 0 0 28px rgba(240, 106, 36, 0.14),
    0 0 26px rgba(255, 140, 50, 0.22),
    0 14px 30px rgba(0, 0, 0, 0.6);
}

.kd-pwa-plate::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(230, 180, 90, 0.26);
  pointer-events: none;
}

/* Köşe taşları: altın elmas + kor taşı (dört köşe, tek arka plan katmanında) */
.kd-pwa-plate::before {
  --stud: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23fff3c4'/%3E%3Cstop offset='.5' stop-color='%23c48a2c'/%3E%3Cstop offset='1' stop-color='%236e4310'/%3E%3C/linearGradient%3E%3CradialGradient id='r' cx='.38' cy='.32' r='.8'%3E%3Cstop offset='0' stop-color='%23ffb3a2'/%3E%3Cstop offset='.45' stop-color='%23e5321f'/%3E%3Cstop offset='1' stop-color='%236a0a06'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cpath d='M10 1L19 10L10 19L1 10Z' fill='url(%23g)' stroke='%231a0904' stroke-width='1.4' stroke-linejoin='round'/%3E%3Ccircle cx='10' cy='10' r='3.4' fill='url(%23r)' stroke='%231a0904' stroke-width='1'/%3E%3C/svg%3E");
  content: "";
  position: absolute;
  inset: -9px;
  z-index: 2;
  pointer-events: none;
  background:
    var(--stud) 0 0 / 18px 18px no-repeat,
    var(--stud) 100% 0 / 18px 18px no-repeat,
    var(--stud) 0 100% / 18px 18px no-repeat,
    var(--stud) 100% 100% / 18px 18px no-repeat;
}

.kd-pwa-rotate__plate {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(100%, 360px);
  margin: auto;
  padding: 26px 22px 24px;
  text-align: center;
}

.kd-pwa-rotate__art svg {
  display: block;
  width: 148px;
  height: 148px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.6));
}

.kd-pwa-rotate__phone {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: kd-pwa-turn 2.8s cubic-bezier(0.6, 0, 0.3, 1) infinite;
}

.kd-pwa-rotate__arrow {
  animation: kd-pwa-arrow 2.8s ease-in-out infinite;
}

@keyframes kd-pwa-turn {
  0%,
  22% {
    transform: rotate(0deg);
  }
  55%,
  88% {
    transform: rotate(-90deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

@keyframes kd-pwa-arrow {
  0%,
  12% {
    opacity: 0.25;
  }
  30%,
  60% {
    opacity: 1;
  }
  100% {
    opacity: 0.25;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kd-pwa-rotate__phone {
    animation: none;
    transform: rotate(-90deg);
  }
  .kd-pwa-rotate__arrow {
    animation: none;
  }
}

.kd-pwa-rotate__title {
  margin: 0;
  font: 700 26px/1.15 var(--kd-font-display, "Palatino Linotype", Georgia, serif);
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #fff6d6 10%, #f2c768 55%, #b47a2a 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 0 #2a0e04) drop-shadow(0 0 10px rgba(255, 150, 60, 0.35));
}

.kd-pwa-rotate__lede {
  margin: 0;
  max-width: 28ch;
  font-size: 16px;
  line-height: 1.45;
  color: var(--pwa-parchment);
}

/* ── Düğmeler: dokunma hedefi en az 44 px ── */
.kd-pwa-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 2px solid transparent;
  border-image: var(--pwa-gold-edge) 1;
  font: 700 15px/1 var(--kd-font-display, "Palatino Linotype", Georgia, serif);
  letter-spacing: 0.05em;
  color: var(--pwa-gold-100);
  text-shadow: 0 1px 0 #000;
  background: linear-gradient(180deg, #5c2b16, #331509 60%, #240d06);
  box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.35), inset 0 0 0 1px #160703, 0 2px 0 #0b0402, 0 4px 10px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.kd-pwa-btn--primary {
  color: #2a0c03;
  text-shadow: 0 1px 0 rgba(255, 232, 190, 0.55);
  background: linear-gradient(180deg, #ffd98a 0%, #f7943a 28%, #d4561c 68%, #8e2a0c 100%);
  box-shadow: inset 0 1px 0 #fff2c4, inset 0 -3px 6px rgba(80, 15, 0, 0.45), 0 0 0 1px var(--pwa-ink), 0 0 20px rgba(255, 140, 50, 0.45), 0 4px 10px rgba(0, 0, 0, 0.5);
}

.kd-pwa-btn--ghost {
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--pwa-gold-300);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(230, 180, 90, 0.45);
}

.kd-pwa-btn:active {
  transform: translateY(1px);
  filter: brightness(0.9);
}

.kd-pwa-btn:focus-visible {
  outline: 2px solid #ffa552;
  outline-offset: 3px;
}

/* ── Ana ekrana ekle ipucu ── */
.kd-pwa-hint {
  position: fixed;
  z-index: 1950;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: grid;
  gap: 12px;
  width: min(calc(100% - 32px), 420px);
  padding: 16px 16px 12px;
  color: var(--pwa-parchment);
  text-align: left;
}

.kd-pwa-hint[hidden] {
  display: none;
}

/* Yan çevir levhasının içinde: sabit konum yerine akışta, ince altın ayraçla */
.kd-pwa-hint--inline {
  position: static;
  transform: none;
  width: 100%;
  margin-top: 6px;
  padding: 14px 0 0;
  border: 0;
  border-top: 1px solid rgba(230, 180, 90, 0.35);
  border-image: none;
  background: none;
  box-shadow: none;
}

.kd-pwa-hint--inline::before,
.kd-pwa-hint--inline::after {
  display: none;
}

.kd-pwa-hint__head {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
}

.kd-pwa-hint__icon {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 11px;
  box-shadow: 0 0 0 1px var(--pwa-ink), 0 0 14px rgba(255, 140, 50, 0.35);
}

.kd-pwa-hint__title {
  margin: 0 0 3px;
  font: 700 17px/1.2 var(--kd-font-display, "Palatino Linotype", Georgia, serif);
  letter-spacing: 0.03em;
  color: var(--pwa-gold-100);
}

.kd-pwa-hint__lede {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--pwa-ash);
}

.kd-pwa-hint__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kd-pwa-hint__steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  list-style: none;
  background: rgba(14, 5, 4, 0.6);
  border: 1px solid rgba(230, 180, 90, 0.25);
  font-size: 14px;
  line-height: 1.4;
}

.kd-pwa-hint__steps[hidden] {
  display: none;
}

.kd-pwa-hint__steps li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: center;
}

.kd-pwa-hint__steps b {
  color: var(--pwa-gold-100);
}

/* Rakamlar süslü başlık yazısında değil, okunur yazıda: Cinzel'in "1"i Roma "I"sine benziyor */
.kd-pwa-hint__step-no {
  position: relative;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  font: 800 14px/1 var(--kd-font-ui, -apple-system, sans-serif);
  font-variant-numeric: lining-nums tabular-nums;
  color: #2a0c03;
  isolation: isolate;
}

.kd-pwa-hint__step-no::before {
  content: "";
  position: absolute;
  inset: 4px;
  z-index: -1;
  background: linear-gradient(135deg, #ffe9aa, #d39a3a);
  border: 1px solid var(--pwa-ink);
  transform: rotate(45deg);
}

.kd-pwa-hint__share {
  vertical-align: -5px;
  margin-left: 2px;
}

/* Kısa yatay ekranda (telefon yatay, açılış ekranı) ipucu yana yaslanır, giriş kartını örtmesin */
@media (orientation: landscape) and (max-height: 520px) {
  .kd-pwa-hint:not(.kd-pwa-hint--inline):not(.kd-pwa-hint--strip) {
    left: auto;
    right: calc(12px + env(safe-area-inset-right));
    bottom: calc(10px + env(safe-area-inset-bottom));
    transform: none;
    width: min(46vw, 340px);
    padding: 12px 12px 8px;
    gap: 8px;
  }
  .kd-pwa-hint:not(.kd-pwa-hint--inline) .kd-pwa-hint__lede {
    font-size: 13px;
  }
}

/* Oyun sahnesinde: üst ortada tek satırlık ince şerit (simge, başlık, iki düğme). Dünyanın ortasını ve
   alttaki beceri çubuğunu örtmez; tarif açılırsa şeridin altına iner. */
.kd-pwa-hint.kd-pwa-hint--strip {
  top: calc(8px + env(safe-area-inset-top));
  bottom: auto;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  grid-template-columns: auto auto;
  align-items: center;
  gap: 6px 14px;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 7px 10px 7px 8px;
}

.kd-pwa-hint--strip .kd-pwa-hint__head {
  grid-template-columns: 32px auto;
  gap: 8px;
}

.kd-pwa-hint--strip .kd-pwa-hint__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.kd-pwa-hint--strip .kd-pwa-hint__title {
  margin: 0;
  font-size: 15px;
  white-space: nowrap;
}

.kd-pwa-hint--strip .kd-pwa-hint__lede {
  display: none;
}

.kd-pwa-hint--strip .kd-pwa-hint__actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.kd-pwa-hint--strip .kd-pwa-btn {
  min-height: 44px;
  padding-inline: 14px;
}

.kd-pwa-hint--strip .kd-pwa-hint__steps {
  grid-column: 1 / -1;
  grid-row: 2;
}
