/* ══════════════════════════════════════════════════════════════════════
   ROYAL CANIN — ORTAK KIOSK ARAYÜZÜ (rc-ui.css)
   Üst bar • isim girişi + dokunmatik klavye • oyun sonu ekranı •
   butonlar • boşta kalma uyarısı • konfeti katmanı
   Tüm ölçüler clamp() ile ekran boyutuna uyum sağlar (Pi + 1080p / dikey).
   ══════════════════════════════════════════════════════════════════════ */

:root {
  --rc-red:        #E2001A;
  --rc-red-dark:   #B80015;
  --rc-gold:       #C4A35A;
  --rc-gold-light: #D4AF37;
  --rc-ink:        #111827;
  --rc-ink-soft:   #4B5563;
  --rc-ink-mute:   #9CA3AF;
  --rc-line:       #E5E7EB;
  --rc-surface:    #FFFFFF;
  --rc-canvas:     #F8F9FA;
  --rc-success:    #10B981;
  --rc-info:       #2563EB;
  --rc-purple:     #7C3AED;

  --rc-shadow-sm: 0 4px 14px rgba(0,0,0,.06);
  --rc-shadow-md: 0 12px 32px rgba(0,0,0,.10);
  --rc-shadow-lg: 0 24px 64px rgba(0,0,0,.18);

  --rc-font:  'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --rc-head:  'Outfit', 'Inter', -apple-system, sans-serif;

  --rc-topbar-h: 62px;
}

/* Kiosk temeli: sayfa asla kaymaz, metin seçilmez, dokunma gecikmesi yok */
/* border-box şart: üst bar gövdeye padding olarak eklenir, content-box olsaydı
   sayfa üst bar yüksekliği kadar taşar ve tek ekran düzeni bozulurdu. */
.rc-kiosk *, .rc-kiosk *::before, .rc-kiosk *::after { box-sizing: border-box; }
.rc-kiosk, .rc-kiosk body { height: 100%; }
.rc-kiosk body {
  margin: 0;
  overflow: hidden;
  font-family: var(--rc-font);
  color: var(--rc-ink);
  background: var(--rc-canvas);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.rc-kiosk body, .rc-kiosk button { user-select: none; -webkit-user-select: none; }
.rc-kiosk button { font-family: inherit; }

/* ═════════════════════════ ÜST BAR ═════════════════════════ */
.rc-topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--rc-topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 0 clamp(14px, 2vw, 28px);
  background: var(--rc-surface);
  border-bottom: 2px solid var(--rc-red);
  box-shadow: var(--rc-shadow-sm);
  z-index: 900;
}
body.rc-has-topbar { padding-top: var(--rc-topbar-h); }

