/* ───────────────────────────────────────────────────────────────
   Brewtendo 3DS simulator — system & app screens
   Top display is 800×480, bottom is 640×480 (2× the real 3DS).
   ─────────────────────────────────────────────────────────────── */

.scr {
  --bg: #e9e9ec;
  --sq: rgba(255, 255, 255, 0.85);
  --panel: #e1e1e3;
  --panel-edge: #cfcfd3;
  --surface: #f7f7f7;
  --surface-2: #ececec;
  --line: #cfcfcf;
  --text: #4a4a4a;
  --text-dim: #8c8c8c;
  --accent: #3fd6b4;
  --accent-ink: #12a888;
  --sel: #fff3c4;
  --shadow: rgba(0, 0, 0, 0.18);
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Rodin', 'Hiragino Maru Gothic ProN', 'Arial Rounded MT Bold', Arial, sans-serif;
  font-size: 24px;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
}
.scr[data-theme="dark"] {
  --bg: #2a2b2f; --sq: rgba(255,255,255,0.05); --panel: #1f2023; --panel-edge: #141518;
  --surface: #3a3b40; --surface-2: #303135; --line: #4a4b51; --text: #ececec; --text-dim: #a0a0a8;
  --sel: #4b4532; --shadow: rgba(0,0,0,0.5);
}
.scr[data-theme="orange"] {
  --bg: #ffe2b8; --sq: rgba(255, 248, 232, 0.9); --panel: #ffd39a; --panel-edge: #f0b765;
  --surface: #fff8e8; --surface-2: #ffeccf; --line: #f3c98a; --text: #6b3a00; --text-dim: #a8692a;
  --accent: #f17a0a; --accent-ink: #d4620a; --sel: #ffe3a8;
}
.scr button { font: inherit; color: inherit; cursor: pointer; }
.scr [hidden] { display: none !important; }
.view, .view > * { position: absolute; inset: 0; }
.glyph { width: 1em; height: 1em; display: block; flex: none; }

