/*
 * Yellow Blast tasarımı: yumuşak 3B kil kartlar ve alttan kalın kenarlı (basınca çöken) düğmeler.
 * Renkler logodan: sarı #ffc912 + açık temada #f2f2f2 zemin, koyu temada antrasit. Başlıklar Baloo 2, metin Nunito.
 * --blue adı eski koddan kalma; artık yazı vurgusu demek (açık temada okunur koyu altın, koyu temada logo sarısı).
 */
:root {
  --bg: #f2f2f2;
  --blob-1: rgba(255, 201, 18, .2);
  --blob-2: rgba(255, 201, 18, .07);
  --blob-3: rgba(255, 255, 255, .7);
  --bg-ring: rgba(255, 201, 18, .28);
  --paint:
    radial-gradient(70vmax 46vmax at -10% -8%, var(--blob-1), transparent 62%),
    radial-gradient(56vmax 44vmax at 112% 18%, var(--blob-2), transparent 62%),
    radial-gradient(64vmax 46vmax at 30% 118%, var(--blob-3), transparent 62%),
    var(--bg);
  --surface: #ffffff;
  --text: #202020;
  --text-2: #5f5f64;
  --text-3: #8e8e93;
  --border: #dedede;
  --ledge: #e1e1e1;
  --fill: rgba(32, 32, 32, .06);
  --fill-2: rgba(32, 32, 32, .11);
  --blue: #9c6d00;
  --blue-hover: #835b00;
  --orange: #f0711f;
  --yellow: #ffc912;
  --focus: 0 0 0 4px rgba(255, 201, 18, .5);
  --radius: 24px;
  --shadow: 0 5px 0 var(--ledge), 0 14px 30px rgba(0, 0, 0, .06);
  --clay: inset 0 2px 0 rgba(255, 255, 255, .9), inset 0 -3px 8px rgba(0, 0, 0, .03);
  --ease: cubic-bezier(.3, .7, .4, 1);
  --bounce: cubic-bezier(.34, 1.56, .64, 1);
  --font: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Baloo 2", "Nunito", ui-rounded, system-ui, sans-serif;

  --board-size: min(94vw, 470px, calc((100vh - 290px) / 1.4));
  --mini: calc(var(--board-size) / 17);
  --mini-gap: 2px;
  --green: #17a865;
  --red: #f0365a;

  --btn: #ffc912;
  --btn-hover: #ffd23d;
  --btn-active: #f5bd00;
  --btn-text: #202020;
  --btn-ledge: #d9a300;
  --switch: #ffc912;
  --bar: rgba(242, 242, 242, .88);
  --bar-glow: rgba(255, 201, 18, .18);
  --hairline: rgba(32, 32, 32, .12);
  --hairline-soft: rgba(32, 32, 32, .06);
  --cell: #ececec;
  --cell-inset: inset 0 2px 3px rgba(0, 0, 0, .07);
  --sheet: #ffffff;
  --glass: rgba(255, 255, 255, .92);
  --glass-strong: rgba(255, 255, 255, .97);
  --pop-shadow: 0 5px 0 var(--ledge), 0 20px 44px rgba(0, 0, 0, .14);
  --sheet-shadow: 0 8px 0 var(--ledge), 0 30px 70px rgba(0, 0, 0, .22);
  --scrim: rgba(20, 20, 20, .45);
  --dim: rgba(242, 242, 242, .6);
  --glow: #ffffff;
  --toast: rgba(32, 32, 32, .95);
  --track: rgba(32, 32, 32, .12);
  --seg-active: #ffffff;
  --gold-bg: rgba(255, 201, 18, .3);
  --gold-text: #8f6400;
  --gold-text-2: #6f4e00;
  --blue-tint: rgba(255, 201, 18, .18);
  --orange-tint: rgba(240, 113, 31, .12);
  --green-tint: rgba(23, 168, 101, .13);
  --red-tint: rgba(240, 54, 90, .1);
  --list-sep: rgba(32, 32, 32, .12);
}

:root[data-theme="dark"] {
  --bg: #1f1f21;
  --blob-1: rgba(255, 201, 18, .08);
  --blob-2: rgba(255, 201, 18, .035);
  --blob-3: rgba(255, 255, 255, .025);
  --bg-ring: rgba(255, 201, 18, .22);
  --surface: #2c2c2f;
  --text: #f2f2f2;
  --text-2: #b5b5ba;
  --text-3: #86868b;
  --border: #404044;
  --ledge: #141416;
  --fill: rgba(255, 255, 255, .07);
  --fill-2: rgba(255, 255, 255, .12);
  --blue: #ffc912;
  --blue-hover: #ffd546;
  --orange: #ff9f5a;
  --green: #3ddc97;
  --red: #ff5c7a;
  --focus: 0 0 0 4px rgba(255, 201, 18, .4);
  --shadow: 0 5px 0 var(--ledge), 0 16px 34px rgba(0, 0, 0, .4);
  --clay: inset 0 2px 0 rgba(255, 255, 255, .05), inset 0 -3px 8px rgba(0, 0, 0, .15);

  --btn-ledge: #a87f00;
  --bar: rgba(31, 31, 33, .88);
  --bar-glow: rgba(255, 201, 18, .06);
  --hairline: rgba(255, 255, 255, .12);
  --hairline-soft: rgba(255, 255, 255, .06);
  --cell: #3a3a3e;
  --cell-inset: inset 0 2px 4px rgba(0, 0, 0, .35);
  --sheet: #2c2c2f;
  --glass: rgba(44, 44, 47, .92);
  --glass-strong: rgba(44, 44, 47, .97);
  --pop-shadow: 0 5px 0 var(--ledge), 0 20px 44px rgba(0, 0, 0, .5);
  --sheet-shadow: 0 8px 0 var(--ledge), 0 30px 70px rgba(0, 0, 0, .6);
  --scrim: rgba(0, 0, 0, .6);
  --dim: rgba(31, 31, 33, .55);
  --glow: #1f1f21;
  --toast: rgba(60, 60, 64, .97);
  --track: rgba(255, 255, 255, .16);
  --seg-active: #47474c;
  --gold-bg: rgba(255, 201, 18, .16);
  --gold-text: #ffd546;
  --gold-text-2: #ffd546;
  --blue-tint: rgba(255, 201, 18, .14);
  --orange-tint: rgba(255, 159, 90, .16);
  --green-tint: rgba(61, 220, 151, .15);
  --red-tint: rgba(255, 92, 122, .16);
  --list-sep: rgba(255, 255, 255, .1);
}

h1, h2, h3,
.score, .final-score, .countdown span, .room-code, .hud-score, .praise-main,
.game-info strong, .mode-text strong, .lobby-title, .elo-text strong, .res-elo strong, .res-player strong {
  font-family: var(--font-display);
}

.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }

@supports (height: 100dvh) {
  :root {
    --board-size: min(94vw, 470px, calc((100dvh - 290px) / 1.4));
  }
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; overscroll-behavior: none; }

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: var(--paint);
  isolation: isolate;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Arka plan: tek katman ızgara + nabız ---------- */

.bg-fx {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 40%, #000 28%, transparent 78%);
  mask-image: radial-gradient(120% 90% at 50% 40%, #000 28%, transparent 78%);
}
.bg-fx::before {
  content: "";
  position: absolute;
  inset: -40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' fill='none'%3E%3Crect x='8' y='8' width='24' height='24' rx='7' fill='%23ffc912' fill-opacity='.16'/%3E%3Crect x='44' y='44' width='20' height='20' rx='6' fill='%23ffc912' fill-opacity='.08'/%3E%3C/svg%3E");
  background-size: 72px 72px;
  background-repeat: repeat;
  transform-origin: 50% 42%;
  animation: bg-fade 9s ease-in-out infinite, bg-breathe 14s ease-in-out infinite alternate;
}
:root[data-theme="dark"] .bg-fx::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' fill='none'%3E%3Crect x='8' y='8' width='24' height='24' rx='7' fill='%23ffffff' fill-opacity='.075'/%3E%3Crect x='44' y='44' width='20' height='20' rx='6' fill='%23ffc912' fill-opacity='.08'/%3E%3C/svg%3E");
}
.bg-fx i {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 18vmax;
  height: 18vmax;
  margin: -9vmax 0 0 -9vmax;
  border-radius: 50%;
  border: 2px solid var(--bg-ring);
  opacity: 0;
  animation: bg-pulse 7s ease-out infinite;
}
.bg-fx i::before,
.bg-fx i::after {
  content: "";
  position: absolute;
  inset: -28%;
  border-radius: 50%;
  border: 1.5px solid var(--bg-ring);
  opacity: 0;
  animation: bg-pulse 7s ease-out infinite;
}
.bg-fx i::before { animation-delay: 1.4s; }
.bg-fx i::after { inset: -56%; animation-delay: 2.8s; }
@keyframes bg-fade {
  0%, 100% { opacity: .45; }
  50% { opacity: 1; }
}
@keyframes bg-breathe {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}
@keyframes bg-pulse {
  0% { transform: scale(.55); opacity: .55; }
  70% { opacity: .12; }
  100% { transform: scale(2.4); opacity: 0; }
}
body.in-match .bg-fx { opacity: .4; }
@media (prefers-reduced-motion: reduce) {
  .bg-fx::before, .bg-fx i, .bg-fx i::before, .bg-fx i::after { animation: none; }
  .bg-fx::before { opacity: .7; transform: none; }
  .bg-fx i, .bg-fx i::before, .bg-fx i::after { opacity: 0; }
}

