:root {
  --team: #2f7bff;
  --team-dark: #163c85;
  --team-light: #9cc2ff;
  --metal1: #3b4148;
  --metal2: #22272c;
  --metal3: #14171a;
  --text: #e6e9ec;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; width: 100%; height: 100%; overflow: hidden;
  background: #000; color: var(--text);
  font-family: 'Segoe UI', Verdana, Tahoma, sans-serif;
  user-select: none; -webkit-user-select: none;
  overscroll-behavior: none;
}
#app { display: flex; width: 100%; height: 100%; width: 100dvw; height: 100dvh; overflow: hidden; }
#viewwrap { position: relative; flex: 1; overflow: hidden; min-width: 0; min-height: 0; touch-action: none; }
#view { display: block; width: 100%; height: 100%; cursor: none; touch-action: none; }
@media (pointer: coarse) {
  #view { cursor: default; }
}
#overlay { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; touch-action: none; }

#messages {
  position: absolute; left: max(12px, env(safe-area-inset-left)); top: 34px; pointer-events: none;
  display: flex; flex-direction: column; gap: 4px; max-width: 65%; z-index: 15;
}
.msg {
  background: rgba(0, 0, 0, 0.65); border-left: 3px solid var(--team);
  padding: 4px 10px; font-size: 13px; color: #cfe8ff; text-shadow: 0 0 4px #000;
  transition: opacity 1s; opacity: 1;
}
.msg.fade { opacity: 0; }
#topbar {
  position: absolute; left: 0; right: 0; top: 0; height: 30px; pointer-events: none;
  display: flex; justify-content: space-between; align-items: center;
  padding: 3px 10px 3px max(12px, env(safe-area-inset-left));
  background: linear-gradient(rgba(0,0,0,0.75), rgba(0,0,0,0));
  font: bold 13px Consolas, monospace; color: #9fd; z-index: 20;
}
.tb-left { display: flex; gap: 10px; align-items: center; }
#fps { color: #788; font-weight: normal; }
.tb-right { display: flex; gap: 5px; pointer-events: auto; }
.tb-btn {
  font: bold 11px Verdana; color: var(--text); cursor: pointer;
  background: rgba(28, 33, 39, 0.85); border: 1px solid #000;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15); padding: 3px 8px;
  border-radius: 2px; touch-action: manipulation;
}
.tb-btn:hover, .tb-btn.on { background: linear-gradient(var(--team), var(--team-dark)); color: #fff; }

/* ------------------------------------------------------------- mobil/dokunmatik komut çubuğu */
#touch-bar {
  position: absolute; left: max(6px, env(safe-area-inset-left)); right: 6px;
  bottom: max(6px, env(safe-area-inset-bottom));
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px;
  pointer-events: none; z-index: 20;
}
.tbtn {
  pointer-events: auto; font: bold 11px Verdana; color: var(--text); cursor: pointer;
  background: linear-gradient(rgba(58, 66, 76, 0.9), rgba(26, 30, 36, 0.92));
  border: 1px solid #000; box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 2px 6px rgba(0,0,0,0.65);
  padding: 6px 8px; border-radius: 3px; touch-action: manipulation; white-space: nowrap;
}
.tbtn:hover { filter: brightness(1.15); }
.tbtn:active { transform: translateY(1px); }
.tbtn.on {
  background: linear-gradient(var(--team), var(--team-dark)); color: #fff;
  box-shadow: 0 0 0 1px var(--team-light), 0 2px 8px rgba(0,0,0,0.7);
}
.tbtn.sm { padding: 6px 7px; }
.tbtn.grp { min-width: 32px; color: #ffd84a; }
.tbtn.grp.has { box-shadow: inset 0 -2px 0 #ffd84a, 0 2px 6px rgba(0,0,0,0.65); }

/* ------------------------------------------------------------- dikey ekran uyarısı (isteğe bağlı, engelleyici değil) */
#orient-warn {
  position: fixed; left: 0; top: 0; right: 0; bottom: 0; inset: 0; z-index: 250; display: none !important;
  align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(ellipse at center, #2a0808, #08090c);
  text-align: center;
}

/* ------------------------------------------------------------- yan panel */
#sidebar {
  width: 248px; flex: none; display: flex; flex-direction: column;
  background: linear-gradient(90deg, var(--metal3), var(--metal2) 8%, var(--metal1) 50%, var(--metal2) 92%, var(--metal3));
  border-left: 3px solid var(--team-dark);
  box-shadow: inset 2px 0 0 rgba(255,255,255,0.06);
  padding: 6px 7px; padding-right: max(7px, env(safe-area-inset-right));
  gap: 6px; overflow: hidden; z-index: 25;
}
#sidebar.collapsed { display: none !important; }
#sb-head {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 4px; border: 1px solid #000; background: linear-gradient(#1a1d21, #0c0e10);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.07);
}
#faction-logo { font: bold 12px Verdana; letter-spacing: 2px; color: var(--team-light); text-shadow: 0 0 6px var(--team); }
#credits {
  font: bold 22px Consolas, 'Courier New', monospace; color: #ffd84a;
  text-shadow: 0 0 8px rgba(255, 200, 40, 0.5); letter-spacing: 1px;
}
#sb-mid { display: contents; }
#radar {
  position: relative; width: 234px; height: 234px; border: 1px solid #000;
  background: #050805; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 0 0 2px var(--metal3);
  align-self: center;
}
#minimap { display: block; width: 100%; height: 100%; image-rendering: pixelated; cursor: crosshair; touch-action: none; }
#radar-label {
  position: absolute; left: 0; top: 0; right: 0; bottom: 0; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font: bold 14px Verdana; color: #6f6; text-shadow: 0 0 6px #0f0; pointer-events: none; text-align: center;
  background: rgba(0, 0, 0, 0.35);
}
#radar-label small { font: 10px Verdana; color: #8a8; margin-top: 4px; text-shadow: none; }
#power { display: flex; align-items: center; gap: 6px; }
#power-bar {
  position: relative; flex: 1; height: 12px; background: #0a0a0a; border: 1px solid #000;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
