:root { color-scheme: dark; }
* { box-sizing: border-box; }
body {
  margin: 0;
  background: #111;
  color: #f3f3f3;
  font: 18px/1.4 system-ui, -apple-system, Segoe UI, sans-serif;
}
main {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px calc(28px + env(safe-area-inset-bottom));
}
h1 { font-size: 34px; margin: 0 0 8px; }
h2 { font-size: 16px; margin: 22px 0 8px; }
.lead, .fine, .heard { color: #c8c8c8; }
.fine { font-size: 15px; margin-top: 28px; }
.drop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  margin: 16px 0;
  border: 2px dashed #6a6a6a;
  border-radius: 16px;
  text-align: center;
  font-size: 16px;
  background: #1a1a1a;
}
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop.hot { border-color: #fff; background: #222; }
.url-box { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 16px; }
input, select, button { font: inherit; }
input[type="url"], input[readonly], select {
  width: 100%;
  min-height: 56px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #444;
  background: #1a1a1a;
  color: #fff;
}
.btn {
  min-height: 56px;
  border: 0;
  border-radius: 14px;
  background: #f3f3f3;
  color: #111;
  font-weight: 700;
  font-size: 20px;
  padding: 12px 16px;
}
.btn:disabled { opacity: 0.45; }
.btn.ghost { background: transparent; color: #f3f3f3; border: 2px solid #888; margin-bottom: 12px; }
.status { min-height: 1.4em; font-size: 18px; }
.status.bad { color: #ffb4b4; }
.hidden { display: none !important; }
.player { position: relative; background: #000; border-radius: 16px; overflow: hidden; }
video { display: block; width: 100%; max-height: 52vh; background: #000; }
.overlay {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 10px;
  z-index: 2;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.78);
  border-radius: 10px;
  padding: 8px 10px;
  touch-action: none;
  cursor: grab;
}
.overlay.placed {
  right: auto;
  bottom: auto;
}
.fill {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 12px;
}
.player.big {
  position: fixed;
  inset: 0;
  z-index: 40;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.player.big video {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}
.overlay:empty { display: none; }
.row { display: flex; align-items: center; gap: 12px; margin: 14px 0; }
.row select { flex: 1; }
.share-box { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
#lines { list-style: none; padding: 0; margin: 0; }
#line, #lines li {
  padding: 12px;
  border-radius: 12px;
  margin: 0 0 8px;
  background: #1a1a1a;
}
#lines li.active { background: #2e2e2e; outline: 2px solid #888; }
#lines button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: inherit;
  border: 0;
  font: inherit;
  padding: 0;
}
.time { display: block; color: #aaa; font-size: 14px; margin-bottom: 4px; }
.text-link { color: #fff; font-size: 18px; }

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin: 0 0 8px;
}
.top h1 { margin: 0; flex: 1 1 auto; }
.ui-lang {
  display: flex;
  flex: 0 0 auto;
  margin-left: auto;
  border: 1px solid #777;
  border-radius: 999px;
  overflow: hidden;
  background: #1a1a1a;
}
.ui-lang button {
  min-height: 44px;
  padding: 8px 14px;
  border: 0;
  background: transparent;
  color: #f3f3f3;
  font: 700 16px/1 system-ui, -apple-system, Segoe UI, sans-serif;
}
.ui-lang button + button { border-left: 1px solid #777; }
.ui-lang button[aria-pressed="true"] {
  background: #f3f3f3;
  color: #111;
}
@media (max-width: 420px) {
  h1 { font-size: 28px; }
  .ui-lang button { padding: 8px 12px; font-size: 15px; }
}


.move-hint {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 3;
  margin: 0;
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  border-radius: 8px;
  padding: 2px;
  font: 700 14px/1.05 system-ui, -apple-system, Segoe UI, sans-serif;
}
