/* Bridge Base Online (BBO) Tarzı Temiz Font & Beyaz Tema - Ekran Görüntüsü Uyumlu */
:root {
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --border-color: #cbd5e1;
  --border-strong: #94a3b8;
  --text-primary: #000000;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --accent-blue: #0284c7;
  --accent-gold: #d97706;
  --accent-green: #15803d;
  --accent-red: #dc2626;

  /* BBO Klasik 4 Renk Deste */
  --c-spade: #000000;    /* Pik: Siyah */
  --c-heart: #dc2626;    /* Kör: Kırmızı */
  --c-diamond: #ea580c;  /* Karo: Turuncu/Amber */
  --c-club: #16a34a;     /* Trefl: Yeşil */

  --font-bbo: Arial, Helvetica, "Nimbus Sans L", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font-bbo);
  background-color: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0;
}

button, .store-btn {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

/* Telefon Genişliği Kapsayıcı (Max 520px) */
.mobile-app-wrapper {
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  padding: 8px 10px 16px 10px;
  gap: 8px;
}

/* Üst Header: BridgeBegin + App Store & Google Play */
.compact-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 5px;
}

.version-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.2;
}

.brand-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: #000000;
  letter-spacing: -0.3px;
  font-family: var(--font-bbo);
}

.header-store-buttons {
  display: flex;
  gap: 5px;
  align-items: center;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s ease;
  line-height: 1;
}

.ios-btn {
  background: #000000;
  color: #ffffff;
  border: 1px solid #000000;
}

.gplay-btn {
  background: #f1f5f9;
  color: #000000;
  border: 1px solid var(--border-strong);
}

/* 4 Modül Sekmeleri */
.module-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.mod-tab {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 2px;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-bbo);
  cursor: pointer;
  text-align: center;
  transition: all 0.1s;
}

.mod-tab.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}

/* Modül 2 Alt Seçici (Kuzey Açışı - Büyük & BBO Renkli) */
.sub-filter-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  background: #f8fafc;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1.5px solid #64748b;
}

.filter-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #0284c7;
  letter-spacing: 0.4px;
}

.filter-buttons {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  width: 100%;
}

.filter-buttons.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.filter-btn {
  background: #ffffff;
  border: 1.5px solid #94a3b8;
  color: var(--text-primary);
  padding: 9px 2px;
  border-radius: 5px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-bbo);
  text-align: center;
  min-width: 0;
  transition: all 0.08s;
}

.filter-btn.active {
  background: #fef08a;
  color: #000000;
  border-color: #ca8a04;
  box-shadow: 0 0 0 1px #ca8a04;
}

.choose-prompt {
  background: #f8fafc;
  border: 1.5px dashed #94a3b8;
  border-radius: 6px;
  padding: 24px 12px;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 700;
  color: #475569;
}

/* Soru Sayacı & Marka Filigranı */
.meta-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 2px 0;
}

.watermark-brand {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.3px;
}

