:root {
  --bezel: #2a2a2e;
  --ink: #3b3326;
  --panel: #f7f1e3;
  --panel-edge: #c9b48e;
  --accent: #f08a24;
  --sky: #9fd6ef;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bezel); overflow: hidden; touch-action: none;
  -webkit-user-select: none; user-select: none; font-family: Nunito, "Trebuchet MS", Verdana, system-ui, sans-serif; }
#ds { position: absolute; left: 0; top: 0; }
#gl { position: absolute; left: 0; top: 0; display: block; }
.screen { position: absolute; overflow: hidden; }
.screen .ui { position: absolute; left: 0; top: 0; width: 256px; height: 192px; transform-origin: 0 0; color: var(--ink); font-size: 9px; }
#bottom { cursor: none; }
.hinge { position: absolute; background: linear-gradient(#1d1d20, #313136 50%, #1d1d20); }

/* generic UI pieces, all in DS pixels (256x192 per screen) */
.btn { position: absolute; display: flex; align-items: center; justify-content: center; text-align: center;
  background: linear-gradient(#fffdf6, #efe3c8); border: 1px solid #b59a6b; border-radius: 5px; color: var(--ink);
  font-weight: bold; font-size: 10px; line-height: 1.1; box-shadow: 0 1px 0 #8f7650; cursor: pointer; }
.btn.pressed, .btn:active { background: linear-gradient(#ffd79a, #f3b35a); transform: translateY(1px); box-shadow: none; }
.btn.disabled { opacity: 0.45; pointer-events: none; }
.icon-btn { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  cursor: pointer; font-size: 6.5px; font-weight: bold; color: #4b3d28; }
.icon-btn .ic { width: 28px; height: 28px; border-radius: 7px; background: linear-gradient(#fffaf0, #eadbbb);
  border: 1px solid #b0915f; box-shadow: 0 1px 0 #7d6440; display: flex; align-items: center; justify-content: center; }
.icon-btn.pressed .ic, .icon-btn:active .ic { background: linear-gradient(#ffe0a8, #f5b862); transform: translateY(1px); box-shadow: none; }
.icon-btn svg { width: 22px; height: 22px; }
.panel { position: absolute; background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 6px; }
.msg { position: absolute; left: 8px; right: 8px; bottom: 6px; min-height: 30px; padding: 4px 7px; background: rgba(255,253,245,.96);
  border: 1px solid #b89d70; border-radius: 6px; font-size: 8.5px; line-height: 1.3; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.title { font-weight: bold; font-size: 11px; }
.hidden { display: none !important; }
.cursor { position: absolute; width: 22px; height: 22px; pointer-events: none; transform: translate(-6px, -3px); z-index: 50; }
.meter { position: absolute; height: 5px; background: #d9ccb0; border-radius: 3px; overflow: hidden; border: 1px solid #a68e64; }
.meter > i { display: block; height: 100%; background: linear-gradient(#ffb04a, #e57a1a); }
.list { position: absolute; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.list::-webkit-scrollbar { display: none; }
.row { display: flex; align-items: center; gap: 4px; padding: 2px 4px; border-bottom: 1px dotted #ccb894; cursor: pointer; font-size: 8px; }
.row.sel { background: #ffe1a8; }
input.ds-input { position: absolute; font: inherit; font-size: 10px; border: 1px solid #a68e64; border-radius: 4px; padding: 2px 4px; background: #fffef8; color: var(--ink); }
.fade { transition: opacity .3s; }
#rotate-hint { display: none; }
.btn.no-chrome { background: none; border: none; box-shadow: none; padding: 0; }
.btn.no-chrome.pressed { transform: translateY(1px); filter: brightness(1.1); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: .35; } }
.btn.tan { background: linear-gradient(#e8d4b0, #d3bc94); border: 1.5px solid #5a4030; border-radius: 6px; box-shadow: inset 0 0 0 1px #f4e8d0; font: 10.5px Verdana, sans-serif; color: #3b2a1a; }
.btn.tan.pressed { background: linear-gradient(#a88660, #8a6a48); color: #fff; }
.btn.green { background: linear-gradient(#a8e0a0, #6cc060); border: 1.5px solid #3a7a30; border-radius: 4px; font: 10.5px Verdana, sans-serif; color: #1a3a10; }
