:root {
  --bg: #050505;
  --panel: #111;
  --text: #f4f4f4;
  --muted: #8a8a8a;
  --red: #e82127;
  --red-dark: #9b161b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 24px 32px 28px;
  gap: 18px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.title-row {
  display: flex;
  align-items: baseline;
  gap: 22px;
  flex-wrap: wrap;
}

h1 {
  font-size: 42px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.back-link {
  font-size: 28px;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  padding: 8px 18px;
  border: 2px solid #fff;
  border-radius: 999px;
  line-height: 1.2;
  white-space: nowrap;
}

.back-link:active {
  background: #fff;
  color: #000;
}

.hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 20px;
}

.count {
  font-size: 28px;
  color: var(--muted);
  padding-top: 8px;
}

.stage {
  flex: 1;
  min-height: 280px;
}

.preview-wrap {
  height: 100%;
  min-height: 280px;
  border-radius: 24px;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.preview-wrap video,
.preview-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.empty {
  color: var(--muted);
  font-size: 28px;
  padding: 0 40px;
  text-align: center;
  line-height: 1.4;
}

.dock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.thumbs {
  width: 100%;
  min-height: 92px;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.thumbs img {
  width: 120px;
  height: 84px;
  object-fit: cover;
  border-radius: 10px;
  flex: 0 0 auto;
  background: #222;
  border: 3px solid transparent;
}

.thumbs img.selected {
  border-color: #fff;
}

.photo-actions {
  display: flex;
  gap: 16px;
  width: 100%;
  max-width: 560px;
}

.action-btn {
  flex: 1;
  min-height: 64px;
  border: 2px solid #fff;
  border-radius: 16px;
  background: transparent;
  color: #fff;
  font-size: 26px;
  font-weight: 500;
}

.action-btn.danger {
  border-color: #ff6b6b;
  color: #ff6b6b;
}

.action-btn:disabled {
  opacity: 0.35;
}

.action-btn:not(:disabled):active {
  background: #fff;
  color: #000;
}

.action-btn.danger:not(:disabled):active {
  background: #ff6b6b;
  color: #fff;
}

.shutter {
  width: 116px;
  height: 116px;
  border: 0;
  background: transparent;
  position: relative;
  cursor: pointer;
}

.shutter:disabled {
  opacity: 0.45;
}

.shutter-ring {
  position: absolute;
  inset: 0;
  border: 6px solid #fff;
  border-radius: 50%;
}

.shutter-core {
  position: absolute;
  inset: 16px;
  background: var(--red);
  border-radius: 50%;
  box-shadow: inset 0 -8px 0 var(--red-dark);
}

.shutter:active .shutter-core {
  transform: scale(0.94);
}

.status {
  min-height: 28px;
  font-size: 22px;
  color: var(--muted);
  text-align: center;
}

.status.error {
  color: #ff6b6b;
}

.status.ok {
  color: #9fe7b0;
}

@media (max-height: 700px) {
  h1 { font-size: 32px; }
  .back-link { font-size: 22px; }
  .hint, .status { font-size: 18px; }
  .shutter { width: 96px; height: 96px; }
}
