/* ═══ v6: oda paneli (Oda kur / Maç bul / Katıl / Odalarım / Açık odalar) + maç bul penceresi ═══
   Önceki panel: backups/oda-paneli-v1 (git tag oda-paneli-v1). */

#screen-play.play-v6,
#queue-modal {
  --pv-surface: #0a0a0b;
  --pv-surface-2: #111113;
  --pv-line: rgba(255,255,255,.08);
  --pv-line-2: rgba(255,255,255,.14);
  --pv-dim: rgba(245,245,244,.62);
  --pv-faint: rgba(245,245,244,.4);
  --pv-paper: #f4f1ea;
  --pv-ease: cubic-bezier(.22,1,.36,1);
}

#screen-play.play-v6 {
  font-family: 'Inter', system-ui, sans-serif; color: #f5f5f4;
  background:
    radial-gradient(ellipse at 70% -10%, rgba(255,255,255,.06), transparent 55%),
    #000;
}
#screen-play.play-v6.hidden { display: none !important; }

/* ── üst çubuk ── */
.pv-top {
  position: sticky; top: 0; z-index: 5;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 16px clamp(16px, 3vw, 32px);
  background: rgba(0,0,0,.7); border-bottom: 1px solid var(--pv-line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.pv-back {
  justify-self: start; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px 9px 11px;
  border-radius: 999px; border: 1px solid var(--pv-line-2); background: rgba(255,255,255,.04); color: var(--pv-dim);
  font: 500 13px/1 'Inter', sans-serif; transition: color .2s, border-color .2s, gap .3s var(--pv-ease);
}
.pv-back:hover { color: #fff; border-color: rgba(255,255,255,.35); gap: 11px; }
.pv-back svg { width: 16px; height: 16px; }

.pv-tabs { display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: rgba(255,255,255,.04); border: 1px solid var(--pv-line-2); }
#screen-play .pv-tabs .tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border: 0; border-radius: 999px; background: none;
  font: 600 13px/1 'Inter', sans-serif; letter-spacing: 0; text-transform: none; color: var(--pv-dim);
  transition: background .35s var(--pv-ease), color .35s;
}
#screen-play .pv-tabs .tab svg { width: 15px; height: 15px; stroke-width: 1.8; }
#screen-play .pv-tabs .tab:hover { color: #fff; background: rgba(255,255,255,.05); }
#screen-play .pv-tabs .tab.active { background: #fff; color: #000; }
#screen-play .pv-tabs .tab::after, #screen-play .pv-tabs .tab::before { display: none; }

.pv-who {
  justify-self: end; display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px;
  border-radius: 999px; border: 1px solid var(--pv-line); background: rgba(255,255,255,.03);
}
.pv-avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #fff; color: #000; }
.pv-avatar svg { width: 15px; height: 15px; }
#screen-play .pv-nick {
  width: 13ch; padding: 0; border: 0; outline: 0; background: none; color: #fff;
  font: 600 13px/1 'Inter', sans-serif; pointer-events: none;
}
#screen-play #nick-ok { width: 15px; height: 15px; color: rgba(255,255,255,.55); }

/* ── düzen ── */
.pv-layout {
  width: min(1120px, 100% - 32px); margin: clamp(28px, 4vw, 48px) auto 64px;
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 16px; align-items: start;
}
.pv-card {
  position: relative; padding: clamp(22px, 3vw, 36px); border-radius: 22px;
  border: 1px solid transparent;
  background:
    linear-gradient(var(--pv-surface), var(--pv-surface)) padding-box,
    linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,.04) 40%, rgba(255,255,255,.08)) border-box;
  box-shadow: 0 40px 120px -40px rgba(255,255,255,.08);
}
.pv-pane { display: grid; gap: 20px; animation: pv-in .5s var(--pv-ease) both; }
.pv-pane.hidden { display: none; }
@keyframes pv-in { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

.pv-head h2 { margin: 6px 0 6px; font-size: clamp(26px, 2.6vw, 32px); font-weight: 600; letter-spacing: -.035em; line-height: 1.1; }
.pv-head p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--pv-dim); }
.pv-head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.pv-eyebrow { font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--pv-faint); }