p { margin: 0; }
img { display: block; max-width: 100%; }
.hidden, [hidden] { display: none !important; }
button { touch-action: manipulation; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  font: 800 15px/1 var(--font);
  letter-spacing: .01em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .12s var(--ease), box-shadow .12s var(--ease), background-color .2s, color .2s, opacity .2s;
}
.btn-sm { min-height: 32px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
.btn-lg { min-height: 50px; padding: 0 24px; border-radius: 17px; font-size: 17px; }
.btn-block { width: 100%; }
.btn-primary {
  background: var(--btn);
  color: var(--btn-text);
  box-shadow: 0 4px 0 var(--btn-ledge), inset 0 2px 0 rgba(255, 255, 255, .55);
}
.btn-primary:hover { background: var(--btn-hover); }
.btn-primary:active {
  background: var(--btn-active);
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--btn-ledge), inset 0 2px 0 rgba(255, 255, 255, .4);
}
.btn-secondary {
  background: var(--surface);
  color: var(--blue);
  box-shadow: 0 4px 0 var(--ledge), inset 0 0 0 2px var(--fill-2);
}
.btn-secondary:hover { background: color-mix(in srgb, var(--blue) 6%, var(--surface)); }
.btn-secondary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ledge), inset 0 0 0 2px var(--fill-2); }
.btn-plain { min-height: 32px; padding: 0 8px; background: none; color: var(--blue); }
.btn-plain:hover { opacity: .75; }
.btn-danger { color: var(--red); }
.btn:disabled { opacity: .45; cursor: default; pointer-events: none; }
.btn.busy { position: relative; color: transparent !important; opacity: 1; }
.btn.busy::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-color: rgba(32, 32, 32, .85) rgba(32, 32, 32, .85) rgba(32, 32, 32, .2) rgba(32, 32, 32, .2);
  animation: spin .7s linear infinite;
}
.btn-secondary.busy::after, .btn-plain.busy::after {
  border-color: var(--blue) var(--blue) var(--track) var(--track);
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--track);
  border-top-color: var(--text-2);
  vertical-align: -4px;
  animation: spin .8s linear infinite;
}
.spinner.big { width: 30px; height: 30px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn:focus-visible, .icon-btn:focus-visible { outline: 0; box-shadow: var(--focus); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  color: var(--blue);
  box-shadow: 0 3px 0 var(--ledge), inset 0 0 0 2px var(--hairline-soft);
  cursor: pointer;
  transition: transform .12s var(--ease), box-shadow .12s var(--ease), background-color .2s, color .2s;
}
.icon-btn:hover { background: color-mix(in srgb, var(--blue) 8%, var(--surface)); }
.icon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ledge), inset 0 0 0 2px var(--hairline-soft); }
.icon-btn .off, .icon-btn.muted .on { display: none; }
.icon-btn.muted .off { display: inline; }
.icon-btn.muted { color: var(--text-2); }

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .01em;
}
.pill-accent { background: var(--orange-tint); color: var(--orange); }
.pill-good { background: var(--green-tint); color: var(--green); }
.pill-bad { background: var(--red-tint); color: var(--red); }

/* ---------- Navigation bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  flex: none;
  padding-top: env(safe-area-inset-top);
  background:
    radial-gradient(320px 130px at 150px 60%, var(--bar-glow), transparent 70%),
    var(--bar);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 5px 0 var(--ledge), 0 16px 34px rgba(0, 0, 0, .12), var(--clay);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 82px;
  padding: 0 28px 0 32px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 14px 0 13px;
  border-radius: 15px;
  background: var(--fill);
  color: var(--blue);
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s, transform .25s var(--bounce);
}
.nav-back:hover { background: var(--fill-2); transform: translateX(-2px); }
body.in-match .nav-back { display: none !important; }
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}
.logo-full, .logo-icon { flex: none; transition: transform .35s var(--bounce); }
.logo-full { width: auto; height: 54px; }
.logo-icon { display: none; width: 50px; height: 50px; }
.brand:hover .logo-full, .brand:hover .logo-icon { transform: rotate(-3deg) scale(1.04); }
.brand-text {
  display: flex;
  align-items: center;
  white-space: nowrap;
}
.brand-text small {
  --g: #f5b200;
  padding: 5px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--g) 16%, var(--surface));
  color: color-mix(in srgb, var(--g) 72%, var(--text));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--g) 28%, transparent), 0 3px 0 color-mix(in srgb, var(--g) 22%, var(--ledge));
  font: 700 15px / 1.2 var(--font-display);
}
.menu-wrap { position: relative; flex: none; }
.menu-btn { position: relative; width: 48px; height: 48px; border-radius: 17px; }
.menu-btn.open { background: color-mix(in srgb, var(--blue) 10%, var(--surface)); }
.menu-btn .badge { position: absolute; top: -5px; right: -6px; box-shadow: 0 0 0 2px var(--bg); }
.top-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: max-content;
  min-width: 230px;
  max-width: calc(100vw - 20px);
  padding: 8px;
  border-radius: 20px;
  background: var(--sheet);
  box-shadow: var(--sheet-shadow), var(--clay);
  transform-origin: top right;
  animation: menu-in .18s var(--ease);
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(.96); } }
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 6px 12px 6px 8px;
  border: 0;
  border-radius: 14px;
  background: none;
  color: var(--text);
  font: 800 15px var(--font);
  text-align: left;
  cursor: pointer;
  transition: background-color .15s;
}
.menu-item:hover { background: var(--fill); }
.menu-item:focus-visible { outline: 0; box-shadow: var(--focus); }
.mi-icon { display: grid; flex: none; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--fill); color: var(--blue); }
.mi-label { flex: 1; white-space: nowrap; }
.mi-val { padding: 3px 8px; border-radius: 8px; background: var(--fill); color: var(--blue); font-size: 12px; letter-spacing: .06em; }
.mi-switch { position: relative; flex: none; width: 40px; height: 24px; border-radius: 12px; background: var(--fill-2); transition: background-color .2s; }
.mi-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s var(--ease); }
.menu-item[aria-checked="true"] .mi-switch { background: var(--switch); }
.menu-item[aria-checked="true"] .mi-switch::after { transform: translateX(16px); }
.logout-item { position: relative; margin-top: 7px; color: var(--red); }
.logout-item::before { content: ""; position: absolute; top: -5px; left: 10px; right: 10px; height: 1px; background: var(--hairline-soft); }
.logout-item .mi-icon { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.logout-item:hover { background: color-mix(in srgb, var(--red) 8%, transparent); }
body.in-match .logout-item, body.in-match .admin-item { display: none; }
.admin-item .mi-icon { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }

.site-banner {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  width: min(100% - 24px, 760px);
  margin: 12px auto 0;
  padding: 10px 10px 10px 16px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--blue) 12%, var(--surface));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--blue) 22%, transparent);
  color: var(--text);
}
.site-banner.warn { background: var(--gold-bg); box-shadow: inset 0 0 0 2px color-mix(in srgb, #f5b200 40%, transparent); }
.site-banner .sb-icon { flex: none; color: var(--blue); }
.site-banner.warn .sb-icon { color: var(--gold-text-2); }
.site-banner p { flex: 1; margin: 0; font-size: 14px; font-weight: 700; line-height: 1.4; }
.sb-close {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--text-2);
  cursor: pointer;
}
.sb-close:hover { background: var(--fill); color: var(--text); }
body.in-match .site-banner { display: none; }
.sound-btn .off, .sound-btn.muted .on { display: none; }
.sound-btn.muted .off { display: inline; }
.sound-btn.muted .mi-icon { color: var(--text-2); }
.topbar-right { display: flex; align-items: center; gap: 12px; flex: none; }
.login-btn { min-height: 48px; padding: 0 20px 0 16px; border-radius: 17px; gap: 8px; font-size: 16px; }
.login-btn[hidden], body.in-match .login-btn { display: none; }

/* ---------- Layout ---------- */

.app {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 12px max(12px, env(safe-area-inset-bottom));
}
.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}
body.in-match .solo-only { display: none !important; }

/* ---------- Scores ---------- */

.scores {
  width: var(--board-size);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
}
.best {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  justify-self: start;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--gold-bg);
  color: var(--gold-text);
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.score-wrap { text-align: center; }
.eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--blue);
}
.score {
  font-size: clamp(38px, 10vw, 52px);
  font-weight: 700;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 3px 0 var(--btn);
}
.score.bump { animation: bump .3s var(--ease); }
@keyframes bump { 40% { transform: scale(1.12); } }

/* ---------- Board ---------- */

.board-wrap { position: relative; }

.board {
  width: var(--board-size);
  height: var(--board-size);
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 4px;
  padding: 10px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--clay);
  transition: filter .6s;
  touch-action: none;
}
.board.over { filter: grayscale(.9) opacity(.75); }
.board.shake { animation: shake .4s; }
@keyframes shake {
  20% { transform: translate(-5px, 2px); }
  40% { transform: translate(5px, -2px); }
  60% { transform: translate(-3px, 1px); }
  80% { transform: translate(3px, -1px); }
}

.cell {
  border-radius: 9px;
  background: var(--cell);
  box-shadow: var(--cell-inset);
}

.block {
  --bev: 3px;
  border-radius: 9px;
  background: radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 52%), var(--c);
  box-shadow:
    inset 0 calc(var(--bev) * -1.3) 0 rgba(0, 0, 0, .16),
    inset 0 2px 0 rgba(255, 255, 255, .5),
    0 2px 3px rgba(32, 32, 32, .14);
}

.cell.ghost {
  background: var(--c);
  opacity: .35;
  box-shadow: none;
}

.cell.highlight {
  opacity: 1;
  background: linear-gradient(180deg, rgba(255, 255, 255, .4) 0%, rgba(255, 255, 255, 0) 60%), var(--c);
  box-shadow:
    inset 0 -3px 0 rgba(0, 0, 0, .14),
    inset 0 1px 0 rgba(255, 255, 255, .5),
    0 0 12px var(--c);
}

.cell.placed { animation: place .22s var(--ease); }
@keyframes place {
  from { transform: scale(.75); }
  to { transform: scale(1); }
}

.cell.clearing { animation: clear .45s ease-in both; }
@keyframes clear {
  0% { transform: scale(1); filter: brightness(1); }
  35% { transform: scale(1.12); filter: brightness(1.35); }
  100% { transform: scale(0); opacity: 0; }
}

/* ---------- Tray ---------- */

.tray {
  width: var(--board-size);
  height: calc(var(--board-size) * .36);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  touch-action: none;
}
.slot {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
}
.slot.dragging .piece { opacity: 0; }

.piece {
  display: grid;
  transition: transform .2s var(--ease), opacity .2s, filter .2s;
}
.tray .block { --bev: 2px; border-radius: 5px; }
.slot:hover .piece:not(.unfit) { transform: scale(1.06); }
.piece.unfit { opacity: .3; filter: grayscale(1); }
.piece.appear { animation: appear .35s cubic-bezier(.2, 1.4, .4, 1) backwards; }
@keyframes appear { from { transform: scale(0); opacity: 0; } }

.drag {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  pointer-events: none;
  will-change: transform;
}
.drag .piece {
  animation: lift .12s var(--ease);
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .18));
}
@keyframes lift { from { transform: scale(.55); } }

.hint {
  max-width: var(--board-size);
  font-size: 13px;
  line-height: 1.38;
  text-align: center;
  color: var(--text-2);
  letter-spacing: 0;
}

