/* gamedschool — Bilge eklentileri: resim yükleme, resimshare.com rozeti ve herkese açık (ziyaretçi) Bilge paneli.
 * Uygulama, açılış sayfası ve herkese açık sayfalarda ortak kullanılır; kendi renk değişkenleriyle çalışır. */
:root {
  --bq-bg: #ffffff; --bq-soft: #f3f6fc; --bq-line: #e2e8f3; --bq-ink: #172036; --bq-mut: #64708a;
  --bq-blue: #2563eb; --bq-blue-2: #1d4ed8; --bq-blue-soft: #e0eaff; --bq-me: #2563eb; --bq-me-ink: #fff;
  --bq-shadow: 0 18px 50px rgba(15, 23, 42, .18), 0 2px 8px rgba(15, 23, 42, .08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bq-bg: #161b2b; --bq-soft: #1e2538; --bq-line: #2c3550; --bq-ink: #eef2fb; --bq-mut: #9aa6c2; --bq-blue-soft: #1e2d55; --bq-shadow: 0 18px 50px rgba(0, 0, 0, .5); }
}
:root[data-theme="dark"] { --bq-bg: #161b2b; --bq-soft: #1e2538; --bq-line: #2c3550; --bq-ink: #eef2fb; --bq-mut: #9aa6c2; --bq-blue-soft: #1e2d55; --bq-shadow: 0 18px 50px rgba(0, 0, 0, .5); }

/* ---------- resimshare.com rozeti: sade, kutusuz; koyu zeminde beyaz logo, açık zeminde lacivert ---------- */
.rs-badge { display: inline-flex; align-items: center; gap: 7px; padding: 3px 6px; border-radius: 6px; color: var(--bq-mut); font-weight: 500; font-size: 13px; line-height: 1; font-family: inherit; text-decoration: none; opacity: .85; transition: opacity .15s ease; }
.rs-badge:hover { opacity: 1; }
.rs-badge:focus-visible { outline: 2px solid #4773BF; outline-offset: 2px; opacity: 1; }
.rs-badge img { display: block; width: 100px; height: auto; }
.rs-badge.sm { font-size: 12px; gap: 6px; }
.rs-badge.sm img { width: 88px; }
.rs-badge .rs-w { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rs-badge .rs-w { display: block; } :root:not([data-theme="light"]) .rs-badge .rs-n { display: none; } }
:root[data-theme="dark"] .rs-badge .rs-w { display: block; }
:root[data-theme="dark"] .rs-badge .rs-n { display: none; }
.bg-rs, .bd-rs, .bq-rs { display: flex; justify-content: center; }
.bg-rs { margin: 0 12px 8px; }
.bd-rs { margin: 4px 10px 0; }

/* ---------- resim ekleme düğmesi, önizleme şeridi, balondaki resim ---------- */
.bimg-btn { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; align-self: flex-end; margin-right: 2px; border-radius: 10px; border: 0; background: transparent; color: var(--bq-mut); cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.bimg-btn:hover { background: var(--bq-blue-soft); color: var(--bq-blue); }
.bimg-btn.on { background: var(--bq-blue-soft); color: var(--bq-blue); }
.bimg-btn:focus-visible { outline: 2px solid var(--bq-blue); outline-offset: 1px; }
.bg-input .bimg-btn, .bd-input .bimg-btn { order: -1; margin-left: -6px; }
.bimg-strip { margin: 0 12px 6px; }
.bimg-strip[hidden] { display: none; }
.bimg-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 4px 6px 4px 4px; border-radius: 12px; border: 1px solid var(--bq-line); background: var(--bq-soft); color: var(--bq-ink); font-size: 12px; }
.bimg-chip img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.bimg-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.bimg-x { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; border: 0; background: transparent; color: var(--bq-mut); cursor: pointer; }
.bimg-x:hover { background: var(--bq-line); color: var(--bq-ink); }
.bimg-spin { width: 16px; height: 16px; margin: 4px; border-radius: 50%; border: 2px solid var(--bq-line); border-top-color: var(--bq-blue); animation: bimg-spin .7s linear infinite; }
@keyframes bimg-spin { to { transform: rotate(360deg); } }
.bimg-drag { outline: 2px dashed var(--bq-blue); outline-offset: 2px; }
.bimg-in { display: block; max-width: min(220px, 100%); max-height: 220px; margin: 2px 0 6px; border-radius: 10px; object-fit: contain; background: rgba(255, 255, 255, .15); }

/* ---------- ziyaretçi Bilge’si: yüzen düğme ---------- */
.bq-fab { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 140; display: inline-flex; align-items: center; gap: 10px; height: 54px; padding: 0 16px 0 6px; border-radius: 99px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #2563eb, #1e40af); color: #fff; box-shadow: 0 10px 28px rgba(37, 99, 235, .38); font-family: inherit; -webkit-tap-highlight-color: transparent;
  transition: transform .18s cubic-bezier(.23, 1, .32, 1), box-shadow .18s ease; }
.bq-fab[hidden] { display: none; }
.bq-fab:hover { box-shadow: 0 14px 34px rgba(37, 99, 235, .45); }
.bq-fab:active { transform: scale(.97); }
.bq-fab:focus-visible { outline: 3px solid #93c5fd; outline-offset: 3px; }
.bq-fab-owl { display: grid; place-items: end center; width: 42px; height: 42px; padding: 4px 8px 0; border-radius: 50%; overflow: hidden; background: #dbeafe; }
.bq-fab-owl img { width: 26px; height: auto; image-rendering: pixelated; }
.bq-fab-t { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; text-align: left; }
.bq-fab-t b { font-size: 15px; font-weight: 800; }
.bq-fab-t small { font-size: 11px; opacity: .85; font-weight: 600; }
.bq-fab.on { transform: scale(.94); }
@media (max-width: 480px) { .bq-fab { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); height: 50px; padding-right: 14px; } .bq-fab-t small { display: none; } }

/* ---------- ziyaretçi Bilge’si: panel ---------- */
.bq-panel { position: fixed; right: 18px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 141; display: flex; flex-direction: column; width: min(390px, calc(100vw - 24px)); height: min(580px, calc(100dvh - 110px)); border-radius: 20px; overflow: hidden;
  background: var(--bq-bg); color: var(--bq-ink); border: 1px solid var(--bq-line); box-shadow: var(--bq-shadow); font-family: inherit; font-size: 14px; line-height: 1.5;
  opacity: 0; transform: translateY(10px) scale(.98); transform-origin: bottom right; pointer-events: none; visibility: hidden;
  transition: opacity .2s ease, transform .22s cubic-bezier(.23, 1, .32, 1), visibility 0s linear .22s; }
.bq-panel.open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity .2s ease, transform .22s cubic-bezier(.23, 1, .32, 1), visibility 0s; }
@media (prefers-reduced-motion: reduce) { .bq-panel { transition: opacity .15s ease, visibility 0s linear .15s; transform: none; } .bq-panel.open { transition: opacity .15s ease, visibility 0s; } }
@media (max-width: 600px) { .bq-panel { right: 8px; left: 8px; width: auto; bottom: calc(72px + env(safe-area-inset-bottom)); height: min(620px, calc(100dvh - 92px)); } }
.bq-head { display: flex; align-items: center; gap: 10px; flex-shrink: 0; padding: 10px 8px 10px 12px; background: linear-gradient(135deg, #2563eb, #1e40af); color: #fff; }
.bq-grow { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.bq-grow b { font-size: 16px; font-weight: 800; }
.bq-grow small { font-size: 12px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bq-av { display: grid; place-items: end center; width: 38px; height: 38px; flex-shrink: 0; padding: 4px 7px 0; border-radius: 50%; overflow: hidden; background: #dbeafe; }
.bq-av img { width: 24px; height: auto; image-rendering: pixelated; }
.bq-av.sm { width: 30px; height: 30px; padding: 3px 6px 0; }
.bq-av.sm img { width: 18px; }
.bq-ic { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; margin: 0; padding: 0; border-radius: 9px; border: 0; background: transparent; color: #fff; font-size: 15px; line-height: 1; cursor: pointer; }
.bq-ic:hover { background: rgba(255, 255, 255, .16); }
.bq-ic:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.bq-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 12px 12px; display: flex; flex-direction: column; gap: 10px; }
.bq-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 100%; }
.bq-msg.me { justify-content: flex-end; }
.bq-b { max-width: 84%; padding: 9px 12px; border-radius: 16px; background: var(--bq-soft); border: 1px solid var(--bq-line); overflow-wrap: anywhere; }
.bq-msg.bot .bq-b { border-bottom-left-radius: 6px; }
.bq-msg.me .bq-b { background: var(--bq-me); color: var(--bq-me-ink); border-color: transparent; border-bottom-right-radius: 6px; white-space: pre-wrap; }
.bq-b p { margin: 0 0 6px; } .bq-b p:last-child { margin-bottom: 0; }
.bq-b h4 { margin: 4px 0 6px; font-size: 14px; }
.bq-b ul, .bq-b ol { margin: 4px 0 6px; padding-left: 20px; }
.bq-b li { margin: 2px 0; }
.bq-b a { color: var(--bq-blue); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.bq-b mark { background: #fef08a; color: #422006; padding: 0 3px; border-radius: 4px; }
.bq-q { margin: 6px 0; padding: 7px 10px; border-radius: 10px; background: var(--bq-blue-soft); }
.bq-q.ok { background: rgba(34, 197, 94, .14); } .bq-q.warn { background: rgba(245, 158, 11, .16); }
.bq-mut { color: var(--bq-mut); font-size: 13px; }
.bq-err { color: #dc2626; margin: 0; }
.bq-tag { display: inline-block; margin-top: 6px; font-size: 11px; color: var(--bq-mut); }
.bq-sug { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bq-sug button, .bq-cats button { padding: 5px 10px; border-radius: 99px; border: 1px solid var(--bq-line); background: var(--bq-bg); color: var(--bq-ink); font-weight: 600; font-size: 12px; line-height: 1.3; font-family: inherit; cursor: pointer; text-align: left; }
.bq-sug button:hover, .bq-cats button:hover { border-color: var(--bq-blue); color: var(--bq-blue); }
.bq-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.bq-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--bq-mut); animation: bq-dot 1s ease-in-out infinite; }
.bq-typing i:nth-child(2) { animation-delay: .15s; } .bq-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bq-dot { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
/* hazır sorular: sohbet akışının içinde (karşılamanın altında), sohbetle birlikte kayar */
.bq-msgs { display: flex; flex-direction: column; gap: 10px; }
.bq-tpl { margin-top: 2px; padding: 10px; border-radius: 14px; border: 1px solid var(--bq-line); background: var(--bq-soft); }
.bq-tpl[hidden] { display: none; }
.bq-tpl-h { margin: 0 2px 8px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--bq-mut); }
.bq-cats { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.bq-cats button { padding: 4px 9px; font-size: 11.5px; white-space: nowrap; }
.bq-cats button.on { background: var(--bq-blue); border-color: var(--bq-blue); color: #fff; }
.bq-qs { display: flex; flex-direction: column; gap: 4px; }
.bq-qs button { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0; padding: 7px 10px; border-radius: 9px; border: 1px solid transparent; background: var(--bq-bg); color: var(--bq-ink); font-weight: 600; font-size: 13px; line-height: 1.3; font-family: inherit; text-align: left; cursor: pointer; box-shadow: none; transition: border-color .15s ease, background-color .15s ease; }
.bq-qs button span { flex: 1; }
.bq-qs button i { font-style: normal; color: var(--bq-mut); font-size: 16px; line-height: 1; }
.bq-qs button:hover { border-color: var(--bq-blue); background: var(--bq-blue-soft); }
/* alt kısım: resim önizlemesi, yazı alanı, rozet ve not */
.bq-foot { flex-shrink: 0; padding: 8px 10px 8px; border-top: 1px solid var(--bq-line); background: var(--bq-bg); }
.bq-strip { margin: 0 0 6px; }
.bq-input { display: flex; align-items: flex-end; gap: 2px; margin: 0; padding: 3px 3px 3px 4px; border-radius: 12px; border: 1.5px solid var(--bq-line); background: var(--bq-soft); }
.bq-input:focus-within { border-color: var(--bq-blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .14); }
/* sayfanın genel textarea stilleri (açılış sayfası) burada geçersiz: tek satır, kaydırma çubuğu yok */
.bq-panel .bq-input textarea { flex: 1; min-width: 0; height: 36px; min-height: 0; max-height: 110px; margin: 0; padding: 8px 4px; border: 0; border-radius: 0; outline: none; box-shadow: none; resize: none; background: none; color: var(--bq-ink);
  font-weight: 500; font-size: 15px; line-height: 20px; font-family: inherit; overflow-y: auto; scrollbar-width: none; -webkit-appearance: none; appearance: none; }
.bq-panel .bq-input textarea::-webkit-scrollbar { display: none; }
.bq-panel .bq-input textarea::placeholder { color: var(--bq-mut); opacity: 1; }
.bq-input .bimg-btn { width: 34px; height: 34px; margin: 0; }
.bq-send { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; margin: 0; padding: 0; border-radius: 9px; border: 0; background: var(--bq-blue); color: #fff; cursor: pointer; }
.bq-send:disabled { opacity: .5; cursor: default; }
.bq-rs { margin: 7px 0 0; }
.bq-note { margin: 4px 0 0; font-size: 11px; line-height: 1.4; color: var(--bq-mut); text-align: center; }
.bq-note a { color: var(--bq-blue); font-weight: 700; text-decoration: none; }
.bq-note a:hover { text-decoration: underline; }
/* açılış sayfasındaki “Bilge’ye şimdi sor” bağlantısı */
.bq-try { display: inline-block; margin-top: 10px; font-weight: 800; font-size: 14px; color: var(--bq-blue); text-decoration: none; }
.bq-try:hover { text-decoration: underline; text-underline-offset: 3px; }
