html, body{
  height:100%;
  margin:0;
  overflow:hidden;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background:#6c357cff;
}

/* Ensure start screen can scroll on small heights */
#startScreen{
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}

/* Make the main panel fit the *visible* viewport on mobile (dvh/svh fixes iOS bars) */
#startScreen .panel{
  max-height: calc(100svh - 24px);
  max-height: calc(100dvh - 24px);
  overflow:auto;
}

/* Mobile layout: stack header + buttons nicely */
@media (max-width: 640px){
  .panelTop{
    flex-direction:column;
    align-items:flex-start;
    gap:12px;
  }
  .panelActions{
    width:100%;
    display:flex;
    gap:10px;
  }
  .panelActions .btn{
    flex:1;
  }
}

.article-content{
  padding:0!important;
  margin:0!important;
}

#nameInput{
  width:200px;
}

.site-header{
  display:none;
}

.alsoPlayed{ opacity:.85; font-size:13px; }

/* Fixed height leaderboard container */
.tableWrap--fixed{
  height:360px;
  overflow:auto;
  border-radius:12px;
}

/* Optional: keeps table header visible while scrolling */
.tableWrap--fixed thead th{
  position:sticky;
  top:0;
  z-index:2;
}

/* Optional: prevent "Loading..." row from looking tiny */
.tableWrap--fixed .muted{
  padding:14px 10px;
}

/* thumbs/cards */
.shipCard{
  display:flex;
  gap:12px;
  align-items:center;
}

.shipThumb{
  width:56px;
  height:56px;
  border-radius:12px;
  background:rgba(255,255,255,0.06);
  border:1px solid rgba(255,255,255,0.10);
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  overflow:hidden;
}

.shipThumb img{
  width:100%;
  height:100%;
  object-fit:contain;
  transform:scale(1.08);
}

.shipText{ min-width:0; }

/* ✅ Real visible viewport sizing on mobile browsers (fixes top/bottom clipping) */
canvas{
  width:100vw;
  height:100svh;
  height:100dvh;
  display:block;
}

/* overlays/screens should also use visible viewport height */
.screen{
  position:fixed;
  inset:0;
  height:100svh;
  height:100dvh;
  width:100vw;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,.35);
  z-index:10;
}

.hud{
  position:fixed;
  top:14px;
  left:14px;
  background:rgba(0,0,0,.35);
  border:1px solid rgba(255,255,255,.12);
  border-radius:12px;
  padding:10px 12px;
  color:#e6edf3;
  font-size:14px;
  line-height:1.35;
  user-select:none;
  backdrop-filter:blur(6px);
  z-index:5;
}
.hud small{
  display:block;
  opacity:.75;
  margin-top:6px;
  font-size:12px;
}

.panel{
  width:min(980px, calc(100vw - 32px));
  background:rgba(0,0,0,.62);
  border:1px solid rgba(255,255,255,.14);
  border-radius:18px;
  padding:16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom)); /* ✅ iOS safe area */
  box-shadow:0 18px 60px rgba(0,0,0,.45);
  color:#e6edf3;
}
.panel.small{ width:min(520px, calc(100vw - 32px)); }

.panelTop{
  display:flex;
  gap:12px;
  align-items:flex-start;
  justify-content:space-between;
  margin-bottom:12px;
}

h1{ margin:0; font-size:22px; }
h2{ margin:0 0 10px; font-size:16px; }
.sub{ margin:6px 0 0; opacity:.85; }
.hint{ margin:10px 0 0; opacity:.75; font-size:12px; }
.muted{ opacity:.7; text-align:center; }

.grid2{
  display:grid;
  grid-template-columns: 1fr 1.35fr;
  gap:12px;
}
@media (max-width: 860px){
  .grid2{ grid-template-columns:1fr; }
}

.box{
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.10);
  border-radius:14px;
  padding:12px;
}

.tableWrap{
  max-height:380px;
  overflow:auto;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
}

.table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}
.table th, .table td{
  padding:8px 10px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.table th{
  position:sticky;
  top:0;
  background:rgba(0,0,0,.55);
  text-align:left;
}

.ships{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  flex-direction:column;
}

.shipCard{
  width:160px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.35);
  padding:10px;
  cursor:pointer;
  transition:transform .08s ease, border-color .08s ease;
}
.shipCard:hover{ transform:translateY(-1px); }
.shipCard.active{ border-color: rgba(120,200,255,.65); }

.shipTitle{ font-weight:700; margin:0 0 6px; }
.shipMeta{ margin:0; opacity:.75; font-size:12px; }

.btn{
  border:none;
  background:rgba(120,200,255,.9);
  color:#081018;
  padding:10px 14px;
  border-radius:12px;
  cursor:pointer;
  font-weight:800;
}
.btn.ghost{
  background:rgba(255,255,255,.10);
  color:#e6edf3;
  border:1px solid rgba(255,255,255,.14);
}

.panelActions{ display:flex; gap:10px; }

.label{
  display:block;
  margin:12px 0 6px;
  opacity:.85;
  font-size:12px;
}

.input{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.35);
  color:#e6edf3;
  outline:none;
}

.row{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  margin-top:12px;
}
