:root {
  --bg: #0c1117;
  --glass: rgba(13, 18, 24, 0.74);
  --glass-b: rgba(255, 255, 255, 0.09);
  --txt: #e9eef3;
  --dim: #93a1ae;
  --gold: #ffd25a;
  --green: #35c07a;
  --red: #ec5560;
  --tap: 44px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--txt);
  font: 14px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overscroll-behavior: none; }
body { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui button, #ui select, #ui input, #ui .panel, #ui .card, #ui .overlay, #ui #shoot-panel, #ui #top-buttons, #ui details { pointer-events: auto; }

button { font: inherit; color: inherit; cursor: pointer; }
.card, .panel {
  background: var(--glass); border: 1px solid var(--glass-b); border-radius: 14px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.lbl { font-size: 11px; letter-spacing: .12em; color: var(--dim); font-weight: 700; }
.lbl b { color: var(--gold); font-size: 13px; margin-left: 4px; }

/* ---- üst çubuk ---- */
#hud-top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: flex-start; gap: 10px;
  padding: calc(10px + var(--safe-t)) calc(10px + var(--safe-r)) 0 calc(10px + var(--safe-l)); flex-wrap: wrap; pointer-events: none; }
#score-card, #bant-card { padding: 7px 12px 8px; min-width: 96px; }
#score-card .big { font-size: 30px; font-weight: 800; line-height: 1.05; color: #fff; }
#score-card .big small { font-size: 14px; color: var(--dim); font-weight: 600; margin-left: 2px; }
#score-card .mini { display: flex; gap: 10px; font-size: 12px; color: var(--dim); margin-top: 2px; }
#score-card .mini b { color: var(--txt); }
.pips { display: flex; gap: 5px; margin: 6px 0 5px; align-items: center; min-height: 14px; }
.pips i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #5a6772; background: transparent; transition: background .15s, border-color .15s, transform .15s; }
.pips i.on { background: var(--gold); border-color: var(--gold); transform: scale(1.1); }
.pips i.ok { background: var(--green); border-color: var(--green); }
.pips .more { font-weight: 800; color: var(--gold); font-size: 13px; margin-left: 2px; }
.chips { display: flex; gap: 6px; }
.chip { font-size: 11px; padding: 2px 8px; border-radius: 99px; border: 1px solid #44525e; color: var(--dim); }
.chip.on { background: rgba(53, 192, 122, .2); border-color: var(--green); color: #bff0d6; }
#top-buttons { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.seg { display: flex; background: var(--glass); border: 1px solid var(--glass-b); border-radius: 12px; overflow: hidden; backdrop-filter: blur(8px); }
.seg button { background: transparent; border: 0; padding: 0 12px; min-height: var(--tap); min-width: var(--tap); font-weight: 600; color: var(--dim); }
.seg button + button { border-left: 1px solid var(--glass-b); }
.seg button.active { background: rgba(255, 210, 90, .18); color: var(--gold); }
.ibtn { background: var(--glass); border: 1px solid var(--glass-b); border-radius: 12px; min-height: var(--tap); min-width: var(--tap); padding: 0 12px; font-weight: 600; backdrop-filter: blur(8px); }
.seg button:hover, .ibtn:hover { filter: brightness(1.25); }
.ibtn .ic { display: none; font-size: 20px; line-height: 1; }
body.portrait .ibtn .ic, body.compact .ibtn .ic { display: inline; }
body.portrait .ibtn .tx, body.compact .ibtn .tx { display: none; }
body.portrait .ibtn, body.compact .ibtn { padding: 0; width: var(--tap); }

/* ---- bildirim ---- */
#toast { position: absolute; left: 50%; top: 24%; transform: translate(-50%, -8px); opacity: 0; padding: 10px 20px; border-radius: 99px;
  background: rgba(10, 14, 18, .88); border: 1px solid var(--glass-b); font-weight: 700; font-size: 17px; pointer-events: none;
  transition: opacity .2s, transform .2s; max-width: 92vw; text-align: center; white-space: normal; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.good { border-color: var(--green); color: #c9ffe0; background: rgba(8, 40, 24, .92); }
#toast.bad { border-color: var(--red); color: #ffd0d3; background: rgba(48, 12, 16, .92); }
#toast.info { border-color: var(--gold); color: #ffeab0; }

/* ---- güç ---- */
#power-panel { position: absolute; left: calc(12px + var(--safe-l)); top: 50%; transform: translateY(-46%); width: 66px; height: min(54vh, 380px);
  padding: 10px 6px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
#power-track { position: relative; flex: 1; width: 100%; min-height: 120px; border-radius: 10px; background: #1a232c; border: 1px solid #2c3a46; overflow: hidden; touch-action: none; cursor: ns-resize; outline: none; }
#power-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 50%; background: linear-gradient(to top, #35c07a, #ffd25a 65%, #ec5560); }
#power-track::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(to top, transparent 0 9.2%, rgba(0,0,0,.35) 9.2% 10%); pointer-events: none; }
#power-thumb { position: absolute; left: -2px; right: -2px; height: 6px; bottom: 50%; margin-bottom: -3px; background: #fff; border-radius: 3px; box-shadow: 0 0 8px rgba(255,255,255,.7); pointer-events: none; }
#power-track:focus-visible { box-shadow: 0 0 0 2px var(--gold); }

/* ---- falso ---- */
#spin-panel { position: absolute; right: calc(14px + var(--safe-r)); bottom: calc(96px + var(--safe-b)); width: 150px; padding: 8px 8px 8px; text-align: center; }
#spin-pad { position: relative; width: 118px; height: 118px; margin: 6px auto 4px; border-radius: 50%; touch-action: none; cursor: crosshair; outline: none; }
#spin-pad .ball { position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #fff 0%, #ece8dc 38%, #b8b4a6 78%, #8a8678 100%); box-shadow: 0 2px 10px rgba(0,0,0,.5), inset 0 0 0 2px rgba(0,0,0,.25); }
#spin-pad .cross { position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background:
    linear-gradient(rgba(0,0,0,.22), rgba(0,0,0,.22)) center / 100% 1px no-repeat,
    linear-gradient(rgba(0,0,0,.22), rgba(0,0,0,.22)) center / 1px 100% no-repeat; }
#spin-pad::after { content: ""; position: absolute; inset: 22.5%; border-radius: 50%; border: 1px dashed rgba(0,0,0,.28); pointer-events: none; }
#spin-dot { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; left: 50%; top: 50%; border-radius: 50%; background: #e63946; border: 2px solid #fff; box-shadow: 0 0 6px rgba(0,0,0,.6); pointer-events: none; }
#spin-pad:focus-visible { box-shadow: 0 0 0 2px var(--gold); }
#spin-panel .hint { font-size: 11px; color: var(--dim); min-height: 14px; }
body.nospin #spin-panel { display: none; }

/* ---- vuruş ---- */
#shoot-panel { position: absolute; right: calc(14px + var(--safe-r)); bottom: calc(14px + var(--safe-b)); width: 150px; display: flex; gap: 6px; align-items: stretch; }
#shoot-btn { flex: 1; min-height: 62px; border-radius: 16px; border: 0; font-size: 20px; font-weight: 800; letter-spacing: .1em;
  color: #1b1405; background: linear-gradient(#ffe07f, #f0b429); box-shadow: 0 4px 0 #a97a10, 0 8px 22px rgba(0,0,0,.45); transition: transform .06s, box-shadow .06s, filter .15s; }
#shoot-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #a97a10, 0 4px 12px rgba(0,0,0,.45); }
#shoot-btn:disabled { filter: grayscale(.9) brightness(.55); cursor: not-allowed; }
.fine { width: var(--tap); min-width: var(--tap); border-radius: 12px; background: var(--glass); border: 1px solid var(--glass-b); font-size: 15px; backdrop-filter: blur(8px); touch-action: manipulation; }
.fine:active { background: rgba(255, 210, 90, .22); }

/* ---- düzen: dikey ekran ---- */
body.portrait #hud-top { gap: 6px; padding-top: calc(6px + var(--safe-t)); }
body.portrait #score-card, body.portrait #bant-card { flex: 1 1 0; min-width: 0; padding: 4px 9px 5px; }
body.portrait #score-card .big { font-size: 24px; }
body.portrait #score-card .mini { font-size: 11px; gap: 7px; }
body.portrait .pips { margin: 3px 0; }
body.portrait .chip { font-size: 10px; padding: 1px 6px; }
body.portrait #top-buttons { margin-left: 0; width: 100%; justify-content: space-between; flex-wrap: nowrap; gap: 5px; }
body.portrait .seg { flex: 1 1 auto; min-width: 0; }
body.portrait .seg button { flex: 1; padding: 0 4px; min-width: 40px; font-size: 13px; }
body.portrait #power-panel { left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r)); top: auto; bottom: calc(110px + var(--safe-b)); transform: none;
  width: auto; height: 62px; flex-direction: row; padding: 8px 12px; }
body.portrait #power-panel .lbl { white-space: nowrap; min-width: 62px; text-align: left; }
body.portrait #power-track { height: 100%; min-height: 0; width: auto; flex: 1; cursor: ew-resize; }
body.portrait #power-fill { left: 0; top: 0; bottom: 0; right: auto; height: auto; width: 50%; background: linear-gradient(to right, #35c07a, #ffd25a 65%, #ec5560); }
body.portrait #power-track::after { background: repeating-linear-gradient(to right, transparent 0 9.2%, rgba(0,0,0,.35) 9.2% 10%); }
body.portrait #power-thumb { top: -2px; bottom: -2px; left: 50%; right: auto; width: 6px; height: auto; margin: 0 0 0 -3px; }
body.portrait #spin-panel { right: auto; left: calc(10px + var(--safe-l)); bottom: calc(8px + var(--safe-b)); width: 106px; padding: 3px 6px 3px; }
body.portrait #spin-panel .lbl { font-size: 10px; }
body.portrait #spin-pad { width: 66px; height: 66px; margin: 2px auto 2px; }
body.portrait #spin-dot { width: 15px; height: 15px; margin: -7.5px 0 0 -7.5px; }
body.portrait #spin-panel .hint { display: none; }
body.portrait #shoot-panel { left: calc(126px + var(--safe-l)); right: calc(10px + var(--safe-r)); width: auto; bottom: calc(14px + var(--safe-b)); }
body.portrait #shoot-btn { min-height: 60px; }
body.portrait.nospin #shoot-panel { left: calc(10px + var(--safe-l)); }

/* ---- düşük yükseklikli yatay ekran (telefon) ---- */
@media (max-height: 520px) and (min-aspect-ratio: 1/1) {
  :root { --tap: 44px; }
  #score-card, #bant-card { padding: 4px 9px 5px; }
  #score-card .big { font-size: 24px; }
  #score-card .mini { font-size: 11px; gap: 7px; }
  .pips { margin: 3px 0; }
  .chip { font-size: 10px; padding: 1px 6px; }
  #power-panel { width: 58px; height: 50vh; padding: 6px 4px; }
  #spin-panel { width: 118px; bottom: calc(78px + var(--safe-b)); padding: 4px 6px; }
  #spin-pad { width: 82px; height: 82px; margin: 3px auto 2px; }
  #spin-panel .hint { display: none; }
  #shoot-panel { width: 150px; }
  #shoot-btn { min-height: 54px; font-size: 18px; }
  #toast { top: 18%; font-size: 15px; padding: 7px 14px; }
}
@media (max-width: 520px) {
  .seg button { padding: 0 9px; }
  .ibtn { padding: 0 9px; }
  #toast { font-size: 15px; }
}

/* ---- pencereler ---- */
.overlay { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(ellipse at center, rgba(8, 12, 16, .55), rgba(4, 6, 9, .82)); overflow-y: auto; }
.overlay.show { display: flex; }
.modal { width: min(440px, 100%); max-height: 100%; overflow-y: auto; margin: auto; padding: 24px 22px 20px; border-radius: 20px;
  background: linear-gradient(#18222c, #10171e); border: 1px solid var(--glass-b); box-shadow: 0 20px 60px rgba(0,0,0,.6); text-align: center; }
.modal.wide { width: min(520px, 100%); text-align: left; }
.modal.small { width: min(360px, 100%); }
.modal h1 { margin: 0 0 4px; font-size: 32px; letter-spacing: .06em; font-weight: 800; }
.modal h1 span { color: var(--gold); }
.modal h2 { margin: 0 0 10px; font-size: 22px; }
.modal h2.win { color: var(--gold); font-size: 30px; text-align: center; letter-spacing: .08em; }
.modal .sub { margin: 0 0 18px; color: var(--dim); }
.btns { display: flex; flex-direction: column; gap: 10px; }
.btns.row-btns { flex-direction: row; justify-content: flex-end; margin-top: 16px; }
.modal.small .btns, .modal:not(.wide) .btns.row-btns { justify-content: center; }
.btns button { min-height: 50px; border-radius: 14px; border: 1px solid var(--glass-b); background: #1f2b36; font-weight: 700; font-size: 16px; padding: 0 20px; }
.btns button:hover { filter: brightness(1.2); }
.btns button.primary { background: linear-gradient(#ffe07f, #f0b429); color: #1b1405; border: 0; box-shadow: 0 3px 0 #a97a10; }
.btns.row-btns button { flex: 1; }
.help { margin-top: 16px; text-align: left; color: var(--dim); }
.help summary { cursor: pointer; padding: 10px 4px; min-height: var(--tap); display: flex; align-items: center; color: var(--txt); font-weight: 600; }
.help-body { font-size: 13px; }
.help-body p { margin: 0 0 8px; }
.help-body table { width: 100%; border-collapse: collapse; }
.help-body td { padding: 4px 4px; border-top: 1px solid rgba(255,255,255,.06); vertical-align: top; }
.help-body td:first-child { color: var(--gold); white-space: nowrap; padding-right: 10px; }
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: var(--tap); padding: 4px 2px; border-bottom: 1px solid rgba(255,255,255,.06); }
.row span { flex: 1; }
.row em { color: var(--dim); font-size: 12px; font-style: normal; }
.row select { background: #1f2b36; color: var(--txt); border: 1px solid var(--glass-b); border-radius: 10px; min-height: 44px; padding: 0 10px; max-width: 58%; font: inherit; }
.row input[type=checkbox] { width: 26px; height: 26px; accent-color: #f0b429; }
.row input[type=range] { width: 46%; accent-color: #f0b429; min-height: 32px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 4px; }
.stat { background: rgba(255,255,255,.05); border-radius: 12px; padding: 10px 6px; }
.stat b { display: block; font-size: 24px; color: #fff; }
.stat span { font-size: 12px; color: var(--dim); }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

@media (max-height: 520px) {
  .overlay { padding: 8px; }
  .modal { padding: 12px 16px 12px; border-radius: 16px; }
  .modal h1 { font-size: 24px; }
  .modal h2 { font-size: 18px; margin-bottom: 6px; }
  .modal h2.win { font-size: 22px; }
  .modal .sub { margin-bottom: 8px; font-size: 13px; }
  .stats { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .stat { padding: 6px 2px; }
  .stat b { font-size: 18px; }
  .stat span { font-size: 10px; }
  .btns { gap: 6px; }
  .btns button { min-height: 44px; font-size: 15px; }
  .btns.row-btns { margin-top: 8px; }
  .row { min-height: 40px; }
  .modal.wide .rows { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
  .modal.wide { width: min(760px, 100%); }
}

/* ======================================================================
   Bilardo 3D eklemeleri
   ====================================================================== */
#view { background: #0a0c0f; }

/* oyuncu kartları */
#players { display: flex; gap: 8px; pointer-events: none; }
.pcard { padding: 6px 12px 7px; min-width: 128px; position: relative; transition: border-color .2s, box-shadow .2s, opacity .2s; }
.pcard.turn { border-color: rgba(255, 210, 90, .75); box-shadow: 0 0 0 1px rgba(255,210,90,.35), 0 6px 24px rgba(0,0,0,.35); }
.pcard:not(.turn) { opacity: .72; }
.pcard .nm { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.pcard .nm .dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset -2px -2px 3px rgba(0,0,0,.35); flex: none; }
.pcard .nm .tag { font-size: 10px; color: var(--dim); font-weight: 600; letter-spacing: .06em; }
.pcard .big { font-size: 28px; font-weight: 800; line-height: 1.05; color: #fff; }
.pcard .big small { font-size: 13px; color: var(--dim); font-weight: 600; margin-left: 2px; }
.pcard .mini { display: flex; gap: 9px; font-size: 11.5px; color: var(--dim); margin-top: 1px; }
.pcard .mini b { color: var(--txt); }
.pcard .grp { font-size: 11px; color: var(--dim); margin: 3px 0 2px; font-weight: 600; letter-spacing: .04em; }
.pcard .balls { display: flex; gap: 3px; flex-wrap: wrap; max-width: 168px; min-height: 16px; }
.mb { width: 15px; height: 15px; border-radius: 50%; position: relative; font-size: 8px; font-weight: 800; color: #111; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; box-shadow: inset -2px -2px 3px rgba(0,0,0,.35), 0 1px 2px rgba(0,0,0,.4); }
.mb.st { background: #f4f1e6 !important; }
.mb.st::before { content: ""; position: absolute; left: 0; right: 0; top: 24%; bottom: 24%; background: var(--c); z-index: 0; }
.mb span { position: relative; z-index: 1; width: 9px; height: 9px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; line-height: 1; }
.mb.gone { opacity: .22; filter: grayscale(.6); }
.pcard .bih { margin-top: 3px; font-size: 10px; font-weight: 800; color: #0d2a19; background: #6fe3a0; padding: 1px 6px; border-radius: 99px; display: none; }
.pcard.hand .bih { display: inline-block; }

#info-card { padding: 7px 12px 8px; min-width: 120px; }
#info-pool { display: none; max-width: 260px; }
body.mode-pool #info-carom { display: none; }
body.mode-pool #info-pool { display: block; }
.pool-msg { font-size: 13px; margin-top: 3px; color: var(--txt); font-weight: 600; }

/* yapay zeka göstergesi */
#ai-think { position: absolute; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); display: none; align-items: center; gap: 10px;
  padding: 8px 16px; border-radius: 99px; background: var(--glass); border: 1px solid var(--glass-b); font-weight: 700; color: var(--gold); backdrop-filter: blur(8px); }
#ai-think.show { display: flex; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,210,90,.25); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#fps { position: absolute; left: calc(12px + var(--safe-l)); bottom: calc(8px + var(--safe-b)); font: 11px ui-monospace, monospace; color: #9fb0bf; display: none; }
#fps.show { display: block; }

#power-panel .speed { font-size: 10px; color: var(--dim); white-space: nowrap; }

/* vuruş noktası paneli */
#spin-panel { width: 188px; bottom: calc(96px + var(--safe-b)); }
.spin-row { display: flex; align-items: center; gap: 6px; justify-content: center; margin-top: 4px; }
#spin-pad { width: 128px; height: 128px; margin: 0; flex: none; }
#spin-pad .ball { background: radial-gradient(circle at 36% 30%, #ffffff 0%, #f2efe6 30%, #cfcabd 66%, #8f8a7e 100%);
  box-shadow: 0 3px 12px rgba(0,0,0,.55), inset 0 0 0 1px rgba(0,0,0,.3); }
#spin-pad .grid { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#spin-pad .grid line { stroke: rgba(0,0,0,.18); stroke-width: .6; }
#spin-pad .grid .lim { fill: none; stroke: rgba(200, 30, 40, .55); stroke-width: .9; stroke-dasharray: 2.5 2; }
#spin-pad .grid .half { fill: none; stroke: rgba(0,0,0,.16); stroke-width: .6; stroke-dasharray: 1.5 2; }
#spin-pad .grid text { font: 700 6px system-ui, sans-serif; fill: rgba(0,0,0,.35); text-anchor: middle; dominant-baseline: middle; }
#spin-pad::after { display: none; }
#spin-dot { width: 26%; height: 26%; margin: -13% 0 0 -13%; background: radial-gradient(circle at 40% 35%, #6f9ad6, #2f5c9b 60%, #1d3c6a);
  border: 2px solid rgba(255,255,255,.9); box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.5); opacity: .92; }
#spin-dot i { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: #fff; }
#elev-box { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 40px; }
#elev-track { position: relative; width: 14px; height: 84px; border-radius: 8px; background: #1a232c; border: 1px solid #2c3a46; touch-action: none; cursor: ns-resize; outline: none; }
#elev-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; border-radius: 8px; background: linear-gradient(to top, #4c89d8, #9a6cff); }
#elev-auto { position: absolute; left: -3px; right: -3px; bottom: 0; height: 2px; background: #ff9a3c; display: none; }
#elev-auto.on { display: block; }
#elev-thumb { position: absolute; left: -4px; right: -4px; height: 6px; margin-bottom: -3px; bottom: 0; background: #fff; border-radius: 3px; box-shadow: 0 0 6px rgba(255,255,255,.6); pointer-events: none; }
#elev-track:focus-visible { box-shadow: 0 0 0 2px var(--gold); }
#elev-icon { width: 34px; height: 34px; }
#elev-icon .b { fill: #ece8dc; }
#elev-icon line { stroke: #d8b47a; stroke-width: 2.6; stroke-linecap: round; }
#elev-icon .t { stroke: #2a8a55; stroke-width: 2; }
.elev-val { font-size: 11px; font-weight: 700; color: var(--gold); white-space: nowrap; }
#spin-panel .hint { margin-top: 4px; color: var(--txt); font-weight: 600; }
#spin-panel .hint2 { font-size: 11px; color: var(--gold); min-height: 14px; }

#shoot-panel { width: 188px; }
#shoot-btn.place { background: linear-gradient(#8ff0b8, #35c07a); box-shadow: 0 4px 0 #1d7a4a, 0 8px 22px rgba(0,0,0,.45); font-size: 15px; }

body.portrait #players { flex: 1 1 100%; }
body.portrait .pcard { flex: 1 1 0; min-width: 0; padding: 4px 9px 5px; }
body.portrait .pcard .big { font-size: 22px; }
body.portrait #info-card { flex: 1 1 100%; padding: 4px 10px; }
body.portrait #info-carom { display: flex; align-items: center; gap: 10px; }
body.portrait.mode-pool #info-carom { display: none; }
body.portrait #spin-panel { width: 150px; }
body.portrait #spin-pad { width: 70px; height: 70px; }
body.portrait #elev-track { height: 56px; }
body.portrait #elev-icon { display: none; }
body.portrait #spin-panel .hint2 { display: none; }
body.portrait #shoot-panel { left: calc(170px + var(--safe-l)); width: auto; }
body.portrait #power-panel .speed { display: none; }
@media (max-height: 520px) and (min-aspect-ratio: 1/1) {
  #spin-panel { width: 160px; bottom: calc(78px + var(--safe-b)); }
  #spin-pad { width: 84px; height: 84px; }
  #elev-track { height: 64px; }
  #elev-icon, #spin-panel .hint2 { display: none; }
  .pcard { padding: 4px 9px 5px; min-width: 104px; }
  .pcard .big { font-size: 22px; }
  #shoot-panel { width: 160px; }
}
body.compact #cam-seg button { padding: 0 8px; }

/* giriş ekranı */
.start-modal { width: min(640px, 100%); }
.start-modal h1 { font-size: 40px; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 6px 0 16px; }
.mode-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 10px 14px; border-radius: 18px;
  background: linear-gradient(#1c2833, #141c24); border: 2px solid var(--glass-b); color: var(--txt); text-align: center; transition: transform .12s, border-color .15s, box-shadow .15s; }
.mode-card:hover { transform: translateY(-2px); }
.mode-card.sel { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255,210,90,.18), 0 10px 30px rgba(0,0,0,.45); }
.mode-card svg { width: 100%; max-width: 230px; height: auto; filter: drop-shadow(0 4px 8px rgba(0,0,0,.45)); }
.mode-card b { font-size: 19px; margin-top: 4px; }
.mode-card span { font-size: 12.5px; color: var(--dim); }
.mode-card .rail-w { fill: #8a4a22; } .mode-card .rail-d { fill: #4a1e0e; }
.mode-card .cloth-g { fill: #1d7a45; } .mode-card .cloth-b { fill: #1f5fa8; }
.mode-card .pk { fill: #070707; } .mode-card .dia circle { fill: #efe9dc; }
.mode-card .path { fill: none; stroke: rgba(255,255,255,.7); stroke-width: 1.4; stroke-dasharray: 4 3; }
.opts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; text-align: left; }
.opt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.opt-row > span { color: var(--dim); font-weight: 600; }
.seg-opt { backdrop-filter: none; }
.seg-opt button { min-height: 40px; }
.opt-row select { background: #1f2b36; color: var(--txt); border: 1px solid var(--glass-b); border-radius: 10px; min-height: 40px; padding: 0 10px; font: inherit; }
.btns button.big { min-height: 58px; font-size: 20px; letter-spacing: .12em; }
.row-btns2 { display: flex; gap: 10px; }
.row-btns2 button { flex: 1; }
@media (max-width: 560px) {
  .modes { gap: 8px; }
  .mode-card { padding: 8px 6px 10px; }
  .mode-card b { font-size: 16px; }
  .mode-card span { font-size: 11px; }
  .opt-row { flex-direction: column; align-items: stretch; gap: 4px; }
  .start-modal h1 { font-size: 30px; }
}
@media (max-height: 520px) {
  .modes { margin: 0 0 8px; }
  .mode-card svg { max-width: 150px; }
  .opts { gap: 4px; margin-bottom: 8px; }
  .btns button.big { min-height: 46px; }
}

#loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #0a0c0f; z-index: 50; pointer-events: auto; transition: opacity .4s; }
#loading.hide { opacity: 0; pointer-events: none; }
.ld-box { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--dim); font-weight: 600; }
.ld-box .spinner { width: 34px; height: 34px; border-width: 3px; }
.go-winner { font-size: 15px; color: var(--txt); margin-bottom: 10px; }