.pv-field { display: grid; gap: 8px; min-width: 0; }
.pv-field.hidden { display: none; }
.pv-label { font-size: 13px; font-weight: 500; color: var(--pv-dim); }
.pv-label em { font-style: normal; font-size: 12px; color: var(--pv-faint); margin-left: 4px; }
.pv-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; }

.pv-input {
  display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 6px 0 14px; border-radius: 12px;
  background: #050505; border: 1px solid var(--pv-line-2);
  transition: border-color .25s, box-shadow .25s, background .25s;
}
.pv-input:hover { border-color: rgba(255,255,255,.24); }
.pv-input:focus-within { border-color: rgba(255,255,255,.6); box-shadow: 0 0 0 4px rgba(255,255,255,.07); background: var(--pv-surface-2); }
.pv-input > svg { width: 17px; height: 17px; flex: none; color: var(--pv-faint); stroke-width: 1.7; }
.pv-input:focus-within > svg { color: #fff; }
#screen-play .pv-input input {
  flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent;
  font: 500 15px/1 'Inter', sans-serif; color: #fff;
}
#screen-play .pv-input input::placeholder { color: rgba(255,255,255,.28); }
#screen-play .pv-input input:-webkit-autofill { -webkit-text-fill-color: #fff; -webkit-box-shadow: 0 0 0 40px var(--pv-surface-2) inset; }
.pv-count { padding-right: 8px; font: 500 11.5px/1 var(--mono); color: var(--pv-faint); }
#screen-play .pw-toggle {
  position: static; transform: none; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; flex: none;
  border: 0; border-radius: 9px; background: transparent; color: var(--pv-faint); transition: background .2s, color .2s;
}
#screen-play .pw-toggle:hover { background: rgba(255,255,255,.06); color: #fff; }
#screen-play .pw-toggle svg { width: 17px; height: 17px; }
.pv-code { height: 64px; }
#screen-play .pv-code input { font: 600 26px/1 var(--mono); letter-spacing: .4em; text-transform: uppercase; }

/* mod kartları */
.pv-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#screen-play .pv-modes .pill {
  position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; row-gap: 3px;
  align-items: center; text-align: left; padding: 16px; height: auto; border-radius: 14px;
  background: #050505; border: 1px solid var(--pv-line-2); color: #fff; font-family: 'Inter', sans-serif;
  text-transform: none; letter-spacing: 0;
  transition: border-color .3s, background .3s, transform .4s var(--pv-ease);
}
#screen-play .pv-modes .pill:hover { border-color: rgba(255,255,255,.3); transform: translateY(-1px); }
#screen-play .pv-modes .pill svg {
  grid-row: 1 / span 2; width: 38px; height: 38px; padding: 9px; border-radius: 10px;
  background: rgba(255,255,255,.06); border: 1px solid var(--pv-line); stroke-width: 1.6;
  transition: background .3s, color .3s;
}
#screen-play .pv-modes .pill b { font-size: 15px; font-weight: 600; }
#screen-play .pv-modes .pill small { font-size: 12.5px; color: var(--pv-faint); }
#screen-play .pv-modes .pill::after {
  content: ''; position: absolute; top: 14px; right: 14px; width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid var(--pv-line-2); transition: border-color .3s, box-shadow .3s, background .3s;
}
#screen-play .pv-modes .pill.active { border-color: rgba(255,255,255,.7); background: var(--pv-surface-2); }
#screen-play .pv-modes .pill.active svg { background: #fff; color: #000; }
#screen-play .pv-modes .pill.active::after { border-color: #fff; background: #fff; box-shadow: inset 0 0 0 4px #111113; }

/* segmentli seçim */
.pv-seg { display: inline-flex; gap: 2px; padding: 4px; width: max-content; border-radius: 12px; background: #050505; border: 1px solid var(--pv-line-2); }
#screen-play .pv-seg .pill {
  min-width: 52px; height: 38px; padding: 0 14px; border: 0; border-radius: 9px; background: none;
  font: 600 14px/1 'Inter', sans-serif; color: var(--pv-dim); text-transform: none; letter-spacing: 0;
  transition: background .3s var(--pv-ease), color .3s;
}
#screen-play .pv-seg .pill:hover { color: #fff; }
#screen-play .pv-seg .pill.active { background: #fff; color: #000; }

