:root{
  --bg:#0f1220;
  --card:#161a2e;
  --text:#e9ecff;
  --muted:#aab0d6;
  --line:rgba(255,255,255,.10);
}

*{ box-sizing:border-box; }

html, body { height: 100%; margin: 0; }

body{
  overflow: hidden; /* ne az oldal scrollozzon */
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 20% 0%, #1a2042 0%, var(--bg) 55%);
  color:var(--text);
}

/* ===== Header ===== */
.topbar{
  height:56px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 0 14px;
  border-bottom:1px solid var(--line);
}
.brand{ font-weight:700; letter-spacing:.2px; }
.status{ color:var(--muted); }

/* ===== Layout (100vh app) ===== */
.layout{
  height: calc(100vh - 56px);
  display:grid;
  grid-template-columns: 1fr 360px;
  gap:12px;
  padding:12px;
  min-height:0;
}

/* ===== Board ===== */
.board-wrap{
  background: rgba(255,255,255,.03);
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
  min-height:0;
  padding: 0; /* fontos */
}

canvas{
  width:100% !important;
  height:100% !important;   /* vizuálisan kitölti */
  display:block;
  border-radius:12px;
  background: rgba(0,0,0,.22);
  border:1px solid var(--line);
}

/* ===== Right panel ===== */
.panel{
  background: rgba(255,255,255,.03);
  border:1px solid var(--line);
  border-radius:14px;
  padding:14px;
  min-height:0;
  overflow:auto; /* A PANEL görget */
}

/* UI elemek */
.row{
  display:flex;
  flex-wrap: wrap; /* ha nem fér, törjön */
  gap:10px;
  margin:10px 0 12px;
}

button{
  appearance:none;
  border:1px solid var(--line);
  background: #2a3170;
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  font-weight:700;
  cursor:pointer;
}
button.secondary{ background:transparent; }
button:disabled{ opacity:.55; cursor:not-allowed; }

.card{
  margin-top:10px;
  padding:12px;
  background: var(--card);
  border:1px solid var(--line);
  border-radius:12px;
  line-height:1.8;
}
.hint{
  margin-top:12px;
  color:var(--muted);
  font-size:13px;
  line-height:1.5;
}

.sep{
  border:0;
  border-top:1px solid var(--line);
  margin:10px 0;
}
.log{
  color: var(--text);
  opacity:.9;
  font-size: 13px;
  line-height: 1.4;
  margin-top:6px;
}

.cardbox{
  margin-top:12px;
  padding:10px;
  border-radius:12px;
  border:1px dashed var(--line);
  background: rgba(255,255,255,.04);
}
.cardbox.hidden{ display:none; }
.ctitle{ font-weight:800; margin-bottom:6px; }
.ctext{ color: var(--muted); font-size: 13px; line-height:1.4; }

.players{
  display:grid;
  grid-template-columns: 1fr;
  gap:10px;
}
.p{
  padding:10px;
  border-radius:12px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
}
.pt{ font-weight:800; margin-bottom:6px; }

