/* ---------- taskbar ---------- */
#taskbar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 50; height: var(--tb-h); display: flex; align-items: stretch; gap: 6px; padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); background: var(--taskbar-bg); color: var(--taskbar-fg); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2); }
#startbtn { flex: none; display: flex; align-items: center; gap: 7px; padding: 0 20px 0 10px; border: 0; border-radius: 0 14px 14px 0; background: var(--start-bg); color: var(--start-fg); font: var(--start-font); text-transform: var(--start-case); text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.45); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 2px 0 5px rgba(0, 0, 0, 0.3); }
#startbtn[aria-expanded="true"] { filter: brightness(0.85); }
#startbtn .ico { width: 22px; height: 22px; }
#tasks { flex: 1; min-width: 0; display: flex; align-items: stretch; gap: 3px; padding: 4px 0; overflow: hidden; }
.task { flex: 0 1 170px; min-width: 34px; display: flex; align-items: center; gap: 6px; padding: 0 8px; background: var(--task-btn-bg); color: var(--taskbar-fg); border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 3px; font-size: var(--small-size); white-space: nowrap; overflow: hidden; }
.task.on { background: var(--task-btn-on); box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.45); }
.task .ico { width: 16px; height: 16px; }
.task span { overflow: hidden; text-overflow: ellipsis; }
#tray { flex: none; display: flex; align-items: center; gap: 2px; padding: 0 10px 0 8px; background: var(--tray-bg); border-left: 1px solid var(--tray-border); }
#tray button { display: grid; place-items: center; padding: 3px; background: none; border: 0; color: var(--taskbar-fg); border-radius: 3px; }
#tray button:hover { background: rgba(255, 255, 255, 0.15); }
#tray .ico { width: 17px; height: 17px; }
#clock { padding-left: 6px; font-size: var(--small-size); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- start menu ---------- */
#startmenu { position: absolute; left: 0; bottom: var(--tb-h); z-index: 60; width: min(410px, 100%); max-height: calc(100% - var(--tb-h)); display: flex; flex-direction: column; overflow: hidden; border-radius: 8px 8px 0 0; background: var(--menu-left); box-shadow: 3px -2px 16px rgba(0, 0, 0, 0.5); }
.sm-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--menu-head); color: var(--menu-head-fg); font: 700 17px/1 var(--title-font); text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4); }
.sm-avatar { width: 46px; height: 46px; border: 2px solid rgba(255, 255, 255, 0.85); border-radius: 5px; overflow: hidden; }
.sm-avatar .ico { width: 100%; height: 100%; }
.sm-cols { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.sm-col { list-style: none; margin: 0; padding: 6px 4px; display: flex; flex-direction: column; gap: 1px; }
.sm-left { background: var(--menu-left); color: var(--menu-fg); }
.sm-right { background: var(--menu-right); color: var(--menu-right-fg); border-left: 1px solid var(--menu-line); }
.sm-item { width: 100%; display: flex; align-items: center; gap: 8px; padding: 4px 6px; background: none; border: 0; border-radius: 2px; color: inherit; text-align: left; font-size: var(--small-size); }
.sm-item .ico { width: 30px; height: 30px; }
.sm-right .sm-item .ico { width: 22px; height: 22px; }
.sm-item b, .sm-item small { display: block; }
.sm-item small { opacity: 0.7; }
.sm-right .sm-item { font-weight: 700; }
.sm-item:hover, .sm-item:focus-visible { background: var(--menu-hover); color: var(--menu-hover-fg); outline: none; }
.sm-sep { height: 1px; margin: 4px 8px; background: linear-gradient(90deg, transparent, var(--menu-line), transparent); }
.sm-foot { flex: none; display: flex; justify-content: flex-end; gap: 8px; padding: 6px 10px; background: var(--menu-foot); }
.sm-foot button { display: flex; align-items: center; gap: 6px; padding: 3px 7px; background: none; border: 0; border-radius: 3px; color: var(--menu-head-fg); font-size: var(--small-size); }
.sm-foot button:hover { background: rgba(255, 255, 255, 0.15); }
.sm-foot .ico { width: 22px; height: 22px; }

/* ---------- context menu, balloon ---------- */
.ctx { position: absolute; z-index: 70; min-width: 200px; padding: 2px; background: var(--panel); color: var(--panel-fg); border: 1px solid var(--line); box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.35); font-size: var(--small-size); }
.ctx button { display: block; width: 100%; padding: 4px 22px; background: none; border: 0; text-align: left; color: inherit; }
.ctx button:hover, .ctx button:focus-visible { background: var(--sel); color: var(--sel-fg); outline: none; }
.ctx hr { margin: 2px 1px; border: 0; border-top: 1px solid var(--line); }
#balloon { position: absolute; right: 8px; bottom: calc(var(--tb-h) + 14px); z-index: 55; width: min(300px, calc(100% - 16px)); padding: 10px 30px 10px 12px; background: var(--tip-bg); color: var(--tip-fg); border: 1px solid var(--tip-border); border-radius: 8px; box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.35); font-size: var(--small-size); cursor: pointer; }
#balloon::after { content: ""; position: absolute; right: 56px; bottom: -11px; border: 11px solid transparent; border-bottom: 0; border-top-color: var(--tip-border); }
#balloon::before { content: ""; position: absolute; right: 57px; bottom: -9px; z-index: 1; border: 10px solid transparent; border-bottom: 0; border-top-color: var(--tip-bg); }
#balloon b { display: flex; align-items: center; gap: 6px; }
#balloon b .ico { width: 16px; height: 16px; }
#balloon p { margin: 6px 0 0; }
.bl-x { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; padding: 0; display: grid; place-items: center; background: none; border: 1px solid transparent; border-radius: 3px; color: inherit; }
.bl-x:hover { border-color: var(--tip-border); }
.bl-x svg { width: 10px; height: 10px; }