/* ---------- Effects ---------- */

.fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.float-score {
  position: absolute;
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--text);
  text-shadow: 0 0 6px var(--glow), 0 0 2px var(--glow);
  font-variant-numeric: tabular-nums;
  animation: floatUp .9s var(--ease) forwards;
}
@keyframes floatUp {
  0% { transform: translate(-50%, -50%) scale(.6); opacity: 0; }
  20% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
  100% { transform: translate(-50%, -160%) scale(1); opacity: 0; }
}

.praise {
  position: absolute;
  left: 50%;
  top: 45%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 28px;
  border-radius: 26px;
  white-space: nowrap;
  background: var(--glass-strong);
  box-shadow: var(--pop-shadow), inset 0 0 0 3px var(--btn);
  animation: praise 1.3s var(--ease) forwards;
}
.praise-main {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(26px, 8vw, 34px);
  font-weight: 700;
  line-height: 1.1;
}
.praise-main::before {
  content: "";
  flex: none;
  width: .8em;
  height: .8em;
  background: url("assets/favicon.png") center / contain no-repeat;
}
.praise-combo {
  font-size: 15px;
  font-weight: 800;
  color: var(--blue);
}
@keyframes praise {
  0% { transform: translate(-50%, -50%) scale(.6); opacity: 0; }
  18% { transform: translate(-50%, -50%) scale(1.04); opacity: 1; }
  30% { transform: translate(-50%, -50%) scale(1); }
  80% { transform: translate(-50%, -55%); opacity: 1; }
  100% { transform: translate(-50%, -70%); opacity: 0; }
}

/* ---------- Game over sheet ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow-y: auto;
  background: var(--scrim);
  animation: sheet-fade .3s var(--ease);
}
.overlay > .sheet { margin: auto; }
.ask-overlay { z-index: 450; }
.ask-sheet { max-width: 360px; padding: 30px 26px 24px; }
.ask-sheet h2 { font-size: 22px; text-wrap: balance; }
.ask-sheet p { margin: 10px 0 0; color: var(--text-2); font-size: 15px; line-height: 1.45; }
.ask-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.ask-actions .btn { min-width: 0; }

.crop-overlay { z-index: 440; }
.crop-sheet { max-width: 380px; padding: 26px 22px 22px; }
.crop-sheet h2 { font-size: 22px; }
.crop-hint { margin: 6px 0 16px; color: var(--text-2); font-size: 14px; line-height: 1.4; }
.crop-stage {
  position: relative;
  width: min(300px, 100%);
  aspect-ratio: 1;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 20px;
  background: var(--fill-2);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
}
.crop-stage.dragging { cursor: grabbing; }
.crop-stage:focus-visible { box-shadow: 0 0 0 3px var(--yellow); }
.crop-img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  transform-origin: 0 0;
  pointer-events: none;
  -webkit-user-drag: none;
}
.crop-frame {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 33%;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .45), inset 0 0 0 2px rgba(255, 255, 255, .85);
  pointer-events: none;
}
.crop-zoom { display: flex; align-items: center; gap: 10px; width: min(300px, 100%); margin: 16px auto 0; color: var(--text-2); }
.crop-zoom svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.crop-zoom input { flex: 1; min-width: 0; margin: 0; accent-color: var(--yellow); cursor: pointer; }
.sheet {
  width: 100%;
  max-width: 380px;
  padding: 38px 34px 30px;
  border-radius: 30px;
  background: var(--sheet);
  text-align: center;
  box-shadow: var(--sheet-shadow), var(--clay);
  animation: sheet-in .4s var(--bounce);
}
@keyframes sheet-in { from { opacity: 0; transform: translateY(18px) scale(.9); } }
@keyframes sheet-fade { from { opacity: 0; } }

.sheet .logo-mark { display: block; margin: 0 auto 16px; animation: wiggle 1.4s .3s var(--ease); }
@keyframes wiggle { 20% { transform: rotate(-10deg) scale(1.08); } 40% { transform: rotate(8deg); } 60% { transform: rotate(-4deg); } 80% { transform: rotate(0); } }
.sheet h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
  font-weight: 700;
}
.final-label {
  margin-top: 18px;
  font-size: 12px;
  font-weight: 800;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: .1em;
}
.final-score {
  font-size: 58px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 0 var(--btn);
}
#newBest { margin-top: 6px; }
.final-best {
  margin: 10px 0 26px;
  font-size: 15px;
  color: var(--text-2);
  letter-spacing: 0;
}

/* ---------- Install sheet ---------- */

.sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: var(--fill);
  color: var(--text-2);
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.sheet-close:hover { background: var(--fill-2); color: var(--text); }
/* ---------- Online: alt düğmeler ---------- */

.bottom-actions {
  display: flex;
  justify-content: center;
  min-height: 44px;
}
.online-btn { box-shadow: 0 4px 0 var(--btn-ledge), 0 12px 26px rgba(255, 170, 0, .32), inset 0 2px 0 rgba(255, 255, 255, .55); }
.restart-btn { gap: 8px; }
.guide-btn { width: 50px; padding: 0; }
body[data-game="hub"] .guide-btn, body.in-match .guide-btn { display: none; }

/* ---------- Oyun rehberi ve ana sayfa tanıtımı ---------- */

.guide { text-align: left; user-select: text; -webkit-user-select: text; }
.guide h1 { margin: 0; font: 700 26px / 1.15 var(--font-display); text-wrap: balance; }
.guide h2 { margin: 22px 0 8px; font: 700 18px / 1.2 var(--font-display); }
.guide p, .guide li { color: var(--text-2); font-size: 15px; line-height: 1.55; }
.guide p + p { margin-top: 8px; }
.guide .guide-intro { margin-top: 10px; color: var(--text); }
.guide ul { margin: 0; padding-left: 20px; }
.guide li + li { margin-top: 4px; }
.guide a { color: var(--blue); font-weight: 800; text-decoration: none; }
.guide a:hover { text-decoration: underline; }
.guide .guide-games { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.guide .guide-games li { margin: 0; }
.guide .guide-games a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 12px; background: var(--fill); color: var(--text); font-size: 14px; }
.guide .guide-games a:hover { background: var(--fill-2); text-decoration: none; }
.guide .guide-all { display: inline-block; margin-top: 12px; }
.guide details { border-top: 1.5px solid var(--hairline); }
.guide details:last-child { border-bottom: 1.5px solid var(--hairline); }
.guide summary { padding: 12px 4px; font-weight: 800; cursor: pointer; }
.guide details p { padding: 0 4px 12px; }

.guide-sheet { position: relative; max-width: 560px; padding: 34px 28px 28px; }
.guide-sheet .guide h1 { padding-right: 36px; }

.hub-about {
  max-width: 820px;
  margin: 48px auto 0;
  padding: 28px 30px;
  border-radius: 30px;
  background: var(--surface);
  box-shadow: var(--clay);
}
.hub-about:empty { display: none; }
@media (max-width: 480px) {
  .hub-about { margin-top: 32px; padding: 22px 20px; border-radius: 24px; }
  .guide-sheet { padding: 30px 20px 22px; }
}

body.in-match .scores,
body.in-match .hint,
body.in-match #restartBtn { display: none !important; }

/* ---------- Online: maç göstergesi ---------- */

.match-hud {
  width: min(94vw, 470px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 62px;
}
.hud-side { display: flex; flex-direction: column; min-width: 0; }
.hud-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-2);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.hud-score {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.hud-me .hud-name { color: var(--blue); }
.hud-center { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.hud-mode {
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--btn);
  color: var(--btn-text);
  box-shadow: 0 2px 0 var(--btn-ledge);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.hud-timer {
  min-height: 22px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.hud-timer.urgent { color: var(--red); animation: tick 1s infinite; }
.hud-lvl { display: inline-block; margin-right: 5px; vertical-align: -5px; line-height: 0; }
.hud-elo {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--fill);
  font-size: 11px;
  font-weight: 800;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- ELO seviye rozeti: altıgen kalkan ---------- */

.lvl-badge { display: block; flex: none; overflow: visible; }
.lvl-badge text { font-family: var(--font-display); font-weight: 700; }
:root[data-theme="dark"] .lvl-badge > path:first-of-type { stroke: #4a4a4f; }

.elo-card {
  --lvl: #ffc800;
  position: relative;
  margin-top: 12px;
  padding: 16px 16px 14px;
  overflow: hidden;
  border-radius: var(--radius);
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--lvl) 24%, transparent), transparent 55%),
    var(--surface);
  box-shadow: var(--shadow), var(--clay);
}
.elo-main { display: flex; align-items: center; gap: 14px; }
.elo-badge { line-height: 0; filter: drop-shadow(0 4px 0 rgba(32, 32, 32, .14)); }
.elo-text { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; flex: 1; }
.elo-text strong { font-size: 28px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.elo-text small { font-family: var(--font); font-size: 12px; font-weight: 800; color: var(--text-3); letter-spacing: .08em; }
.elo-text > span {
  padding: 2px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--lvl) 28%, var(--surface));
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}
.elo-form { display: flex; gap: 5px; }
.form-chip {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 26px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18), inset 0 2px 0 rgba(255, 255, 255, .3);
}
.form-w { background: #22b573; }
.form-l { background: #f0365a; }
.form-d { background: #a1a1a6; }
.elo-bar {
  height: 14px;
  margin-top: 14px;
  padding: 3px;
  border-radius: 999px;
  background: var(--fill);
  box-shadow: inset 0 2px 3px rgba(32, 32, 32, .1);
}
.elo-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .28) 0 6px, transparent 6px 12px), var(--lvl);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .14);
  transition: width .6s var(--bounce);
}
.elo-range {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.elo-range #eloNext { color: var(--text); font-weight: 800; text-align: center; }

.rank-elo { display: inline-flex; align-items: center; gap: 8px; }

.res-elo {
  --lvl: #ffc800;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
  margin-bottom: 18px;
  padding: 12px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--lvl) 14%, var(--fill));
}
.res-elo > span:first-child { line-height: 0; }
.res-elo strong { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.res-elo small { font-family: var(--font); font-size: 12px; font-weight: 800; color: var(--text-3); }
.res-elo .pill { font-size: 13px; }
.res-elo-level {
  flex-basis: 100%;
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-2);
}
.res-elo-level.up { color: var(--text); animation: level-up .8s var(--bounce); }
@keyframes level-up { from { transform: scale(.6); opacity: 0; } }

