/* LAGOR — Araçlar: Tetris, Dama, SOS, Tavla. Tüm sınıflar g- önekli. */

.g-root {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  padding: 8px 10px 8px;
  overflow: hidden;
  background: var(--bg, #0A1020);
  color: var(--bone, #EEF2FF);
  font-family: var(--f-body, 'Figtree', system-ui, sans-serif);
  font-size: 14px;
  line-height: 1.3;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
.g-root *, .g-root *::before, .g-root *::after { box-sizing: border-box; }

/* Tam ekranda çentik / ev çubuğu boşlukları */
:fullscreen .g-root, .g-root:fullscreen,
:-webkit-full-screen .g-root {
  padding:
    calc(10px + env(safe-area-inset-top, 0px))
    calc(12px + env(safe-area-inset-right, 0px))
    calc(10px + env(safe-area-inset-bottom, 0px))
    calc(12px + env(safe-area-inset-left, 0px));
}

/* ---------- üst çubuk ---------- */
.g-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  min-width: 0;
}
.g-bar-spacer { flex: 1 1 auto; min-width: 0; }
.g-bar-label {
  font-family: var(--f-display, 'Bricolage Grotesque', Georgia, serif);
  font-size: 15px;
  color: var(--muted, #8B98B8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.g-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1 1 0;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line, #24345A);
  border-radius: 10px;
  background: var(--surface, #111B32);
  color: var(--muted, #8B98B8);
  transition: border-color .2s, color .2s;
}
.g-chip.is-on { border-color: var(--gold, #FFD84D); color: var(--bone, #EEF2FF); }
.g-chip-name {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}
.g-chip-val {
  flex: 0 0 auto;
  font-family: var(--f-display, 'Bricolage Grotesque', Georgia, serif);
  font-size: 18px;
  color: var(--bone, #EEF2FF);
  font-variant-numeric: tabular-nums;
}
.g-dot {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px rgba(10,16,32, .25);
}
.g-dot--bone { background: var(--bone, #EEF2FF); }
.g-dot--gold { background: var(--gold, #FFD84D); }

/* ---------- sahne ---------- */
.g-stage {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.g-canvas {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: block;
  touch-action: none;
  outline: none;
}

/* ---------- kontroller ---------- */
.g-controls {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  min-width: 0;
}
.g-controls:empty { display: none; }

.g-btn {
  appearance: none;
  -webkit-appearance: none;
  flex: 1 1 0;
  min-width: 0;
  min-height: 46px;
  padding: 0 8px;
  border: 1px solid var(--line, #24345A);
  border-radius: 11px;
  background: var(--surface, #111B32);
  color: var(--bone, #EEF2FF);
  font: 500 14px/1 var(--f-body, 'Figtree', system-ui, sans-serif);
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  touch-action: manipulation;
  transition: background .12s, border-color .12s, color .12s, opacity .12s;
}
.g-btn:hover { border-color: #33466F; }
.g-btn:active, .g-btn.is-down { background: var(--surface-2, #16223D); border-color: var(--gold, #FFD84D); }
.g-btn:focus-visible { outline: 2px solid var(--gold, #FFD84D); outline-offset: 1px; }
.g-btn[disabled] { opacity: .36; cursor: default; border-color: var(--line, #24345A); background: var(--surface, #111B32); }
.g-btn--gold { border-color: var(--gold, #FFD84D); color: var(--gold, #FFD84D); background: var(--gold-soft, rgba(255,216,77, .14)); }
.g-btn--gold:active { background: rgba(255,216,77, .24); }
.g-btn--sm { flex: 0 0 auto; min-height: 40px; padding: 0 13px; font-size: 13px; }
.g-btn--wide { flex: 1.6 1 0; }

/* ---------- S / O seçici ---------- */
.g-seg {
  flex: 0 0 auto;
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  border: 1px solid var(--line, #24345A);
  border-radius: 12px;
  background: var(--surface, #111B32);
}
.g-seg button {
  appearance: none;
  width: 52px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted, #8B98B8);
  font: 600 22px/1 var(--f-display, 'Bricolage Grotesque', Georgia, serif);
  cursor: pointer;
  touch-action: manipulation;
}
.g-seg button.is-on {
  border-color: var(--gold, #FFD84D);
  background: var(--gold-soft, rgba(255,216,77, .14));
  color: var(--gold, #FFD84D);
}
.g-seg button:focus-visible { outline: 2px solid var(--gold, #FFD84D); outline-offset: 1px; }

/* ---------- bitiş / duraklatma paneli ---------- */
.g-panel {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10,16,32, .74);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: g-fade .18s ease-out;
}
.g-panel-card {
  width: 100%;
  max-width: 300px;
  padding: 22px 20px 18px;
  border: 1px solid var(--line, #24345A);
  border-radius: var(--r, 14px);
  background: var(--surface, #111B32);
  text-align: center;
}
.g-panel-title {
  font-family: var(--f-display, 'Bricolage Grotesque', Georgia, serif);
  font-size: 28px;
  line-height: 1.15;
  color: var(--bone, #EEF2FF);
}
.g-panel-sub {
  margin-top: 8px;
  color: var(--muted, #8B98B8);
  font-size: 14px;
}
.g-panel-btns {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}
@keyframes g-fade { from { opacity: 0; } to { opacity: 1; } }

/* geniş ekranda çubuk ve düğmeler tahtadan taşmasın */
.g-bar, .g-controls { width: 100%; max-width: 720px; align-self: center; }

/* ---------- oyun özel ---------- */
.g-tetris .g-controls .g-btn { font-size: 13px; }
.g-sos .g-bar { gap: 6px; }
.g-tavla .g-btn--roll { flex: 1.4 1 0; }

@media (max-width: 380px) {
  .g-root { padding: 6px 6px 6px; gap: 6px; }
  .g-chip { padding: 0 8px; gap: 6px; }
  .g-btn { font-size: 13px; padding: 0 4px; }
  .g-btn--sm { padding: 0 10px; }
  .g-seg button { width: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  .g-panel { animation: none; }
}

/* ---------- Tetris dokunmatik tuş takımı: simge + kısa ad ---------- */
.g-tetris .g-controls .g-pad { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 56px; padding: 0 2px; font-size: 13px; }
.g-pad svg { width: 22px; height: 22px; stroke-width: 2.1; flex: none; }
.g-pad-l { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 10.5px; font-weight: 600; line-height: 1; letter-spacing: .02em; color: var(--muted, #8B98B8); transition: color .12s; }
.g-pad:active .g-pad-l, .g-pad.is-down .g-pad-l { color: var(--bone, #EEF2FF); }
.g-pad.is-down svg { color: var(--gold, #FFD84D); }
