/* osir.co.uk: Device Tester */
.dt-tabs { margin-bottom: 4px; }
.dt-pane { margin-top: 14px; }
.dt-h3 { margin-top: 22px; font-size: 16px; font-weight: 750; }
.u-pane-head .dt-h3 { margin-top: 0; }
.dt-sub { margin-top: 6px; }
.dt-sub .dt-h3 { margin-top: 16px; }
.dt-note { margin-top: 14px; }
.dt-tiles { margin-top: 14px; }
.dt-tiles .u-tile b { font-size: 18px; overflow-wrap: anywhere; }
.dt-tiles .u-tile b.dt-small-b { font-size: 14px; font-weight: 700; }
.dt-row-actions { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-top: 12px; }
.dt-privacy { margin-top: 12px; display: flex; gap: 8px; align-items: flex-start; }
.dt-privacy .icon { flex: none; margin-top: 2px; color: #16a34a; }
.dt-controls { margin-top: 12px; }
.dt-narrow { flex: 0 1 180px !important; }
.dt-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; }

/* Keyboard: a 92-column grid (4 columns per key width). The keyboard scrolls sideways inside its box on phones. */
.dt-kb-wrap { margin-top: 14px; overflow-x: auto; padding-bottom: 4px; }
.dt-kb { container-type: inline-size; min-width: 640px; display: grid; grid-template-columns: repeat(92, minmax(0, 1fr)); gap: 4px; }
.dt-key {
  position: relative; display: grid; place-items: center; align-content: center; min-height: calc(100cqw / 23 - 4px); padding: 2px;
  border-radius: 6px; background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: 0 2px 0 var(--border-strong);
  font-size: max(10px, calc(100cqw / 23 * .3)); font-weight: 650; line-height: 1.1; color: var(--text-2); text-align: center; user-select: none;
  transition: background .08s, transform .08s;
}
.dt-key-wide { font-size: max(9px, calc(100cqw / 23 * .24)); }
.dt-key-top, .dt-key-bot { display: block; }
.dt-key-top { font-size: .85em; color: var(--muted); }
.dt-key-enter { clip-path: polygon(0 0, 100% 0, 100% 100%, 17% 100%, 17% 52%, 0 52%); }
.dt-key.is-ok { background: rgba(34, 197, 94, .2); border-color: rgba(22, 163, 74, .6); color: var(--text); }
.dt-key.is-down { background: var(--brand-1); border-color: var(--brand-1); color: #fff; transform: translateY(2px); box-shadow: none; }
.dt-key.is-down .dt-key-top { color: #fff; }
.dt-combos { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.dt-combo { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.dt-combo .t-badge { min-width: 64px; justify-content: center; }
.dt-keylog td { font-size: 13px; padding: 6px 10px; }
.dt-other-label { margin-top: 12px; }
.dt-kb-scroll { display: none; margin-top: 4px; }
@media (max-width: 720px) { .dt-kb-scroll { display: block; } }

/* Mouse */
.dt-buttons { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.dt-btn { display: grid; gap: 2px; padding: 10px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-2); text-align: center; min-width: 0; }
.dt-btn-name { font-weight: 750; font-size: 14px; }
.dt-btn-count { font-size: 12px; color: var(--muted); }
.dt-btn.is-ok { background: rgba(34, 197, 94, .14); border-color: rgba(22, 163, 74, .55); }
.dt-btn.is-down { background: var(--brand-1); border-color: var(--brand-1); color: #fff; }
.dt-btn.is-down .dt-btn-count { color: #fff; }
.dt-area { position: relative; margin-top: 12px; height: 260px; border-radius: 16px; border: 2px dashed var(--border-strong); background: var(--surface-2); overflow: hidden; display: grid; place-items: center; user-select: none; -webkit-user-select: none; }
.dt-area canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.dt-area-hint { position: relative; color: var(--muted); font-size: 14px; text-align: center; pointer-events: none; padding: 0 16px; }
.dt-area[data-wheel="up"] { box-shadow: inset 0 6px 0 var(--brand-1); }
.dt-area[data-wheel="down"] { box-shadow: inset 0 -6px 0 var(--brand-1); }
.dt-area[data-wheel="left"] { box-shadow: inset 6px 0 0 var(--brand-1); }
.dt-area[data-wheel="right"] { box-shadow: inset -6px 0 0 var(--brand-1); }
@keyframes dtdbl { from { background: color-mix(in srgb, var(--brand-1) 25%, var(--surface-2)); } to { background: var(--surface-2); } }
.dt-area.is-dbl { animation: dtdbl .5s ease-out; }
.dt-touch { height: 320px; touch-action: none; cursor: crosshair; }
.dt-touch:fullscreen, .dt-touch.is-full { position: fixed; inset: 0; z-index: 1000; height: auto; margin: 0; border-radius: 0; border: 0; background: var(--bg); }
.dt-touch-exit { position: absolute; top: 12px; right: 12px; z-index: 2; }

/* Webcam */
.dt-video { position: relative; margin-top: 14px; aspect-ratio: 16 / 9; max-height: 70vh; border-radius: 16px; overflow: hidden; background: #0b0d14; display: grid; place-items: center; }
.dt-video video { width: 100%; height: 100%; object-fit: contain; }
.dt-video video.is-mirror { transform: scaleX(-1); }
.dt-video-idle { position: absolute; color: #c3c9dc; font-size: 15px; }
.dt-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-top: 14px; }
.dt-shot { margin: 0; padding: 8px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); min-width: 0; }
.dt-shot img { display: block; width: 100%; height: auto; border-radius: 8px; }
.dt-shot figcaption { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 6px; font-size: 13px; color: var(--muted); }
.dt-shot figcaption a { color: var(--link); font-weight: 650; }

/* Microphone */
.dt-meter-wrap { margin-top: 16px; }
.dt-meter { position: relative; height: 22px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border-strong); overflow: hidden; }
.dt-meter i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #16a34a; transition: width .05s linear; }
.dt-meter i.is-loud { background: #d97706; }
.dt-meter i.is-clip { background: #dc2626; }
.dt-meter b { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1px; left: 0; background: var(--text); opacity: .7; }
.dt-meter-scale { position: relative; height: 18px; font-size: 11px; color: var(--muted); margin: 0 12px; }
.dt-meter-scale span { position: absolute; top: 3px; transform: translateX(-50%); white-space: nowrap; }
.dt-hist { display: block; width: 100%; height: 60px; margin-top: 4px; border-radius: 8px; background: var(--surface-2); }
#dt-rec-out { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
#dt-rec-out audio { max-width: 100%; }
#dt-rec-out a { text-decoration: none; }

/* Speakers */
.dt-vol { flex: 1 1 220px; margin-top: 0; }
.dt-vol output, .u-range output { font-variant-numeric: tabular-nums; }
.dt-lr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.dt-lr-btn { width: 100%; }
.dt-lr-btn.is-on { border-color: var(--brand-1); background: color-mix(in srgb, var(--brand-1) 14%, var(--surface)); }
.dt-pan { position: relative; display: flex; justify-content: space-between; align-items: center; margin-top: 10px; height: 26px; padding: 0 8px; border-radius: 99px; background: var(--surface-2); font-size: 12px; font-weight: 750; color: var(--muted); }
.dt-pan i { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--brand-1); transition: left .1s linear; }

/* Screen */
.dt-patterns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.dt-fs { position: fixed; inset: 0; z-index: 2000; background: #000; outline: none; cursor: default; }
.dt-fs.no-cursor { cursor: none; }
.dt-fs canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.dt-fs-cap { position: absolute; left: 50%; bottom: 24px; z-index: 1; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 14px; border-radius: 12px; background: rgba(0, 0, 0, .75); color: #fff; font-size: 14px; text-align: center; opacity: 0; transition: opacity .4s; pointer-events: none; }
.dt-fs-cap.is-on { opacity: 1; }
body.dt-fs-open { overflow: hidden; }

/* Game controller */
.dt-gp { margin-top: 16px; padding: 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-2); }
.dt-gp-id { margin-top: 4px; overflow-wrap: anywhere; }
.dt-sticks { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px; }
.dt-stick-wrap { display: grid; justify-items: center; gap: 4px; }
.dt-stick { position: relative; width: 110px; height: 110px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface-solid); }
.dt-stick::before, .dt-stick::after { content: ""; position: absolute; background: var(--border); }
.dt-stick::before { left: 50%; top: 6px; bottom: 6px; width: 1px; }
.dt-stick::after { top: 50%; left: 6px; right: 6px; height: 1px; }
.dt-stick i { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--brand-1); z-index: 1; }
.dt-gp-btns { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; margin-top: 14px; }
.dt-gp-btn { position: relative; padding: 8px 10px 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-solid); font-size: 13px; font-weight: 650; overflow: hidden; min-width: 0; }
.dt-gp-btn i { position: absolute; left: 0; bottom: 0; height: 4px; width: 0; background: var(--brand-1); }
.dt-gp-btn.is-ok { border-color: rgba(22, 163, 74, .6); background: rgba(34, 197, 94, .12); }
.dt-gp-btn.is-down { background: var(--brand-1); color: #fff; }

@media (max-width: 560px) {
  .dt-buttons { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dt-area { height: 220px; }
  .dt-touch { height: 280px; }
  .dt-tabs .t-tab { padding: 7px 10px; font-size: 13.5px; }
}