/* ---------- Dil düğmesi ---------- */

body.in-match .lang-btn { display: none; }
@keyframes tick { 50% { opacity: .55; } }

.hud-opp { flex-direction: row; align-items: center; justify-content: flex-end; gap: 10px; }
.hud-opp-text { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; }
.hud-opp .hud-score { font-size: 20px; }
.hud-badge {
  margin-top: 1px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 800;
}
.opp-view { flex: none; display: flex; }
.opp-view:empty { display: none; }
.mini-board {
  flex: none;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 1px;
  width: 58px;
  height: 58px;
  padding: 3px;
  border-radius: 11px;
  background: var(--surface);
  box-shadow: 0 3px 0 var(--ledge);
}
.mini-board span { border-radius: 2px; background: var(--cell); }
.hud-mode.my-turn { background: var(--green-tint); color: var(--green); }

/* ---------- Online: tahta üstü ---------- */

.countdown {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--dim);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.countdown span {
  font-size: clamp(60px, 22vw, 104px);
  font-weight: 700;
  color: var(--text);
  text-shadow: 0 6px 0 var(--btn);
}
.countdown span.pop { animation: pop .6s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

.conn-warn {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 6;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--toast);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.board-note {
  position: absolute;
  left: 50%;
  top: 14px;
  z-index: 6;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--glass-strong);
  box-shadow: var(--pop-shadow);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: none;
  animation: note 1.8s var(--ease) forwards;
}
.board-note.attack { color: var(--orange); }
.board-note.hit { color: var(--red); }
@keyframes note {
  0% { transform: translate(-50%, -8px); opacity: 0; }
  12%, 80% { transform: translate(-50%, 0); opacity: 1; }
  100% { transform: translate(-50%, -6px); opacity: 0; }
}

.board.hit { animation: hit .45s; }
@keyframes hit {
  0% { box-shadow: var(--shadow), 0 0 0 0 rgba(227, 0, 0, .5); }
  30% { transform: translateY(3px); box-shadow: var(--shadow), 0 0 0 6px rgba(227, 0, 0, .25); }
  100% { box-shadow: var(--shadow), 0 0 0 0 rgba(227, 0, 0, 0); }
}
.cell.garbage-in { animation: garbage .4s var(--ease); }
@keyframes garbage { from { transform: scale(1.4); opacity: 0; } }

.app-toast {
  position: fixed;
  left: 50%;
  top: calc(64px + env(safe-area-inset-top));
  z-index: 400;
  max-width: calc(100vw - 32px);
  padding: 11px 20px;
  border-radius: 18px;
  background: var(--toast);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .22), 0 14px 30px rgba(32, 32, 32, .25);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  transform: translateX(-50%);
}
.app-toast.show { animation: toast .4s var(--bounce); }
@keyframes toast { from { opacity: 0; transform: translate(-50%, -8px); } }

/* ---------- Online: lobi ---------- */

.lobby {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  flex-direction: column;
  background: var(--paint);
  animation: lobby-in .4s var(--bounce);
  user-select: text;
  -webkit-user-select: text;
}
@keyframes lobby-in { from { opacity: 0; transform: translateY(24px); } }
.lobby-bar {
  position: relative;
  flex: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: calc(82px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 28px 0;
  background: var(--bar);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 5px 0 var(--ledge), 0 16px 34px rgba(0, 0, 0, .12), var(--clay);
}
.lobby-title { grid-column: 2; font-size: 26px; font-weight: 800; }
.lobby-back {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 14px 0 13px;
  border: 0;
  border-radius: 15px;
  background: var(--fill);
  color: var(--blue);
  font: 800 15px var(--font);
  cursor: pointer;
}
.lobby .lobby-close { position: static; grid-column: 3; justify-self: end; width: 42px; height: 42px; border-radius: 15px; }
.lobby-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.lobby-view {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 28px 20px calc(32px + env(safe-area-inset-bottom));
}
.lobby-view.center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  text-align: center;
}
.lobby-view.auth-view {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
}
.lobby-view h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.12;
  font-weight: 700;
}
.lobby-logo { margin-bottom: 18px; }
.lobby-sub {
  margin: 10px auto 26px;
  max-width: 360px;
  font-size: 17px;
  color: var(--text-2);
}
.lobby-sub.left { margin: 8px 0 22px; text-align: left; }
.lobby-sub strong { color: var(--text); font-weight: 600; }
.lobby-note {
  margin: -12px 0 22px;
  padding: 11px 15px;
  border-radius: 16px;
  font-weight: 600;
  background: var(--blue-tint);
  color: var(--blue);
  font-size: 15px;
}
.lobby-foot { margin-top: 22px; font-size: 13px; color: var(--text-3); }

.auth-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; max-width: 340px; }
.google-slot { width: 100%; }
/* Google'ın iframe'i açık şemada; kapsayıcı koyu şemada kalırsa tarayıcı arkasını opak beyaza boyar. */
.google-btn { display: flex; justify-content: center; min-height: 44px; color-scheme: light; }
.or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0 14px;
  font-size: 13px;
  color: var(--text-3);
}
.or::before, .or::after { content: ""; flex: 1; height: 2px; border-radius: 2px; background: var(--border); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.lobby-view > h1 + .auth-form { margin-top: 22px; }
.fields {
  overflow: hidden;
  border: 2px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 4px 0 var(--ledge);
}
.float-field { position: relative; display: block; }
.float-field + .float-field { border-top: 2px solid var(--border); }
.float-field input {
  width: 100%;
  height: 56px;
  padding: 22px 16px 6px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 600 17px var(--font);
}
.float-field span {
  position: absolute;
  left: 16px;
  top: 17px;
  color: var(--text-3);
  font-size: 17px;
  pointer-events: none;
  transform-origin: left top;
  transition: transform .15s var(--ease), color .15s;
}
.float-field input:focus + span,
.float-field input:not(:placeholder-shown) + span { transform: translateY(-10px) scale(.72); }
.float-field input:focus + span { color: var(--blue); }
.fields:focus-within { border-color: var(--blue); box-shadow: var(--focus); }
.float-field.has-toggle input { padding-right: 58px; }
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background-color .2s, color .2s;
}
.pw-toggle:hover { background: var(--fill); color: var(--blue); }
.pw-toggle .eye-off, .pw-toggle.on .eye { display: none; }
.pw-toggle.on .eye-off { display: block; }
.pw-toggle.on { color: var(--blue); }

.code-input {
  width: 100%;
  height: 66px;
  border: 2px solid var(--border);
  border-radius: 18px;
  outline: 0;
  background: var(--surface);
  box-shadow: 0 4px 0 var(--ledge);
  color: var(--text);
  font: 600 30px var(--font-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: .35em;
  text-align: center;
  text-indent: .35em;
}
.code-input:focus { border-color: var(--blue); box-shadow: var(--focus); }
.code-input::placeholder { color: var(--border); }

.form-hint { font-size: 13px; color: var(--text-3); }
.form-error {
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--red-tint);
  color: var(--red);
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}
.lobby-view.center .form-error { margin-top: 16px; text-align: center; }
.form-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 18px; margin-top: 18px; }

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 14px 14px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow), var(--clay);
}
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--yellow);
  color: #202020;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .13), inset 0 2px 0 rgba(255, 255, 255, .5);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  transform: rotate(-4deg);
}
.profile-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.profile-info strong { overflow: hidden; font-family: var(--font-display); font-size: 19px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.profile-info span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.guest-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 8px 8px 8px 14px;
  border-radius: 16px;
  font-weight: 700;
  background: var(--gold-bg);
  color: var(--gold-text-2);
  font-size: 13px;
}

.segmented {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  gap: 3px;
  padding: 4px;
  border-radius: 17px;
  background: var(--fill);
  box-shadow: inset 0 2px 3px rgba(32, 32, 32, .07);
}
.segmented button {
  min-height: 34px;
  border: 0;
  border-radius: 13px;
  background: none;
  color: var(--text-2);
  font: 800 14px var(--font);
  cursor: pointer;
  transition: background-color .2s, box-shadow .2s, color .2s, transform .25s var(--bounce);
}
.segmented button:hover:not(.active) { color: var(--text); }
.segmented button.active {
  background: var(--seg-active);
  color: var(--text);
  box-shadow: 0 3px 0 var(--ledge), 0 6px 14px rgba(0, 0, 0, .12);
  transform: translateY(-1px);
}
.lobby-tabs { margin: 22px 0 6px; }
.rank-tabs { margin: 18px 0 14px; }

.sg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 24px 0 12px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .1em;
}
.sg-header::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 4px;
  background: var(--btn);
  box-shadow: 0 2px 0 var(--btn-ledge);
  transform: rotate(45deg);
}

/* Lobi ana ekranı: solda profil ve oyun seçimi, sağda seçili oyun */
.lobby-view.lobby-home { max-width: 560px; }
.home-side .side-header { margin-top: 22px; }
.game-hero {
  --g: var(--blue);
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 22px;
  padding: 18px 24px 18px 18px;
  overflow: hidden;
  border-radius: 28px;
  background:
    radial-gradient(130% 160% at 100% 0%, rgba(255, 255, 255, .5), transparent 55%),
    color-mix(in srgb, var(--g) 22%, var(--surface));
  box-shadow: 0 6px 0 color-mix(in srgb, var(--g) 35%, var(--ledge)), 0 16px 34px rgba(0, 0, 0, .12), var(--clay);
}
.hero-art {
  display: grid;
  place-items: center;
  flex: none;
  width: 104px;
  height: 104px;
  border-radius: 24px;
  background: color-mix(in srgb, var(--g) 16%, var(--surface));
  box-shadow: inset 0 -4px 0 color-mix(in srgb, var(--g) 25%, transparent), inset 0 2px 0 rgba(255, 255, 255, .55);
  overflow: hidden;
}
.hero-art > div { transform: scale(1.35); }
.hero-art > .kl-art { transform: scale(1.05); }
.hero-text { display: flex; flex-direction: column; min-width: 0; }
.hero-text small {
  align-self: flex-start;
  margin-bottom: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--g);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
}
.hero-text strong { font: 800 clamp(28px, 4vw, 38px) / 1.05 var(--font-display); }
.hero-text span { margin-top: 4px; font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--text-2); }
:root[data-theme="dark"] .game-hero {
  background:
    radial-gradient(130% 160% at 100% 0%, rgba(255, 255, 255, .06), transparent 55%),
    color-mix(in srgb, var(--g) 22%, var(--surface));
}
:root[data-theme="dark"] .hero-art { box-shadow: inset 0 -4px 0 color-mix(in srgb, var(--g) 25%, transparent), inset 0 2px 0 rgba(255, 255, 255, .08); }
@media (min-width: 900px) {
  .lobby-view.lobby-home {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    align-items: start;
    gap: 32px;
    max-width: 1140px;
    padding-left: 28px;
    padding-right: 28px;
  }
  .home-side { position: sticky; top: 28px; }
  .home-main > .game-hero { margin-top: 0; }
}