.bank-actions{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bank-actions button{
  flex: 1 1 140px;
}

/* Mobil: panel le alulra */
@media (max-width: 980px){
  .layout{ grid-template-columns: 1fr; }
  .panel{ max-height: 40vh; }
}
.panel{
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden; /* FONTOS: nem itt scrollozunk */
}

.panel h2{
  flex: 0 0 auto;
}

.panel-body{
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;   /* ✔ ITT VAN A SCROLL */
  padding-right: 4px; /* hogy ne vágja a scrollbar */
}
/* Mini esemény sáv: görgetés nélkül is elfér */
.event-mini{
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0,0,0,.18);
}
.event-title{
  font-weight: 800;
  margin-bottom: 6px;
  opacity: .9;
}
.event-text{
  font-size: 13px;
  line-height: 1.35;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;   /* max 2 sor */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Overlay area: itt lesz később a modal/drawer */
.overlay-area{
  margin-top: 10px;
}
/* ===== KOMPAKT JÁTÉKOS NÉZET ===== */
.players{
  display: grid;
  grid-template-columns: 1fr 1fr; /* 2 oszlop */
  gap: 8px;
}

.p{
  font-size: 13px;
  line-height: 1.35;
  padding: 8px;
}

.pt{
  font-size: 13px;
  margin-bottom: 4px;
}

.p div{
  white-space: nowrap;
}
/* ===== MODAL OVERLAY ===== */
.modal{
  position: fixed;
  inset: 0;
  z-index: 100;
}

.modal.hidden{ display:none; }

.modal-backdrop{
  z-index: 1;
  position:absolute;
  inset:0;

  /* csak sötétítés */
  background: rgba(0,0,0,.55);

  /* ❌ ezt vedd ki, mert a panelt is elhomályosítja */
  /* backdrop-filter: blur(4px); */

  pointer-events: auto;
}


.modal-content{
  position: relative;
  z-index: 2;
  height: 100%;
  display:flex;
  align-items:center;
  justify-content:center;
  pointer-events: none;
}

.modal-box{
  width: min(420px, 92vw);
  background: var(--card);
  border:1px solid var(--line);
  border-radius:16px;
  padding:18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  pointer-events: auto;
}
/* általános hidden mindenre */
.modal-box.hidden { display: none !important; }

/* (opcionális, de elég lenne ez is)
.modal-box.hidden { display:none !important; }
*/


.modal-title{
  font-weight:800;
  font-size:18px;
  margin-bottom:10px;
}

.modal-text{
  font-size:14px;
  line-height:1.45;
  margin-bottom:12px;
}

.modal-close{
  margin-top:12px;
}

.modal-warn.hidden { display: none; }
.modal-warn{
  margin-top: 10px;
  font-size: 14px;
  color: #ff6b6b;
  text-shadow: 0 0 10px rgba(255,107,107,0.25);
}
/* ===== BOARD: fix 3:2 arány (1536x1024) ===== */

/* Ne nyújtsa szét a grid az elemeket magasságban */
.layout{
  align-items: start;
}

/* A board doboz arányvezérelt legyen */
.board-wrap{
  width: 100%;
  aspect-ratio: 3 / 2;
  align-self: start;
  display: flex;
}
.board-layer{
  width: 100%;
  height: 100%;
}

/* A canvas töltse ki az arányos board dobozt */
.board-wrap > #board{
  width: 100% !important;
  height: 100% !important;
  display: block;
}
.ng-row { display: grid; gap: 8px; margin: 12px 0; }
.ng-ai { display: flex; align-items: center; gap: 8px; user-select: none; }
.ng-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
/* Game Over modal */
#modalGameOver { width: min(520px, 92vw); }

#modalGameOver .gameover-canvas-wrap {
  height: 220px;
}
#modalGameOver #gameOverFireworks {
  width: 100%;
  height: 100%;
  display: block;
}



.gameover-winner {
  font-size: 18px;
  font-weight: 700;
  margin: 8px 0 12px;
}

.gameover-canvas-wrap {
  position: relative;
  width: 100%;
  height: 220px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

#gameOverFireworks {
  width: 100%;
  height: 100%;
  display: block;
}
/* GameOver fireworks canvas: ne örökölje a board-canvas stílust */
#modalGameOver #gameOverFireworks {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
}
/* Liquidation modal list */
.liq-list{
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.liq-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.18);
}

.liq-meta{
  display:flex;
  flex-direction:column;
  gap: 2px;
  min-width: 0;
}

.liq-name{
  font-weight: 800;
  font-size: 14px;
  line-height: 1.2;
}

.liq-sub{
  font-size: 12px;
  color: var(--muted);
}
#propsPanel .props-item{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:4px 0;
  border-bottom:1px solid rgba(255,255,255,.06);
}
#propsPanel .props-item:last-child{ border-bottom:0; }
#propsPanel .props-lvl{ opacity:.8; font-variant-numeric: tabular-nums; }
/* Ingatlan lista */
#propsPanel .props-cols{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 8px;
}

#propsPanel .props-head{
  font-weight: 800;
  margin: 6px 0 6px;
  opacity: .95;
}

#propsPanel .props-list{
  font-size: 13px;
  line-height: 1.35;
}

#propsPanel .props-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:6px 0;
  border-bottom:1px solid rgba(255,255,255,.06);
}

#propsPanel .props-item:last-child{ border-bottom:0; }

#propsPanel .props-left{
  display:flex;
  align-items:center;
  gap:8px;
  min-width: 0;
}

#propsPanel .props-dot{
  width:10px;
  height:10px;
  border-radius:50%;
  flex: 0 0 auto;
  background: var(--p-accent, #7cf);
  box-shadow: 0 0 10px var(--p-glow, rgba(120,200,255,.6));
  opacity: .95;
}

#propsPanel .props-name{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: .98;
}

#propsPanel .props-lvl{
  opacity:.9;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

/* üres állapot */
#propsPanel .props-empty{
  opacity:.65;
  font-style: italic;
  padding: 4px 0;
}
/* alapállapot */
.board-layer {
  transition: filter .25s ease, transform .25s ease;
}

/* amikor modal nyitva van */
body.modal-open .board-layer {
  filter: blur(6px) saturate(0.9);
  transform: scale(0.995);
  pointer-events: none; /* ne lehessen kattintani */
}
body.modal-open .panel {
  position: relative;
  z-index: 5;
}
