/* ==========================================================================
   TAF — çocuklar için birlikte oyun platformu
   Yan (yatay) ekran öncelikli. Ölçüler rem ile, rem de ekrana göre ölçeklenir.
   ========================================================================== */

:root {
  --ink: #24135F;
  --ink-2: #4B3C8A;
  --ink-3: #8C82B8;
  --paper: #FFFFFF;
  --paper-2: #F4F1FF;
  --paper-3: #E8E2FF;

  --grape: #7C5CFF;  --grape-d: #5A3BE0;
  --sun: #FFC93C;    --sun-d: #E8A400;
  --coral: #FF6B6B;  --coral-d: #E04848;
  --mint: #2FD38A;   --mint-d: #1BA86A;
  --sky: #45C4F5;    --sky-d: #1E9BD0;
  --pink: #FF7AC6;   --pink-d: #E0529F;

  --bg-1: #1B0E4D;
  --bg-2: #3B1E95;
  --bg-3: #6A2BB8;

  --r-sm: 0.8rem;
  --r: 1.25rem;
  --r-lg: 1.8rem;
  --shadow: 0 0.6rem 1.6rem rgba(20, 6, 70, 0.28);
  --shadow-sm: 0 0.3rem 0.8rem rgba(20, 6, 70, 0.18);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  color-scheme: light;
}

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

html {
  font-size: clamp(13px, 1.6vmin + 0.35vmax, 22px);
  height: 100%;
  overscroll-behavior: none;
}

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: "Baloo 2", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg-1);
  -webkit-user-select: none;
  user-select: none;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

input, button { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
img { display: block; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

/* ---------- Gökyüzü arka planı ---------- */
#sky {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background:
    radial-gradient(60rem 40rem at 85% -10%, rgba(255, 122, 198, .35), transparent 60%),
    radial-gradient(50rem 40rem at -10% 110%, rgba(69, 196, 245, .30), transparent 60%),
    linear-gradient(160deg, var(--bg-2) 0%, var(--bg-1) 55%, #12093A 100%);
}
#sky .star {
  position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff;
  animation: twinkle var(--d, 3s) ease-in-out infinite; animation-delay: var(--delay, 0s); opacity: .2;
}
#sky .blob {
  position: absolute; border-radius: 50%; filter: blur(2px); opacity: .32;
  animation: float var(--d, 14s) ease-in-out infinite alternate;
}
@keyframes twinkle { 50% { opacity: .95; transform: scale(1.4); } }
@keyframes float { to { transform: translate(var(--x, 30px), var(--y, -40px)) scale(1.08); } }

#app {
  position: fixed; inset: 0; z-index: 1;
  padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);
}

/* ---------- Ekran geçişleri ---------- */
.screen { position: absolute; inset: 0; display: flex; animation: screenIn .45s var(--ease-out) both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(1.2rem) scale(.985); } }
.screen.out { animation: screenOut .25s ease-in both; }
@keyframes screenOut { to { opacity: 0; transform: scale(.98); } }

/* ---------- Düğmeler ---------- */
.btn {
  --c: var(--grape); --cd: var(--grape-d); --fg: #fff;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 3.1rem; padding: .35rem 1.5rem .5rem;
  border-radius: 1.1rem; background: var(--c); color: var(--fg);
  font-size: 1.15rem; font-weight: 800; letter-spacing: .01em; white-space: nowrap;
  box-shadow: 0 .32rem 0 var(--cd), 0 .6rem 1rem rgba(20, 6, 70, .25);
  transition: transform .12s ease, box-shadow .12s ease, filter .2s, opacity .2s;
}
.btn::after {
  content: ""; position: absolute; inset: .25rem .6rem auto; height: 35%;
  border-radius: 1rem; background: linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,0)); pointer-events: none;
}
.btn:active:not(:disabled) { transform: translateY(.28rem); box-shadow: 0 .04rem 0 var(--cd), 0 .2rem .4rem rgba(20, 6, 70, .2); }
.btn:disabled { --c: rgba(255,255,255,.16); --cd: rgba(0,0,0,.12); --fg: rgba(255,255,255,.62); cursor: default; }
.btn:disabled::after { display: none; }
.modal .btn:disabled, .card .btn:disabled { --c: var(--paper-2); --cd: var(--paper-3); --fg: var(--ink-3); }
.btn.sun   { --c: var(--sun);   --cd: var(--sun-d);   --fg: var(--ink); }
.btn.mint  { --c: var(--mint);  --cd: var(--mint-d); }
.btn.coral { --c: var(--coral); --cd: var(--coral-d); }
.btn.sky   { --c: var(--sky);   --cd: var(--sky-d); }
.btn.pink  { --c: var(--pink);  --cd: var(--pink-d); }
.btn.ghost { --c: var(--paper-2); --cd: var(--paper-3); --fg: var(--ink); }
.btn.white { --c: #fff; --cd: #D9D1FF; --fg: var(--ink); }
.btn.big { min-height: 3.8rem; font-size: 1.45rem; padding: .4rem 2.2rem .6rem; border-radius: 1.35rem; }
.btn.small { min-height: 2.4rem; font-size: .95rem; padding: .2rem 1rem .35rem; border-radius: .9rem; box-shadow: 0 .22rem 0 var(--cd); }
.btn.block { width: 100%; }
.btn svg { width: 1.3em; height: 1.3em; flex: none; }

.icon-btn {
  width: 3rem; height: 3rem; border-radius: 1rem; display: grid; place-items: center;
  background: rgba(255,255,255,.14); color: #fff; transition: transform .15s var(--ease-pop), background .2s;
}
.icon-btn:active { transform: scale(.9); }
.icon-btn svg { width: 1.5rem; height: 1.5rem; }
.icon-btn.light { background: var(--paper-2); color: var(--ink); }

/* Canlı yenilemelerde giriş animasyonlarını tekrar oynatma */
.page.no-anim, .no-anim .group-card, .no-anim .invite-card, .no-anim .seat { animation: none !important; }

/* ---------- Kartlar ---------- */
.card {
  background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow);
  position: relative;
}

/* ---------- Avatar ---------- */
.avatar {
  --size: 3.4rem;
  position: relative; flex: none; width: var(--size); height: var(--size); border-radius: 50%;
  display: grid; place-items: center; font-size: calc(var(--size) * .58); line-height: 1;
  background: var(--bg, #FFB547);
  box-shadow: inset 0 calc(var(--size) * -.07) 0 rgba(0,0,0,.12), 0 0 0 calc(var(--size) * .06) #fff;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar .emo { transform: translateY(4%); }
.avatar .dot {
  position: absolute; right: 2%; bottom: 2%; width: 26%; height: 26%; border-radius: 50%;
  background: #B9B3D6; box-shadow: 0 0 0 calc(var(--size) * .05) #fff;
}
.avatar .dot.on { background: var(--mint); }
.avatar .dot.on::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--mint);
  animation: ping 1.8s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(2.4); opacity: 0; } }