.mode-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.mode-card {
  --m: var(--blue);
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr;
  gap: 12px 14px;
  padding: 18px;
  border-radius: var(--radius);
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--m) 14%, transparent), transparent 60%),
    var(--surface);
  box-shadow: 0 5px 0 color-mix(in srgb, var(--m) 30%, var(--ledge)), 0 12px 26px rgba(0, 0, 0, .08), var(--clay);
  transition: transform .3s var(--bounce);
}
.mode-card:hover { transform: translateY(-3px); }
.mode-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: var(--m);
  color: #fff;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .16), inset 0 2px 0 rgba(255, 255, 255, .35);
  transform: rotate(-4deg);
}
.mode-text { display: flex; flex-direction: column; gap: 3px; }
.mode-text strong { font-size: 21px; font-weight: 700; line-height: 1.15; }
.mode-text span { font-size: 14px; line-height: 1.45; color: var(--text-2); }
.mode-actions { grid-column: 1 / -1; align-self: end; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-actions .btn { min-width: 0; padding-left: 10px; padding-right: 10px; }

.join-form { display: flex; flex-direction: column; gap: 10px; }
.join-card {
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow), var(--clay);
}
.join-row { display: flex; gap: 10px; }
.room-input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 16px;
  border: 2px solid var(--border);
  border-radius: 15px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
  font: 700 17px var(--font);
  letter-spacing: .2em;
  text-transform: uppercase;
}
.room-input::placeholder { font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-3); }
.room-input:focus { border-color: var(--blue); box-shadow: var(--focus); }
.join-row .btn { min-height: 46px; }

.rank-list {
  margin: 0;
  padding: 6px;
  list-style: none;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow), var(--clay);
}
.rank-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 17px;
  font-size: 16px;
}
.rank-row + .rank-row { margin-top: 2px; }
.rank-row:nth-child(even) { background: color-mix(in srgb, var(--fill) 55%, transparent); }
.rank-row.me { background: var(--gold-bg); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--yellow) 60%, transparent); }
.rank-pos {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.rank-row:nth-child(-n + 3) .rank-pos { color: #202020; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .14), inset 0 2px 0 rgba(255, 255, 255, .45); }
.rank-row:nth-child(1) .rank-pos { background: #ffc912; }
.rank-row:nth-child(2) .rank-pos { background: #d8d8dc; }
.rank-row:nth-child(3) .rank-pos { background: #f4a96e; }
.rank-name { display: flex; flex-direction: column; min-width: 0; overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.rank-name small { font-size: 12px; font-weight: 700; color: var(--text-3); }
.rank-value { font-family: var(--font-display); font-weight: 600; font-variant-numeric: tabular-nums; }
.rank-empty { padding: 26px 16px; color: var(--text-2); text-align: center; font-size: 15px; }
.rank-me { margin-top: 12px; color: var(--text-2); font-size: 14px; text-align: center; }

.pulse-logo {
  position: relative;
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
  margin-bottom: 18px;
}
.pulse-logo::before, .pulse-logo::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(253, 199, 0, .3);
  animation: pulse 2s var(--ease) infinite;
}
.pulse-logo::after { animation-delay: 1s; }
.pulse-logo img { position: relative; animation: breathe 2s ease-in-out infinite; }
@keyframes pulse { from { transform: scale(.4); opacity: 1; } to { transform: scale(1); opacity: 0; } }
@keyframes breathe { 50% { transform: scale(.92); } }

.room-code {
  margin: 0 0 22px;
  padding: 14px 26px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow), inset 0 0 0 3px var(--btn);
  color: var(--blue);
  font-size: 46px;
  font-weight: 700;
  letter-spacing: .18em;
  text-indent: .18em;
  font-variant-numeric: tabular-nums;
  user-select: all;
  -webkit-user-select: all;
}
.room-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.room-wait { margin: 26px 0 8px; color: var(--text-2); font-size: 15px; }

/* ---------- Online: sonuç ---------- */

.result-sheet h2 { font-size: 32px; }
.result-sheet.won h2 { color: var(--text); text-shadow: 0 4px 0 var(--btn); }
.res-reason { margin-top: 6px; color: var(--text-2); font-size: 15px; font-weight: 600; }
.res-scores {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 22px 0 14px;
  padding: 14px 10px;
  border-radius: 20px;
  background: var(--fill);
}
.res-player { display: flex; flex-direction: column; min-width: 0; }
.res-player span { overflow: hidden; font-size: 13px; font-weight: 800; color: var(--text-2); text-overflow: ellipsis; white-space: nowrap; }
.res-player strong { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.res-player:first-child span { color: var(--blue); }
.res-vs { color: var(--text-3); font-size: 20px; }
.result-sheet #resRematch { margin-top: 8px; }
.res-note { margin-top: 10px; font-size: 14px; color: var(--text-2); }
.res-secondary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }

/* ---------- Arkadaşlar ve sohbet ---------- */

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font: 800 11px/1 var(--font);
  font-variant-numeric: tabular-nums;
}
.btn .badge { margin-left: 2px; }

.text-input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 16px;
  border: 2px solid var(--border);
  border-radius: 15px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
  font: 600 16px var(--font);
}
.text-input::placeholder { color: var(--text-3); }
.text-input:focus, .room-input:focus { border-color: var(--blue); box-shadow: var(--focus); }

.social-locked {
  margin-top: 18px;
  padding: 22px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow), var(--clay);
  text-align: center;
}
.social-locked p { margin: 0 0 16px; color: var(--text-2); font-size: 15px; line-height: 1.45; }

.invite-list { display: flex; flex-direction: column; gap: 10px; }
.invite-list:not(:empty) { margin-top: 16px; }
.invite-card {
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--blue-tint);
  box-shadow: inset 0 0 0 2px var(--fill-2);
}
.invite-card p { margin: 0 0 10px; font-size: 15px; line-height: 1.4; }
.invite-actions { display: flex; gap: 8px; }

.friend-list {
  margin: 0;
  padding: 6px;
  list-style: none;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow), var(--clay);
}
.friend-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 4px 12px;
  padding: 10px 10px 10px 12px;
  border-radius: 17px;
}
.friend-row + .friend-row { margin-top: 2px; }
.friend-row.incoming { background: var(--gold-bg); }
.friend-info { display: flex; flex-direction: column; min-width: 0; }
.friend-info strong { overflow: hidden; font-size: 16px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.friend-info span { overflow: hidden; font-size: 13px; font-weight: 600; color: var(--text-2); text-overflow: ellipsis; white-space: nowrap; }
.friend-info span.playing { color: var(--orange); }
.friend-row.incoming .friend-info span { color: var(--gold-text-2); }
.friend-actions { display: flex; align-items: center; gap: 6px; }
.friend-actions .btn-sm { padding: 0 12px; }
.friend-remove {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text-3);
  cursor: pointer;
}
.friend-remove:hover { background: var(--red-tint); color: var(--red); }
.friend-modes {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding: 12px;
  border-radius: 16px;
  background: var(--fill);
}
.friend-modes-label { font-size: 13px; font-weight: 800; color: var(--text-2); }
.friend-modes-row { display: flex; flex-wrap: wrap; gap: 8px; }
.friend-modes-row .btn { background: var(--surface); }
.friend-modes-hint { font-size: 12px; color: var(--text-3); }

.avatar.small { width: 40px; height: 40px; border-radius: 13px; font-size: 17px; position: relative; transform: none; }
.avatar.online::after {
  content: "";
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2px var(--surface);
}

/* Mesaj balonları */
.chat-log {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px;
}
.chat-empty { margin: auto; padding: 20px 10px; color: var(--text-3); font-size: 14px; text-align: center; }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 82%; margin-top: 8px; }
.msg.grouped { margin-top: 0; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg-name {
  margin: 0 0 2px 12px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue);
  font: 800 12px var(--font);
  cursor: pointer;
}
.msg-name:hover { text-decoration: underline; }
.msg-bubble {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 2px 8px;
  padding: 8px 13px;
  border-radius: 18px 18px 18px 6px;
  background: var(--fill-2);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}
.msg.mine .msg-bubble { border-radius: 18px 18px 6px 18px; background: var(--btn); color: var(--btn-text); }
.msg-text { overflow-wrap: anywhere; white-space: pre-wrap; }
.msg-time { margin-left: auto; font-size: 11px; opacity: .6; font-variant-numeric: tabular-nums; }

.chat-form { display: flex; gap: 8px; padding: 10px; }
.chat-form .btn { flex: none; width: 44px; min-height: 44px; padding: 0; }

.chat-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 14px;
  border-top: 1px solid var(--hairline-soft);
  background: var(--blue-tint);
  font-size: 14px;
}
.chat-pick span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-rules { margin: 0; padding: 0 14px 12px; font-size: 12px; color: var(--text-3); text-align: center; }

/* Sağ alttaki sohbet balonu ve paneli */
.dock-btn {
  position: fixed;
  right: calc(18px + env(safe-area-inset-right));
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 170;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--btn);
  color: var(--btn-text);
  box-shadow: 0 4px 0 var(--btn-ledge), 0 12px 26px rgba(255, 170, 0, .32), inset 0 2px 0 rgba(255, 255, 255, .55);
  cursor: pointer;
  transition: transform .25s var(--bounce), background-color .2s;
}
.dock-btn:hover { background: var(--btn-hover); transform: translateY(-2px); }
.dock-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--btn-ledge), inset 0 2px 0 rgba(255, 255, 255, .55); }
.dock-btn .dock-btn-close, .dock-btn.open .dock-btn-chat { display: none; }
.dock-btn.open .dock-btn-close { display: block; }
.dock-btn .badge { position: absolute; top: -5px; right: -5px; box-shadow: 0 0 0 2px var(--bg); }
.dock-btn.open .badge { display: none; }
body.in-match .dock-btn,
body.in-match .social-dock { display: none !important; }

