/* Online Yanık arayüzü */
/* Kart oyunu olduğu için sayfanın TAMAMI yeşil çuha desenidir (base.css'teki genel koyu arka planın yerine geçer),
   böylece masa ile geri kalan alan arasında siyah/kopuk bölge kalmaz; el de bu deseni görür. */
body {
  background-image:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .035) 0 2px, transparent 2px 26px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .035) 0 2px, transparent 2px 26px),
    radial-gradient(140% 90% at 50% -10%, color-mix(in srgb, var(--felt) 65%, transparent), transparent 60%),
    linear-gradient(180deg, var(--felt), var(--felt-2));
  background-attachment: fixed, fixed, fixed, fixed;
}
.tools { display: flex; gap: 8px; }
.banner { margin: 0 auto 8px; width: min(560px, 100% - 32px); padding: 10px 16px; border-radius: 14px; background: color-mix(in srgb, var(--warn) 20%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--warn) 55%, transparent); font-weight: 700; text-align: center; }
.view { width: min(760px, 100% - 24px); margin: 0 auto; padding-bottom: 40px; }
.panel { width: min(440px, 100%); margin: 8px auto 0; padding: 26px 22px; display: grid; gap: 14px; }
.panel h2 { font-size: 26px; letter-spacing: -0.02em; }
.panel.center { text-align: center; justify-items: center; }
.field { display: grid; gap: 6px; text-align: left; width: 100%; font-weight: 700; font-size: 14.5px; }
.wide { width: 100%; }
.or { display: grid; place-items: center; position: relative; color: var(--muted); font-size: 13px; }
.or::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--border); }
.or span { position: relative; background: var(--bg); padding: 0 12px; border-radius: 99px; }
.err { color: var(--danger); min-height: 1.3em; font-size: 14.5px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
#codeInput { text-transform: uppercase; letter-spacing: .3em; text-align: center; font-weight: 800; font-size: 20px; }

/* Bekleme odası */
.code { font-size: clamp(44px, 14vw, 68px); font-weight: 900; letter-spacing: .18em; padding-left: .18em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.1; }
.plist { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 8px; width: 100%; text-align: left; }
.plist li { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); font-weight: 700; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); flex: none; }
.dot.off { background: var(--danger); }
.tag { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); }