.avatar.off { filter: grayscale(.85); opacity: .55; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { --size: 2.2rem; margin-left: -.55rem; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-stack .more {
  --size: 2.2rem; margin-left: -.55rem; width: var(--size); height: var(--size); border-radius: 50%;
  background: var(--paper-3); color: var(--ink-2); display: grid; place-items: center; font-size: .85rem;
  box-shadow: 0 0 0 calc(var(--size) * .06) #fff;
}

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label { font-size: .95rem; color: var(--ink-2); font-weight: 700; padding-left: .3rem; }
.input {
  width: 100%; height: 3.4rem; padding: 0 1.1rem; border-radius: 1.1rem; outline: none;
  border: .2rem solid var(--paper-3); background: var(--paper-2); font-size: 1.35rem; font-weight: 700; color: var(--ink);
  transition: border-color .2s, background .2s, box-shadow .2s;
  -webkit-user-select: text; user-select: text;
}
.input:focus { border-color: var(--grape); background: #fff; box-shadow: 0 0 0 .3rem rgba(124, 92, 255, .18); }
.input::placeholder { color: var(--ink-3); font-weight: 600; }
.hint { font-size: .9rem; color: var(--ink-3); padding-left: .3rem; min-height: 1.3rem; }
.hint.ok { color: var(--mint-d); }
.hint.err { color: var(--coral-d); }

/* ---------- PIN ---------- */
.pin-dots { display: flex; gap: .8rem; justify-content: center; }
.pin-dots span {
  width: 3rem; height: 3.4rem; border-radius: 1rem; background: var(--paper-2); border: .2rem solid var(--paper-3);
  display: grid; place-items: center; font-size: 1.8rem; font-weight: 800; color: var(--ink);
  transition: transform .2s var(--ease-pop), background .2s, border-color .2s;
}
.pin-dots span.filled { background: #fff; border-color: var(--grape); transform: scale(1.06); }
.pin-dots span.cur { border-color: var(--grape); box-shadow: 0 0 0 .25rem rgba(124,92,255,.18); }
.pin-dots.shake { animation: shake .45s; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; }
.keypad button {
  height: 3.1rem; border-radius: 1rem; background: var(--paper-2); font-size: 1.5rem; font-weight: 800; color: var(--ink);
  box-shadow: 0 .22rem 0 var(--paper-3); transition: transform .1s, box-shadow .1s;
}
.keypad button:active { transform: translateY(.2rem); box-shadow: 0 0 0 var(--paper-3); background: var(--paper-3); }
.keypad button svg { width: 1.5rem; height: 1.5rem; margin: auto; }

@keyframes shake {
  10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); } 40%, 60% { transform: translateX(8px); }
}

/* ---------- Karşılama ---------- */
.welcome { align-items: center; justify-content: center; gap: 3.5rem; padding: 2rem 2.5rem; overflow: hidden; }
.welcome::before {
  content: ""; position: absolute; inset: -3rem; z-index: -1;
  background: linear-gradient(rgba(14, 10, 60, .55), rgba(14, 10, 60, .7)), url(/img/kapak.webp) center / cover no-repeat;
  filter: blur(18px) saturate(1.2);
}
.cover-art {
  height: min(78vh, 46vw); aspect-ratio: 1; border-radius: 2.4rem; object-fit: cover; flex: none;
  box-shadow: 0 0 0 .35rem rgba(255,255,255,.9), 0 1.6rem 3.5rem rgba(0,0,0,.45);
  animation: logoIn .9s var(--ease-pop) both, floatArt 6s ease-in-out 1s infinite;
}
@keyframes logoIn { from { opacity: 0; transform: scale(.5) rotate(-8deg); } }
@keyframes floatArt { 50% { transform: translateY(-.7rem) rotate(-1deg); } }
.welcome .hero .actions { margin-top: 1rem; }
.welcome h1, .welcome p { text-shadow: 0 .15rem .6rem rgba(0,0,0,.45); }
.welcome .hero { display: flex; flex-direction: column; align-items: flex-start; gap: .8rem; color: #fff; max-width: 30rem; }
.logo { display: flex; align-items: center; gap: .6rem; }
.logo-mark { width: 4.2rem; height: 4.2rem; border-radius: 26%; object-fit: cover; box-shadow: 0 .4rem .9rem rgba(0,0,0,.35), 0 0 0 .14rem rgba(255,255,255,.85); }
.login-logo { width: 7rem; height: 7rem; }
.welcome h1 { font-size: 2.4rem; line-height: 1.1; font-weight: 800; }
.welcome h1 em { font-style: normal; color: var(--sun); }
.welcome p { font-size: 1.15rem; color: rgba(255,255,255,.75); font-weight: 600; }
.welcome .actions { display: flex; flex-direction: column; gap: .9rem; width: min(21rem, 100%); }
.welcome .actions .btn { width: 100%; }
.welcome .actions .link { color: rgba(255,255,255,.8); font-size: 1.05rem; text-align: center; padding: .4rem; }
.welcome .actions .link b { color: var(--sun); }
@keyframes bob { 50% { transform: translateY(-.8rem) rotate(var(--rot, 4deg)); } }

/* ---------- Kayıt / Giriş sihirbazı ---------- */
.wizard { align-items: center; justify-content: center; padding: 1rem 1.5rem; }
.wizard .panel {
  width: min(56rem, 100%); max-height: 100%; display: grid; grid-template-columns: 17rem 1fr; overflow: hidden;
}
.wizard .side {
  background: linear-gradient(160deg, var(--grape), #9A5CFF 60%, var(--pink));
  color: #fff; padding: 1.6rem 1.4rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
  border-radius: var(--r-lg) 0 0 var(--r-lg); position: relative; overflow: hidden;
}
.wizard .side::before {
  content: ""; position: absolute; width: 16rem; height: 16rem; border-radius: 50%; background: rgba(255,255,255,.1); top: -6rem; right: -6rem;
}
.wizard .side .avatar { --size: 8.5rem; }
.wizard .side .who { font-size: 1.6rem; font-weight: 800; text-align: center; line-height: 1.1; min-height: 1.8rem; }
.wizard .side .who small { display: block; font-size: 1rem; opacity: .8; font-weight: 600; }
.wizard .main { padding: 1.4rem 1.8rem; display: flex; flex-direction: column; gap: 1rem; min-height: 0; overflow-y: auto; }
.wizard .top { display: flex; align-items: center; gap: .8rem; }
.wizard .top h2 { font-size: 1.7rem; font-weight: 800; flex: 1; line-height: 1.1; }
.steps { display: flex; gap: .4rem; }
.steps i { width: .6rem; height: .6rem; border-radius: 1rem; background: var(--paper-3); transition: width .3s var(--ease-out), background .3s; }
.steps i.on { width: 1.6rem; background: var(--grape); }
.steps i.done { background: var(--mint); }
.step-body { display: flex; flex-direction: column; gap: 1rem; animation: stepIn .35s var(--ease-out) both; }
@keyframes stepIn { from { opacity: 0; transform: translateX(1.5rem); } }
.wizard .nav { display: flex; gap: .8rem; justify-content: flex-end; margin-top: auto; padding-top: .3rem; }

.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: .5rem; }
.emoji-grid button {
  aspect-ratio: 1; border-radius: 1rem; font-size: 2.3rem; line-height: 1; background: var(--paper-2);
  transition: transform .18s var(--ease-pop), background .2s, box-shadow .2s;
}
.emoji-grid button:active { transform: scale(.88); }
.emoji-grid button.sel { background: #fff; box-shadow: 0 0 0 .22rem var(--grape); transform: scale(1.08); }
.swatches { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; }
.swatches button {
  width: 2.3rem; height: 2.3rem; border-radius: 50%; background: var(--c);
  box-shadow: inset 0 -.2rem 0 rgba(0,0,0,.12); transition: transform .18s var(--ease-pop);
}
.swatches button.sel { transform: scale(1.18); box-shadow: 0 0 0 .2rem #fff, 0 0 0 .38rem var(--ink); }
.photo-btn { margin-left: auto; }

/* ---------- Kabuk (ana uygulama) ---------- */
.shell { flex-direction: row; }
.rail {
  width: 6.4rem; flex: none; display: flex; flex-direction: column; align-items: center; gap: .6rem;
  padding: 1rem 0 1rem; position: relative;
}
.rail .logo-mark { width: 3.2rem; height: 3.2rem; margin-bottom: .6rem; }
.rail .tab {
  position: relative; width: 4.9rem; padding: .55rem 0 .45rem; border-radius: 1.2rem; color: rgba(255,255,255,.65);
  display: flex; flex-direction: column; align-items: center; gap: .15rem; font-size: .82rem; font-weight: 700;
  transition: color .2s, background .25s, transform .15s var(--ease-pop);
}
.rail .tab svg { width: 1.8rem; height: 1.8rem; }
.rail .tab:active { transform: scale(.92); }
.rail .tab.on { color: var(--ink); background: #fff; box-shadow: var(--shadow-sm); }
.rail .tab.on svg { animation: tabPop .45s var(--ease-pop); }
@keyframes tabPop { 40% { transform: scale(1.25) rotate(-6deg); } }
.rail .tab .badge {
  position: absolute; top: .1rem; right: .65rem; min-width: 1.35rem; height: 1.35rem; padding: 0 .3rem;
  border-radius: 1rem; background: var(--coral); color: #fff; font-size: .8rem; display: grid; place-items: center;
  box-shadow: 0 0 0 .18rem var(--bg-1); animation: badgeIn .5s var(--ease-pop);
}
@keyframes badgeIn { from { transform: scale(0); } }
.rail .me { margin-top: auto; }
.rail .me .avatar { --size: 3rem; }

.content { flex: 1; min-width: 0; position: relative; }
.page { position: absolute; inset: 0; overflow-y: auto; padding: 1.2rem 1.6rem 1.6rem .4rem; animation: screenIn .4s var(--ease-out) both; }
.page-head { display: flex; align-items: center; gap: 1rem; color: #fff; margin-bottom: 1.1rem; min-height: 3rem; }
.page-head h1 { font-size: 2rem; font-weight: 800; line-height: 1; }
.page-head p { color: rgba(255,255,255,.65); font-size: 1rem; font-weight: 600; }
.page-head .grow { flex: 1; min-width: 0; }

/* Oyunlar — kart: yalnız logo ve ad */
.games { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.game-card {
  position: relative; overflow: hidden; border-radius: var(--r-lg); color: #fff; aspect-ratio: 4 / 5;
  max-height: calc(100dvh - 9rem); padding: 1rem .8rem 1.1rem;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: .4rem;
  background: radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,.28), transparent 60%), linear-gradient(160deg, var(--c1), var(--c2));
  box-shadow: inset 0 -.45rem 0 rgba(0,0,0,.14), var(--shadow);
  transition: transform .25s var(--ease-pop), box-shadow .25s; animation: cardIn .5s var(--ease-pop) both;
}
.game-card:nth-child(2) { animation-delay: 60ms; } .game-card:nth-child(3) { animation-delay: 120ms; } .game-card:nth-child(4) { animation-delay: 180ms; }
.game-card:active { transform: scale(.96); }
@media (hover: hover) { .game-card:hover { transform: translateY(-.3rem) rotate(-.6deg); } }
.game-card .logo-art { flex: 1; min-height: 0; width: 100%; display: grid; place-items: center; }
.game-card .logo-art svg { width: 82%; max-height: 100%; filter: drop-shadow(0 .4rem .5rem rgba(0,0,0,.18)); }
.game-card h3 {
  font-size: 1.35rem; font-weight: 800; line-height: 1.05; text-align: center; width: 100%;
  text-shadow: 0 .12rem 0 rgba(0,0,0,.15); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.game-card.soon { filter: saturate(.6) brightness(.95); }
.game-card.soon .logo-art { opacity: .8; }
.game-card .lock {
  position: absolute; top: .6rem; right: .6rem; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0,0,0,.22); font-size: .95rem; z-index: 1;
}
.games.mini { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.games.mini .game-card { max-height: 12rem; }
.games.mini .game-card h3 { font-size: 1rem; white-space: normal; }

/* Gruplar */
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; }
.group-card {
  padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: .7rem; text-align: left;
  transition: transform .2s var(--ease-pop); animation: cardIn .5s var(--ease-pop) both; animation-delay: calc(var(--i, 0) * 60ms);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(1rem) scale(.95); } }
.group-card:active { transform: scale(.97); }
.group-card .row { display: flex; align-items: center; gap: .8rem; }
.group-emoji {
  width: 3.6rem; height: 3.6rem; border-radius: 1.2rem; flex: none; display: grid; place-items: center; font-size: 2rem;
  background: var(--c, var(--grape)); box-shadow: inset 0 -.3rem 0 rgba(0,0,0,.15);
}
.group-card h3 { font-size: 1.35rem; font-weight: 800; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-card .sub { font-size: .9rem; color: var(--ink-3); }
.pill {
  display: inline-flex; align-items: center; gap: .4rem; padding: .1rem .7rem .2rem; border-radius: 1rem;
  font-size: .9rem; font-weight: 800; background: var(--paper-2); color: var(--ink-2); white-space: nowrap;
}
.pill .live { width: .55rem; height: .55rem; border-radius: 50%; background: var(--mint); position: relative; }
.pill .live::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--mint); animation: ping 1.6s infinite; }
.pill.green { background: #DDF8EA; color: var(--mint-d); }
.pill.sun { background: #FFF2C9; color: #A86F00; }
.pill.coral { background: #FFE1E1; color: var(--coral-d); }
.group-card .foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.group-card .tags { display: flex; gap: .4rem; flex-wrap: wrap; }
.new-group {
  border: .22rem dashed rgba(255,255,255,.35); border-radius: var(--r-lg); color: #fff; min-height: 10rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; font-size: 1.2rem; font-weight: 800;
  transition: background .2s, transform .2s var(--ease-pop);
}
.new-group:active { transform: scale(.97); background: rgba(255,255,255,.08); }
.new-group .plus { width: 3.4rem; height: 3.4rem; border-radius: 50%; background: var(--sun); color: var(--ink); display: grid; place-items: center; box-shadow: 0 .3rem 0 var(--sun-d); }
.new-group .plus svg { width: 1.8rem; height: 1.8rem; }

/* Boş durum */
.empty { color: #fff; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 2rem 1rem; }
.empty .hero-emoji { font-size: 4rem; animation: bob 3s ease-in-out infinite; }
.empty h2 { font-size: 1.6rem; font-weight: 800; }
.empty p { color: rgba(255,255,255,.7); max-width: 28rem; }

/* Davetler */
.invites { display: grid; grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); gap: 1rem; }
.invite-card { padding: 1rem 1.1rem; display: flex; align-items: center; gap: 1rem; animation: cardIn .5s var(--ease-pop) both; }
.invite-card .txt { flex: 1; min-width: 0; line-height: 1.2; }
.invite-card .txt b { font-weight: 800; }
.invite-card .txt small { display: block; color: var(--ink-3); font-size: .9rem; margin-top: .15rem; }
.invite-card .acts { display: flex; gap: .5rem; }
.invite-card.gone { animation: cardOut .35s ease-in forwards; }
@keyframes cardOut { to { opacity: 0; transform: scale(.9) translateX(2rem); } }

/* Profil */
.profile { display: grid; grid-template-columns: 19rem 1fr; gap: 1rem; align-items: start; }
.profile .me-card { padding: 1.6rem 1.2rem; display: flex; flex-direction: column; align-items: center; gap: .6rem; text-align: center; }
.profile .me-card .avatar { --size: 8rem; }
.profile .me-card h2 { font-size: 1.8rem; font-weight: 800; line-height: 1.05; margin-top: .4rem; }
.profile .me-card .uname { color: var(--ink-3); font-size: 1.05rem; }
.settings { padding: .5rem; display: flex; flex-direction: column; }
.setting { display: flex; align-items: center; gap: 1rem; padding: .9rem 1rem; border-radius: 1.1rem; text-align: left; width: 100%; }
.setting + .setting { border-top: .12rem solid var(--paper-2); }
.settings.flat { padding: 0; box-shadow: none; }
.settings.flat .setting { padding: .7rem .4rem; }
.setting.danger b { color: var(--coral-d); }
.setting .ico { width: 2.8rem; height: 2.8rem; border-radius: .9rem; display: grid; place-items: center; font-size: 1.5rem; background: var(--paper-2); flex: none; }
.setting .txt { flex: 1; line-height: 1.2; }
.setting .txt b { font-size: 1.15rem; font-weight: 800; display: block; }
.setting .txt small { color: var(--ink-3); font-size: .9rem; }
.switch { width: 3.6rem; height: 2.1rem; border-radius: 2rem; background: var(--paper-3); position: relative; transition: background .25s; flex: none; }
.switch::after {
  content: ""; position: absolute; top: .2rem; left: .2rem; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: #fff;
  box-shadow: 0 .15rem .3rem rgba(0,0,0,.2); transition: transform .3s var(--ease-pop);
}
.switch.on { background: var(--mint); }
.switch.on::after { transform: translateX(1.5rem); }

/* ---------- Lobi ---------- */
.lobby { display: grid; grid-template-columns: 1fr 19rem; gap: 1rem; height: calc(100% - 4.1rem); min-height: 15rem; }
.lobby .members { padding: 1rem; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr); gap: .7rem; }
.seat {
  border-radius: 1.3rem; background: var(--paper-2); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .3rem; padding: .5rem; position: relative; text-align: center; min-height: 0;
  transition: background .3s, transform .25s var(--ease-pop), box-shadow .3s;
}
.seat .avatar { --size: clamp(2.6rem, 11vh, 5.5rem); transition: transform .4s var(--ease-pop); }
.seat .name { font-weight: 800; font-size: 1.05rem; line-height: 1.05; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .state { font-size: .8rem; font-weight: 800; color: var(--ink-3); line-height: 1; }
.seat.here { background: #EEE9FF; }
.seat.here .state { color: var(--grape); }
.seat.ready { background: #DDF8EA; box-shadow: inset 0 0 0 .2rem var(--mint); }
.seat.ready .state { color: var(--mint-d); }
.seat.ready .avatar { animation: readyHop .6s var(--ease-pop); }
@keyframes readyHop { 40% { transform: translateY(-.7rem) scale(1.08); } }
.seat .check {
  position: absolute; z-index: 2; top: .35rem; right: .35rem; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--mint); color: #fff;
  display: grid; place-items: center; animation: badgeIn .45s var(--ease-pop); box-shadow: 0 .15rem 0 var(--mint-d);
}
.seat .check svg { width: 1.1rem; height: 1.1rem; }
.seat .crown { position: absolute; z-index: 2; top: .25rem; left: .4rem; font-size: 1.3rem; filter: drop-shadow(0 .1rem .1rem rgba(0,0,0,.2)); }
.seat.offline .avatar { filter: grayscale(.9); opacity: .5; }
.seat.offline .name { color: var(--ink-3); }
.seat.empty { background: transparent; border: .2rem dashed var(--paper-3); color: var(--ink-3); font-size: .9rem; font-weight: 800; }
.seat.empty .plus { width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--paper-2); display: grid; place-items: center; }
.seat.empty .plus svg { width: 1.3rem; height: 1.3rem; }
.seat.pending { background: transparent; border: .2rem dashed #CFC5FF; }
.seat.pending .avatar { opacity: .6; }

.lobby .side { display: flex; flex-direction: column; gap: .8rem; min-height: 0; overflow-y: auto; }
.lobby .side .game-card.picked {
  aspect-ratio: auto; max-height: none; flex: none; height: clamp(5.5rem, 24vh, 10rem); flex-direction: row; justify-content: flex-start;
  padding: .6rem 1rem; gap: .8rem; animation: none;
}
.lobby .side .game-card.picked .logo-art { flex: none; width: auto; height: 100%; aspect-ratio: 1; max-width: 45%; }
.lobby .side .game-card.picked .logo-art svg { width: 100%; height: 100%; }
.lobby .side .game-card.picked h3 { font-size: 1.5rem; text-align: left; white-space: normal; }
.settings-bar {
  display: flex; align-items: center; gap: .5rem; padding: .6rem .7rem; border-radius: 1.1rem; background: rgba(255,255,255,.12);
  color: #fff; text-align: left; width: 100%; transition: background .2s;
}
.settings-bar:not(:disabled):active { background: rgba(255,255,255,.2); }
.settings-bar:disabled { cursor: default; }
.settings-bar .chips { display: flex; flex-wrap: wrap; gap: .35rem; flex: 1; }
.settings-bar .edit { font-size: 1.3rem; }
.chip { background: rgba(255,255,255,.16); border-radius: 1rem; padding: .05rem .6rem .15rem; font-size: .88rem; font-weight: 800; white-space: nowrap; }
.seg { display: flex; gap: .5rem; }
.seg button {
  flex: 1; height: 3rem; border-radius: 1rem; background: var(--paper-2); font-size: 1.15rem; font-weight: 800; color: var(--ink);
  box-shadow: 0 .2rem 0 var(--paper-3); transition: transform .15s var(--ease-pop), background .2s;
}
.seg button.on { background: var(--grape); color: #fff; box-shadow: 0 .2rem 0 var(--grape-d); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .45rem; }
.cat-grid button {
  display: flex; align-items: center; gap: .4rem; padding: .45rem .6rem; border-radius: .9rem; background: var(--paper-2);
  font-size: .95rem; font-weight: 800; color: var(--ink); text-align: left; line-height: 1.1;
}
.cat-grid button span { font-size: 1.3rem; }
.cat-grid button.on { background: #EEE9FF; box-shadow: inset 0 0 0 .18rem var(--grape); }
.stats { display: flex; flex-direction: column; gap: .3rem; width: 100%; max-width: 30rem; margin: 0 auto; }
.stat { display: flex; align-items: center; gap: .6rem; padding: .3rem .7rem; border-radius: .9rem; background: var(--paper-2); font-weight: 800; font-size: .95rem; }
.stat.me { background: #FFF2C9; }
.stat .avatar { --size: 1.9rem; }
.stat .nm { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat .sc { min-width: 2.6rem; text-align: right; font-size: 1.1rem; }
.lobby .cta { display: flex; flex-direction: column; gap: .5rem; }
.lobby .cta .note { color: rgba(255,255,255,.75); text-align: center; font-size: .95rem; min-height: 1.4rem; }
.lobby .cta .btn.big { width: 100%; }
.btn.ready-on { animation: readyPulse 1.8s ease-in-out infinite; }
@keyframes readyPulse { 50% { box-shadow: 0 .32rem 0 var(--cd), 0 0 0 .55rem rgba(47, 211, 138, .25); } }
.lobby-live-game { display: flex; align-items: center; gap: .6rem; }

/* ---------- Pencere (modal) ---------- */
#layer { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.modal-wrap {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 1rem; pointer-events: auto;
  background: rgba(15, 5, 50, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fadeIn .25s ease both;
}
.modal-wrap.out { animation: fadeOut .2s ease both; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.modal {
  width: min(32rem, 100%); max-height: 100%; overflow-y: auto; padding: 1.4rem 1.6rem; display: flex; flex-direction: column; gap: 1rem;
  animation: modalIn .45s var(--ease-pop) both;
}
.modal.wide { width: min(46rem, 100%); }
.modal-wrap.out .modal { animation: modalOut .2s ease-in both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(2rem) scale(.9); } }
@keyframes modalOut { to { opacity: 0; transform: scale(.94); } }
.modal .mh { display: flex; align-items: center; gap: .8rem; }
.modal .mh h2 { font-size: 1.6rem; font-weight: 800; flex: 1; line-height: 1.1; }
.modal .mf { display: flex; gap: .7rem; justify-content: flex-end; }
.modal .lead { color: var(--ink-2); font-size: 1.05rem; line-height: 1.35; }
.list { display: flex; flex-direction: column; gap: .4rem; }
.list .item { display: flex; align-items: center; gap: .8rem; padding: .5rem .6rem; border-radius: 1rem; background: var(--paper-2); }
.list .item .avatar { --size: 2.4rem; }
.list .item .grow { flex: 1; min-width: 0; line-height: 1.15; }
.list .item small { color: var(--ink-3); display: block; }

/* ---------- Bildirim ---------- */
#toasts { position: fixed; top: calc(.8rem + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: .5rem; align-items: center; pointer-events: none; }
.toast {
  background: #fff; color: var(--ink); padding: .55rem 1.2rem .65rem; border-radius: 1.2rem; font-weight: 800; font-size: 1.05rem;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: .6rem; animation: toastIn .45s var(--ease-pop) both; max-width: 90vw;
}
.toast.err { background: var(--coral); color: #fff; }
.toast.ok { background: var(--mint); color: #fff; }
.toast.out { animation: toastOut .3s ease-in forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-1.5rem) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-1rem); } }
#net {
  position: fixed; bottom: calc(.8rem + var(--safe-b)); left: 50%; transform: translateX(-50%); z-index: 90;
  background: var(--ink); color: #fff; padding: .35rem 1rem .45rem; border-radius: 1rem; font-size: .95rem; font-weight: 700;
  box-shadow: var(--shadow); animation: toastIn .4s var(--ease-pop);
}

/* ---------- Konfeti ---------- */
#confetti { position: fixed; inset: 0; z-index: 120; pointer-events: none; }

/* ==========================================================================
   ADAM ASMACA
   ========================================================================== */
.hm { position: fixed; inset: 0; z-index: 40; display: grid; padding: calc(.7rem + var(--safe-t)) calc(1rem + var(--safe-r)) calc(.7rem + var(--safe-b)) calc(1rem + var(--safe-l));
  grid-template-columns: minmax(12rem, 26%) 1fr minmax(11rem, 20%); grid-template-rows: auto 1fr; gap: .8rem 1rem;
  background:
    radial-gradient(40rem 30rem at 50% 120%, rgba(69, 196, 245, .22), transparent 60%),
    radial-gradient(40rem 30rem at 100% -20%, rgba(255, 122, 198, .25), transparent 60%),
    linear-gradient(160deg, var(--bg-2) 0%, var(--bg-1) 60%, #12093A 100%);
  animation: screenIn .5s var(--ease-out) both; }
.hm-top { grid-column: 1 / -1; display: flex; align-items: center; gap: .8rem; color: #fff; min-height: 2.8rem; }
.hm-top .round { font-size: 1.1rem; font-weight: 800; background: rgba(255,255,255,.14); padding: .15rem .9rem .25rem; border-radius: 1rem; }
.hm-top .cat {
  display: flex; align-items: center; gap: .5rem; font-size: 1.35rem; font-weight: 800; background: #fff; color: var(--ink);
  padding: .1rem 1.1rem .2rem .5rem; border-radius: 1.4rem; box-shadow: var(--shadow-sm);
}
.hm-top .cat .ci { width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--sun); display: grid; place-items: center; font-size: 1.2rem; }
.hm-top .cat.pop { animation: catPop .6s var(--ease-pop); }
@keyframes catPop { from { transform: scale(.6); opacity: 0; } }
.hm-top .spacer { flex: 1; }
.hearts { display: flex; gap: .2rem; }
.hearts span { font-size: 1.35rem; transition: transform .3s var(--ease-pop), filter .3s, opacity .3s; filter: drop-shadow(0 .1rem .1rem rgba(0,0,0,.25)); }
.hearts span.lost { filter: grayscale(1); opacity: .35; transform: scale(.8); }
.hearts span.break { animation: heartBreak .6s ease; }
@keyframes heartBreak { 30% { transform: scale(1.5) rotate(-12deg); } 60% { transform: scale(.7) rotate(10deg); } }

.hm-stage { grid-row: 2; padding: .6rem; display: flex; flex-direction: column; min-height: 0; }
.hm-stage svg { width: 100%; height: 100%; min-height: 0; flex: 1; }
.hm-stage .part { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); opacity: 0; }
.hm-stage .part.show { opacity: 1; animation: draw .7s var(--ease-out) forwards; }
.hm-stage .fill-part { opacity: 0; transform-box: fill-box; transform-origin: center; }
.hm-stage .fill-part.show { animation: popIn .5s var(--ease-pop) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: scale(1); } }
.hm-stage.hit { animation: shake .5s; }
.hm-stage .face { transition: opacity .3s; }
.hm-stage .sway { transform-origin: 150px 62px; animation: sway 3s ease-in-out infinite; }
@keyframes sway { 50% { transform: rotate(3deg); } }

.hm-center { grid-row: 2; display: flex; flex-direction: column; min-height: 0; gap: .8rem; }
.word { flex: 1; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .45rem; min-height: 0; padding: .2rem; container-type: inline-size; }
.word .gap { width: 1.4rem; }
.tile {
  --w: max(1.6rem, min(5rem, 13vh, calc((100cqw - (var(--n, 8) - 1) * .45rem) / var(--n, 8))));
  width: var(--w); height: calc(var(--w) * 1.18); border-radius: calc(var(--w) * .22); perspective: 30rem; position: relative;
}
.tile .in {
  position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .6s var(--ease-pop);
}
.tile .face-a, .tile .face-b {
  position: absolute; inset: 0; border-radius: inherit; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: grid; place-items: center; font-weight: 800; font-size: calc(var(--w) * .66); line-height: 1;
}
.tile .face-a { background: rgba(255,255,255,.14); border: .18rem solid rgba(255,255,255,.28); border-radius: calc(var(--w) * .22); }
.tile .face-a::after { content: ""; position: absolute; bottom: 18%; width: 46%; height: .22rem; border-radius: 1rem; background: rgba(255,255,255,.5); }
.tile .face-b { background: #fff; color: var(--ink); transform: rotateY(180deg); box-shadow: inset 0 calc(var(--w) * -.08) 0 var(--paper-3); border-radius: calc(var(--w) * .22); }
.tile.open .in { transform: rotateY(180deg); }
.tile.missed .face-b { background: #FFE1E1; color: var(--coral-d); box-shadow: inset 0 calc(var(--w) * -.08) 0 #FFC4C4; }
.tile.win .face-b { background: #DDF8EA; color: var(--mint-d); box-shadow: inset 0 calc(var(--w) * -.08) 0 #B6EED2; animation: tileWin .7s var(--ease-pop) both; animation-delay: calc(var(--i) * 60ms); }
@keyframes tileWin { 40% { transform: rotateY(180deg) translateY(-.8rem) scale(1.1); } to { transform: rotateY(180deg); } }

.kbd { display: flex; flex-direction: column; gap: .4rem; position: relative; }
.kbd .row { display: flex; gap: .4rem; justify-content: center; }
.key {
  --c: #fff; --cd: #CFC5FF; --fg: var(--ink);
  flex: 1; max-width: 3.8rem; height: clamp(2.3rem, 9.5vh, 3.6rem); border-radius: .85rem; background: var(--c); color: var(--fg);
  font-size: clamp(1.05rem, 5vh, 1.6rem); font-weight: 800; box-shadow: 0 .26rem 0 var(--cd);
  transition: transform .1s, box-shadow .1s, background .25s, opacity .25s;
}
.key:active:not(:disabled) { transform: translateY(.22rem); box-shadow: 0 .04rem 0 var(--cd); }
.key.hit { --c: var(--mint); --cd: var(--mint-d); --fg: #fff; }
.key.miss { --c: #B9B0DC; --cd: #9C92C6; --fg: rgba(255,255,255,.75); opacity: .55; }
.key:disabled { cursor: default; }
.key.just { animation: keyJust .5s var(--ease-pop); }
@keyframes keyJust { 40% { transform: scale(1.25); } }
.kbd.locked .key:not(.hit):not(.miss) { opacity: .45; }
.kbd .wait {
  position: absolute; inset: -.3rem; display: flex; align-items: center; justify-content: center; pointer-events: none;
}
.kbd .wait span {
  display: flex; align-items: center; gap: .6rem; background: var(--ink); color: #fff; padding: .4rem 1.2rem .5rem .5rem; border-radius: 2rem;
  font-size: 1.15rem; font-weight: 800; box-shadow: var(--shadow); animation: toastIn .4s var(--ease-pop);
}
.kbd .wait .avatar { --size: 2.2rem; }

.hm-players { grid-row: 2; display: flex; flex-direction: column; gap: .5rem; min-height: 0; overflow-y: auto; padding: .1rem; }
.pl {
  display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; border-radius: 1.1rem; background: rgba(255,255,255,.1); color: #fff;
  position: relative; transition: background .3s, transform .35s var(--ease-pop), box-shadow .3s; flex: none;
}
.pl .avatar { --size: 2.6rem; }
.pl .nm { flex: 1; min-width: 0; font-weight: 800; font-size: 1rem; line-height: 1.05; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl .nm small { display: block; font-size: .75rem; opacity: .7; font-weight: 700; }
.pl .sc { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.pl.turn { background: #fff; color: var(--ink); transform: scale(1.04); box-shadow: 0 0 0 .2rem var(--sun), var(--shadow-sm); }
.pl.left { opacity: .4; }
.pl .ring { position: absolute; left: .35rem; top: 50%; width: 3.3rem; height: 3.3rem; transform: translate(-.05rem, -50%) rotate(-90deg); pointer-events: none; }
.pl .ring circle { fill: none; stroke: var(--sun); stroke-width: 3.2; stroke-linecap: round; }
.pl .ring circle.warn { stroke: var(--coral); }
.float-pts {
  position: absolute; right: .5rem; top: -.2rem; font-weight: 800; font-size: 1.3rem; color: var(--mint); pointer-events: none;
  text-shadow: 0 .1rem 0 rgba(0,0,0,.15); animation: floatUp 1.2s var(--ease-out) forwards;
}
@keyframes floatUp { from { opacity: 0; transform: translateY(.6rem) scale(.6); } 20% { opacity: 1; transform: translateY(0) scale(1.15); } to { opacity: 0; transform: translateY(-2rem); } }

.timer { display: flex; align-items: center; gap: .5rem; font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 4.5rem; justify-content: flex-end; }
.timer .bar { width: 6rem; height: .7rem; border-radius: 1rem; background: rgba(255,255,255,.18); overflow: hidden; }
.timer .bar i { display: block; height: 100%; border-radius: 1rem; background: var(--sun); transform-origin: left; }
.timer.warn { color: var(--coral); animation: pulse .5s ease-in-out infinite alternate; }
.timer.warn .bar i { background: var(--coral); }
@keyframes pulse { to { transform: scale(1.08); } }

.hm-actions { display: flex; align-items: center; justify-content: center; gap: .8rem; min-height: 2.4rem; }
.hm-actions .guess-note { color: rgba(255,255,255,.7); font-size: .95rem; font-weight: 700; }
.guess-btn:not(:disabled) { animation: guessGlow 2s ease-in-out infinite; }
@keyframes guessGlow { 50% { box-shadow: 0 .22rem 0 var(--cd), 0 0 0 .45rem rgba(255, 201, 60, .28); } }
.word-input { text-align: center; font-size: 1.8rem; letter-spacing: .12em; text-transform: uppercase; }
.pl .dart { font-size: 1rem; }
.pl.out { opacity: .5; filter: grayscale(.8); }
.pl.out .nm small { color: var(--coral); opacity: 1; }
.tag-out { background: #FFE1E1; color: var(--coral-d); border-radius: .7rem; padding: 0 .5rem .1rem; font-size: .8rem; }

/* Sıra sende afişi */
.banner {
  position: fixed; left: 0; right: 0; top: 50%; z-index: 60; transform: translateY(-50%); display: flex; justify-content: center; pointer-events: none;
}
.banner .b {
  display: flex; align-items: center; gap: 1rem; padding: .6rem 2.2rem .8rem 1rem; border-radius: 3rem; background: var(--sun); color: var(--ink);
  font-size: 2.6rem; font-weight: 800; box-shadow: 0 .45rem 0 var(--sun-d), 0 1.5rem 3rem rgba(0,0,0,.35);
  animation: bannerIn 1.6s var(--ease-out) forwards;
}
.banner .b .avatar { --size: 4rem; }
.banner .b.coral { background: var(--coral); color: #fff; box-shadow: 0 .45rem 0 var(--coral-d), 0 1.5rem 3rem rgba(0,0,0,.35); }
@keyframes bannerIn {
  0% { opacity: 0; transform: translateX(-40vw) skewX(12deg); }
  18% { opacity: 1; transform: translateX(1rem) skewX(-4deg); }
  26% { transform: translateX(0) skewX(0); }
  78% { opacity: 1; transform: translateX(0) scale(1); }
  100% { opacity: 0; transform: translateX(30vw) scale(.9); }
}

/* Tur sonu / oyun sonu */
.result { text-align: center; align-items: center; }
.result .emoji-big { font-size: 4rem; line-height: 1; animation: bob 2.4s ease-in-out infinite; }
.result h2 { font-size: 2rem !important; }
.result .reveal { display: flex; gap: .3rem; justify-content: center; flex-wrap: wrap; }
.result .reveal span { min-width: 2.4rem; height: 2.9rem; padding: 0 .3rem; border-radius: .7rem; background: var(--paper-2); display: grid; place-items: center; font-size: 1.6rem; font-weight: 800;
  animation: popIn .4s var(--ease-pop) both; animation-delay: calc(var(--i) * 50ms); }
.result .reveal span.miss { background: #FFE1E1; color: var(--coral-d); }
.result .reveal span.sp { background: transparent; min-width: 1rem; }
.next-bar { width: 100%; height: .6rem; border-radius: 1rem; background: var(--paper-2); overflow: hidden; }
.next-bar i { display: block; height: 100%; background: var(--grape); border-radius: 1rem; transform-origin: left; animation: shrink linear forwards; }
@keyframes shrink { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.podium { display: flex; align-items: flex-end; justify-content: center; gap: .8rem; margin-top: .5rem; }
.podium .p { display: flex; flex-direction: column; align-items: center; gap: .3rem; width: 7.5rem; animation: rise .8s var(--ease-pop) both; }
.podium .p .avatar { --size: 3.6rem; }
.podium .p.first .avatar { --size: 4.6rem; }
.podium .p .nm { font-weight: 800; font-size: 1.05rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .p .blk {
  width: 100%; border-radius: 1rem 1rem .4rem .4rem; display: grid; place-items: center; color: #fff; font-size: 1.6rem; font-weight: 800;
  box-shadow: inset 0 -.4rem 0 rgba(0,0,0,.15);
}
.podium .p.first { order: 2; animation-delay: .5s; } .podium .p.first .blk { height: 6rem; background: var(--sun); color: var(--ink); }
.podium .p.second { order: 1; animation-delay: .25s; } .podium .p.second .blk { height: 4.3rem; background: var(--sky); }
.podium .p.third { order: 3; animation-delay: 0s; } .podium .p.third .blk { height: 3.2rem; background: var(--pink); }
.podium .p .pts { font-size: .95rem; color: var(--ink-2); font-weight: 800; }
@keyframes rise { from { opacity: 0; transform: translateY(3rem); } }
.crown-anim { font-size: 2rem; animation: crown 1s var(--ease-pop) 1.2s both; margin-bottom: -.6rem; }
@keyframes crown { from { opacity: 0; transform: translateY(-3rem) rotate(-30deg); } }

/* ---------- Küçük yükseklik (telefon yan) ---------- */
@media (max-height: 460px) {
  html { font-size: 13px; }
  .rail { width: 5.4rem; gap: .35rem; padding-top: .6rem; }
  .rail .tab { width: 4.3rem; padding: .35rem 0 .3rem; font-size: .75rem; }
  .rail .tab svg { width: 1.5rem; height: 1.5rem; }
  .rail .logo-mark { width: 2.6rem; height: 2.6rem; margin-bottom: .2rem; }
  .page { padding: .8rem 1rem 1rem .3rem; }
  .page-head { margin-bottom: .7rem; }
  .page-head h1 { font-size: 1.7rem; }
  .welcome { gap: 2rem; }
  .welcome h1 { font-size: 2rem; }
  .wizard { padding: .5rem 1rem; }
  .wizard .panel { grid-template-columns: 13rem 1fr; }
  .wizard .side .avatar { --size: 6rem; }
  .wizard .main { padding: 1rem 1.2rem; gap: .7rem; }
  .emoji-grid button { font-size: 1.9rem; border-radius: .8rem; }
  .keypad button { height: 2.6rem; }
  .hm { gap: .5rem .8rem; }
  .hm-top { min-height: 2.4rem; }
  .pl .avatar { --size: 2.2rem; }
  .pl .ring { width: 2.9rem; height: 2.9rem; }
  .banner .b { font-size: 2rem; }
  .modal { padding: 1rem 1.2rem; gap: .7rem; }
  .result h2 { font-size: 1.6rem !important; }
  .result .emoji-big { font-size: 3rem; }
  .podium { margin-top: 0; }
  .podium .p .avatar { --size: 2.8rem; }
  .podium .p.first .avatar { --size: 3.4rem; }
  .podium .p.first .blk { height: 3.6rem; }
  .podium .p.second .blk { height: 2.7rem; }
  .podium .p.third .blk { height: 2rem; }
  .podium .p .blk { font-size: 1.2rem; }
  .crown-anim { font-size: 1.5rem; }
  .btn.big { min-height: 3.2rem; font-size: 1.25rem; }
}

/* ---------- Dar yatay pencere ---------- */
@media (max-width: 760px) and (orientation: landscape) {
  .lobby { grid-template-columns: 1fr 14rem; }
  .profile { grid-template-columns: 1fr; }
}

/* ==========================================================================
   DİKEY EKRAN (telefon/tablet dik, dar pencere): her şey alt alta
   ========================================================================== */
@media (orientation: portrait) {
  /* Karşılama */
  .welcome { flex-direction: column; gap: 1.8rem; padding: 1.5rem; justify-content: center; }
  .cover-art { height: auto; width: min(82vw, 46vh); }
  .welcome .hero { align-items: center; text-align: center; }
  .welcome .hero { max-width: 34rem; width: 100%; }
  .welcome .actions { width: min(24rem, 100%); }

  /* Kayıt/giriş: yan panel üstte ince şerit */
  .wizard { align-items: flex-start; padding: 1rem; overflow-y: auto; }
  .wizard .panel { grid-template-columns: 1fr; max-height: none; }
  .wizard .side { flex-direction: row; justify-content: flex-start; padding: 1rem 1.2rem; border-radius: var(--r-lg) var(--r-lg) 0 0; gap: 1rem; }
  .wizard .side .avatar { --size: 4.6rem; }
  .wizard .side .who { text-align: left; font-size: 1.4rem; }
  .wizard .side .login-logo { width: 4rem; height: 4rem; }
  .wizard .main { overflow: visible; }

  /* Oyunlar */
  .games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-card { max-height: none; }

  .profile { grid-template-columns: 1fr; }

  /* Lobi */
  .lobby { grid-template-columns: 1fr; height: auto; }
  .lobby .members { grid-template-rows: none; grid-auto-rows: minmax(7.6rem, auto); }
  .seat .avatar { --size: clamp(2.6rem, 13vw, 4.4rem); }
  .lobby .side { flex-direction: column; }
  .lobby .side .game-card.picked { flex: none; height: 6.5rem; }

  /* Oyun: üstte çizim + oyuncular, altta kelime + klavye */
  .hm {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 42%) minmax(0, 1fr);
    grid-template-areas: "top top" "stage players" "center center";
  }
  .hm-top { grid-area: top; flex-wrap: wrap; row-gap: .5rem; }
  .hm-stage { grid-area: stage; }
  .hm-players { grid-area: players; }
  .hm-center { grid-area: center; justify-content: flex-end; }
  .hm-center .word { flex: 1; max-height: 9rem; }
  .key { height: clamp(2.6rem, 6.5vh, 4rem); font-size: clamp(1.1rem, 3.2vh, 1.8rem); max-width: 4.4rem; }
  .kbd .row { gap: .35rem; }
  .podium .p { width: 6rem; }
}

/* ---------- Telefon genişliği: menü alta iner ---------- */
@media (max-width: 699px) {
  .shell { flex-direction: column-reverse; }
  .rail {
    width: auto; flex-direction: row; justify-content: space-around; gap: .2rem;
    padding: .35rem .4rem calc(.35rem + var(--safe-b)); margin-bottom: calc(-1 * var(--safe-b));
    background: rgba(18, 8, 56, .88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, .08); z-index: 5;
  }
  .rail > div:first-child { display: none; }
  .rail .tab { flex: 1; width: auto; max-width: 6rem; }
  .rail .tab .badge { right: calc(50% - 1.9rem); }
  .page { padding: 1rem 1rem 1.4rem; }
  .page-head { gap: .6rem; }
  .page-head h1 { font-size: 1.7rem; }
  .page-head .grow h1, .page-head .grow p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lobby .members { padding: .6rem; gap: .5rem; }
  .seat .name { font-size: .95rem; }
  .invites { grid-template-columns: 1fr; }
  .invite-card { flex-wrap: wrap; }
  .invite-card .acts { width: 100%; justify-content: flex-end; }
  .hm { gap: .5rem .6rem; padding-left: calc(.6rem + var(--safe-l)); padding-right: calc(.6rem + var(--safe-r)); }
  .hm-top .round { font-size: .95rem; }
  .hm-top .cat { font-size: 1.15rem; }
  .hearts span { font-size: 1.05rem; }
  .timer .bar { width: 3.5rem; }
  .pl { padding: .35rem .45rem; gap: .45rem; }
  .pl .avatar { --size: 2.1rem; }
  .pl .ring { width: 2.8rem; height: 2.8rem; }
  .banner .b { font-size: 1.8rem; padding: .5rem 1.4rem .65rem .7rem; }
  .banner .b .avatar { --size: 2.8rem; }
  .emoji-grid { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 480px) {
  .btn .lbl { display: none; }
  .result .reveal { gap: .2rem; }
  .result .reveal span { min-width: 1.75rem; height: 2.3rem; font-size: 1.25rem; padding: 0 .15rem; }
  .btn.small:has(.lbl) { padding: .2rem .7rem .35rem; }
  .games { gap: .7rem; }
  .game-card h3 { font-size: 1.1rem; }
  .games.mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .podium { gap: .4rem; }
  .podium .p { width: 5.2rem; }
}

/* ---------- Büyük ekran: içerik çok yayılmasın ---------- */
@media (min-width: 1700px) {
  .page > * { max-width: 1500px; margin-left: auto; margin-right: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