.social-dock {
  position: fixed;
  right: calc(18px + env(safe-area-inset-right));
  bottom: calc(90px + env(safe-area-inset-bottom));
  z-index: 175;
  display: flex;
  flex-direction: column;
  width: 380px;
  height: min(600px, calc(100dvh - 120px));
  overflow: hidden;
  border-radius: 26px;
  background: var(--sheet);
  box-shadow: var(--sheet-shadow);
  user-select: text;
  -webkit-user-select: text;
  transform-origin: bottom right;
}
.social-dock[hidden] { display: none; }
.social-dock.show { animation: dock-in .3s var(--bounce); }
@keyframes dock-in { from { opacity: 0; transform: translateY(16px) scale(.94); } }
.dock-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--hairline-soft);
}
.dock-tabs { flex: 1; }
.dock-tabs button { position: relative; }
.dock-tabs .badge { position: absolute; top: -6px; right: 2px; box-shadow: 0 0 0 2px var(--sheet); }
.dock-bar .sheet-close { position: static; flex: none; }
.dock-bar .dock-expand { margin-right: -4px; }
.dock-expand-off, .social-dock.full .dock-expand-on { display: none; }
.social-dock.full .dock-expand-off { display: block; }
.dock-grab { display: none; }

.social-dock.full {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: auto;
  height: auto;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  border-radius: 0;
  box-shadow: none;
}
.social-dock.full > * { width: 100%; max-width: 760px; margin-inline: auto; }
.social-dock.full .dock-bar { padding-top: 14px; }
body.dock-full .dock-btn { display: none; }
.social-dock.settling { transition: transform .22s var(--ease); }
.dock-pane { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.dock-pane[hidden] { display: none; }
.dock-pane > .social-locked { margin: 16px; box-shadow: none; background: var(--fill); }
.dock-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px;
}
.dock-scroll[hidden] { display: none; }
.dock-scroll .friend-list { margin-top: 12px; padding: 0; box-shadow: none; background: none; }
.dock-scroll .friend-list:empty { display: none; }
.dock-scroll .friend-row { padding: 8px 6px; }
.dock-scroll .friend-row.incoming { padding-inline: 10px; }
.dock-scroll .invite-list:not(:empty) { margin-top: 12px; }
.dock-scroll .friend-actions .btn-sm { padding: 0 10px; }
.dock-pane .chat-log { flex: 1; min-height: 0; }
.dock-pane .chat-log[hidden], .dock-pane .chat-form[hidden] { display: none; }
.dock-pane .chat-form { border-top: 1px solid var(--hairline-soft); }

.dm-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--hairline-soft);
}
.dm-head .profile-info { flex: 1; min-width: 0; }
.dm-head .profile-info strong, .dm-head .profile-info span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-head .profile-info span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.dm-head .avatar { flex: none; border: 0; cursor: pointer; }
.dock-back {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: var(--fill);
  color: var(--text-2);
  cursor: pointer;
}
.dock-back:hover { background: var(--fill-2); color: var(--text); }

.msg-head { display: flex; align-items: center; gap: 6px; margin: 0 0 2px 12px; }
.msg-head .msg-name { margin: 0; }
.msg-staff {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--gold-bg);
  color: var(--gold-text);
  font: 800 10px/1.4 var(--font);
  text-transform: uppercase;
}
.mention { color: var(--blue); font-weight: 800; }
.mention.me { padding: 0 3px; border-radius: 5px; background: var(--gold-bg); color: var(--gold-text-2); }
.msg.mine .mention { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.msg.mentioned .msg-bubble { background: var(--gold-bg); box-shadow: inset 0 0 0 2px var(--btn); }
.msg.locked .msg-text { font-style: italic; opacity: .65; }
.msg-row { display: flex; align-items: center; gap: 4px; max-width: 100%; min-width: 0; }
.msg.mine .msg-row { flex-direction: row-reverse; }
.msg-row .msg-bubble { min-width: 0; }
.msg-del {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--text-3);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}
.msg:hover .msg-del, .msg.actions .msg-del, .msg-del:focus-visible { opacity: 1; pointer-events: auto; }
.msg-del:hover { background: var(--red-tint); color: var(--red); }
.msg.deleted .msg-bubble { background: none; box-shadow: inset 0 0 0 1.5px var(--hairline); color: var(--text-3); }
.msg.deleted .msg-text { font-style: italic; font-weight: 600; }
.msg.mine.deleted .msg-bubble { color: var(--text-3); }
.msg.sys.deleted { font-style: italic; }
.msg.deleted.staff-view .msg-bubble { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--red) 45%, transparent); }
.msg-deleted-note { font-size: 11px; font-weight: 800; color: var(--red); }
.msg-deleted-text { color: var(--text-2); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--red) 50%, transparent); overflow-wrap: anywhere; }
.msg.deleted.staff-view .msg-time { align-self: flex-end; }

.mention-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 220px;
  overflow-y: auto;
  padding: 6px;
  border-top: 1px solid var(--hairline-soft);
}
.mention-box[hidden] { display: none; }
.mention-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 8px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--text);
  font: 700 15px var(--font);
  text-align: left;
  cursor: pointer;
}
.mention-opt .avatar.small { width: 30px; height: 30px; border-radius: 10px; font-size: 14px; }
.mention-opt:hover, .mention-opt.active { background: var(--blue-tint); }
.mention-hint { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--text-3); }
.mention-opt .avatar.cmd { background: var(--fill-2); color: var(--text-2); font-weight: 800; }
.cmd-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.cmd-text strong, .cmd-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-text small { font-size: 12px; font-weight: 600; color: var(--text-3); }
.cmd-args { font-weight: 600; color: var(--text-3); }

/* Moderasyon: sistem satırları, duyurular ve oda durumu */
.msg.sys {
  align-self: center;
  align-items: center;
  max-width: 92%;
  margin: 10px 0 4px;
  padding: 6px 12px;
  border-radius: 12px;
  background: var(--fill);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}
.msg.sys .sys-reason { font-weight: 600; color: var(--text-3); }
.msg.sys-ban, .msg.sys-mute { background: var(--red-tint); }
.msg.sys-help { align-items: stretch; text-align: left; }
.cmd-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; padding: 0; list-style: none; }
.cmd-list li { display: flex; flex-direction: column; }
.cmd-list code { color: var(--text); font: 800 12.5px var(--font); }
.cmd-list span { font-weight: 600; color: var(--text-3); }
.msg.announce {
  align-self: stretch;
  align-items: stretch;
  max-width: none;
  margin: 10px 0 4px;
  padding: 10px 13px;
  border-radius: 16px;
  background: var(--gold-bg);
  box-shadow: inset 0 0 0 2px var(--btn);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}
.announce-head { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; font-size: 12px; }
.announce-head strong { color: var(--gold-text); font-weight: 800; text-transform: uppercase; }
.announce-head span { color: var(--text-2); font-weight: 700; }
.chat-room-note {
  margin: 0;
  padding: 8px 14px;
  border-top: 1px solid var(--hairline-soft);
  background: var(--fill);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}
.chat-room-note[hidden] { display: none; }

.e2e-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 7px 12px;
  background: var(--green-tint);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.e2e-note svg { flex: none; }
.e2e-note.warn { background: var(--red-tint); color: var(--red); }

.friend-modes-game { display: flex; align-items: center; gap: 10px; }
.friend-modes-select {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: 700 14px var(--font);
}

/* Maç içi sohbet */
.bottom-actions { gap: 10px; }
.chat-btn { position: relative; }
.res-social { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; }
.res-social .btn-plain:disabled { color: var(--text-3); }

.match-chat {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 260;
  display: flex;
  flex-direction: column;
  width: min(100%, 460px);
  max-height: min(70dvh, 520px);
  padding-bottom: env(safe-area-inset-bottom);
  border-radius: 26px 26px 0 0;
  background: var(--sheet);
  box-shadow: var(--sheet-shadow);
  transform: translateX(-50%);
  animation: chat-up .28s var(--ease);
}
@keyframes chat-up { from { transform: translate(-50%, 40px); opacity: 0; } }
.match-chat-bar {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 56px 0 18px;
  border-bottom: 1px solid var(--hairline-soft);
  font-size: 16px;
}
.match-chat-bar .sheet-close { top: 11px; }
.match-chat .chat-log { flex: 1; min-height: 140px; }
.quick-chat {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 10px 0;
  scrollbar-width: none;
}
.quick-chat::-webkit-scrollbar { display: none; }
.quick-chip {
  flex: none;
  min-height: 32px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: var(--blue-tint);
  color: var(--blue);
  font: 800 13px var(--font);
  cursor: pointer;
}
.quick-chip:hover { background: var(--fill-2); }
.quick-chip:disabled { opacity: .5; }

.chat-pop {
  position: fixed;
  left: 50%;
  top: calc(62px + env(safe-area-inset-top));
  z-index: 240;
  display: flex;
  flex-direction: column;
  max-width: min(86vw, 360px);
  padding: 9px 16px;
  border-radius: 20px;
  background: var(--glass-strong);
  box-shadow: var(--pop-shadow);
  font-size: 15px;
  font-weight: 600;
  transform: translateX(-50%);
  cursor: pointer;
}
.chat-pop strong { font-size: 12px; font-weight: 800; color: var(--blue); }
.chat-pop span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.chat-pop.show { animation: pop-in .3s var(--ease); }
@keyframes pop-in { from { opacity: 0; transform: translate(-50%, -10px) scale(.96); } }

.notify-bar {
  position: fixed;
  left: 50%;
  top: calc(60px + env(safe-area-inset-top));
  z-index: 380;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px 12px;
  width: min(calc(100vw - 24px), 460px);
  padding: 12px 14px;
  border-radius: 22px;
  background: var(--glass-strong);
  box-shadow: var(--pop-shadow), inset 0 0 0 2px var(--fill-2);
  transform: translateX(-50%);
}
.notify-bar.show { animation: toast .4s var(--bounce); }
.notify-bar p { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.35; }
.notify-actions { display: flex; justify-content: flex-end; gap: 8px; }
.notify-actions:empty { display: none; }

/* ---------- Header hesap düğmesi ---------- */

.account-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 220px;
  min-height: 48px;
  padding: 5px 16px 5px 5px;
  border: 0;
  border-radius: 18px;
  background: var(--fill);
  color: var(--text);
  font: 800 15px var(--font);
  cursor: pointer;
  transition: background-color .2s, transform .25s var(--bounce);
}
.account-btn:hover { background: var(--fill-2); transform: translateY(-1px); }
.account-btn .avatar { width: 38px; height: 38px; border-radius: 13px; font-size: 18px; transform: none; }
.account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.in-match .account-btn { display: none; }