/* Masa */
.table { display: grid; gap: 10px; }
.scorebar { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; }
.chip { flex: 1 0 auto; min-width: 92px; padding: 6px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); font-size: 13.5px; line-height: 1.3; }
.chip b { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }
.chip.turn { border-color: var(--accent-2); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-2) 40%, transparent); }
.chip.me b::after { content: ' (sen)'; color: var(--muted); font-weight: 500; }
.chip.dead { opacity: .55; }
.chip.warn { border-color: var(--warn); }
.opps { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.opp { display: grid; justify-items: center; gap: 4px; padding: 8px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); min-width: 110px; }
.opp.turn { border-color: var(--accent-2); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-2) 40%, transparent); }
.opp.dead { opacity: .5; }
.opp .nm { font-weight: 700; font-size: 14px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backs { display: flex; height: 40px; padding-left: 20px; }
.backs .pc.back { width: 26px; height: 38px; margin-left: -18px; border-radius: 5px; }
.felt { border-radius: 24px; padding: 16px 12px 14px; display: grid; gap: 12px; justify-items: center; background: radial-gradient(120% 120% at 50% 0%, var(--felt), var(--felt-2)); border: 1px solid var(--border); box-shadow: inset 0 0 40px rgba(0, 0, 0, .25); }
.piles { display: flex; gap: 26px; align-items: center; }
.pile { display: grid; justify-items: center; gap: 6px; background: none; border: 0; padding: 4px; color: var(--text); border-radius: 12px; }
.pile small { color: color-mix(in srgb, var(--text) 80%, transparent); font-weight: 700; }
.pile:disabled { cursor: default; opacity: .9; }
.pile.can { animation: bob 1.4s ease-in-out infinite; }
.pile.can .pc { box-shadow: 0 0 0 3px var(--accent-2), 0 10px 22px rgba(0, 0, 0, .35); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.status { font-weight: 700; text-align: center; min-height: 1.5em; }
.timer { width: min(320px, 100%); height: 8px; border-radius: 99px; background: rgba(0, 0, 0, .25); overflow: hidden; }
.timer i { display: block; height: 100%; width: 100%; background: var(--grad); transform-origin: 0 50%; }
.timer.low i { background: var(--danger); }

/* Kâğıtlar */
.pc { --w: 46px; --h: 66px; position: relative; display: inline-grid; align-content: center; justify-items: center; width: var(--w); height: var(--h); padding: 0; border-radius: 8px; background: #fbfbfb; color: #1d1b34; border: 1px solid rgba(0, 0, 0, .2); box-shadow: 0 5px 12px rgba(0, 0, 0, .25); font-weight: 800; line-height: 1; user-select: none; }
.pc .r { font-size: calc(var(--w) * .42); }
.pc .s { font-size: calc(var(--w) * .42); }
.pc.red { color: #dc2626; }
.pc.joker { color: #7c3aed; background: linear-gradient(135deg, #fff, #f3e8ff); }
.pc.joker .r { font-size: calc(var(--w) * .3); letter-spacing: .02em; }
.pc.back { background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .12) 0 5px, transparent 5px 10px), linear-gradient(135deg, var(--accent), var(--accent-3)); border-color: rgba(255, 255, 255, .35); }
.pc.big { --w: 56px; --h: 80px; }
.pc.sm { --w: 30px; --h: 42px; border-radius: 5px; box-shadow: 0 2px 5px rgba(0, 0, 0, .2); }
.pc.empty { background: transparent; border: 2px dashed rgba(255, 255, 255, .35); box-shadow: none; }
button.pc { cursor: pointer; padding: 0; transition: transform .15s, box-shadow .15s; }

/* El: tek sıra, taşarsa yatay kaydırılır (sürükleyerek dizmeyle çakışmasın diye kaydırma dokunuşu kart üstünde değil boşlukta yapılır) */
.hand { display: flex; flex-direction: column; gap: 10px; padding: 10px 6px 14px; min-height: 100px; }
.hand-groups { display: flex; flex-wrap: wrap; gap: 8px 10px; justify-content: center; }
.hand-rest { display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-padding: 0 12px; padding: 8px 8px 10px; border-radius: 16px; border: 1px dashed var(--border); }
.hand-rest:empty { display: none; }
.grp { display: flex; gap: 6px; flex: none; }
.hand .pc { --w: clamp(38px, 10.4vw, 56px); --h: calc(var(--w) * 1.42); flex: none; }
.hand button.pc { position: relative; touch-action: none; transition: transform .15s, box-shadow .15s; }
.hand button.pc:hover { transform: translateY(-4px); }
.hand button.pc.sel { transform: translateY(-14px); box-shadow: 0 0 0 3px var(--accent-2), 0 12px 22px rgba(0, 0, 0, .35); }
.hand button.pc.sug::after { content: '✦'; position: absolute; top: -9px; right: -5px; font-size: 13px; color: var(--ok); text-shadow: 0 0 6px rgba(0, 0, 0, .5); z-index: 2; }
.hand button.pc.dragging { position: relative; z-index: 30; cursor: grabbing; transition: none; box-shadow: 0 16px 30px rgba(0, 0, 0, .4); }
.hint { text-align: center; font-size: 12.5px; color: var(--muted); margin: -4px 0 2px; }
.pile.drop-target .pc { box-shadow: 0 0 0 3px var(--ok), 0 0 22px color-mix(in srgb, var(--ok) 60%, transparent); }
.actions { display: flex; gap: 10px; justify-content: center; }
.actions .btn { min-width: 130px; }
.open { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 50% { box-shadow: 0 0 0 10px transparent; } }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; color: var(--muted); font-size: 13.5px; text-align: center; }
.quit { justify-self: center; font-size: 13px; padding: 8px 16px; }

/* Pencereler (el sonu, oyun sonu, kurallar) */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; overflow: auto; padding: 16px; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.sheet { width: min(560px, 100%); margin: auto; padding: 24px 20px; display: grid; gap: 12px; animation: pop .25s ease-out; background: color-mix(in srgb, var(--bg) 94%, var(--surface-2)); }
.sheet h2 { font-size: 24px; letter-spacing: -0.02em; text-align: center; }
.sheet p { color: var(--muted); }
.sheet .rules { display: grid; gap: 8px; color: var(--text); font-size: 15px; }
.sheet .rules p { color: var(--text); }
.results { display: grid; gap: 10px; }
.res { display: grid; gap: 6px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.res.win { border-color: var(--ok); }
.res.dead { opacity: .7; }
.res .head { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.res .pts { margin-left: auto; font-variant-numeric: tabular-nums; }
.res .cards { display: flex; flex-wrap: wrap; gap: 4px; }
.res .cards .sep { width: 8px; }
.sheet .row .btn { flex: 1 1 140px; }
.winner { text-align: center; font-size: 46px; }

@media (min-width: 700px) {
  .pc { --w: 54px; --h: 77px; }
  .hand .pc { --w: 56px; }
  .piles { gap: 40px; }
}

/* Telefon: her şey biraz daha sıkı, tek elle kullanılabilir */
@media (max-width: 480px) {
  .top { padding: 10px 12px; gap: 8px; }
  .top h1 { font-size: 17px; }
  .pill { height: 36px; padding: 0 12px; font-size: 13.5px; }
  .pill.icon { width: 36px; }
  .view { width: 100%; padding: 0 8px 24px; }
  .panel { padding: 20px 16px; }
  .table { gap: 8px; }
  .scorebar { gap: 6px; }
  .chip { min-width: 78px; padding: 5px 10px; font-size: 12.5px; }
  .chip b { max-width: 100px; font-size: 13px; }
  .opps { gap: 6px; }
  .opp { min-width: 84px; padding: 6px 9px; }
  .felt { padding: 12px 8px 10px; border-radius: 18px; }
  .piles { gap: 18px; }
  .pc { --w: 44px; --h: 63px; }
  .pc.big { --w: 50px; --h: 71px; }
  .status { font-size: 14.5px; }
  .hand { min-height: 90px; }
  .hand .pc { --w: 46px; }
  .actions .btn { min-width: 0; flex: 1; padding: 12px 10px; font-size: 14.5px; }
  .sheet { padding: 18px 14px; border-radius: 20px; }
  .sheet .winner { font-size: 38px; }
  .res .cards { gap: 3px; }
  .code { letter-spacing: .12em; padding-left: .12em; }
}
/* Yatay/kısa ekranlar (küçük telefon yatayda): dikey yer kazan */
@media (max-height: 560px) {
  .felt { padding: 8px 8px 6px; gap: 6px; }
  .hand { min-height: 74px; padding: 6px 6px 10px; }
  .hint { display: none; }
  .opps { display: none; } /* kâğıt sayıları scorebar'da zaten var */
}