/* ana buton */
.pv-submit {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; margin-top: 4px; border: 0; border-radius: 12px; background: #fff; color: #000;
  font: 600 15px/1 'Inter', sans-serif; transition: background .3s, transform .3s var(--pv-ease), gap .4s var(--pv-ease);
}
.pv-submit svg { width: 18px; height: 18px; }
.pv-submit::after {
  content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(0,0,0,.08) 50%, transparent 70%);
  transform: translateX(-100%); transition: transform .8s var(--pv-ease);
}
.pv-submit:hover { background: var(--pv-paper); gap: 14px; }
.pv-submit:hover::after { transform: translateX(100%); }
.pv-submit:active { transform: scale(.985); }
.pv-submit:disabled { opacity: .6; }
.pv-hint { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--pv-faint); }
.pv-hint svg { width: 15px; height: 15px; }

.pv-icon {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none; padding: 0;
  border-radius: 12px; border: 1px solid var(--pv-line-2); background: rgba(255,255,255,.04); color: #fff;
  transition: background .2s, transform .5s var(--pv-ease);
}
.pv-icon:hover { background: rgba(255,255,255,.1); transform: rotate(180deg); }
.pv-icon svg { width: 17px; height: 17px; }

/* oda listesi (app.js üretir: .room-row) */
#screen-play .pv-list { display: grid; gap: 8px; max-height: none; overflow: visible; padding: 0; }
#screen-play .pv-list .room-row {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto auto; align-items: center; gap: 14px;
  padding: 12px 12px 12px 14px; margin: 0; border-radius: 14px;
  background: #050505; border: 1px solid var(--pv-line); color: #fff;
  transition: border-color .3s, background .3s, transform .4s var(--pv-ease);
  animation: pv-in .45s var(--pv-ease) both;
}
#screen-play .pv-list .room-row:nth-child(2) { animation-delay: .04s; }
#screen-play .pv-list .room-row:nth-child(3) { animation-delay: .08s; }
#screen-play .pv-list .room-row:nth-child(4) { animation-delay: .12s; }
#screen-play .pv-list .room-row:nth-child(n+5) { animation-delay: .16s; }
#screen-play .pv-list .room-row:hover { border-color: var(--pv-line-2); background: var(--pv-surface-2); }
#screen-play .pv-list .emblem {
  display: grid; place-items: center; width: 40px; height: 40px; margin: 0; border-radius: 11px;
  background: rgba(255,255,255,.06); border: 1px solid var(--pv-line); color: #fff;
}
#screen-play .pv-list .emblem svg { width: 18px; height: 18px; stroke-width: 1.7; }
#screen-play .pv-list .ri { display: grid; gap: 4px; min-width: 0; }
#screen-play .pv-list .ri b { display: flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#screen-play .pv-list .ri > span, #screen-play .pv-list .meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--pv-faint); }
#screen-play .pv-list .mono { font-family: var(--mono); color: var(--pv-dim); letter-spacing: .06em; }
#screen-play .pv-list .lock-ic { width: 13px; height: 13px; color: var(--pv-faint); }
#screen-play .pv-list .pill-paused {
  padding: 3px 7px; border-radius: 999px; border: 1px solid var(--pv-line-2); background: rgba(255,255,255,.04);
  font: 600 10px/1 var(--mono); letter-spacing: .08em; color: var(--pv-dim);
}
#screen-play .pv-list .tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  font: 600 10.5px/1 var(--mono); letter-spacing: .08em; border: 1px solid var(--pv-line-2); background: rgba(255,255,255,.04); color: var(--pv-dim);
}
#screen-play .pv-list .tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
#screen-play .pv-list .tag.lobby { color: #fff; border-color: rgba(255,255,255,.35); }
#screen-play .pv-list .tag.lobby::before { animation: pv-pulse 1.6s infinite; }
@keyframes pv-pulse { 50% { opacity: .3; } }
#screen-play .pv-list .cnt { font: 600 13px/1 var(--mono); color: var(--pv-dim); font-variant-numeric: tabular-nums; }
#screen-play .pv-list .btn {
  height: 36px; padding: 0 16px; border-radius: 10px; border: 0; background: #fff; color: #000;
  font: 600 13px/1 'Inter', sans-serif; letter-spacing: 0; text-transform: none; box-shadow: none;
  transition: background .2s, transform .3s var(--pv-ease);
}
#screen-play .pv-list .btn:hover:not(:disabled) { background: var(--pv-paper); transform: translateY(-1px); }
#screen-play .pv-list .btn:disabled { background: rgba(255,255,255,.08); color: var(--pv-faint); }
#screen-play .pv-list .empty {
  padding: 40px 20px; border-radius: 14px; border: 1px dashed var(--pv-line-2); text-align: center;
  font-size: 14px; color: var(--pv-faint); background: transparent;
}
#screen-play #ptab-mine .room-row { grid-template-columns: 40px minmax(0, 1fr) auto auto; }