/* ---------- Tıklanabilir oyuncu adları ---------- */

.profile-open,
.rank-name,
.friend-name,
.prof-link,
button.avatar {
  border: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.profile-open, .rank-name, .friend-name, .prof-link { padding: 0; background: none; }
.profile-open {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
  margin: -6px;
  padding: 6px;
  border-radius: 18px;
  transition: background-color .2s;
}
.profile-open:hover { background: var(--fill); }
.profile-card .icon-btn { width: 42px; height: 42px; border-radius: 15px; }
.rank-name:hover, .friend-name:hover, .prof-link:hover { color: var(--blue); }
.friend-name { overflow: hidden; font-size: 16px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.prof-link { font-weight: 800; color: var(--blue); }
.prof-link:hover { text-decoration: underline; }

/* ---------- Profil ---------- */

.avatar.big { width: 84px; height: 84px; border-radius: 28px; font-size: 40px; }
.lobby-view.profile-view { max-width: 880px; }
.prof-loading { display: grid; place-items: center; min-height: 240px; }
.prof-hero {
  --c: var(--yellow);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px 24px;
  border-radius: 28px;
  background:
    radial-gradient(130% 160% at 100% 0%, rgba(255, 255, 255, .5), transparent 55%),
    color-mix(in srgb, var(--c) 20%, var(--surface));
  box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 32%, var(--ledge)), 0 16px 34px rgba(0, 0, 0, .12), var(--clay);
}
:root[data-theme="dark"] .prof-hero {
  background:
    radial-gradient(130% 160% at 100% 0%, rgba(255, 255, 255, .06), transparent 55%),
    color-mix(in srgb, var(--c) 20%, var(--surface));
}
.prof-hero .avatar.big { box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .14), inset 0 3px 0 rgba(255, 255, 255, .45), 0 6px 0 rgba(32, 32, 32, .1); }
.prof-hero-text { flex: 1; min-width: 0; }
.prof-hero-text h1 {
  overflow: hidden;
  font: 800 clamp(28px, 4vw, 36px) / 1.1 var(--font-display);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prof-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 0; font-size: 14px; font-weight: 700; color: var(--text-2); }
