/* Shared base for DisplayApps glasses apps — 600x600, additive display, D-pad + pinch */
:root {
  --surface: #0f1115;
  --surface-2: #1a1e25;
  --text: #ffffff;
  --text-2: #e4e6eb;
  --muted: #b0b3b8;
  --accent: #5ee7c8;
  --accent-ink: #062b23;
  --glow: rgba(94, 231, 200, 0.4);
  --danger: #ff6b6b;
  --ok: #7cf0c8;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 600px; height: 600px; overflow: hidden; background: #000000; color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
#app { width: 600px; height: 600px; padding: 8px; position: relative; }
.screen { position: absolute; inset: 8px; width: 584px; height: 584px; display: flex; flex-direction: column; gap: 8px; }
.screen.hidden { display: none; }
.header { display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 20px; border-radius: 16px; background: var(--surface); flex-shrink: 0; gap: 12px; }
.header h1 { font-size: 26px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-meta { font-size: 15px; color: var(--muted); white-space: nowrap; }
.content { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-bottom: 24px; }
.content::-webkit-scrollbar { display: none; }
.content.center { align-items: center; justify-content: center; text-align: center; }
.row, .tile, .btn, .nav-item, .cell-btn { border-radius: 16px; background: var(--surface); border: 2px solid transparent; color: var(--text);
  font: inherit; cursor: pointer; opacity: .88; transition: border-color .2s, box-shadow .2s, opacity .2s, transform .3s cubic-bezier(.6,0,.4,1); text-align: left; }
.row { display: flex; align-items: center; gap: 14px; min-height: 88px; padding: 12px 16px; flex-shrink: 0; }
.row.done .name { text-decoration: line-through; color: var(--muted); }
.row .ico { flex: 0 0 52px; height: 52px; border-radius: 13px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; font-size: 24px; font-weight: 800; }
.row .ico img { width: 52px; height: 52px; display: block; object-fit: cover; }
.row .txt { min-width: 0; flex: 1; }
.row .name { font-size: 20px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { font-size: 15px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.wrap .name, .row.wrap .sub { white-space: normal; }
.row .badge { margin-left: auto; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); background: rgba(94,231,200,.12); border-radius: 999px; padding: 4px 10px; flex-shrink: 0; }
.row .badge.red { color: #fff; background: #e0245e; }
.thumb { flex: 0 0 96px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.thumb img { width: 96px; height: 64px; object-fit: cover; display: block; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { min-height: 104px; padding: 14px 16px; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; }
.tile .name { font-size: 20px; font-weight: 700; }
.tile .sub { font-size: 14px; color: var(--muted); }
.nav-bar { display: flex; gap: 8px; flex-shrink: 0; }
.nav-bar:empty { display: none; }
.nav-item, .btn { flex: 1; min-height: 72px; font-size: 20px; font-weight: 600; text-align: center; padding: 0 14px; }
.nav-item.primary, .btn.primary { background: var(--accent); color: var(--accent-ink); }
.nav-item.danger { color: var(--danger); }
.focusable:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 20px var(--glow); opacity: 1; }
.primary.focusable:focus { border-color: #ffffff; }
.section-label { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; padding: 6px 12px 0; }
.status { padding: 22px; border-radius: 16px; background: var(--surface); font-size: 18px; color: var(--text-2); text-align: center; line-height: 1.4; }
.status.small { font-size: 15px; color: var(--muted); }
input.field, textarea.field { width: 100%; min-height: 72px; border-radius: 16px; background: var(--surface); border: 2px solid transparent; color: var(--text);
  font: inherit; font-size: 20px; padding: 14px 18px; opacity: .88; flex-shrink: 0; }
input.field::placeholder { color: var(--muted); }
.frame { flex: 1; min-height: 0; border-radius: 16px; overflow: hidden; background: #0a0a0a; position: relative; }
.frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.hint { height: 28px; text-align: center; font-size: 13px; color: var(--muted); line-height: 28px; flex-shrink: 0; }
.toast { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); max-width: 536px; padding: 12px 20px; border-radius: 24px; background: var(--surface-2); color: var(--text);
  font-size: 16px; opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 10; }
.toast.visible { opacity: 1; }

/* big readouts (timers, converters, sensors) */
.readout { flex: 1; min-height: 0; border-radius: 16px; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 16px; gap: 6px; }
.readout .big { font-size: 96px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.readout .big.xl { font-size: 130px; }
.readout .big.md { font-size: 64px; }
.readout .big.sm { font-size: 40px; }
.readout .label { font-size: 18px; color: var(--muted); }
.readout .warn { color: #ffb347; }
.readout .ok { color: var(--ok); }
.readout.flash { animation: flash .5s steps(2, start) infinite; }
@keyframes flash { to { background: #1f3b30; } }
.rail { display: flex; gap: 8px; flex-shrink: 0; }
.pill-btn { flex: 1; min-height: 64px; border-radius: 14px; background: var(--surface); border: 2px solid transparent; color: var(--text); font: inherit; font-size: 18px; font-weight: 600; cursor: pointer; opacity: .88; }
.pill-btn.primary { background: var(--accent); color: var(--accent-ink); }
.pill-btn.on { background: var(--surface-2); border-color: rgba(255,255,255,.25); }

/* article-style text (wikipedia, lyrics, readme) */
.article { padding: 18px 20px; border-radius: 16px; background: var(--surface); font-size: 20px; line-height: 1.45; color: var(--text-2); white-space: pre-wrap; word-wrap: break-word; flex-shrink: 0; }
.article.focusable { cursor: default; }
.article h2 { font-size: 22px; color: var(--text); margin-bottom: 8px; }
.article img { max-width: 100%; border-radius: 12px; margin-top: 10px; display: block; }
.photo { border-radius: 16px; overflow: hidden; background: var(--surface); flex-shrink: 0; }
.photo img { width: 100%; max-height: 380px; object-fit: contain; display: block; background: #000; }
.caption { font-size: 16px; color: var(--text-2); padding: 12px 16px; line-height: 1.4; }

/* grids for board games */
.grid-board { display: grid; gap: 8px; flex: 1; min-height: 0; padding: 4px; }
.cell-btn { display: grid; place-items: center; font-size: 34px; font-weight: 800; min-height: 0; }
.cell-btn.lit { background: #f5d76e; color: #1a1a1a; }
.cell-btn.open { background: #23272e; opacity: 1; font-size: 26px; }
.cell-btn.flag { color: #ffb347; }
.cell-btn.mine { background: #5a1f1f; color: #fff; }
.cell-btn.n1 { color: #8fb4ff; } .cell-btn.n2 { color: #7cf0c8; } .cell-btn.n3 { color: #ff8a80; } .cell-btn.n4 { color: #b39ddb; }
.cell-btn.hidden-card { background: var(--surface-2); color: transparent; }
.cell-btn.matched { background: #1f3b30; color: var(--ok); }
.pad-4 { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 10px; flex: 1; min-height: 0; padding: 4px; }
.pad-4 .cell-btn { font-size: 40px; }
.pad-4 .g { background: #1f3b2a; } .pad-4 .r { background: #3b1f1f; } .pad-4 .b { background: #1f2a3b; } .pad-4 .y { background: #3b351f; }
.pad-4 .g.lit { background: #7cf0c8; } .pad-4 .r.lit { background: #ff6b6b; } .pad-4 .b.lit { background: #8fb4ff; } .pad-4 .y.lit { background: #f5d76e; }