#power-fill { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(#5f5, #1a1); transition: width 0.3s; }
#power-fill.warn { background: linear-gradient(#ff5, #a81); }
#power-fill.low { background: linear-gradient(#f55, #911); animation: blink 0.6s infinite alternate; }
#power-use { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #fff; box-shadow: 0 0 3px #000; transition: left 0.3s; }
#power-text { font: bold 11px Consolas, monospace; min-width: 78px; text-align: right; color: #bdf; }
#power-text.low { color: #f66; }
@keyframes blink { from { opacity: 1; } to { opacity: 0.45; } }

#tools { display: flex; gap: 3px; }
#tools button, .menu-box button, .btn-row button, .orient-box button {
  font: bold 11px Verdana; color: var(--text); cursor: pointer;
  background: linear-gradient(#4a525b, #2a3036); border: 1px solid #000;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15); padding: 5px 4px;
  touch-action: manipulation;
}
#tools button { flex: 1; white-space: nowrap; }
#tools button:hover, .menu-box button:hover { background: linear-gradient(#5a636d, #333a41); }
#tools button.on { background: linear-gradient(var(--team), var(--team-dark)); color: #fff; }

#tabs { display: flex; gap: 2px; }
.tab {
  flex: 1; text-align: center; font: bold 10px Verdana; padding: 6px 1px; cursor: pointer;
  background: linear-gradient(#2c3238, #181b1f); border: 1px solid #000; color: #aab;
  touch-action: manipulation; white-space: nowrap;
}
.tab:hover { color: #fff; }
.tab.active { background: linear-gradient(var(--team), var(--team-dark)); color: #fff; }
.tab.busy { box-shadow: inset 0 -2px 0 #ffd84a; }
.tab.ready { animation: tabflash 0.5s infinite alternate; }
.tab.off { opacity: 0.45; }
@keyframes tabflash { from { box-shadow: inset 0 0 0 2px #ffd84a; } to { box-shadow: inset 0 0 0 2px transparent; } }

#build-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; align-content: start;
  flex: 1; min-height: 110px; overflow-y: auto; padding-right: 2px;
  touch-action: pan-y; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.cameo {
  position: relative; width: 100%; height: auto; aspect-ratio: 108 / 66; cursor: pointer;
  border: 1px solid #000; box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
  touch-action: manipulation; overflow: hidden;
}
.cameo canvas { display: block; width: 100%; height: 100%; pointer-events: none; }
.cameo:hover { box-shadow: 0 0 0 1px var(--team-light); }
.cname {
  position: absolute; left: 0; right: 0; bottom: 0; font: bold 9px Verdana; text-align: center;
  background: rgba(0, 0, 0, 0.7); padding: 1px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
}
.ccost { position: absolute; right: 2px; top: 1px; font: bold 10px Consolas; color: #ffd84a; text-shadow: 0 0 3px #000, 0 0 2px #000; pointer-events: none; }
.cover { position: absolute; left: 0; top: 0; right: 0; bottom: 0; inset: 0; display: none; pointer-events: none; }
.ccount { position: absolute; left: 3px; top: 1px; font: bold 13px Verdana; color: #fff; text-shadow: 0 0 3px #000, 0 0 2px #000; pointer-events: none; }
.ccancel {
  position: absolute; right: 2px; bottom: 14px; width: 22px; height: 20px;
  background: rgba(185, 24, 20, 0.92); border: 1px solid #000; color: #fff;
  font: bold 12px/18px Verdana; text-align: center; border-radius: 2px;
  display: none; z-index: 4; touch-action: manipulation;
}
.cameo.queued .ccancel, .cameo.ready .ccancel { display: block; }
.cready {
  position: absolute; left: 0; right: 0; top: 20px; text-align: center; display: none;
  font: bold 13px Verdana; color: #6f6; text-shadow: 0 0 4px #000, 0 0 2px #000; animation: blink 0.4s infinite alternate;
  pointer-events: none;
}
.clock { position: absolute; left: 3px; top: 2px; display: none; font-size: 12px; pointer-events: none; }
.cameo.ready .cready { display: block; }
.cameo.locked { filter: grayscale(1) brightness(0.45); }
.cameo.locked .clock { display: block; }
.cameo.dim { filter: brightness(0.55); }
.cameo.placing { box-shadow: 0 0 0 2px #6f6; }

#sel-info {
  order: 10; min-height: 70px; max-height: 105px; overflow: hidden; padding: 5px 7px;
  background: linear-gradient(#111417, #0a0c0e); border: 1px solid #000; font-size: 11px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
.si-name { font: bold 11px Verdana; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.si-hp { height: 6px; background: #300; border: 1px solid #000; margin-bottom: 3px; }
.si-hp div { height: 100%; background: linear-gradient(#6f6, #2a2); }
.si-line { line-height: 1.35; }
.si-line.dim { color: #889; }
.vet { color: #ffd84a; }

#tooltip {
  position: fixed; display: none; z-index: 50; width: 220px; pointer-events: none;
  background: rgba(10, 12, 15, 0.95); border: 1px solid var(--team); padding: 7px 9px; font-size: 11px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
}
.tt-name { font: bold 13px Verdana; color: var(--team-light); }
.tt-cost { color: #ffd84a; font: bold 12px Consolas; margin: 2px 0 4px; }
.pw-plus { color: #6f6; } .pw-minus { color: #f88; }
.tt-desc { color: #ccd; margin-bottom: 4px; }
.tt-stats { color: #9ab; margin-bottom: 4px; }
.tt-req { color: #f77; font-weight: bold; margin-bottom: 4px; }
.tt-hint { color: #778; font-size: 10px; }

/* ------------------------------------------------------------- katmanlar */
.overlay {
  position: fixed; left: 0; top: 0; right: 0; bottom: 0; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(60, 0, 0, 0.55), rgba(0, 0, 0, 0.92));
  padding: 6px;
}
.overlay.hidden { display: none; }
#pause { background: rgba(0, 0, 0, 0.55); }
.menu-box {
  width: min(740px, 96vw); max-height: 95vh; max-height: 95dvh; overflow-y: auto; padding: 16px 22px;
  background: linear-gradient(#262b31, #121518); border: 2px solid #000;
  box-shadow: 0 0 0 1px #4a525b, 0 10px 40px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.1);
  touch-action: pan-y; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.menu-box.small { width: min(460px, 94vw); text-align: center; }
.menu-top-actions { display: flex; justify-content: flex-end; margin-bottom: 2px; }
.menu-top-actions button { padding: 4px 10px; font-size: 11px; }
.title {
  margin: 0; text-align: center; font: 900 44px Impact, 'Arial Black', sans-serif; letter-spacing: 5px;
  color: #ff2a1a; text-shadow: 0 0 18px rgba(255, 30, 0, 0.7), 3px 3px 0 #300;
}
.subtitle { text-align: center; color: #aab; margin: 2px 0 10px; font-size: 12px; letter-spacing: 1px; }
.menu-section .label { font: bold 11px Verdana; color: #889; margin-bottom: 5px; letter-spacing: 1px; text-transform: uppercase; }
.faction-pick { display: flex; gap: 10px; margin-bottom: 10px; }
.fbtn {
  flex: 1; text-align: left; padding: 9px 11px !important; cursor: pointer;
  border: 2px solid #000 !important; opacity: 0.65; transition: opacity 0.15s, transform 0.15s;
}
.fbtn.allies { background: linear-gradient(#1f4fa8, #0f2652) !important; }
.fbtn.soviets { background: linear-gradient(#a8261f, #520f0b) !important; }
.fbtn.selected { opacity: 1; box-shadow: 0 0 0 2px #ffd84a, 0 0 18px rgba(255, 216, 74, 0.35) !important; transform: translateY(-1px); }
.fname { font: bold 15px Verdana; letter-spacing: 1px; }
.fdesc { font: 11px Verdana; color: #dde; margin-top: 3px; font-weight: normal; line-height: 1.3; }
.menu-grid { display: grid; grid-template-columns: 135px 1fr; gap: 6px 10px; align-items: center; margin: 6px 0 10px; text-align: left; }
.menu-grid label { font: bold 12px Verdana; color: #aab; }
select, input[type=number] {
  font: 13px Verdana; color: var(--text); background: #0d0f12; border: 1px solid #000;
  box-shadow: inset 0 0 0 1px #3a4148; padding: 5px 8px; width: 100%;
  touch-action: manipulation;
}
.seed-row { display: flex; gap: 6px; }
.seed-row button { width: 42px; }
button.big {
  display: block; width: 100%; padding: 11px !important; font: bold 17px Verdana !important; letter-spacing: 3px;
  background: linear-gradient(#c8281c, #6e0f0b) !important; color: #fff !important; margin: 6px 0 6px;
}
button.big:hover { filter: brightness(1.2); }
button.wide { display: block; width: 100%; padding: 7px !important; margin-bottom: 6px; }
.help { margin-top: 6px; font-size: 12px; color: #bbc; background: rgba(0,0,0,0.25); padding: 6px 10px; border: 1px solid #000; }
.help summary { cursor: pointer; font-weight: bold; color: #dde; padding: 2px 0; touch-action: manipulation; }
.help ul { margin: 4px 0 8px; padding-left: 18px; }
.help li { margin: 2px 0; }
.help-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.toggles { display: flex; flex-direction: column; gap: 8px; text-align: left; margin: 0 0 14px; font-size: 13px; }
.btn-row { display: flex; gap: 8px; }
.btn-row button { flex: 1; padding: 9px; }
h2 { margin: 0 0 12px; font: bold 24px Verdana; letter-spacing: 3px; color: #ffd84a; }
#go-title { font: 900 50px Impact, 'Arial Black', sans-serif; letter-spacing: 6px; margin: 0 0 10px; }
#go-title.win { color: #ffd84a; text-shadow: 0 0 20px rgba(255, 216, 74, 0.6); }
#go-title.lose { color: #ff2a1a; text-shadow: 0 0 20px rgba(255, 30, 0, 0.6); }
#go-stats table { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 13px; }
#go-stats th, #go-stats td { padding: 4px 6px; border-bottom: 1px solid #2a2f35; }
#go-stats td:first-child { text-align: left; color: #aab; }
.loading-box { font: bold 22px Verdana; color: #ffd84a; letter-spacing: 2px; animation: blink 0.6s infinite alternate; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: #4a525b; }
::-webkit-scrollbar-track { background: #111; }

/* ------------------------------------------------------------- telefon & tablet yatay uyumu */
@media (max-height: 600px), (max-width: 960px) {
  #sidebar { width: 224px; padding: 4px 5px; padding-right: max(5px, env(safe-area-inset-right)); gap: 4px; }
  #sb-head { flex-direction: row; justify-content: space-between; padding: 3px 6px; }
  #faction-logo { font-size: 10px; letter-spacing: 1px; }
  #credits { font-size: 16px; }
  #sb-mid { display: flex; flex-direction: row; gap: 4px; height: 88px; align-items: stretch; }
  #radar { width: 88px; height: 88px; flex: none; }
  #radar-label { font-size: 9px; padding: 2px; }
  #radar-label small { display: none; }
  #sel-info { order: 0; flex: 1; min-height: 0; max-height: 88px; padding: 3px 5px; font-size: 10px; }
  #power { gap: 4px; }
  #power-bar { height: 9px; }
  #power-text { font-size: 10px; min-width: 64px; }
  #tools button { padding: 4px 3px; font-size: 10px; }
  .tab { padding: 5px 0; font-size: 10px; }
  #build-grid { min-height: 64px; gap: 3px; }
  .tbtn { padding: 5px 7px; font-size: 10px; }
  .menu-box { padding: 10px 14px; }
  .title { font-size: 28px; letter-spacing: 3px; }
  .subtitle { margin: 1px 0 6px; font-size: 11px; }
  .menu-section .label { display: none; }
  .faction-pick { gap: 6px; margin-bottom: 6px; }
  .fbtn { padding: 6px 8px !important; }
  .fname { font-size: 13px; }
  .fdesc { font-size: 9.5px; line-height: 1.2; margin-top: 2px; }
  .menu-grid { grid-template-columns: auto 1fr auto 1fr; gap: 4px 8px; margin: 4px 0 6px; }
  .menu-grid label { font-size: 11px; }
  select, input[type=number] { padding: 3px 6px; font-size: 11px; }
  button.big { padding: 8px !important; font-size: 14px !important; margin: 4px 0 4px; }
  button.wide { padding: 5px !important; font-size: 11px !important; margin-bottom: 4px; }
}

/* ------------------------------------------------------------- telefon dikey (portrait) uyumu */
@media (orientation: portrait) and (max-width: 760px) {
  #app { flex-direction: column; }
  #viewwrap { flex: 1; width: 100%; min-height: 180px; }
  #touch-bar { left: 4px; right: 4px; bottom: 4px; gap: 3px; }
  .tbtn { padding: 4px 6px; font-size: 9.5px; }
  #sidebar {
    width: 100%; height: 42vh; height: 42dvh; max-height: 290px; min-height: 185px;
    border-left: none; border-top: 2px solid var(--team-dark);
    padding: 4px 6px; padding-bottom: max(4px, env(safe-area-inset-bottom)); gap: 3px;
  }
  #sb-mid { height: 62px; }
  #radar { width: 62px; height: 62px; }
  #sel-info { max-height: 62px; }
  #build-grid { grid-template-columns: repeat(3, 1fr); min-height: 55px; gap: 3px; }
  .menu-grid { grid-template-columns: 105px 1fr; gap: 5px 8px; }
  .help-cols { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .faction-pick { gap: 5px; }
  .fdesc { display: none; }
}

/* ------------------------------------------------------------- 8 Devlet kurulumu ve Diplomasi paneli */
.states-sec {
  margin-bottom: 8px; padding: 7px 9px; background: rgba(0, 0, 0, 0.32);
  border: 1px solid #000; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.states-bar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 6px; margin-bottom: 6px;
}
.states-bar .label { margin: 0 !important; display: inline !important; }
.states-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.sm-btn {
  padding: 3px 7px !important; font: bold 10px Verdana !important;
  border-radius: 2px;
}
.sm-btn:disabled { opacity: 0.4; cursor: default; }
.states-list {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px;
  max-height: 156px; overflow-y: auto; padding-right: 2px;
}
.state-row {
  display: flex; align-items: center; gap: 4px; padding: 3px 5px;
  background: rgba(18, 22, 27, 0.85); border: 1px solid #000;
}
.state-row.human { border-color: rgba(255, 216, 74, 0.55); background: rgba(34, 42, 54, 0.9); }
.st-badge {
  width: 18px; height: 18px; border-radius: 3px; border: 1px solid #000;
  font: bold 10px/16px Verdana; text-align: center; color: #fff; text-shadow: 0 0 3px #000; flex: none;
}
.st-role { font: bold 10px Verdana; color: #ccd; width: 34px; flex: none; }
.state-row select { padding: 3px 4px; font-size: 11px; flex: 1; min-width: 0; }
.st-del {
  width: 22px; height: 22px; padding: 0 !important; font: bold 11px Verdana !important;
  background: rgba(140, 24, 20, 0.85) !important; color: #fff !important; flex: none;
}
.st-del:disabled { opacity: 0.25; cursor: default; }

#diplo-panel {
  position: absolute; right: 10px; top: 34px; width: min(420px, calc(100% - 20px));
  max-height: calc(100% - 80px); overflow-y: auto; z-index: 30;
  background: rgba(14, 17, 21, 0.95); border: 2px solid #000;
  box-shadow: 0 0 0 1px var(--team), 0 8px 28px rgba(0, 0, 0, 0.85);
  padding: 8px 10px; font-size: 11px; pointer-events: auto;
}
#diplo-panel.hidden { display: none !important; }
.dp-head {
  display: flex; justify-content: space-between; align-items: center;
  font: bold 12px Verdana; color: #ffd84a; margin-bottom: 4px;
}
.dp-head button {
  background: #2a3036; border: 1px solid #000; color: #fff;
  font: bold 11px Verdana; padding: 2px 6px; cursor: pointer;
}
.dp-sub { color: #9ab; font-size: 10.5px; margin-bottom: 6px; line-height: 1.3; }
.dp-list { display: flex; flex-direction: column; gap: 4px; }
.dp-row {
  display: flex; align-items: center; gap: 6px; padding: 4px 6px;
  background: rgba(28, 33, 40, 0.85); border: 1px solid #000;
}
.dp-row.defeated { opacity: 0.45; }
.dp-dot { width: 12px; height: 12px; border-radius: 2px; border: 1px solid #000; flex: none; }
.dp-name { flex: 1; font: bold 11px Verdana; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-name small { color: #89a; font-weight: normal; }
.dp-stat { color: #aab; font-size: 10px; white-space: nowrap; }
.dp-self { color: #ffd84a; font-weight: bold; font-size: 10.5px; }
.dp-ally { color: #5cff8a; font-weight: bold; font-size: 10.5px; }
.dp-enemy { color: #ff6b60; font-weight: bold; font-size: 10.5px; }
.dp-dead { color: #778; font-style: italic; font-size: 10px; }
.dp-btn {
  font: bold 10px Verdana; padding: 3px 7px; cursor: pointer;
  border: 1px solid #000; color: #fff; border-radius: 2px;
}
.dp-btn.ally { background: linear-gradient(#1f7a3a, #124822); }
.dp-btn.enemy { background: linear-gradient(#3e4650, #23282e); }
.dp-btn:hover { filter: brightness(1.18); }

@media (max-width: 720px) {
  .states-list { grid-template-columns: 1fr; max-height: 120px; }
}

/* ---------------- Çok Oyunculu (Multiplayer) Lobi & Sohbet ---------------- */
.menu-start-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px;
}
#btn-mp-open {
  margin-top: 0 !important;
  background: linear-gradient(180deg, #1b6ca8, #0f3f66) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 0 16px rgba(47,123,255,0.35);
}
#btn-mp-open:hover { filter: brightness(1.15); }
#btn-start { margin-top: 0 !important; }
@media (max-width: 640px) {
  .menu-start-row { grid-template-columns: 1fr; }
}

.mp-box {
  width: min(760px, 96vw) !important;
  max-height: 94vh;
  overflow-y: auto;
}
.mp-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; margin-bottom: 6px;
}
.mp-head h2 { margin: 0; font-size: 18px; color: #ffd84a; letter-spacing: 1px; }
.mp-transport-badge {
  font-size: 10.5px; color: #8be9fd; background: rgba(16, 36, 56, 0.85);
  border: 1px solid #255a88; padding: 3px 8px; border-radius: 99px;
}
.mp-top-grid {
  display: grid; grid-template-columns: 1fr 1.2fr 1.2fr; gap: 8px;
  background: rgba(14, 18, 24, 0.85); border: 1px solid #000; padding: 8px; margin-bottom: 8px;
}
@media (max-width: 700px) {
  .mp-top-grid { grid-template-columns: 1fr; }
}
.mp-card {
  display: flex; flex-direction: column; gap: 5px;
  background: rgba(25, 31, 40, 0.85); border: 1px solid #2b3542; padding: 7px 8px;
}
.mp-card-title { font: bold 11px Verdana; color: #ffd84a; }
.mp-join-row { display: flex; gap: 5px; }
.mp-join-row input {
  flex: 1; min-width: 0; font: bold 15px monospace; letter-spacing: 3px;
  text-align: center; background: #0f1318; color: #ffd84a; border: 1px solid #445; padding: 5px;
}
.mp-status {
  padding: 6px 10px; font: bold 11.5px Verdana; border: 1px solid #2a3340;
  background: rgba(16, 20, 26, 0.9); color: #ccd; margin-bottom: 8px; border-radius: 3px;
}
.mp-status.ok { border-color: #24b84e; color: #8ff5a8; background: rgba(16, 50, 28, 0.75); }
.mp-status.warn { border-color: #e8a218; color: #ffe08a; background: rgba(58, 42, 10, 0.75); }
.mp-status.err { border-color: #d8261f; color: #ff9d94; background: rgba(65, 16, 16, 0.75); }

.mp-public-rooms {
  max-height: 76px; overflow-y: auto; background: rgba(12, 15, 20, 0.85);
  border: 1px solid #222a35; padding: 5px 8px; margin-bottom: 8px; font-size: 11px;
}
.mp-empty-rooms { color: #89a; font-size: 10.5px; }
.mp-room-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 3px 0; border-bottom: 1px dashed rgba(255,255,255,0.08);
}
.mp-room-item:last-child { border-bottom: none; }

.mp-room-panel {
  border: 1px solid #2f7bff; background: rgba(15, 20, 28, 0.92);
  padding: 8px 10px; margin-top: 4px;
}
.mp-room-panel.hidden { display: none !important; }
.mp-room-bar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 6px; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid #263244;
}
.mp-code-pill {
  font: bold 15px monospace; color: #ffd84a; background: #0c1017;
  border: 1px solid #f59e0b; padding: 3px 10px; border-radius: 4px;
}
.mp-share-btns { display: flex; flex-wrap: wrap; gap: 5px; }
.mp-opts-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px;
}
.mp-opts-row label { display: flex; flex-direction: column; gap: 2px; font-size: 10.5px; color: #9ab; }
.mp-slot-role, .mp-slot-type { width: 145px !important; font: bold 10.5px Verdana; color: #e2e8f0; flex: none !important; }
#mp-slots-list { grid-template-columns: 1fr !important; max-height: 175px; }

.mp-chat-wrap {
  margin-top: 8px; display: flex; flex-direction: column; gap: 4px;
}
#mp-chat-log {
  height: 68px; overflow-y: auto; background: #0a0d12; border: 1px solid #242c38;
  padding: 5px 7px; font: 11px/1.35 Verdana; color: #dde;
}
.mp-chat-input-row { display: flex; gap: 5px; }
.mp-chat-input-row input {
  flex: 1; background: #10151c; color: #fff; border: 1px solid #334155; padding: 5px 8px; font: 11.5px Verdana;
}
.mp-top-badge {
  background: rgba(24, 110, 180, 0.88); border: 1px solid #60a5fa; color: #fff;
  padding: 2px 7px; border-radius: 4px; font: bold 10.5px Verdana;
}
.mp-top-badge.hidden, #btn-mp-chat.hidden { display: none !important; }

.ingame-chat-bar {
  position: absolute; left: 50%; top: 38px; transform: translateX(-50%);
  width: min(460px, calc(100% - 24px)); display: flex; gap: 5px;
  background: rgba(12, 16, 22, 0.94); border: 1px solid #3b82f6; padding: 5px; z-index: 35;
  pointer-events: auto;
}
.ingame-chat-bar.hidden { display: none !important; }
.ingame-chat-bar input {
  flex: 1; background: #090d12; color: #fff; border: 1px solid #334155; padding: 5px 8px; font: 12px Verdana;
}
.ingame-chat-bar button {
  background: #1d4ed8; color: #fff; border: 1px solid #000; padding: 4px 10px; font: bold 11px Verdana; cursor: pointer;
}