/* ── yan panel ── */
.pv-side { display: grid; gap: 16px; position: sticky; top: 92px; }
.play-v6:has(#ptab-create.hidden) .pv-preview { display: none; }
.pv-preview { border-radius: 22px; overflow: hidden; background: var(--pv-surface); border: 1px solid var(--pv-line); }
.pv-preview-map {
  position: relative; aspect-ratio: 16 / 9; border-bottom: 1px solid var(--pv-line);
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 24px 24px,
    #050505;
}
.pv-preview-map svg { position: absolute; inset: 8%; width: 84%; height: 84%; animation: pv-float 9s ease-in-out infinite; }
.pv-preview-map svg path { fill: #141416; stroke: rgba(255,255,255,.28); stroke-width: .8; vector-effect: non-scaling-stroke; transition: fill .6s var(--pv-ease); }
.pv-preview-map svg path.on { fill: #fff; stroke: #000; }
.pv-preview-map svg path.on2 { fill: #7a7a7d; stroke: #000; }
@keyframes pv-float { 50% { transform: translateY(-4px); } }
.pv-preview-body { padding: 18px 20px 20px; }
.pv-preview-body h3 { margin: 8px 0 14px; font-size: 19px; font-weight: 600; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.pv-sum div { padding: 10px 12px; border-radius: 12px; background: #050505; border: 1px solid var(--pv-line); }
.pv-sum dt { font-size: 11.5px; color: var(--pv-faint); margin-bottom: 4px; }
.pv-sum dd { margin: 0; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-sum dd.flash { animation: pv-flash .6s var(--pv-ease); }
@keyframes pv-flash { from { color: #000; background: #fff; } }

.pv-perks { display: grid; gap: 2px; padding: 8px; border-radius: 22px; background: var(--pv-surface); border: 1px solid var(--pv-line); }
.pv-perks > div { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 12px; border-radius: 14px; transition: background .3s; }
.pv-perks > div:hover { background: rgba(255,255,255,.03); }
.pv-perks svg { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid var(--pv-line); stroke-width: 1.6; }
.pv-perks span { font-size: 13px; line-height: 1.5; color: var(--pv-faint); }
.pv-perks b { display: block; margin-bottom: 2px; font-size: 14px; font-weight: 600; color: #fff; }

/* ── maç bul penceresi ── */
#queue-modal .queue-card {
  /* .modal-card eski açık temayı !important ile basıyor; burada geri alıyoruz */
  width: min(440px, calc(100vw - 32px)); padding: 28px; border-radius: 22px !important; color: #fff !important;
  font-family: 'Inter', system-ui, sans-serif;
  border: 1px solid transparent !important;
  background:
    linear-gradient(var(--pv-surface), var(--pv-surface)) padding-box,
    linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,.05) 45%, rgba(255,255,255,.1)) border-box !important;
  box-shadow: 0 40px 120px -30px rgba(0,0,0,.9);
  animation: pv-in .45s var(--pv-ease) both;
}
#queue-modal .card-title { margin: 0 0 6px; font-family: 'Inter', sans-serif; font-size: 26px; font-weight: 600; letter-spacing: -.035em; text-transform: none; color: #fff; }
#queue-modal .card-sub, #queue-modal .sub { margin: 0; font-size: 14px; line-height: 1.55; color: var(--pv-dim); }
#queue-modal #queue-setup { display: grid; gap: 18px; margin-top: 22px; }
#queue-modal #queue-setup.hidden, #queue-modal #queue-wait.hidden, #queue-modal .field.hidden { display: none; }
#queue-modal .field { display: grid; gap: 8px; margin: 0; }
#queue-modal .field label { font-size: 13px; font-weight: 500; color: var(--pv-dim); letter-spacing: 0; text-transform: none; }
#queue-modal .pills { display: inline-flex; gap: 2px; padding: 4px; width: max-content; border-radius: 12px; background: #050505; border: 1px solid var(--pv-line-2); }
#queue-modal .pill {
  height: 38px; padding: 0 16px; border: 0; border-radius: 9px; background: none; color: var(--pv-dim);
  font: 600 14px/1 'Inter', sans-serif; text-transform: none; letter-spacing: 0; transition: background .3s, color .3s;
}
#queue-modal .pill.active { background: #fff; color: #000; }
#queue-modal .pill:disabled { opacity: .35; }
#queue-modal #queue-lock { padding: 12px 14px; border-radius: 12px; background: #050505; border: 1px solid var(--pv-line); font-size: 13px; }
#queue-modal .btn-primary, #queue-modal .btn-outline {
  height: 50px; width: 100%; border-radius: 12px; font: 600 15px/1 'Inter', sans-serif; text-transform: none; letter-spacing: 0; box-shadow: none;
}
#queue-modal .btn-primary { background: #fff !important; color: #000 !important; border: 0 !important; }
#queue-modal .btn-primary:hover { background: var(--pv-paper) !important; }
#queue-modal .btn-outline { background: transparent !important; color: #fff !important; border: 1px solid var(--pv-line-2) !important; }
#queue-modal .modal-x { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 50% !important; border: 1px solid var(--pv-line-2) !important; background: rgba(255,255,255,.04) !important; color: #fff !important; }
#queue-modal #queue-wait { display: grid; justify-items: center; gap: 10px; margin-top: 24px; text-align: center; }
#queue-modal #queue-wait::before {
  content: ''; width: 72px; height: 72px; border-radius: 50%; margin-bottom: 6px;
  border: 2px solid rgba(255,255,255,.1); border-top-color: #fff; animation: pv-spin 1s linear infinite;
}
@keyframes pv-spin { to { transform: rotate(360deg); } }
#queue-modal .rs-kicker { margin: 0; font: 600 11px/1 var(--mono); letter-spacing: .16em; color: var(--pv-faint) !important; }
#queue-modal .queue-time { margin: 0; font-size: 40px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: #fff !important; }

/* ── duyarlı ── */
@media (max-width: 980px) {
  .pv-top { grid-template-columns: auto 1fr; }
  .pv-tabs { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; overflow-x: auto; scrollbar-width: none; }
  .pv-tabs::-webkit-scrollbar { display: none; }
  #screen-play .pv-tabs .tab { flex: none; }
  .pv-layout { grid-template-columns: 1fr; }
  .pv-side { position: static; }
  .pv-perks { display: none; }
}
@media (max-width: 600px) {
  #screen-play .pv-tabs .tab svg { display: none; }
  .pv-row { grid-template-columns: 1fr; }
  .pv-modes { grid-template-columns: 1fr; }
  #screen-play .pv-list .room-row, #screen-play #ptab-mine .room-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  #screen-play .pv-list .tag { display: none; }
  #screen-play .pv-list .cnt { display: none; }
  .pv-sum { grid-template-columns: 1fr 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  #screen-play.play-v6 *, #queue-modal * { animation: none !important; transition: none !important; }
}
