:root{
  --bg0:#070A12;
  --bg1:#0E1426;
  --card:#121A33;
  --card2:#0F1730;
  --text:#EAF0FF;
  --muted:#A9B6DF;
  --accent:#7C5CFF;
  --accent2:#22C55E;
  --danger:#EF4444;
  --shadow: 0 18px 60px rgba(0,0,0,.45);
  --radius: 18px;
  --radius2: 24px;
  --border: 1px solid rgba(255,255,255,.08);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
  color:var(--text);
  background:
    radial-gradient(900px 600px at 20% 10%, rgba(124,92,255,.25), transparent 60%),
    radial-gradient(800px 600px at 90% 0%, rgba(34,197,94,.18), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}
a{color:inherit}
.app{min-height:100%; display:flex; flex-direction:column}
.topbar{
  padding:18px 18px 14px;
  display:flex; gap:14px; align-items:center; justify-content:space-between;
  position:sticky; top:0; z-index:20;
  background: rgba(7,10,18,.72);
  backdrop-filter: blur(12px);
  border-bottom: var(--border);
}
.brand{display:flex; align-items:center; gap:12px}
.brand-badge{
  width:44px; height:44px; border-radius:14px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(124,92,255,.35), rgba(34,197,94,.22));
  border: var(--border);
  box-shadow: 0 10px 26px rgba(0,0,0,.25);
}
.brand-title{font-weight:800; letter-spacing:.2px}
.brand-subtitle{font-size:12px; color:var(--muted)}
.wallet{display:flex; gap:10px; flex-wrap:wrap; justify-content:center}
.pill{
  padding:10px 12px; border-radius:999px;
  border: var(--border);
  background: rgba(18,26,51,.65);
  display:flex; align-items:baseline; gap:8px;
}
.pill.subtle{background: rgba(18,26,51,.35)}
.pill .label{font-size:12px; color:var(--muted)}
.pill .value{font-size:18px; font-weight:800}
.pill .unit{font-size:12px; color:var(--muted)}
.actions{display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end}
.btn{
  border: var(--border);
  background: rgba(18,26,51,.65);
  color:var(--text);
  padding:10px 12px;
  border-radius:14px;
  cursor:pointer;
  transition: transform .08s ease, background .2s ease, border-color .2s ease, opacity .2s;
}
.btn:hover{transform: translateY(-1px); background: rgba(18,26,51,.85)}
.btn:active{transform: translateY(0)}
.btn.primary{
  background: linear-gradient(135deg, rgba(124,92,255,.95), rgba(124,92,255,.55));
  border-color: rgba(124,92,255,.65);
}
.btn.ghost{background: rgba(18,26,51,.35)}
.btn.danger{background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.35)}
.btn.danger:hover{background: rgba(239,68,68,.18)}
.main{padding:16px; width:min(1100px, 100%); margin:0 auto; flex:1}
.view{display:block}
.hidden{display:none !important}
.panel{
  background: rgba(18,26,51,.55);
  border: var(--border);
  border-radius: var(--radius2);
  padding:18px;
  box-shadow: var(--shadow);
}
.panel + .panel{margin-top:14px}
h1,h2{margin:0 0 8px}
.muted{color:var(--muted)}
.small{font-size:12px}
.grid{
  margin-top:14px;
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:12px;
}
@media (max-width: 940px){ .grid{grid-template-columns: repeat(2, minmax(0,1fr));} }
@media (max-width: 560px){
  .grid{grid-template-columns: 1fr;}
  .topbar{align-items:flex-start; flex-direction:column}
  .actions{justify-content:flex-start}
}
.game-card{
  padding:14px;
  border-radius: var(--radius);
  background: rgba(15,23,48,.65);
  border: var(--border);
  cursor:pointer;
  transition: transform .10s ease, background .2s ease, border-color .2s ease;
  display:flex; flex-direction:column; gap:10px;
}
.game-card:hover{transform: translateY(-2px); background: rgba(15,23,48,.85)}
.game-name{font-weight:800}
.game-meta{font-size:12px; color:var(--muted); line-height:1.35}
.tag{
  display:inline-flex; gap:6px; align-items:center;
  padding:6px 10px; border-radius:999px;
  border: var(--border);
  background: rgba(124,92,255,.10);
  color: var(--text);
  font-size:12px;
  width: fit-content;
}
.tag.green{background: rgba(34,197,94,.12)}
.game-header{display:flex; align-items:flex-start; justify-content:space-between; gap:10px}
.inline-actions{display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end}
.game-body{min-height:360px}
.row{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.row > *{flex:0 0 auto}
input, select{
  padding:10px 12px;
  border-radius:14px;
  border: var(--border);
  background: rgba(7,10,18,.55);
  color: var(--text);
  outline:none;
}
input:focus, select:focus{border-color: rgba(124,92,255,.65)}
hr{
  border:0;
  height:1px;
  background: rgba(255,255,255,.08);
  margin:14px 0;
}
.toast{
  position:fixed; left:50%; bottom:18px; transform:translateX(-50%);
  padding:10px 14px; border-radius:999px;
  background: rgba(0,0,0,.65);
  border: var(--border);
  box-shadow: var(--shadow);
  z-index:50;
}
.overlay{
  position:fixed; inset:0;
  background: rgba(0,0,0,.55);
  display:grid; place-items:center;
  padding:18px;
  z-index:60;
}
.modal{
  width: min(820px, 100%);
  border-radius: var(--radius2);
  background: rgba(18,26,51,.92);
  border: var(--border);
  box-shadow: var(--shadow);
  padding:18px;
}
.modal.wide{width:min(980px, 100%)}
.modal-head{display:flex; align-items:center; justify-content:space-between; gap:10px}
.tabs{display:flex; gap:8px; flex-wrap:wrap; margin-top:10px}
.tab{
  padding:8px 10px;
  border-radius:999px;
  border: var(--border);
  background: rgba(15,23,48,.45);
  cursor:pointer;
  font-size:12px;
}
.tab.active{background: rgba(124,92,255,.22); border-color: rgba(124,92,255,.55)}
.lb-content{margin-top:12px}
.table{
  width:100%;
  border-collapse:collapse;
  overflow:hidden;
  border-radius: 14px;
  border: var(--border);
}
.table th, .table td{
  padding:10px 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  text-align:left;
  font-size:14px;
}
.table th{font-size:12px; color:var(--muted); background: rgba(7,10,18,.35)}
.table tr:last-child td{border-bottom:0}
.kpi{
  display:flex; gap:10px; flex-wrap:wrap;
}
.kpi .pill{background: rgba(7,10,18,.35)}
.rules{color: var(--text); line-height:1.55}
.footer{
  padding:16px;
  text-align:center;
  color: var(--muted);
  font-size:12px;
}
.link{opacity:.85}
.link:hover{opacity:1}
/* Mines grid */
.mines-grid{
  display:grid;
  grid-template-columns: repeat(5, 54px);
  gap:10px;
  margin-top:14px;
}
@media (max-width: 480px){
  .mines-grid{grid-template-columns: repeat(5, 48px); gap:8px}
}
.mine-cell{
  width:54px; height:54px;
  border-radius: 14px;
  border: var(--border);
  background: rgba(7,10,18,.35);
  cursor:pointer;
  display:grid; place-items:center;
  user-select:none;
  transition: transform .08s ease, background .2s ease;
}
.mine-cell:hover{transform: translateY(-1px); background: rgba(7,10,18,.55)}
.mine-cell.revealed{cursor:default; background: rgba(15,23,48,.65)}
.mine-cell.safe{background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.35)}
.mine-cell.boom{background: rgba(239,68,68,.14); border-color: rgba(239,68,68,.35)}
/* Card display */
.card-face{
  width:84px; height:120px;
  border-radius:16px;
  border: var(--border);
  background: rgba(7,10,18,.45);
  display:grid; place-items:center;
  font-size:24px; font-weight:800;
}
.cards-row{display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:12px}