/* 3D depth: elements tilt toward the pointer and lift off the screen */
.depth {
  transform:
    perspective(900px)
    rotateY(calc(var(--px, 0) * var(--depth, 0) * 9deg))
    rotateX(calc(var(--py, 0) * var(--depth, 0) * -7deg))
    translateZ(calc(var(--depth, 0) * 26px));
  filter: drop-shadow(0 calc(4px + var(--depth, 0) * 18px) calc(4px + var(--depth, 0) * 14px) var(--shadow));
  transition: transform 0.15s ease-out;
}
.theme-bg { position: absolute; inset: 0; background: var(--bg); overflow: hidden; }
.theme-bg::before {
  content: '';
  position: absolute;
  inset: -60px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='172' height='176'%3E%3Crect x='14' y='14' width='144' height='148' rx='26' fill='white'/%3E%3C/svg%3E");
  background-size: 172px 176px;
  background-position: -20px 34px;
  opacity: 1;
  filter: blur(2px);
  mix-blend-mode: normal;
  -webkit-mask: linear-gradient(#000, #000);
  transform: translate(calc(var(--px, 0) * var(--depth, 0) * -16px), calc(var(--py, 0) * var(--depth, 0) * -10px));
  transition: transform 0.2s ease-out;
}
.scr[data-theme="dark"] .theme-bg::before { opacity: 0.05; }
.scr[data-theme="orange"] .theme-bg::before { opacity: 0.7; }

/* Fades & HUD */
.fade { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; z-index: 50; }
.fade.is-on { opacity: 1; }
.hud {
  position: absolute; z-index: 40; left: 50%; top: 70px;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 22px; border-radius: 30px;
  background: rgba(30, 30, 34, 0.82); color: #fff; font-size: 30px;
  transform: translate(-50%, -10px); opacity: 0; transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.hud.is-on { opacity: 1; transform: translate(-50%, 0); }
.hud-bars { display: flex; gap: 4px; }
.hud-bars i { width: 12px; height: 22px; border-radius: 3px; background: rgba(255,255,255,0.22); }
.hud-bars i.on { background: #7fe0ff; }
.hud-3d { font-size: 24px; letter-spacing: 1px; }

/* ── Status bar ─────────────────────────────────────────────────── */
.status {
  position: absolute; z-index: 30; left: 0; right: 0; top: 0; height: 52px;
  display: flex; align-items: center; gap: 22px; padding: 0 12px;
  background: linear-gradient(rgba(255,255,255,0.92), rgba(255,255,255,0.78));
  color: #3a3a3a; font-size: 30px; white-space: nowrap;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.scr[data-theme="dark"] .status { background: linear-gradient(rgba(20,20,24,0.92), rgba(20,20,24,0.8)); color: #eee; }
.sig { display: flex; align-items: flex-end; gap: 3px; height: 34px; }
.sig i { width: 6px; background: #2fa7e8; border-radius: 1px; }
.sig i:nth-child(1) { height: 9px; } .sig i:nth-child(2) { height: 17px; } .sig i:nth-child(3) { height: 25px; } .sig i:nth-child(4) { height: 33px; }
.sig.is-off i { background: #bbb; }
.net-pill {
  min-width: 220px; text-align: center; padding: 2px 18px; border-radius: 10px;
  background: linear-gradient(#69c2f5, #2f9ae0); color: #fff; font-size: 26px;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.12), 0 1px 0 rgba(255,255,255,0.8);
}
.net-pill.is-off { background: linear-gradient(#c7c7c7, #a2a2a2); }
.st-steps { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.st-steps .glyph { width: 28px; height: 28px; }
.st-steps b { font-weight: inherit; }
.batt {
  display: flex; gap: 2px; padding: 4px; border: 3px solid #1e2a3a; border-radius: 5px; position: relative; margin-right: 4px;
}
.batt::after { content: ''; position: absolute; right: -8px; top: 8px; width: 4px; height: 10px; background: #1e2a3a; border-radius: 0 2px 2px 0; }
.batt i { width: 10px; height: 16px; background: #3e8fe8; }
.batt i.e { background: transparent; }
.batt.is-charging i { background: #f2c200; }
.scr[data-theme="dark"] .batt { border-color: #ddd; } .scr[data-theme="dark"] .batt::after { background: #ddd; }

/* ── Boot ───────────────────────────────────────────────────────── */
.boot-top { background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; color: #f17a0a; font-size: 44px; }
.boot-top img { width: 140px; height: 140px; }
.boot-bottom { background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.boot-bottom p { color: #8c8c8c; font-size: 26px; text-align: center; padding: 0 60px; animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.4; } }

/* ── HOME Menu: top screen ──────────────────────────────────────── */
.banner-wrap { position: absolute; inset: 52px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.banner-wrap.pop { animation: pop 0.22s ease-out; }
@keyframes pop { from { opacity: 0; transform: scale(0.96); } }
.banner { display: flex; flex-direction: column; align-items: center; gap: 22px; margin-top: -10px; }
.banner-icon { width: 176px; height: 176px; padding: 8px; background: #fff; border-radius: 26px; box-shadow: 0 0 0 2px rgba(0,0,0,0.06); }
.banner-icon .ic { border-radius: 18px; }
.banner-plate {
  min-width: 520px; max-width: 700px; padding: 14px 34px 16px; border-radius: 22px; text-align: center;
  background: var(--surface); box-shadow: 0 0 0 2px var(--line);
}
.banner-title { font-size: 34px; }
.banner-pub { font-size: 24px; color: var(--text-dim); margin-top: 2px; }
.banner-susp { font-size: 20px; color: #2f8fe0; margin-top: 6px; }
.carousel { display: flex; align-items: center; gap: 30px; }
.car-item { width: 96px; height: 96px; padding: 14px; border-radius: 14px; background: rgba(255,255,255,0.75); box-shadow: 0 0 0 2px rgba(0,0,0,0.05); opacity: 0.55; }
.car-item .glyph { width: 100%; height: 100%; }
.car-item.is-sel { width: 128px; height: 128px; padding: 20px; opacity: 1; background: #d6d6d6; box-shadow: 0 0 0 3px #fff, 0 6px 16px var(--shadow); }
.car-label { margin-top: 26px; font-size: 30px; padding: 8px 26px; border-radius: 20px; background: var(--surface); box-shadow: 0 0 0 2px var(--line); }
.lr { position: absolute; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: rgba(255,255,255,0.85); color: #333; font-size: 28px; }
.lr .glyph { width: 40px; height: 40px; --glyph-bg: #fff; }
.lr-l { left: 0; border-radius: 0 18px 0 0; }
.lr-r { right: 0; border-radius: 18px 0 0 0; }
.key { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; background: #333; color: #fff; font-size: 24px; }
.np-chip {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; max-width: 520px;
  padding: 8px 20px; border-radius: 26px; background: rgba(23, 103, 214, 0.9); color: #fff; font-size: 24px; white-space: nowrap;
}
.np-chip span { overflow: hidden; text-overflow: ellipsis; }
.np-chip em { font-style: normal; opacity: 0.75; margin-left: 6px; }

/* ── App icons ──────────────────────────────────────────────────── */
.ic { width: 100%; height: 100%; border-radius: 10px; overflow: hidden; display: grid; place-items: center; }
.ic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ic .glyph { width: 62%; height: 62%; filter: drop-shadow(0 2px 0 rgba(0,0,0,0.18)); }

/* ── HOME Menu: bottom screen ───────────────────────────────────── */
.home-bottom.bounce .panel { animation: nudge 0.3s; }
@keyframes nudge { 30% { transform: translateY(4px); } }
.topbar {
  position: absolute; left: 0; right: 0; top: 0; height: 64px;
  display: flex; align-items: stretch;
  background: linear-gradient(#f9f9f9, #e9e9e9); border-bottom: 2px solid #d4d4d4;
}
.scr[data-theme="dark"] .topbar { background: linear-gradient(#3a3b40, #2d2e33); border-color: #1a1b1e; }
.scr[data-theme="orange"] .topbar { background: linear-gradient(#fff6e6, #ffe6c2); border-color: #f0c27e; }
.topbar button { border: 0; background: transparent; padding: 0; display: grid; place-items: center; }
.tb-set { width: 102px; color: #6f86b5; background: var(--tab-bg, linear-gradient(#ffffff, #f0f0f0)) !important; border-right: 2px solid var(--tab-edge, #d4d4d4) !important; border-radius: 0 0 14px 0; --glyph-bg: var(--tab-solid, #f6f6f6); }
.scr[data-theme="dark"]   { --tab-bg: linear-gradient(#4a4b51, #3a3b40); --tab-edge: #1a1b1e; --tab-solid: #424348; }
.scr[data-theme="orange"] { --tab-bg: linear-gradient(#fffaf0, #fff0d8); --tab-edge: #f0c27e; --tab-solid: #fff5e4; }
.scr[data-theme="dark"] .tb-set { color: #a9bce6; }
.scr[data-theme="dark"] .tb-size, .scr[data-theme="orange"] .tb-size { border-color: var(--tab-edge); }
.tb-set .glyph { width: 52px; height: 52px; }
.tb-applets { flex: 1; display: flex; justify-content: space-around; padding: 0 6px; }
.tb-app { width: 76px; }
.tb-app .glyph { width: 50px; height: 50px; --glyph-bg: #fff; filter: drop-shadow(0 2px 0 rgba(0,0,0,0.12)); }
.tb-size { display: flex; width: 104px; border-left: 2px solid #d4d4d4; }
.tb-size button { flex: 1; color: #9aa6b8; }
.tb-size button .glyph { width: 34px; height: 34px; }
.tb-size button.is-on { color: #3b4b66; }
.topbar .is-sel { box-shadow: inset 0 0 0 4px var(--accent); border-radius: 12px; animation: selpulse 1.2s ease-in-out infinite; }
.topbar button:hover .glyph { transform: translateY(-1px); }

.panel {
  position: absolute; left: 20px; right: -40px; top: 76px; bottom: 58px;
  background: var(--panel); border-radius: 18px 0 0 18px; overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.12), inset 0 0 0 2px var(--panel-edge);
  touch-action: pan-y;
}
.grid-clip {
  position: absolute; inset: 0;
  /* fade the peeking column at the left edge so it never sits under the arrow */
  -webkit-mask-image: linear-gradient(to right, transparent 0, transparent 20px, #000 46px);
          mask-image: linear-gradient(to right, transparent 0, transparent 20px, #000 46px);
}
.grid-clip.at-start { -webkit-mask-image: none; mask-image: none; }
.grid-track { position: absolute; inset: 0; transition: transform 0.25s cubic-bezier(.25,.8,.3,1); }
.tile {
  position: absolute; padding: 8px; border-radius: 16px; cursor: pointer;
  background: #fbfbfb; box-shadow: 0 2px 0 #c4c4c4, 0 0 0 2px #dedede;
  transition: transform 0.12s;
}
.tile:hover { transform: translateY(-2px); }
.tile.is-sel { transform: scale(1.04); }
.is-small .tile { padding: 5px; border-radius: 11px; }
.is-small .tile .ic { border-radius: 7px; }
.tile.is-suspended::after {
  content: ''; position: absolute; right: -6px; bottom: -6px; width: 26px; height: 26px; border-radius: 50%;
  background: #3aa1ff; box-shadow: 0 0 0 3px #fff;
}
.slot-empty { position: absolute; display: grid; place-items: center; cursor: pointer; }
.slot-empty i { width: 38%; height: 38%; border-radius: 8px; border: 2px solid var(--panel-edge); background: rgba(255,255,255,0.25); }
.cursor { position: absolute; left: 0; top: 0; pointer-events: none; transition: transform 0.16s cubic-bezier(.3,1.3,.5,1); }
.cursor.is-hidden { visibility: hidden; }
.cursor i { position: absolute; width: 26px; height: 26px; border: 7px solid var(--accent); animation: selpulse 1.2s ease-in-out infinite; }
.cursor i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: 14px 0 0 0; }
.cursor i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 14px 0 0; }
.cursor i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 14px; }
.cursor i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 14px 0; }
@keyframes selpulse { 50% { opacity: 0.6; } }
.pg {
  position: absolute; top: 50%; width: 40px; height: 104px; margin-top: -52px; border: 0; padding: 0;
  background: rgba(255,255,255,0.92); color: #9aa; display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15); transition: opacity 0.2s;
}
.pg .glyph { width: 26px; height: 26px; }
.panel.is-small .pg { height: 84px; margin-top: -42px; }
.panel.is-small .pg .glyph { width: 24px; height: 24px; }
.pg-r { right: 40px; border-radius: 52px 0 0 52px; padding-left: 8px; }
.pg-l { left: 0; border-radius: 0 52px 52px 0; padding-right: 8px; }
.pg.is-hidden { opacity: 0; pointer-events: none; }

.bottombar { position: absolute; left: 0; right: 0; bottom: 0; height: 54px; display: flex; gap: 4px; }
.bb {
  border: 0; border-radius: 14px 14px 0 0; font-size: 30px;
  background: linear-gradient(#fbfbfb, #dedede); color: #555 !important;
  box-shadow: inset 0 0 0 2px #d0d0d0, 0 -1px 2px rgba(0,0,0,0.08);
}
.bb-l { width: 210px; }
.bb-r { flex: 1; }
.bb:active { background: linear-gradient(#e2e2e2, #f4f4f4); }
.bb:disabled { color: #b8b8b8 !important; cursor: default; }
.scr[data-theme="dark"] .bb { background: linear-gradient(#45464c, #333439); color: #ddd !important; box-shadow: inset 0 0 0 2px #232428; }

/* ── Dialog ─────────────────────────────────────────────────────── */
.dialog-layer { position: absolute; inset: 0; z-index: 45; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,0.35); }
.dialog-layer.is-on { display: flex; }
.dlg { width: 540px; border-radius: 22px; background: var(--surface); box-shadow: 0 10px 40px rgba(0,0,0,0.35); overflow: hidden; animation: pop 0.18s ease-out; }
.dlg-text { margin: 0; padding: 40px 36px; text-align: center; font-size: 28px; }
.dlg-btns { display: flex; border-top: 2px solid var(--line); }
.dlg-btn { flex: 1; border: 0; padding: 18px; font-size: 28px; background: transparent; }
.dlg-btn + .dlg-btn { border-left: 2px solid var(--line); }
.dlg-btn.is-sel { background: var(--sel); }

/* ── Shared app bits ────────────────────────────────────────────── */
.app-bottom, .app-top { background: var(--bg); }
.wb-btn {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 0; border-radius: 16px; text-align: left;
  background: var(--surface); box-shadow: 0 2px 0 var(--line), inset 0 0 0 2px var(--line); font-size: 24px;
}
.wb-btn .glyph { width: 36px; height: 36px; color: #f17a0a; --glyph-bg: var(--surface); }
.wb-btn.is-sel { box-shadow: 0 2px 0 var(--line), inset 0 0 0 4px var(--accent); background: var(--sel); }
.wb-btn:active { transform: translateY(2px); box-shadow: inset 0 0 0 2px var(--line); }
.chip { display: inline-block; padding: 1px 12px; border-radius: 10px; background: rgba(0,0,0,0.08); font-size: 0.85em; }

/* Web */
.web-top { background: #fff; }
.web-top iframe { position: absolute; inset: 0; width: 800px; height: 480px; border: 0; background: #fff; }
.web-loading { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 24px; background: #fff; color: #888; text-align: center; font-size: 24px; }
.web-loading.is-on { display: flex; }
.spin { width: 64px; height: 64px; border-radius: 50%; border: 8px solid #f3d3a8; border-top-color: #f17a0a; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.web-bottom { padding: 22px 22px 0; }
.wb-head { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.wb-head .ic { width: 76px; height: 76px; flex: none; border-radius: 14px; box-shadow: 0 0 0 3px #fff, 0 2px 6px var(--shadow); }
.wb-head b { display: block; font-size: 32px; font-weight: normal; }
.wb-head span { color: var(--text-dim); font-size: 22px; }
.wb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.urlbar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; padding: 8px 8px 8px 16px; border-radius: 18px; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line); }
.urlbar-ic { color: #2f8fe0; } .urlbar-ic .glyph { width: 34px; height: 34px; }
.urlbar input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 22px; color: var(--text); outline: none; }
.urlbar button { border: 0; border-radius: 12px; padding: 8px 20px; background: #2f8fe0; color: #fff !important; font-size: 22px; }

/* Music */
.mu-top { color: #fff; }
.mu-bg { position: absolute; inset: 0; background: radial-gradient(ellipse at 20% 30%, #ffb445 0%, #f17a0a 45%, #a84a00 100%); }
.mu-top.is-playing .mu-bg { animation: hue 12s ease-in-out infinite; }
@keyframes hue { 50% { filter: hue-rotate(-18deg) saturate(1.15); } }
.mu-art {
  position: absolute; left: 44px; top: 80px; width: 250px; height: 250px; border-radius: 20px; overflow: hidden;
  background: linear-gradient(160deg, #fff6e2, #ffd59a); box-shadow: 0 0 0 4px rgba(255,255,255,0.6);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.mu-art img { width: 160px; height: 160px; object-fit: contain; }
.mu-art span { color: #a84a00; font-size: 20px; }
.mu-meta { position: absolute; left: 330px; right: 40px; top: 84px; }
.mu-album { font-size: 22px; opacity: 0.85; }
.mu-title { font-size: 46px; line-height: 1.15; margin: 6px 0 8px; text-shadow: 0 2px 0 rgba(0,0,0,0.15); }
.mu-plat { font-size: 22px; opacity: 0.95; min-height: 30px; }
.mu-plat .chip { background: rgba(255,255,255,0.25); }
.mu-prog { display: flex; align-items: center; gap: 14px; margin-top: 26px; font-size: 20px; font-variant-numeric: tabular-nums; }
.mu-bar { position: relative; flex: 1; height: 12px; border-radius: 6px; background: rgba(0,0,0,0.22); cursor: pointer; touch-action: none; }
.mu-bar::before { content: ''; position: absolute; inset: -14px 0; }
.mu-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: #fff; }
.mu-bar b { position: absolute; top: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.3); }
.mu-flags { display: flex; gap: 14px; margin-top: 18px; font-size: 20px; }
.mu-flags span { display: flex; align-items: center; gap: 8px; padding: 4px 14px; border-radius: 14px; background: rgba(0,0,0,0.16); opacity: 0.55; }
.mu-flags span.is-on { opacity: 1; background: rgba(255,255,255,0.22); }
.mu-flags em { font-style: normal; }
.mu-flags .glyph { width: 22px; height: 22px; }
.mu-vis { position: absolute; left: 0; bottom: 0; width: 800px; height: 130px; opacity: 0.55; }

.mu-bottom { background: var(--bg); }
.mu-head { position: absolute; left: 0; right: 0; top: 0; height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px;
  background: linear-gradient(#ffb445, #f17a0a); color: #fff; font-size: 26px; }
.mu-head b { font-weight: normal; }
.mu-head span { font-size: 20px; opacity: 0.9; }
.mu-list { position: absolute; left: 0; right: 0; top: 58px; bottom: 92px; overflow-y: auto; scrollbar-width: thin; overscroll-behavior: contain; }
.mu-group { padding: 12px 22px 4px; font-size: 18px; color: var(--text-dim); }
.mu-row { display: flex; align-items: center; gap: 14px; height: 56px; padding: 0 22px; cursor: pointer; font-size: 24px; border-bottom: 1px solid var(--line); }
.mu-row:hover { background: rgba(0,0,0,0.03); }
.mu-row.is-cursor { background: var(--sel); box-shadow: inset 5px 0 0 var(--accent-ink); }
.mu-n { width: 30px; text-align: right; color: var(--text-dim); font-size: 18px; font-variant-numeric: tabular-nums; }
.mu-eq { display: none; width: 30px; height: 22px; align-items: flex-end; gap: 3px; }
.mu-eq i { width: 6px; background: #f17a0a; border-radius: 2px; height: 30%; }
.mu-row.is-playing .mu-n { display: none; }
.mu-row.is-playing .mu-eq { display: flex; }
.mu-bottom.is-playing .mu-row.is-playing .mu-eq i { animation: eq 0.9s ease-in-out infinite; }
.mu-eq i:nth-child(2) { animation-delay: -0.3s !important; height: 70%; }
.mu-eq i:nth-child(3) { animation-delay: -0.6s !important; height: 50%; }
@keyframes eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }
.mu-row.is-playing .mu-name { color: #d4620a; }
.mu-name { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mu-chip { font-size: 16px; padding: 2px 10px; border-radius: 10px; background: var(--surface-2); color: var(--text-dim); white-space: nowrap; }
.mu-dur { width: 58px; text-align: right; color: var(--text-dim); font-size: 20px; font-variant-numeric: tabular-nums; }
.mu-ctrl {
  position: absolute; left: 0; right: 0; bottom: 0; height: 92px; display: flex; align-items: center; justify-content: center; gap: 18px;
  background: linear-gradient(var(--surface), var(--surface-2)); border-top: 2px solid var(--line);
}
.mu-ctrl button { position: relative; width: 62px; height: 62px; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; color: var(--text-dim); }
.mu-ctrl button .glyph { width: 34px; height: 34px; }
.mu-ctrl button:hover { background: rgba(0,0,0,0.05); }
.mu-ctrl button.is-on { color: #f17a0a; }
.mu-ctrl button em { position: absolute; right: 8px; bottom: 6px; font-style: normal; font-size: 16px; }
.mu-ctrl .mu-play { width: 76px; height: 76px; background: linear-gradient(#ffb445, #f17a0a); color: #fff; box-shadow: 0 3px 0 #c45a00; }
.mu-ctrl .mu-play:hover { background: linear-gradient(#ffc163, #f58a1f); }
.mu-ctrl .mu-play .glyph { width: 40px; height: 40px; }
.mu-ctrl .mu-play:active { transform: translateY(3px); box-shadow: none; }
.mu-c-back { position: absolute !important; left: 14px; }
.mu-c-stop { position: absolute !important; right: 14px; font-size: 26px; }

/* Discord */
.dc-top { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; }
.dc-card { position: relative; display: flex; align-items: center; gap: 30px; padding: 30px 40px; border-radius: 26px; background: #2f3136; color: #fff; }
.dc-icon { width: 150px; height: 150px; border-radius: 34px; }
.dc-info { display: flex; flex-direction: column; gap: 6px; }
.dc-sub { color: #b9bbbe; font-size: 22px; }
.dc-name { font-weight: normal; font-size: 46px; }
.dc-stats { display: flex; align-items: center; gap: 10px; color: #b9bbbe; font-size: 22px; }
.dc-stats i { width: 12px; height: 12px; border-radius: 50%; background: #747f8d; }
.dc-stats i.on { background: #3ba55d; }
.dc-stats em { font-style: normal; margin-right: 14px; }
.dc-link { color: #8ea1e1; font-size: 22px; }
.dc-hint { position: relative; margin: 0; font-size: 24px; color: var(--text-dim); }
.dc-hint b { font-weight: normal; color: var(--text); }
.dc-bottom iframe { position: absolute; inset: 0; width: 640px; height: 480px; border: 0; background: #2f3136; }

/* Settings */
.set-top { display: grid; place-items: center; }
.set-card { position: relative; width: 640px; max-height: 380px; margin-top: 52px; padding: 30px 40px; border-radius: 26px; background: var(--surface); box-shadow: 0 0 0 2px var(--line); }
.set-card h2 { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; font-weight: normal; font-size: 34px; }
.set-card h2 .glyph { width: 40px; height: 40px; color: #8a7a4a; --glyph-bg: var(--surface); }
.set-card p { margin: 0; font-size: 24px; color: var(--text-dim); }
.set-big { font-size: 64px; color: var(--accent-ink); margin-bottom: 10px; }
.keys { width: 100%; border-collapse: collapse; font-size: 19px; }
.keys th { text-align: left; font-weight: normal; padding: 5px 10px 5px 0; white-space: nowrap; }
.keys td { padding: 5px 10px 5px 0; color: var(--text-dim); }
.keys td:last-child { text-align: right; white-space: nowrap; color: var(--text); }
.keys tr + tr { border-top: 1px solid var(--line); }
.set-head { position: absolute; left: 0; right: 0; top: 0; height: 70px; display: flex; align-items: center; gap: 16px; padding: 0 20px; background: var(--surface); border-bottom: 2px solid var(--line); font-size: 28px; }
.set-head .ic { width: 50px; height: 50px; border-radius: 10px; }
.set-head b { font-weight: normal; }
.set-list { position: absolute; left: 0; right: 0; top: 70px; bottom: 54px; overflow-y: auto; padding: 10px 16px; scrollbar-width: thin; }
.set-row { display: flex; align-items: center; gap: 16px; height: 62px; padding: 0 14px; margin-bottom: 6px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line); cursor: pointer; font-size: 24px; }
.set-row.is-sel { background: var(--sel); box-shadow: inset 0 0 0 4px var(--accent); }
.set-ic .glyph { width: 30px; height: 30px; color: #8a7a4a; --glyph-bg: var(--surface); }
.set-label { flex: 1; }
.set-val { display: flex; align-items: center; gap: 6px; }
.set-val em { font-style: normal; min-width: 130px; text-align: center; }
.set-val button { width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--surface-2); font-size: 16px; color: var(--text-dim); }
.set-val button:hover { background: var(--line); }
.set-go .glyph { width: 26px; height: 26px; color: var(--text-dim); }

/* Title card */
.ti-wash { position: absolute; inset: 0; background: var(--ti-bg); opacity: 0.9; }
.ti-wash::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 120%, rgba(0,0,0,0.35), transparent 60%); }
.ti-card { position: absolute; left: 50px; right: 50px; top: 90px; display: flex; gap: 34px; align-items: center; padding: 30px; border-radius: 28px; background: rgba(255,255,255,0.94); color: #3a3a3a; }
.ti-icon { width: 190px; height: 190px; flex: none; padding: 8px; border-radius: 26px; background: #fff; box-shadow: 0 0 0 2px #e6e6e6; }
.ti-icon .ic { border-radius: 18px; }
.ti-text b { display: block; font-weight: normal; font-size: 36px; line-height: 1.15; }
.ti-text span { display: block; color: #888; font-size: 22px; margin: 6px 0 12px; }
.ti-text p { margin: 0; font-size: 22px; color: #555; }
.ti-bottom { padding: 34px 26px 0; }
.ti-msg { margin: 0 0 26px; text-align: center; font-size: 24px; color: var(--text-dim); }
.ti-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Manual */
.man-top { background: #d9d4c4; display: grid; place-items: center; }
.man-page { width: 700px; margin-top: 30px; padding: 30px 40px; border-radius: 10px; background: #fffdf5; color: #3a3a3a; }
.man-head { display: flex; align-items: center; gap: 18px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 2px solid #e9e2cc; }
.man-head .ic { width: 70px; height: 70px; border-radius: 12px; flex: none; }
.man-head b { display: block; font-weight: normal; font-size: 30px; }
.man-head span { color: #999; font-size: 20px; }
.man-page p { margin: 0; font-size: 24px; line-height: 1.5; }
.man-bottom { display: flex; flex-direction: column; align-items: center; padding-top: 110px; }
.man-tab { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-radius: 18px; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line); font-size: 28px; }
.man-tab .glyph { width: 34px; height: 34px; color: #e8b400; --glyph-bg: var(--surface); }
.man-bottom p { color: var(--text-dim); font-size: 22px; }

/* Notes */
.no-top { background: #fff8d8; }
.no-head { display: flex; align-items: center; gap: 12px; position: absolute; left: 30px; right: 30px; top: 66px; font-size: 30px; color: #6b5a00; }
.no-head .glyph { width: 36px; height: 36px; color: #f2c200; --glyph-bg: #fff8d8; }
.no-head b { font-weight: normal; }
.no-head span { margin-left: auto; font-size: 20px; color: #a89650; }
.no-gallery { position: absolute; left: 30px; right: 30px; top: 120px; bottom: 20px; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 160px; gap: 16px; }
.no-gallery img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; box-shadow: 0 0 0 2px #eadf9f, 0 3px 8px rgba(0,0,0,0.12); background: #fffdf2; }
.no-empty { grid-column: 1 / -1; align-self: center; text-align: center; color: #a89650; font-size: 24px; }
.no-empty b { font-weight: normal; color: #6b5a00; }
.no-bottom canvas { position: absolute; left: 0; top: 0; width: 640px; height: 396px; touch-action: none; cursor: crosshair; }
.no-tools { position: absolute; left: 0; right: 0; bottom: 0; height: 84px; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: linear-gradient(#f9f9f9, #e4e4e4); border-top: 2px solid #d0d0d0; }
.no-color { width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px #fff, 0 0 0 4px #ccc; }
.no-color.is-on { box-shadow: 0 0 0 3px #fff, 0 0 0 7px #3fd6b4; }
.no-tool { height: 56px; min-width: 56px; border: 0; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 2px #d4d4d4; display: grid; place-items: center; color: #666 !important; }
.no-tool .glyph { width: 30px; height: 30px; }
.no-tool.is-on { box-shadow: inset 0 0 0 4px #3fd6b4; }
.no-dot { width: var(--s, 8px); height: var(--s, 8px); border-radius: 50%; background: #444; }
.no-save { margin-left: auto; display: flex !important; gap: 8px; padding: 0 18px; background: linear-gradient(#ffd55a, #f2b400) !important; color: #5a4300 !important; box-shadow: 0 3px 0 #c99400 !important; font-size: 22px; }

/* Friends */
.fr-card { position: absolute; left: 70px; right: 70px; top: 110px; display: flex; align-items: center; gap: 34px; padding: 30px; border-radius: 26px; background: var(--surface); box-shadow: 0 0 0 2px var(--line); }
.fr-big { width: 170px; height: 170px; border-radius: 30px; flex: none; object-fit: cover; }
.fr-card b { display: block; font-weight: normal; font-size: 42px; }
.fr-card span { color: #f28a1f; font-size: 22px; }
.fr-card p { margin: 14px 0 0; color: var(--text-dim); font-size: 22px; }
.av-fb { display: grid; place-items: center; background: linear-gradient(#ffb445, #f17a0a); color: #fff; font-size: 0.5em; }
.fr-big.av-fb { font-size: 80px; }
.fr-av.av-fb { font-size: 48px; }
.fr-head, .nt-head { position: absolute; left: 0; right: 0; top: 0; height: 70px; display: flex; align-items: center; gap: 14px; padding: 0 22px; background: var(--surface); border-bottom: 2px solid var(--line); font-size: 28px; }
.fr-head .glyph { width: 36px; height: 36px; color: #f28a1f; }
.fr-head b, .nt-head b { font-weight: normal; }
.fr-head span { margin-left: auto; color: var(--text-dim); font-size: 20px; }
.fr-grid { position: absolute; left: 20px; right: 20px; top: 100px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.fr-cell { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 8px; border: 0; border-radius: 18px; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line); font-size: 20px; }
.fr-cell.is-sel { background: var(--sel); box-shadow: inset 0 0 0 4px var(--accent); }
.fr-av { width: 96px; height: 96px; border-radius: 20px; object-fit: cover; }
.fr-cell span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Notifications */
.nt-top { background: var(--bg); display: grid; place-items: center; }
.nt-paper { width: 680px; margin-top: 40px; padding: 30px 40px; border-radius: 22px; background: var(--surface); box-shadow: 0 0 0 2px var(--line); }
.nt-paper b { display: block; font-weight: normal; font-size: 32px; margin-bottom: 14px; color: #12a888; }
.nt-paper p { margin: 0; font-size: 24px; line-height: 1.5; }
.nt-head .glyph { width: 36px; height: 36px; color: #1fbf9a; }
.nt-list { position: absolute; left: 0; right: 0; top: 70px; bottom: 0; overflow-y: auto; padding: 12px 16px; }
.nt-row { display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin-bottom: 8px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line); cursor: pointer; font-size: 23px; }
.nt-row.is-sel { background: var(--sel); box-shadow: inset 0 0 0 4px var(--accent); }
.nt-dot { width: 14px; height: 14px; border-radius: 50%; background: #1fbf9a; flex: none; }

@media (prefers-reduced-motion: reduce) {
  .cursor i, .topbar .is-sel, .boot-bottom p, .mu-top.is-playing .mu-bg, .mu-eq i { animation: none !important; }
  .grid-track, .depth, .theme-bg::before { transition: none; }
}

/* ── Nintendo DS games ──────────────────────────────────────────── */
.ds-top, .ds-bottom { background: #000; }
.ds-intro { position: absolute; inset: 0; display: grid; place-items: center; background: var(--bg); }
.ds-intro-card { display: flex; align-items: center; gap: 30px; width: 700px; padding: 30px; border-radius: 26px; background: var(--surface); box-shadow: 0 0 0 2px var(--line); }
.ds-intro-icon { width: 170px; height: 170px; flex: none; padding: 8px; border-radius: 24px; background: #fff; box-shadow: 0 0 0 2px #e6e6e6; }
.ds-intro-icon .ic { border-radius: 16px; }
.ds-intro-card b { display: block; font-weight: normal; font-size: 36px; line-height: 1.15; }
.ds-intro-card span { display: block; color: var(--text-dim); font-size: 22px; margin: 6px 0 14px; }
.ds-status { margin: 0; font-size: 22px; color: var(--accent-ink); }
.ds-top.is-running .ds-intro { display: none; }

/* DS screens are 256×192 (4:3). Top: centred with black bars on the wider
   3DS screen; bottom: fills the 4:3 touch screen exactly (2.5×).        */
.ds-screen { position: absolute; inset: 0; display: grid; place-items: center; }
.ds-screen-top .ds-canvas { width: 640px; height: 480px; }
.ds-screen-bottom .ds-canvas { width: 640px; height: 480px; touch-action: none; cursor: pointer; }
.ds-canvas { display: block; image-rendering: auto; }
.ds-bottom:not(.is-running) .ds-screen { display: none; }

.ds-pick, .ds-loading { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 0 50px; text-align: center; background: var(--bg); color: var(--text); }
.ds-card-slot { width: 96px; height: 96px; border-radius: 18px; display: grid; place-items: center; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line); color: var(--text-dim); }
.ds-card-slot .glyph { width: 50px; height: 50px; }
.ds-pick h3 { margin: 0; font-weight: normal; font-size: 34px; }
.ds-pick p { margin: 0; font-size: 21px; color: var(--text-dim); line-height: 1.45; }
.ds-pick p b { font-weight: normal; color: var(--text); }
.ds-file-btn { display: flex; align-items: center; gap: 12px; padding: 16px 30px; border-radius: 20px; cursor: pointer; font-size: 26px; background: linear-gradient(#ffb445, #f17a0a); color: #fff; box-shadow: 0 4px 0 #c45a00; }
.ds-file-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #c45a00; }
.ds-file-btn .glyph { width: 28px; height: 28px; }
.ds-err { color: #d4362a !important; }
.ds-loading p { color: var(--text-dim); font-size: 24px; margin: 0; }
.ds-toast { position: absolute; z-index: 41; right: 16px; bottom: 16px; padding: 6px 16px; border-radius: 16px; background: rgba(0,0,0,0.7); color: #fff; font-size: 20px; }