.hand-counter-badge {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

.meta-right-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.btn-share-mini {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #eff6ff;
  border: 1px solid #93c5fd;
  color: #0284c7;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-bbo);
  cursor: pointer;
  white-space: nowrap;
}

.btn-share-mini:active {
  background: #dbeafe;
}

.btn-next-mini {
  display: inline-flex;
  align-items: center;
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #15803d;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 800;
  font-family: var(--font-bbo);
  cursor: pointer;
  white-space: nowrap;
}

.btn-next-mini:active {
  background: #bbf7d0;
}

/* ============================================================== */
/* PAYLAŞILABİLİR KART: ELİNİZ (SOL) + DEKLARASYON (SAĞ) YAN YANA */
/* Ekran görüntüsü (SS) alındığında tek karede mükemmel çıkar      */
/* ============================================================== */
.board-card {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 8px;
  background: #ffffff;
  border: 1.5px solid #64748b;
  border-radius: 6px;
  padding: 8px 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  align-items: stretch;
}

.column-title {
  font-size: 0.76rem;
  font-weight: 800;
  color: #475569;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid #e2e8f0;
}

/* Sol Taraf: ELİNİZ */
.hand-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cards-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

.card-suit-line {
  display: flex;
  align-items: center;
  font-family: var(--font-bbo);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
}

.suit-glyph {
  width: 20px;
  font-size: 1.2rem;
  text-align: center;
  flex-shrink: 0;
}

.suit-s { color: var(--c-spade); }
.suit-h { color: var(--c-heart); }
.suit-d { color: var(--c-diamond); }
.suit-c { color: var(--c-club); }
.suit-nt { color: #000000; }

.cards-string {
  letter-spacing: 1.5px;
  color: #000000;
  margin-left: 3px;
  font-family: var(--font-bbo);
}

.cards-void {
  color: #94a3b8;
  font-size: 0.85rem;
  font-style: italic;
  letter-spacing: 0;
}

/* Sağ Taraf: DEKLARASYON TABLOSU (Büyük & Okunaklı) */
.auction-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 6px 7px;
}

.auction-header {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  text-align: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: #475569;
  padding: 2px 0 4px 0;
  border-bottom: 1px solid #cbd5e1;
  align-items: start;
}

.auction-header small {
  display: block;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1.1;
}

.partner-col { color: #0284c7; }
.you-col { color: #16a34a; }

.auction-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

.auction-round {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  text-align: center;
}

.auction-cell {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 4px 1px;
  border-radius: 3px;
  font-size: 0.94rem;
  font-weight: 800;
  font-family: var(--font-bbo);
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000000;
}

.auction-cell.current-turn {
  background: #fef08a;
  border: 1.5px solid #ca8a04;
  color: #854d0e;
}

/* Öğrenci cevap verdikten sonraki hücre renkleri (SS'de gözüksün) */
.auction-cell.submitted-correct {
  background: #dcfce7;
  border: 1.5px solid #16a34a;
  color: #15803d;
}

.auction-cell.submitted-wrong {
  background: #fee2e2;
  border: 1.5px solid #dc2626;
  color: #dc2626;
}

/* ============================================================== */
/* İHALE KUTUSU (Tam Genişlik & Rahat Dokunma Boyutu)             */
/* ============================================================== */
.bidding-section {
  background: #f8fafc;
  border: 1.5px solid #64748b;
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}

.bidding-top-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.bidding-top-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-mode-toggle {
  display: inline-flex;
  background: #e2e8f0;
  border-radius: 5px;
  padding: 2px;
  gap: 2px;
}

.mode-pill {
  border: none;
  background: transparent;
  color: #475569;
  font-family: var(--font-bbo);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 4px;
  cursor: pointer;
}

.mode-pill.active {
  background: #ffffff;
  color: #0284c7;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ============================================================== */
/* FİZİKSEL TURNUVA BIDDING BOX GÖRÜNÜMÜ (Kompakt Kart Destesi)   */
/* ============================================================== */
.bidding-box-view {
  display: flex;
  justify-content: center;
  padding-top: 2px;
}

.physical-box-shell {
  width: 100%;
  max-width: 325px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  filter: drop-shadow(0 3px 8px rgba(15, 23, 42, 0.14));
}

.bbox-stack {
  display: flex;
  flex-direction: column;
  padding: 0 5px;
}

.bbox-level-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  position: relative;
}

.bbox-level-row + .bbox-level-row {
  margin-top: -2px;
}

.bbox-level-row:last-child .bbox-card {
  padding-bottom: 10px;
}

.bbox-card {
  position: relative;
  border: 1px solid #cbd5e1;
  border-bottom: none;
  border-radius: 5px 5px 0 0;
  padding: 5px 2px 6px 2px;
  font-family: var(--font-bbo);
  font-size: 0.96rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  box-shadow: 0 -1px 3px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: transform 0.08s ease, filter 0.08s ease;
}

/* Her rengin kart tonu (Fiziksel Bidding Box renkleri) */
.bbox-card.card-nt {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  color: #0f172a;
}

.bbox-card.card-s {
  background: linear-gradient(180deg, #f8fbff 0%, #e0edff 100%);
  color: #0f172a;
}
.bbox-card.card-s .suit-s { color: #2563eb; }

.bbox-card.card-h {
  background: linear-gradient(180deg, #fff9fa 0%, #ffe4e6 100%);
  color: #0f172a;
}

.bbox-card.card-d {
  background: linear-gradient(180deg, #fffcf5 0%, #fef3c7 100%);
  color: #0f172a;
}

.bbox-card.card-c {
  background: linear-gradient(180deg, #f7fef9 0%, #dcfce7 100%);
  color: #0f172a;
}

.bbox-card:hover:not(.card-empty) {
  transform: translateY(-2px);
  z-index: 5;
  filter: brightness(0.97);
}

.bbox-card:active:not(.card-empty) {
  transform: translateY(1px);
}

.bbox-card.card-empty {
  visibility: hidden;
  pointer-events: none;
}

/* Ön Kısım: Kırmızı Plastik Kutu & X / Pass / XX Sekmeleri */
.bbox-tray-front {
  position: relative;
  z-index: 10;
  margin-top: -3px;
  background: linear-gradient(180deg, #c83228 0%, #9f1d15 100%);
  border-radius: 5px 5px 7px 7px;
  padding: 0 4px 4px 4px;
  border: 1px solid #7f1d1d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.tray-tabs-row {
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr;
  gap: 2px;
  margin-top: -4px;
  padding: 0 3px;
}

.tray-tab {
  border: none;
  border-radius: 6px 6px 0 0;
  font-family: var(--font-bbo);
  font-weight: 800;
  color: #ffffff;
  padding: 6px 0 8px 0;
  font-size: 0.94rem;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.tab-x {
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
  color: rgba(255, 255, 255, 0.7);
  cursor: default;
}

.tab-pass {
  background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
  cursor: pointer;
  letter-spacing: 0.5px;
  font-size: 1rem;
}

.tab-pass:hover {
  filter: brightness(1.06);
}

.tab-pass:active {
  transform: translateY(1px);
}

.tab-xx {
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  color: rgba(255, 255, 255, 0.7);
  cursor: default;
}

.tray-pocket-lip {
  height: 16px;
  background: linear-gradient(180deg, #b92b22 0%, #8f1811 100%);
  border-top: 1.5px solid rgba(255, 255, 255, 0.22);
  border-radius: 2px 2px 4px 4px;
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.2);
}

.keypad-view {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.keypad-preview-wrap {
  display: flex;
  justify-content: center;
  padding: 2px 0;
}

.keypad-preview-box {
  min-width: 96px;
  height: 34px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  font-family: var(--font-bbo);
  font-size: 1.25rem;
  font-weight: 800;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  letter-spacing: 0.5px;
}

.keypad-preview-box.has-value {
  background: #fef9c3;
  border-color: #eab308;
  color: #000000;
}

.section-micro-title {
  font-size: 0.75rem;
  font-weight: 800;
  color: #475569;
}

.preview-mini-badge {
  font-family: var(--font-bbo);
  font-size: 0.95rem;
  font-weight: 800;
  color: #000000;
  background: #fef08a;
  border: 1px solid #ca8a04;
  padding: 1px 8px;
  border-radius: 3px;
  min-width: 34px;
  text-align: center;
}

.bidding-row {
  display: grid;
  gap: 4px;
}

/* Sayılar 1..7 */
.numbers-row {
  grid-template-columns: repeat(7, 1fr);
}

.num-btn {
  background: #ffffff;
  border: 1px solid #94a3b8;
  color: #000000;
  padding: 8px 0;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 800;
  font-family: var(--font-bbo);
  cursor: pointer;
  transition: all 0.05s;
}

.num-btn:active, .num-btn.selected {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

/* Renkler ♣ ♦ ♥ ♠ NT */
.suits-row {
  grid-template-columns: repeat(5, 1fr);
}

.suit-btn {
  background: #ffffff;
  border: 1px solid #94a3b8;
  padding: 7px 0;
  border-radius: 4px;
  font-size: 1.22rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-bbo);
}

.suit-btn.highlight {
  border-color: #0284c7;
  background: #f0f9ff;
  box-shadow: 0 0 4px rgba(2, 132, 199, 0.4);
}

/* Aksiyonlar: Sil & PASS */
.actions-row {
  grid-template-columns: 1fr 2fr;
}

.action-btn {
  border: none;
  padding: 8px 0;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  font-family: var(--font-bbo);
}

.btn-clear {
  background: #fee2e2;
  border: 1px solid #f87171;
  color: #dc2626;
}

.btn-pass {
  background: #dcfce7;
  border: 1.5px solid #22c55e;
  color: #15803d;
  letter-spacing: 1px;
}

/* Geri Bildirim Paneli */
.feedback-panel {
  background: #f0fdf4;
  border: 1.5px solid #16a34a;
  border-radius: 6px;
  padding: 8px 10px;
  animation: pop-in 0.15s ease-out;
}

.feedback-panel.wrong {
  background: #fef2f2;
  border-color: #dc2626;
}

.feedback-result {
  font-size: 0.92rem;
  font-weight: 800;
  margin-bottom: 3px;
  font-family: var(--font-bbo);
}

.res-correct { color: #15803d; }
.res-wrong { color: #dc2626; }

.feedback-text {
  font-size: 0.8rem;
  line-height: 1.4;
  color: #000000;
  margin-bottom: 6px;
  font-family: var(--font-bbo);
}

.feedback-actions-row {
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: 6px;
}

.btn-share-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #ffffff;
  color: #0284c7;
  border: 1.5px solid #0284c7;
  padding: 11px 6px;
  border-radius: 5px;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: var(--font-bbo);
}

.btn-next {
  width: 100%;
  background: #16a34a;
  color: #ffffff;
  border: none;
  padding: 11px;
  border-radius: 5px;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: var(--font-bbo);
}

.share-toast {
  text-align: center;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 6px;
  animation: pop-in 0.15s ease-out;
}

/* Alt Sade Alan */
.compact-footer {
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid var(--border-color);
}

.copyright {
  text-align: center;
  font-size: 0.68rem;
  color: #64748b;
}

.copyright a {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

/* ============================================================== */
/* DAR TELEFON EKRANLARI (iPhone / Android 360px-440px)           */
/* Yatay taşma olmaması için kesin uyum kuralları                 */
/* ============================================================== */
@media (max-width: 440px) {
  .mobile-app-wrapper {
    padding: 6px 8px 14px 8px;
    gap: 6px;
    border-left: none;
    border-right: none;
  }

  .brand-title {
    font-size: 0.95rem;
  }

  .store-btn {
    padding: 4px 5px;
    font-size: 0.66rem;
    gap: 3px;
  }

  .mod-tab {
    font-size: 0.66rem;
    padding: 6px 1px;
    line-height: 1.15;
    min-width: 0;
  }

  .filter-btn {
    padding: 8px 1px;
    font-size: 0.92rem;
  }

  .watermark-brand {
    font-size: 0.6rem;
    white-space: nowrap;
  }

  .btn-share-mini, .btn-next-mini, .hand-counter-badge {
    font-size: 0.64rem;
    padding: 2px 6px;
  }

  .board-card {
    grid-template-columns: 1fr 1.12fr;
    gap: 5px;
    padding: 6px;
  }

  .card-suit-line {
    font-size: 0.94rem;
  }

  .suit-glyph {
    width: 17px;
    font-size: 1.08rem;
  }

  .cards-string {
    letter-spacing: 0.8px;
  }

  .auction-column {
    padding: 4px 5px;
  }

  .auction-header {
    font-size: 0.72rem;
  }

  .auction-header small {
    font-size: 0.54rem;
  }

  .auction-cell {
    font-size: 0.8rem;
    min-height: 26px;
    padding: 3px 0;
    min-width: 0;
  }
}

/* ============================================================== */
/* ALT REHBER & SEO BİLGİ ALANI (Oyun ekranının altında sade)     */
/* ============================================================== */
.seo-guide-section {
  margin-top: 10px;
  padding: 10px 10px 8px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: #334155;
  font-size: 0.78rem;
  line-height: 1.48;
}

.seo-guide-section h1 {
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 5px;
}

.seo-guide-section p {
  margin-bottom: 6px;
}

.seo-guide-section details summary {
  cursor: pointer;
  font-weight: 700;
  color: #0284c7;
  padding: 2px 0;
  list-style: none;
}

.seo-guide-section details ul {
  margin: 6px 0 6px 16px;
}

.seo-guide-section details li {
  margin-bottom: 4px;
}

.seo-guide-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #e2e8f0;
}

.seo-guide-links a {
  color: #0284c7;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.75rem;
}