/* desktop gadgets */
#gadgets { position: absolute; top: 14px; right: max(16px, env(safe-area-inset-right, 0px)); z-index: 1; width: 214px; display: flex; flex-direction: column; gap: 16px; }
.note { --note: #fff27a; --note-band: #f4d63a; --note-ink: #3a3000; padding: 26px 14px 12px; background: linear-gradient(180deg, var(--note-band) 0 18px, var(--note) 18px); color: var(--note-ink); box-shadow: 2px 7px 14px rgba(0, 0, 0, 0.35); transform: rotate(1.6deg); }
.note textarea { display: block; width: 100%; height: 168px; padding: 0; resize: none; background: transparent; border: 0; color: inherit; font: 600 24px/1.08 "Caveat", "Comic Sans MS", cursive; user-select: text; -webkit-user-select: text; }
.note textarea:focus-visible { outline: 1px dashed var(--note-ink); outline-offset: 4px; }
.race { --race-ink: #ffffff; --race-hot: #ffb27a; padding: 12px 14px 14px; border-radius: 12px; background: linear-gradient(180deg, rgba(40, 40, 58, 0.84), rgba(10, 10, 20, 0.92)); border: 1px solid rgba(255, 255, 255, 0.28); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 6px 16px rgba(0, 0, 0, 0.35); color: var(--race-ink); font: 12px/1.35 Tahoma, Verdana, sans-serif; text-align: center; }
.race small { display: block; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.7; }
.race b { display: block; margin-top: 6px; font: 700 15px/1.2 "Trebuchet MS", Tahoma, sans-serif; }
.race-days { display: block; margin: 6px 0 2px; color: var(--race-hot); font: 700 44px/1 "Trebuchet MS", Tahoma, sans-serif; font-variant-numeric: tabular-nums; }
.race-when { display: block; margin-top: 4px; opacity: 0.75; }
.race button { margin-top: 10px; padding: 4px 12px; background: rgba(255, 255, 255, 0.12); color: var(--race-ink); border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 12px; font-size: 11px; }
.race button:hover { background: rgba(255, 255, 255, 0.22); }
@media (max-width: 1099px) { #gadgets { display: none; } }
