body { font-family: 'Quicksand', sans-serif; }
[hidden] { display: none !important; }

.em-wrap { display: flex; justify-content: center; padding: 10px 10px 24px; box-sizing: border-box; }
.em-card {
  --emh: 780px; position: relative; width: 100%; max-width: 440px; height: var(--emh); box-sizing: border-box; overflow: hidden;
  border-radius: 22px; background: linear-gradient(180deg, #0a0f1f 0%, #141c3d 100%); color: #f4f1ea;
  font-family: 'Quicksand', sans-serif; display: flex; flex-direction: column; padding: 12px 12px 10px; gap: 8px;
  border: 1px solid rgba(255,255,255,.1); box-shadow: 0 18px 50px rgba(5,8,20,.45); user-select: none; -webkit-user-select: none;
}
.em-card button { font-family: inherit; touch-action: manipulation; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.em-card button:focus-visible, .em-card a:focus-visible { outline: 3px solid #f5c542; outline-offset: 2px; }

/* HUD */
.em-top { display: flex; align-items: center; gap: 12px; }
.em-clock { flex: 1; }
.em-clock-h { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; letter-spacing: 2px; color: #9aa3c0; }
.em-clockbar { margin-top: 5px; height: 8px; border-radius: 4px; background: rgba(255,255,255,.1); overflow: hidden; }
.em-clockbar i { display: block; height: 100%; width: 0; background: #f5c542; }
.em-time { min-width: 82px; text-align: right; font-size: 28px; font-weight: 700; color: #f5c542; font-variant-numeric: tabular-nums; }
.em-bal { text-align: center; padding: 2px 0; }
.em-bal-l { font-size: 11px; font-weight: 700; letter-spacing: 3px; color: #9aa3c0; }
.em-bal-v { font-size: 42px; font-weight: 700; line-height: 1.05; color: #3ddc97; font-variant-numeric: tabular-nums; text-shadow: 0 0 22px rgba(61,220,151,.4); }
.em-bal-r { font-size: 12.5px; font-weight: 700; color: #c9cee2; font-variant-numeric: tabular-nums; }

/* rows */
.em-rows { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 7px; padding-right: 2px; }
.em-row { position: relative; display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 16px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); flex: none; }
.em-row.em-locked { opacity: .6; }
.em-row.em-ready { border-color: #f5c542; background: rgba(245,197,66,.12); }
.em-mono { flex: none; width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--tint); color: var(--tint); background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; }
.em-main { flex: 1; min-width: 0; min-height: 52px; display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 4px; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; }
.em-main:disabled { cursor: default; }
.em-nm { display: flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 700; white-space: nowrap; }
.em-lv { font-style: normal; font-size: 11px; font-weight: 700; color: #9aa3c0; }
.em-auto { text-decoration: none; font-size: 10px; font-weight: 700; letter-spacing: 1px; padding: 2px 6px; border-radius: 8px; background: #f5c542; color: #1a1305; }
.em-bar { display: block; height: 10px; border-radius: 5px; background: rgba(255,255,255,.1); overflow: hidden; }
.em-fill { display: block; height: 100%; width: 0; background: var(--tint); }
.em-run .em-fill { background-image: linear-gradient(90deg, rgba(255,255,255,0) 0, rgba(255,255,255,.35) 50%, rgba(255,255,255,0) 100%); background-size: 60px 100%; background-color: var(--tint); animation: emShim 1s linear infinite; }
.em-row.em-ready .em-fill { background: #f5c542; animation: emPulse 1s ease-in-out infinite; }
.em-ln { font-size: 12px; font-weight: 700; color: #c9cee2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.em-row.em-ready .em-ln { color: #f5c542; }
.em-buy { flex: none; min-width: 76px; min-height: 48px; border-radius: 12px; border: 0; background: #3ddc97; color: #06231a; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 0 6px; }
.em-buy:disabled { background: rgba(255,255,255,.1); color: #9aa3c0; cursor: default; }
.em-bt { font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.em-bc { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.em-pop { position: absolute; right: 92px; top: 6px; font-size: 14px; font-weight: 700; color: #3ddc97; pointer-events: none; animation: emPop .9s ease-out forwards; text-shadow: 0 1px 4px rgba(0,0,0,.6); }

/* controls */
.em-mults { display: flex; gap: 6px; justify-content: center; }
.em-mults button { min-width: 56px; min-height: 40px; border-radius: 20px; border: 1px solid rgba(255,255,255,.18); background: transparent; color: #c9cee2; font-weight: 700; font-size: 13px; }
.em-mults button[aria-pressed="true"] { background: #f5c542; color: #1a1305; border-color: #f5c542; }
.em-btns { display: flex; gap: 8px; }
.em-mgr { flex: 1; min-height: 48px; border-radius: 14px; border: 0; background: #f5c542; color: #1a1305; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 700; letter-spacing: 1px; }
.em-badge { background: #1a1305; color: #f5c542; border-radius: 10px; padding: 2px 8px; font-size: 12px; }
.em-ic { flex: none; width: 52px; min-height: 48px; border-radius: 14px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: #f4f1ea; display: flex; align-items: center; justify-content: center; }
.em-toast { position: absolute; left: 50%; bottom: 74px; transform: translateX(-50%); background: #f5c542; color: #1a1305; font-weight: 700; font-size: 13px; padding: 8px 16px; border-radius: 20px; z-index: 8; max-width: 90%; text-align: center; pointer-events: none; }

/* overlays: all opaque so nothing ghosts through */
.em-ov { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; box-sizing: border-box; padding: 18px 18px 16px; background: #0a0f1f; overflow-y: auto; }
.em-ov > :first-child { margin-top: auto; }
.em-ov > :last-child { margin-bottom: auto; }
.em-start { background: linear-gradient(180deg, #0a0f1f 0%, #141c3d 62%, #1f1a3d 100%); }
.em-kick { text-align: center; font-size: 12px; font-weight: 700; letter-spacing: 4px; color: #9aa3c0; }
.em-hero { display: flex; justify-content: center; margin: 4px 0 0; }
.em-hero svg { width: 100%; max-width: 340px; height: auto; }
.em-title { text-align: center; font-size: 52px; font-weight: 700; letter-spacing: 6px; line-height: 1; color: #f5c542; text-shadow: 0 0 28px rgba(245,197,66,.45); margin-top: 8px; }
.em-tag { text-align: center; font-size: 14.5px; font-weight: 600; color: #c9cee2; margin-top: 8px; }
.em-modes { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.em-mode { display: flex; align-items: center; justify-content: space-between; min-height: 54px; padding: 0 16px; border-radius: 16px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.05); color: #f4f1ea; text-align: left; }
.em-mode b { font-size: 16px; letter-spacing: 1px; }
.em-mode span { font-size: 13px; font-weight: 600; color: #9aa3c0; }
.em-mode[aria-checked="true"] { border: 2px solid #f5c542; background: rgba(245,197,66,.12); }
.em-mode[aria-checked="true"] span { color: #f5c542; }
.em-desc { margin-top: 12px; text-align: center; font-size: 13.5px; font-weight: 600; line-height: 1.45; color: #c9cee2; min-height: 40px; }
.em-best { margin-top: 4px; text-align: center; font-size: 13px; font-weight: 700; color: #9aa3c0; }
.em-best b { color: #3ddc97; }
.em-play { margin-top: 16px; min-height: 54px; border-radius: 28px; border: 0; background: #f5c542; color: #1a1305; font-size: 18px; font-weight: 700; letter-spacing: 3px; box-shadow: 0 8px 24px -6px rgba(245,197,66,.6); }
.em-links { margin-top: 8px; display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; }
.em-links button { min-height: 44px; padding: 0 12px; border: 0; background: transparent; color: #c9cee2; font-size: 13px; font-weight: 700; }
.em-h2 { text-align: center; font-size: 22px; font-weight: 700; letter-spacing: 3px; color: #f5c542; margin: 0 0 12px; }
.em-count { text-align: center; font-size: 110px; font-weight: 700; color: #f5c542; line-height: 1; }
.em-menu { display: flex; flex-direction: column; gap: 8px; }
.em-item { display: flex; align-items: center; justify-content: space-between; min-height: 50px; padding: 0 16px; border-radius: 14px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06); color: #f4f1ea; font-size: 14px; font-weight: 700; letter-spacing: 1px; text-align: left; }
.em-item span { color: #f5c542; }
.em-item.em-primary { background: #f5c542; border-color: transparent; color: #1a1305; }
.em-sub { margin: 10px 0 4px; font-size: 11px; font-weight: 700; letter-spacing: 2px; color: #9aa3c0; }
#trophy-list { max-height: 46vh; overflow-y: auto; margin: 8px 0; padding: 4px; border-radius: 14px; }
.em-mgrlist { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.em-mrow { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); flex: none; }
.em-mrow .em-mono { border-radius: 23px; width: 42px; height: 42px; }
.em-mrow-t { flex: 1; min-width: 0; }
.em-mrow-t b { display: block; font-size: 14.5px; }
.em-mrow-t span { font-size: 12px; font-weight: 600; color: #9aa3c0; }
.em-hire { flex: none; min-width: 84px; min-height: 44px; border-radius: 12px; border: 0; background: #f5c542; color: #1a1305; font-size: 13px; font-weight: 700; }
.em-hire:disabled { background: rgba(255,255,255,.1); color: #9aa3c0; cursor: default; }
.em-hire.em-done { background: transparent; border: 1px solid rgba(255,255,255,.18); color: #3ddc97; }
.em-bal-mini { padding: 10px 14px; border-radius: 14px; background: rgba(61,220,151,.1); border: 1px solid rgba(61,220,151,.4); display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 12px; font-weight: 700; letter-spacing: 2px; color: #c9cee2; }
.em-bal-mini b { font-size: 24px; letter-spacing: 0; color: #3ddc97; }

.em-card.em-compact .em-bal-v { font-size: 34px; }
.em-card.em-compact .em-title { font-size: 42px; }
.em-card.em-compact .em-hero { display: none; }
.em-card.em-tight .em-mults button { min-width: 48px; }
.em-card.em-tight .em-buy { min-width: 68px; }
.em-card.em-tight .em-bc { font-size: 13px; }

@keyframes emShim { from { background-position: 0 0; } to { background-position: 60px 0; } }
@keyframes emPulse { 50% { opacity: .55; } }
@keyframes emPop { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-26px); } }
@media (prefers-reduced-motion: reduce) {
  .em-run .em-fill, .em-row.em-ready .em-fill, .em-pop { animation: none; }
}
.em-card.em-tight .em-clock-h span:last-child { display: none; }
