/* Minimal touch-friendly styles for NESP frontend scoring MVP */
.nesp-scoring-app { --nesp-card-size:84px; --nesp-gap:8px; max-width: 900px; margin: 0 auto; padding: 12px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif; }
.nesp-scoring-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.nesp-round-badge { font-weight:700; font-size:1.1rem; }
.nesp-players-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(var(--nesp-card-size,84px),1fr)); gap:var(--nesp-gap,8px); }
.nesp-player-card { background:#fff; border:1px solid #ddd; border-radius:8px; padding:8px; text-align:center; box-shadow:0 1px 2px rgba(0,0,0,0.04); cursor:pointer; user-select:none; }
.nesp-player-card.scored { opacity:0.45; transform:scale(.98); }
.nesp-card-rank { font-size:1.1rem; font-weight:700; display:block; }
.nesp-card-suit { font-size:1rem; }
/* bottom sheet */
.nesp-sheet { position:fixed; left:0; right:0; bottom:0; background:#fff; border-top-left-radius:12px; border-top-right-radius:12px; box-shadow:0 -8px 24px rgba(0,0,0,0.12); padding:12px; transform: translateY(110%); transition: transform .18s ease-out; z-index:9999; }
.nesp-sheet.open { transform: translateY(0); }
.nesp-bubbles { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; margin-bottom:8px; }
.nesp-bubble { width:44px; height:44px; border-radius:999px; background:#f3f3f3; display:flex; align-items:center; justify-content:center; font-weight:600; cursor:pointer; }
.nesp-bubble.selected { background:#0073aa; color:#fff; }
.nesp-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:8px; }
.nesp-btn { padding:8px 12px; border-radius:6px; background:#0073aa; color:#fff; border:none; cursor:pointer; }
.nesp-btn.ghost { background:#f3f3f3; color:#111; }
.nesp-toast { position:fixed; left:50%; transform:translateX(-50%); bottom:16px; background:#111; color:#fff; padding:8px 12px; border-radius:6px; z-index:10000; }

/* Game over modal */
.nesp-gameover-modal { position:fixed; inset:0; display:flex; align-items:center; justify-content:center; background:rgba(0,0,0,0.35); z-index:11000; }
.nesp-gameover-inner { background:#fff; padding:18px; border-radius:10px; max-width:420px; width:90%; box-shadow:0 10px 30px rgba(0,0,0,0.18); text-align:center; }
.nesp-gameover-inner h3 { margin-top:0; margin-bottom:8px; }
.nesp-gameover-inner p { margin:6px 0; }
.nesp-gameover-inner .nesp-btn { width:100%; }

/* Improve player card appearance */
.nesp-player-card { display:flex; flex-direction:column; align-items:center; justify-content:center; padding:12px; min-height:72px; }
.nesp-player-card .nesp-card-rank { font-size:1.15rem; color:#222; }
.nesp-player-card .nesp-card-suit { color:#666; font-size:0.95rem; }

/* Suit color differentiation */
.nesp-player-card.nesp-card--red { border-color:#c4002f; }
.nesp-player-card.nesp-card--red .nesp-card-rank,
.nesp-player-card.nesp-card--red .nesp-card-suit { color:#c4002f; }
.nesp-player-card.nesp-card--black { border-color:#222; }
.nesp-player-card.nesp-card--black .nesp-card-rank { color:#111; }

/* Classification badge */
.nesp-card-class { display:inline-block; font-size:0.55rem; line-height:1; padding:3px 5px; border-radius:4px; background:#e7eef8; color:#333; font-weight:600; letter-spacing:.5px; margin-bottom:4px; }
.nesp-card--red .nesp-card-class { background:#fde5eb; }

/* Density control (injected by JS) basic styling */
.nesp-density-controls { display:flex; justify-content:flex-end; gap:6px; margin-bottom:8px; align-items:center; }
.nesp-density-controls label { font-weight:500; color:#333; }
.nesp-density-controls select { padding:4px 6px; border:1px solid #ccc; border-radius:4px; background:#fff; font-size:0.85rem; }
.nesp-header-actions { display:flex; align-items:center; gap:8px; }
.nesp-refresh-btn { background:#555; }
.nesp-refresh-btn:active { transform:translateY(1px); }

/* Larger touch targets for bubbles */
.nesp-bubble { width:var(--nesp-bubble-size,52px); height:var(--nesp-bubble-size,52px); font-size:1rem; }
.nesp-bubble[data-role="loners"] { width:44px; height:44px; }
.nesp-bubble[data-type="other"] { font-size:0.9rem; padding:6px 8px; }

/* subtle hover/tap feedback */
.nesp-player-card:active, .nesp-bubble:active { transform:translateY(1px); }

@media (max-width:480px){ .nesp-bubble{ width:44px; height:44px; } .nesp-player-card{ padding:8px; } }

/* Leaderboard */
.nesp-leaderboard { max-width:900px; margin:24px auto; padding:12px; border:1px solid #ddd; border-radius:10px; background:#fff; box-shadow:0 2px 4px rgba(0,0,0,.04); font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif; }
.nesp-leaderboard-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.nesp-leaderboard-title { margin:0; font-size:1.1rem; }
.nesp-leaderboard-loading, .nesp-leaderboard-empty, .nesp-leaderboard-error { text-align:center; padding:24px 0; color:#555; font-size:.9rem; }
.nesp-lb-cols { display:flex; gap:16px; }
.nesp-lb-col { flex:1; display:flex; flex-direction:column; gap:4px; }
.nesp-lb-row { display:grid; grid-template-columns:48px 1fr 76px 60px; align-items:center; background:#f9f9f9; border:1px solid #ececec; border-radius:6px; padding:4px 10px 4px 8px; font-size:.8rem; }
.nesp-lb-row:nth-child(odd){ background:#fdfdfd; }
.nesp-lb-player { font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.nesp-lb-subhead { display:grid; grid-template-columns:48px 1fr 70px 54px; padding:4px 8px; font-size:.55rem; text-transform:uppercase; letter-spacing:.5px; color:#555; background:#eef2f6; border:1px solid #dde3ea; border-radius:6px; margin:0 0 4px 0; font-weight:600; }
.nesp-lb-subhead .nesp-lb-h-points, .nesp-lb-subhead .nesp-lb-h-loners { text-align:right; justify-self:end; }
.nesp-lb-h-points, .nesp-lb-h-loners { display:inline-block; width:100%; text-align:right; }
.nesp-lb-h-points { padding-right:4px; }
.nesp-lb-h-loners { padding-right:2px; }
.nesp-lb-points { text-align:right; font-weight:600; justify-self:end; }
.nesp-lb-loners { text-align:right; font-size:.7rem; opacity:.7; justify-self:end; }
.nesp-lb-head { display:none; }
.nesp-lb-subhead { display:grid; grid-template-columns:48px 1fr 76px 60px; padding:4px 10px 4px 8px; font-size:.55rem; text-transform:uppercase; letter-spacing:.5px; color:#555; background:#eef2f6; border:1px solid #dde3ea; border-radius:6px; margin:0 0 4px 0; font-weight:600; }
.nesp-lb-card-rank { font-weight:600; margin-right:2px; }
.nesp-lb-card-suit { font-weight:600; }
.nesp-lb-card-suit--red { color:#c4002f; }
.nesp-lb-rank-badge { display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; border-radius:50%; font-size:.7rem; font-weight:700; background:#e3eaf2; color:#1b3d57; box-shadow:0 1px 2px rgba(0,0,0,.06); }
.rank-1 .nesp-lb-rank-badge { background:linear-gradient(135deg,#ffdd55,#ffb347); color:#593800; }
.rank-2 .nesp-lb-rank-badge { background:linear-gradient(135deg,#d7dde3,#b5bcc3); color:#2f3740; }
.rank-3 .nesp-lb-rank-badge { background:linear-gradient(135deg,#f7c9a2,#e09b64); color:#613a11; }
.nesp-lb-row { transition:background .15s,border-color .2s,transform .15s; }
.nesp-lb-row:hover { background:#ffffff; border-color:#ccd7e2; transform:translateY(-1px); }
.nesp-leaderboard-header { background:linear-gradient(90deg,#0d4f80,#0a699f); color:#fff; padding:10px 12px; border-radius:10px; margin:-12px -12px 12px -12px; display:flex; align-items:center; justify-content:space-between; }
.nesp-leaderboard-title { font-size:1rem; font-weight:600; }
.nesp-lb-actions .nesp-btn { background:rgba(255,255,255,.18); backdrop-filter:blur(2px); border:1px solid rgba(255,255,255,.3); padding:6px 10px; }
.nesp-lb-actions .nesp-btn:hover { background:rgba(255,255,255,.3); }
.nesp-leaderboard--inline-fallback .nesp-leaderboard-header { background:#1e6ea8; }
.nesp-lb-cols { position:relative; }
.nesp-leaderboard { position:relative; }
.nesp-leaderboard-grid { scrollbar-width:thin; }
.nesp-leaderboard-grid.nesp-lb-fade { transition: opacity .25s ease; }
.nesp-leaderboard-grid::-webkit-scrollbar { height:8px; width:8px; }
.nesp-leaderboard-grid::-webkit-scrollbar-track { background:transparent; }
.nesp-leaderboard-grid::-webkit-scrollbar-thumb { background:#c2ccd4; border-radius:4px; }
.nesp-lb-refresh { background:#555; }
/* Loner leader highlight */
.loner-leader { box-shadow:0 0 0 2px rgba(255,165,0,.5); position:relative; }
.loner-leader:after { content:'★'; position:absolute; top:-6px; right:-6px; background:#ffb347; color:#4a3000; font-size:10px; width:16px; height:16px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:700; box-shadow:0 1px 3px rgba(0,0,0,.25); }
.nesp-lb-round { font-size:.7rem; font-weight:600; color:#ffe9a6; margin-left:6px; }
@media (max-width:700px){ .nesp-lb-cols{ flex-direction:column; } .nesp-lb-row{ grid-template-columns:42px 1fr 60px 46px; } }