.prof-online { color: var(--green); }
.prof-online::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--green);
  vertical-align: 1px;
}
.prof-actions { display: flex; flex: none; gap: 8px; }
.prof-badge {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--green) 14%, var(--surface));
  color: var(--green);
  font-size: 14px;
  font-weight: 800;
}
.prof-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.prof-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow), var(--clay);
}
.prof-tile strong {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 800 26px / 1.1 var(--font-display);
  font-variant-numeric: tabular-nums;
}
.prof-tile span { font-size: 13px; font-weight: 700; color: var(--text-2); }
.prof-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.prof-game {
  --g: var(--blue);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px 14px;
  padding: 14px;
  border-radius: 22px;
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--g) 12%, transparent), transparent 60%),
    var(--surface);
  box-shadow: 0 5px 0 color-mix(in srgb, var(--g) 26%, var(--ledge)), 0 12px 26px rgba(0, 0, 0, .07), var(--clay);
}
.prof-game-art.chip-art {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 17px;
  background: color-mix(in srgb, var(--g) 16%, var(--surface));
  overflow: hidden;
}
.prof-game-art > div { transform: scale(.72); }
.prof-game-art > .kl-art { transform: scale(.5); }
.prof-game-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.prof-game-info strong { font: 800 19px / 1.15 var(--font-display); }
.prof-game-info span { font-size: 13px; font-weight: 700; color: var(--text-2); }
.prof-game-info span.muted { color: var(--text-3); }
.prof-best { align-self: flex-start; margin-top: 3px; padding: 1px 9px; border-radius: 999px; background: var(--gold-bg); color: var(--gold-text-2) !important; }
.prof-elo {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 16px;
  background: var(--fill);
}
.prof-elo strong { flex: 1; font: 800 18px var(--font-display); font-variant-numeric: tabular-nums; }
.prof-elo .form-chip { width: 22px; height: 24px; font-size: 11px; }
.prof-matches { margin: 0; padding: 6px; list-style: none; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow), var(--clay); }
.prof-match {
  --g: var(--blue);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
}
.prof-match:nth-child(even) { background: color-mix(in srgb, var(--fill) 55%, transparent); }
.prof-match-main { display: flex; flex-direction: column; min-width: 0; }
.prof-match-main strong { overflow: hidden; font-size: 15px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.prof-match-main strong small { font-size: 13px; font-weight: 700; color: var(--text-2); }
.prof-vs { overflow: hidden; font-size: 13px; font-weight: 600; color: var(--text-2); text-overflow: ellipsis; white-space: nowrap; }
.prof-match-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.prof-delta { font-size: 13px; font-weight: 800; color: var(--text-3); white-space: nowrap; }
.prof-delta.up { color: var(--green); }
.prof-delta.down { color: var(--red); }
.prof-match-side time { font-size: 12px; font-weight: 700; color: var(--text-3); }
.form-a { background: #c7c7cc; }

/* ---------- Ayarlar ---------- */

.lobby-view.settings-view { max-width: 600px; }
.settings-view > [hidden]:first-child + [data-member-only] > .sg-header:first-child { margin-top: 0; }
.set-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow), var(--clay);
}
.set-card.danger { box-shadow: 0 5px 0 color-mix(in srgb, var(--red) 22%, var(--ledge)), 0 14px 30px rgba(0, 0, 0, .08), var(--clay); }
.sg-header.danger { color: var(--red); }
.sg-header.danger::before { background: var(--red); box-shadow: 0 2px 0 color-mix(in srgb, var(--red) 60%, #000); }
.set-avatar { display: flex; align-items: center; gap: 18px; }
.set-avatar .avatar.big { width: 72px; height: 72px; border-radius: 24px; font-size: 34px; }
.set-avatar-text { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.set-avatar-text strong { font-size: 15px; font-weight: 800; }
.set-avatar { align-items: flex-start; }
.set-avatar-btn { position: relative; padding: 0; cursor: pointer; }
.set-avatar-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(0, 0, 0, .35) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z'/%3E%3Ccircle cx='12' cy='13' r='4'/%3E%3C/svg%3E") center / 26px no-repeat;
  opacity: 0;
  transition: opacity .15s;
}
.set-avatar-btn:hover::after, .set-avatar-btn:focus-visible::after, .set-avatar-btn.busy::after { opacity: 1; }
.set-photo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: -4px; }
.set-photo-actions .btn[hidden] { display: none; }
.avatar.has-photo { color: transparent; }
.color-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.color-swatch {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: var(--sw);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15), inset 0 2px 0 rgba(255, 255, 255, .4);
  cursor: pointer;
  transition: transform .25s var(--bounce), box-shadow .2s;
}
.color-swatch:hover { transform: translateY(-2px); }
.color-swatch.active { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--sw); transform: scale(1.06); }
.set-form { display: flex; flex-direction: column; gap: 10px; }
.set-form + .set-form, .set-row + .set-form, .set-form + .set-row { padding-top: 18px; border-top: 2px solid var(--hairline-soft); }
.set-label { font-size: 13px; font-weight: 800; color: var(--text-2); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.set-row + .set-row { padding-top: 16px; border-top: 2px solid var(--hairline-soft); }
.set-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.set-row-text strong { overflow: hidden; font-size: 16px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.set-seg { flex: none; min-width: 200px; }
.set-check {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--green) 16%, var(--surface));
  color: var(--green);
}
.set-actions { flex-direction: row; flex-wrap: wrap; gap: 10px; }
.set-actions .btn { flex: 1; min-height: 44px; }
.set-warn { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.45; color: var(--text-2); }
.set-guest {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 0 6px;
  padding: 16px 18px;
  border-radius: 20px;
  background: var(--gold-bg);
  color: var(--gold-text-2);
  font-weight: 700;
}
.set-guest p { margin: 0; }
.set-guest-actions { display: flex; flex: none; gap: 8px; }
.settings-view > .set-guest { margin-top: 0; }
.btn-danger-solid {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--red) 70%, #000), inset 0 2px 0 rgba(255, 255, 255, .3);
}
.btn-danger-solid:hover { background: color-mix(in srgb, var(--red) 88%, #fff); }
.btn-danger-solid:active { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in srgb, var(--red) 70%, #000); }
.float-field[hidden] + .float-field { border-top: 0; }

/* ---------- Yönetim paneli ---------- */

.lobby-view.admin-view { max-width: 720px; }
.adm-stats { margin-top: 12px; }
.adm-live { display: flex; flex-direction: column; gap: 10px; }
.prof-totals.adm-live-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 0; }
.adm-live-dot {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 55%, transparent);
  animation: adm-pulse 2s ease-out infinite;
}
@keyframes adm-pulse { 70%, 100% { box-shadow: 0 0 0 8px transparent; } }
.adm-live-games { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-live-game {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 12px;
  border-radius: 12px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
}
.adm-live-game b { min-width: 22px; padding: 1px 7px; border-radius: 8px; background: var(--fill); text-align: center; font-variant-numeric: tabular-nums; }
.adm-live-empty { font-size: 13px; font-weight: 700; color: var(--text-3); }
.adm-tabs { margin: 22px 0 16px; }
.adm-pane { display: flex; flex-direction: column; gap: 12px; }
.adm-pane[hidden] { display: none; }
.adm-search, .adm-ban .text-input, .adm-announce { flex: none; width: 100%; }
.adm-search::-webkit-search-cancel-button { cursor: pointer; }
.adm-more { align-self: center; }

.adm-user {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 12px;
  padding: 12px;
  border-radius: 17px;
}
.adm-user + .adm-user { margin-top: 2px; border-top: 2px solid var(--hairline-soft); border-top-left-radius: 0; border-top-right-radius: 0; }
.adm-user.banned { background: var(--red-tint); }
.adm-user .avatar { width: 40px; height: 40px; border-radius: 14px; font-size: 18px; }
.adm-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.adm-name .prof-link, .adm-name strong { overflow: hidden; font-size: 16px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.adm-info .adm-ban-note { color: var(--red); font-weight: 700; white-space: normal; }
.adm-actions { flex-wrap: wrap; justify-content: flex-end; }
.adm-role {
  min-height: 32px;
  padding: 0 28px 0 10px;
  border: 0;
  border-radius: 12px;
  background: var(--fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%236c6286' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--text);
  font: 800 13px var(--font);
  appearance: none;
  cursor: pointer;
}
.adm-role:focus-visible { outline: 0; box-shadow: var(--focus); }

.role-badge {
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--fill);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.role-badge.role-admin { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.role-badge.role-superadmin { background: color-mix(in srgb, #f5b200 22%, transparent); color: var(--gold-text-2); }

.adm-ban {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--fill-2);
}
.adm-spans button { font-size: 13px; }
.adm-check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--text-2); cursor: pointer; }
.adm-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--red); }
.adm-ban-actions { display: flex; justify-content: flex-end; gap: 8px; }
.adm-ban-actions .btn { min-height: 40px; }

.adm-setting { flex: 1; }
.adm-setting strong { white-space: normal; }
.adm-setting .form-hint { margin: 0; white-space: normal; }
.adm-switch { display: flex; flex: none; padding: 4px; border: 0; border-radius: 16px; background: none; cursor: pointer; }
.adm-switch:focus-visible { outline: 0; box-shadow: var(--focus); }
.adm-switch:disabled { opacity: .6; cursor: default; }
.adm-switch[aria-checked="true"] .mi-switch { background: var(--switch); }
.adm-switch.danger[aria-checked="true"] .mi-switch { background: var(--red); }
.adm-switch[aria-checked="true"] .mi-switch::after { transform: translateX(16px); }
.adm-announce { height: auto; min-height: 72px; padding: 12px 16px; resize: vertical; font: 600 15px/1.4 var(--font); }

.adm-log-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 12px;
}
.adm-log-row + .adm-log-row { border-top: 2px solid var(--hairline-soft); }
.adm-log-row .friend-info strong, .adm-log-row .friend-info span { white-space: normal; }
.adm-log-row .friend-info strong { font-size: 15px; }
.adm-log-row time { font-size: 12px; font-weight: 700; color: var(--text-3); white-space: nowrap; }
.adm-log-dot { width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--blue); }
.log-ban .adm-log-dot { background: var(--red); }
.log-unban .adm-log-dot { background: var(--green); }
.log-settings .adm-log-dot { background: #f5b200; }

@media (max-width: 560px) {
  .adm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-live-tiles .prof-tile { padding: 12px; }
  .adm-live-tiles .prof-tile strong { font-size: 22px; }
  .adm-live-tiles .prof-tile span { font-size: 12px; }
  .adm-user { grid-template-columns: auto minmax(0, 1fr); }
  .adm-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .adm-log-row { grid-template-columns: auto minmax(0, 1fr); }
  .adm-log-row time { grid-column: 2; }
}

/* ---------- Responsive ---------- */

@media (max-width: 734px) {
  .topbar-inner { height: 66px; padding: 0 10px 0 14px; }
  .logo-full { height: 40px; }
  .menu-btn { width: 42px; height: 42px; border-radius: 15px; }
  .topbar-right { gap: 8px; }
  .login-btn { min-height: 42px; padding: 0 14px 0 12px; border-radius: 15px; font-size: 15px; }
  .account-btn { min-height: 42px; padding: 3px 3px 3px 3px; border-radius: 15px; }
  .account-btn .avatar { width: 36px; height: 36px; border-radius: 12px; }
  .account-name { display: none; }
  .prof-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prof-hero { flex-wrap: wrap; padding: 18px; }
  .prof-hero .avatar.big { width: 68px; height: 68px; border-radius: 22px; font-size: 32px; }
  .prof-actions { width: 100%; }
  .prof-actions > * { flex: 1; }
  .set-row:has(.set-seg) { flex-direction: column; align-items: stretch; gap: 8px; }
  .set-seg { min-width: 0; }
  .set-guest { flex-direction: column; align-items: stretch; text-align: center; }
  .lobby-bar { height: calc(66px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0; }
}

@media (max-width: 560px) {
  .brand-text { display: none; }
  .nav-back { min-height: 38px; padding: 0 12px; }
  .nav-back span { display: none; }
  .topbar-left { gap: 8px; }
  .topbar-inner { height: 62px; padding: 0 8px 0 12px; }
  .logo-full { height: 33px; }
  .menu-btn { width: 40px; height: 40px; border-radius: 14px; }
  .topbar-right { gap: 6px; }
  .login-btn { min-height: 40px; width: 40px; padding: 0; border-radius: 14px; }
  .login-btn span { display: none; }
}

@media (max-width: 400px) {
  .restart-btn, .online-btn { padding-inline: 16px; font-size: 15px; }
}

@media (max-width: 359px) {
  .restart-btn, .online-btn { padding-inline: 12px; }
  body:not(.in-match) .restart-btn { width: 44px; padding: 0; }
  body:not(.in-match) .restart-btn span { display: none; }
  body:not([data-game="hub"]) .logo-full { display: none !important; }
  body:not([data-game="hub"]) .logo-icon { display: block; width: 44px; height: 44px; }
}

@media (max-width: 480px) {
  .sheet { padding: 36px 22px 24px; }
  .lobby-tabs button { font-size: 13px; }
  .notify-bar { grid-template-columns: auto 1fr; }
  .notify-actions { grid-column: 1 / -1; }
  .friend-row { gap: 4px 10px; }
  .friend-actions { gap: 4px; }
  .friend-actions .btn-sm, .dock-scroll .friend-actions .btn-sm { padding: 0 9px; font-size: 13px; }
  .friend-remove { width: 26px; }
  .hud-score { font-size: 24px; }
  .mini-board { width: 50px; height: 50px; }
  .room-code { font-size: 36px; }
}

@media (max-height: 700px) {
  .hint { display: none; }
}

@media (max-width: 560px) {
  .dock-btn {
    right: calc(12px + env(safe-area-inset-right));
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 14px);
    width: 48px;
    height: 48px;
    border-radius: 16px;
  }
  body.dock-open .dock-btn { display: none; }
  body:not([data-game="hub"]):not(.in-match) .bottom-actions { padding-right: 56px; }
  .lobby-view { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  .lobby-view.auth-view { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  .social-dock {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: min(86dvh, 680px);
    padding-bottom: env(safe-area-inset-bottom);
    border-radius: 26px 26px 0 0;
    transform-origin: bottom center;
  }
  .social-dock.show { animation: chat-up-dock .3s var(--ease); }
  .social-dock.full { border-radius: 0; }
  .social-dock .dock-bar { position: relative; padding-top: 20px; touch-action: none; }
  .social-dock.full .dock-bar { padding-top: 20px; }
  .dock-grab {
    display: block;
    position: absolute;
    top: 7px;
    left: 50%;
    width: 38px;
    height: 5px;
    border-radius: 3px;
    background: var(--track);
    transform: translateX(-50%);
  }
  .social-dock.dragging { user-select: none; -webkit-user-select: none; }
}
@keyframes chat-up-dock { from { opacity: 0; transform: translateY(40px); } }

/* ---------- Açılış animasyonu (oturumda bir kez) ---------- */

.splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background:
    radial-gradient(60vmax 50vmax at 50% 45%, rgba(255, 201, 18, .16), transparent 60%),
    radial-gradient(50vmax 40vmax at 100% 0%, rgba(255, 201, 18, .06), transparent 60%),
    #1f1f21;
  color: #ffc912;
  cursor: pointer;
  transition: opacity .45s var(--ease), transform .45s var(--ease);
}
.splash.out { opacity: 0; transform: scale(1.06); pointer-events: none; }

.sp-logo { display: block; width: min(64vmin, 300px); aspect-ratio: 1; overflow: visible; }
.sp-symbol { fill: currentColor; }
.sp-core, .sp-fragment, .sp-star, .sp-wave {
  transform-box: view-box;
  transform-origin: 145.72px 141.683px;
  will-change: transform, opacity;
}
.sp-core {
  animation: sp-core-arrive 790ms cubic-bezier(.16, 1.1, .3, 1) both,
             sp-core-idle 4200ms ease-in-out 1100ms infinite;
}
.sp-fragment { animation: sp-fragment-arrive 900ms cubic-bezier(.13, 1, .3, 1) var(--delay) both; }
.sp-star {
  transform-origin: 126.999px 124.116px;
  animation: sp-star-arrive 800ms cubic-bezier(.18, 1.4, .3, 1) 340ms both,
             sp-star-twinkle 3200ms ease-in-out 1150ms infinite;
}
.sp-wave {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  opacity: 0;
  animation: sp-shockwave 1050ms ease-out 170ms both;
}
.sp-wave.sp-two { animation-delay: 330ms; }
.sp-word {
  font: 700 clamp(30px, 8vmin, 44px) / 1 var(--font-display);
  color: #f2f2f2;
  text-shadow: 0 4px 0 #ffc912;
  animation: sp-word-in 600ms var(--bounce) 650ms both;
}

@keyframes sp-core-arrive {
  0% { transform: scale(.38) rotate(-22deg); opacity: 0; }
  67% { transform: scale(1.075) rotate(4deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes sp-core-idle {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.027); }
}
@keyframes sp-fragment-arrive {
  0% { transform: translate(var(--from-x), var(--from-y)) scale(.2) rotate(var(--turn)); opacity: 0; }
  50% { opacity: 1; }
  76% { transform: translate(0, 0) scale(1.055) rotate(-2deg); }
  100% { transform: translate(0, 0) scale(1) rotate(0); opacity: 1; }
}
@keyframes sp-star-arrive {
  0% { transform: scale(0) rotate(-65deg); opacity: 0; }
  75% { transform: scale(1.25) rotate(12deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes sp-star-twinkle {
  0%, 65%, 100% { transform: scale(1) rotate(0); opacity: 1; }
  76% { transform: scale(1.2) rotate(13deg); opacity: .75; }
  87% { transform: scale(.96) rotate(-7deg); opacity: 1; }
}
@keyframes sp-shockwave {
  0% { opacity: .65; transform: scale(.46); stroke-width: 5; }
  100% { opacity: 0; transform: scale(1.48); stroke-width: .5; }
}
@keyframes sp-word-in { from { opacity: 0; transform: translateY(14px) scale(.9); } }

@media (prefers-reduced-motion: reduce) {
  .sp-core, .sp-fragment, .sp-star, .sp-wave, .sp-word { animation: none !important; transform: none !important; }
  .sp-wave { opacity: 0 !important; }
}