.rc-topbar-left  { display: flex; align-items: center; gap: 14px; min-width: 0; }
.rc-topbar-logo  { height: 32px; width: auto; object-fit: contain; flex: none; }
.rc-topbar-titles{ display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.rc-topbar-title {
  font-family: var(--rc-head); font-weight: 800; font-size: 16px;
  color: var(--rc-ink); letter-spacing: .2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rc-topbar-sub {
  font-size: 10px; font-weight: 700; letter-spacing: 1.4px;
  color: var(--rc-gold); text-transform: uppercase;
}

.rc-topbar-right { display: flex; align-items: center; gap: 12px; flex: none; }

.rc-player-chip {
  display: flex; flex-direction: column; align-items: flex-end;
  line-height: 1.2; padding: 6px 14px;
  background: linear-gradient(135deg, #FFF9E8, #FFF);
  border: 1px solid rgba(196,163,90,.45);
  border-radius: 999px;
}
.rc-player-name { font-size: 13px; font-weight: 700; color: var(--rc-ink); max-width: 190px;
                  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-player-pts  { font-size: 11px; font-weight: 600; color: var(--rc-gold); }
.rc-player-pts b{ font-weight: 700; }

.rc-home-btn {
  border: 2px solid var(--rc-red); background: var(--rc-surface); color: var(--rc-red);
  font-weight: 700; font-size: 14px; padding: 10px 18px; border-radius: 999px;
  cursor: pointer; transition: background .18s, color .18s, transform .12s;
  min-height: 44px;
}
.rc-home-btn:active { transform: scale(.95); background: var(--rc-red); color: #fff; }

/* ═════════════════════════ KATMANLAR ═════════════════════════ */
.rc-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(12px, 2.4vh, 28px);
  background: rgba(17, 24, 39, .55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: rcFadeIn .22s ease both;
}
.rc-overlay.rc-fade-out { animation: rcFadeOut .18s ease both; }

.rc-panel {
  background: var(--rc-surface);
  border-radius: 24px;
  box-shadow: var(--rc-shadow-lg);
  border-top: 5px solid var(--rc-red);
  max-height: 100%;
  display: flex; flex-direction: column;
  animation: rcPop .3s cubic-bezier(.34,1.56,.64,1) both;
}

@keyframes rcFadeIn  { from { opacity: 0 } to { opacity: 1 } }
@keyframes rcFadeOut { from { opacity: 1 } to { opacity: 0 } }
@keyframes rcPop     { from { opacity: 0; transform: translateY(18px) scale(.96) } to { opacity: 1; transform: none } }

/* ═══════════════ İSİM GİRİŞİ + DOKUNMATİK KLAVYE ═══════════════ */
.rc-name-panel {
  width: min(940px, 96vw);
  padding: clamp(14px, 2.4vh, 26px) clamp(16px, 2.4vw, 30px) clamp(14px, 2vh, 22px);
  text-align: center; gap: clamp(8px, 1.4vh, 16px);
}
.rc-name-icon { font-size: clamp(30px, 4.4vh, 44px); line-height: 1; }
.rc-name-head h2 {
  margin: 6px 0 4px; font-family: var(--rc-head);
  font-size: clamp(21px, 3.1vh, 30px); font-weight: 800; color: var(--rc-ink);
}
.rc-name-head p {
  margin: 0; font-size: clamp(12px, 1.7vh, 14px); color: var(--rc-ink-soft);
  max-width: 620px; margin-inline: auto; line-height: 1.5;
}

.rc-name-field {
  display: flex; align-items: center; justify-content: center; gap: 2px;
  min-height: clamp(52px, 7.4vh, 70px);
  margin: 4px auto; padding: 0 22px; width: min(620px, 92%);
  background: var(--rc-canvas);
  border: 3px solid var(--rc-gold); border-radius: 16px;
  font-family: var(--rc-head);
  font-size: clamp(22px, 3.6vh, 34px); font-weight: 700; letter-spacing: .6px;
  color: var(--rc-ink);
}
.rc-name-field.rc-empty::before {
  content: 'Adınızı yazın'; color: var(--rc-ink-mute); font-weight: 500;
  font-size: clamp(15px, 2.2vh, 21px); font-family: var(--rc-font);
}
.rc-name-field.rc-empty .rc-caret { display: none; }
.rc-caret {
  width: 3px; height: clamp(24px, 3.4vh, 34px); background: var(--rc-red);
  animation: rcBlink 1s steps(2, start) infinite;
}
@keyframes rcBlink { to { visibility: hidden } }

.rc-shake { animation: rcShake .4s; }
@keyframes rcShake {
  0%,100% { transform: translateX(0) }
  20% { transform: translateX(-11px) } 40% { transform: translateX(11px) }
  60% { transform: translateX(-7px) }  80% { transform: translateX(7px) }
}

.rc-kb { display: flex; flex-direction: column; gap: clamp(5px, .8vh, 9px); width: 100%; }
.rc-kb-row { display: flex; gap: clamp(5px, .7vw, 9px); justify-content: center; }

.rc-key {
  flex: 1 1 0; min-width: 0;
  min-height: clamp(46px, 7vh, 62px);
  border: 1px solid var(--rc-line); border-bottom-width: 3px;
  background: var(--rc-surface); border-radius: 11px;
  font-size: clamp(15px, 2.4vh, 22px); font-weight: 700; color: var(--rc-ink);
  cursor: pointer; transition: transform .08s, background .12s;
}
.rc-key:active {
  transform: translateY(2px); border-bottom-width: 1px;
  background: #FFF0F1; color: var(--rc-red);
}
.rc-key-wide  { flex: 2 1 0; font-size: clamp(13px, 1.9vh, 17px); }
.rc-key-space { flex: 5 1 0; font-size: clamp(13px, 1.9vh, 17px); color: var(--rc-ink-soft); }
.rc-key-del   { background: #FFF5F5; color: var(--rc-red); border-color: rgba(226,0,26,.28); }
.rc-key-ok    { background: var(--rc-success); color: #fff; border-color: #059669; }
.rc-key-ok:active { background: #059669; color: #fff; }

.rc-guest-btn {
  margin-top: 2px; background: none; border: none;
  color: var(--rc-ink-mute); font-size: 13px; font-weight: 600;
  text-decoration: underline; cursor: pointer; padding: 10px; min-height: 44px;
}
.rc-guest-btn:active { color: var(--rc-red); }

/* ═════════════════════ OYUN SONU EKRANI ═════════════════════ */
.rc-result-panel {
  width: min(760px, 96vw);
  padding: clamp(16px, 2.6vh, 30px) clamp(18px, 3vw, 38px) clamp(16px, 2.4vh, 26px);
  text-align: center; gap: clamp(6px, 1vh, 12px);
  overflow-y: auto;
}
.rc-result-badge {
  width: clamp(64px, 9.6vh, 92px); height: clamp(64px, 9.6vh, 92px);
  margin: 0 auto; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(30px, 4.8vh, 46px);
  /* Yedek: color-mix desteklemeyen eski Chromium sürümlerinde (Pi OS Bullseye)
     düz beyaz zemin kullanılır, rozet yine okunur kalır. */
  background: #FFFFFF;
  background: color-mix(in srgb, var(--rc-accent) 14%, #fff);
  border: 3px solid var(--rc-accent);
  box-shadow: 0 0 0 8px rgba(196,163,90,.10);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--rc-accent) 10%, transparent);
}
.rc-result-title {
  margin: 8px 0 0; font-family: var(--rc-head);
  font-size: clamp(22px, 3.4vh, 32px); font-weight: 800; color: var(--rc-ink);
}
.rc-result-sub { margin: 0; font-size: clamp(13px, 1.8vh, 15px); color: var(--rc-ink-soft); }

.rc-result-score {
  font-family: var(--rc-head); font-weight: 800;
  font-size: clamp(44px, 8vh, 76px); line-height: 1;
  color: var(--rc-red); margin: clamp(4px, .8vh, 10px) 0 0;
  display: flex; align-items: baseline; justify-content: center; gap: 4px;
}
.rc-result-score .rc-plus { font-size: .55em; color: var(--rc-gold); }
.rc-result-score .rc-unit {
  font-family: var(--rc-font); font-size: clamp(11px, 1.5vh, 14px);
  font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--rc-gold); margin-left: 8px;
}
.rc-score-note { font-size: 12.5px; color: var(--rc-ink-mute); font-weight: 600; }
.rc-score-note.up { color: var(--rc-success); }

.rc-result-detail {
  font-size: clamp(12px, 1.7vh, 14px); color: var(--rc-ink-soft);
  background: var(--rc-canvas); border-radius: 12px;
  padding: 10px 16px; line-height: 1.55;
}
.rc-result-detail b { color: var(--rc-ink); }

.rc-bonus-banner {
  background: linear-gradient(135deg, var(--rc-gold-light), var(--rc-gold));
  color: #241d05; font-weight: 800; font-size: clamp(13px, 1.9vh, 16px);
  padding: 12px 16px; border-radius: 14px;
  animation: rcPulse 1.1s ease-in-out infinite;
}
@keyframes rcPulse { 0%,100% { transform: scale(1) } 50% { transform: scale(1.028) } }

.rc-result-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-top: 4px;
}
.rc-stat {
  background: var(--rc-canvas); border: 1px solid var(--rc-line);
  border-radius: 14px; padding: clamp(8px, 1.3vh, 13px) 6px;
  display: flex; flex-direction: column; gap: 2px;
}
.rc-stat-val {
  font-family: var(--rc-head); font-weight: 800;
  font-size: clamp(19px, 2.9vh, 26px); color: var(--rc-ink);
}
.rc-stat-lbl {
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--rc-ink-mute);
}

/* İlerleme rozetleri: hangi oyun oynandı, kaç puan alındı */
.rc-pill-row { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.rc-pill {
  flex: 1 1 0; min-width: 84px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 8px 4px; border-radius: 12px;
  background: var(--rc-canvas); border: 1.5px solid var(--rc-line);
  opacity: .55; transition: all .25s;
}
.rc-pill.done    { opacity: 1; background: #F0FDF4; border-color: rgba(16,185,129,.45); }
.rc-pill.current { border-color: var(--rc-red); background: #FFF5F6; opacity: 1; box-shadow: 0 0 0 3px rgba(226,0,26,.10); }
.rc-pill-icon { font-size: 17px; line-height: 1.1; }
.rc-pill-name { font-size: 9.5px; font-weight: 700; color: var(--rc-ink-soft); text-align: center; }
.rc-pill-pts  { font-size: 12px; font-weight: 800; color: var(--rc-ink); font-family: var(--rc-head); }
.rc-pill.done .rc-pill-pts { color: var(--rc-success); }

/* ── Pasaportun hediye damgası (10. Yıl çarkı) ──
   Kilitli: soluk gri. Açık: altın çerçeve + nabız. Alındı: altın dolu. */
.rc-pill-gift.locked { opacity: .5; border-style: dashed; }
.rc-pill-gift.open {
  opacity: 1; background: #FFFBEB;
  border-color: var(--rc-gold); border-width: 2px;
  animation: rcGiftPulse 1.6s ease-in-out infinite;
}
.rc-pill-gift.done {
  opacity: 1; background: #FFF7E0;
  border-color: var(--rc-gold); border-width: 2px;
}
.rc-pill-gift .rc-pill-pts { color: var(--rc-gold); }
@keyframes rcGiftPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196,163,90,.45); }
  50%      { box-shadow: 0 0 0 7px rgba(196,163,90,0); }
}

/* Hediye çarkı butonu: altın, ödül töreni hissi */
.rc-btn-gift {
  background: linear-gradient(135deg, var(--rc-gold-light), var(--rc-gold)) !important;
  color: #1A1A2E !important; border-color: var(--rc-gold) !important;
  box-shadow: 0 8px 24px rgba(196,163,90,.42) !important;
}

/* ── Otomatik geçiş sayacı ──
   Ziyaretçi ekranı bırakırsa akış tıkanmasın; dokununca iptal olur. */
.rc-autonext {
  position: relative; margin-top: 10px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 11.5px; font-weight: 600; color: var(--rc-ink-mute);
}
.rc-autonext-bar {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--rc-gold); animation: rcGiftPulse 1.2s ease-in-out infinite;
}
.rc-autonext-txt b { color: var(--rc-ink-soft); font-family: var(--rc-head); }

.rc-result-actions {
  display: flex; flex-wrap: wrap; gap: 9px; justify-content: center;
  margin-top: clamp(4px, 1vh, 10px);
}

/* ═════════════════════════ BUTONLAR ═════════════════════════ */
.rc-btn {
  border: none; border-radius: 999px; cursor: pointer;
  font-family: var(--rc-font); font-weight: 700;
  font-size: clamp(13px, 1.9vh, 16px);
  padding: clamp(12px, 1.9vh, 17px) clamp(20px, 2.6vw, 32px);
  min-height: 48px;
  transition: transform .12s, box-shadow .18s, background .18s;
}
.rc-btn:active { transform: scale(.96); }
.rc-btn-primary {
  background: linear-gradient(135deg, var(--rc-red), var(--rc-red-dark));
  color: #fff; box-shadow: 0 8px 22px rgba(226,0,26,.30);
  flex: 1 1 100%;
}
.rc-btn-gold {
  background: linear-gradient(135deg, var(--rc-gold-light), var(--rc-gold));
  color: #241d05; box-shadow: 0 8px 22px rgba(196,163,90,.34);
}
.rc-btn-ghost {
  background: var(--rc-surface); color: var(--rc-ink-soft);
  border: 2px solid var(--rc-line);
}
.rc-btn-ghost:active { border-color: var(--rc-red); color: var(--rc-red); }

/* ══════════════════ BOŞTA KALMA UYARISI ══════════════════ */
/* Ekranın tam ortasında durur: altta iken oyunun içinde kayboluyordu,
   asıl işi "ekrana dokun" demek olduğu için görülmesi gerekiyor. */
.rc-idle-warn {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 1200; display: flex; align-items: center; gap: clamp(9px, 1.2vw, 14px);
  background: rgba(17,24,39,.94); color: #fff;
  padding: clamp(16px, 2.6vh, 26px) clamp(24px, 3vw, 44px); border-radius: 999px;
  font-family: var(--rc-head); font-size: clamp(15px, 2.4vh, 24px); font-weight: 700;
  box-shadow: var(--rc-shadow-lg);
  /* Kendi giriş animasyonu: rcPop'un "transform: none" bitişi
     translate(-50%,-50%)'i eziyor ve kutu ortadan kayıyordu. */
  animation: rcIdlePop .3s cubic-bezier(.34,1.56,.64,1) both;
  pointer-events: none; text-align: center;
}
@keyframes rcIdlePop {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.86); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.rc-idle-dot {
  width: clamp(11px, 1.5vh, 15px); height: clamp(11px, 1.5vh, 15px); flex: none;
  border-radius: 50%; background: var(--rc-red);
  animation: rcBlinkDot .9s ease-in-out infinite;
}
@keyframes rcBlinkDot { 0%,100% { opacity: 1 } 50% { opacity: .25 } }

/* ══════════════════════ KONFETİ KATMANI ══════════════════════ */
.rc-confetti {
  position: fixed; inset: 0; z-index: 1100; pointer-events: none;
}

/* ══════════ HAREKET AZALTMA TERCİHİ ══════════ */
@media (prefers-reduced-motion: reduce) {
  .rc-overlay, .rc-panel, .rc-bonus-banner, .rc-idle-warn { animation: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════════
   TELEFON UYUMU

   Kiosk (1920x1080, 1366x768, dikey 1080x1920) bu blokların hiçbirine
   girmez: üçünün de genişliği 640'ın, yüksekliği 500'ün üstündedir.
   Buradaki kurallar yalnızca telefonda çalışır, kiosk düzeni değişmez.

   Temel fark: kioskta sayfa asla kaymaz, her şey tek ekrana sığar.
   Telefonda sığmayan içeriğin kaydırılabilmesi gerekir.
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  :root { --rc-topbar-h: 54px; }

  /* Tek ekran kilidi açılır: sayfa dikeyde kayar.
     100dvh: telefon tarayıcısının adres çubuğu açılıp kapandıkça
     yükseklik değişir; 100vh bu durumda alttan taşma yaratır. */
  .rc-kiosk, .rc-kiosk body { height: auto; min-height: 100dvh; }
  .rc-kiosk body { overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; }

  /* Sayfaların tek ekran kapları da esner. Bu üç sınıf sırasıyla
     ana ekran, oyun sayfaları ve laboratuvardır. */
  .rc-kiosk .hub, .rc-kiosk .stage, .rc-kiosk .lab {
    height: auto !important; min-height: calc(100dvh - var(--rc-topbar-h));
  }

  /* Üst bar sıkışır: alt başlık düşer, ögeler daralır */
  .rc-topbar { gap: 8px; padding: 0 12px; }
  .rc-topbar-logo { height: 26px; }
  .rc-topbar-sub { display: none; }
  .rc-topbar-title { font-size: 14px; }
  .rc-topbar-right { gap: 8px; }
  .rc-player-chip { padding: 4px 11px; }
  .rc-player-name { font-size: 12px; max-width: 96px; }
  .rc-player-pts  { font-size: 10px; }
  .rc-home-btn { font-size: 13px; padding: 8px 13px; min-height: 40px; }

  /* Sonuç ekranı ve klavye telefonda tam genişlik kullanır */
  .rc-overlay { padding: 10px; align-items: flex-start; }
  .rc-panel { width: 100%; margin: auto 0; }
}

/* Çok dar telefonlar: sayfa başlığı yerine logo yeter, yer kalmıyor */
@media (max-width: 430px) {
  .rc-topbar-titles { display: none; }
}

/* Telefon yatay: yükseklik çok az, üst bar incelir */
@media (max-height: 500px) and (max-width: 950px) {
  :root { --rc-topbar-h: 46px; }
  .rc-kiosk, .rc-kiosk body { height: auto; min-height: 100dvh; }
  .rc-kiosk body { overflow-y: auto; overflow-x: hidden; }
  .rc-kiosk .hub, .rc-kiosk .stage, .rc-kiosk .lab {
    height: auto !important; min-height: calc(100dvh - var(--rc-topbar-h));
  }
  .rc-topbar-sub { display: none; }
  .rc-topbar-logo { height: 24px; }
}
