:root {
  color-scheme: light;
  font-family: "Baloo 2", "Trebuchet MS", sans-serif;
  background: #f6efe2;
  color: #4b2b2b;
  --beige: #f6efe2;
  --beige-cream: #fbf5ea;
  --pink: #f06a86;
  --pink-deep: #c84b63;
  --green: #7fb77a;
  --ink: #4b2b2b;
  --shell: rgba(246, 239, 226, 0.95);
  --shadow: 0 18px 36px rgba(200, 75, 99, 0.18);
}

* {
  box-sizing: border-box;
}

body.retro {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--beige) 0%, var(--beige-cream) 60%, var(--beige) 100%);
  color: var(--ink);
}

.app {
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 32px;
}

.feed {
  width: min(1400px, 100%);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--pink-deep);
}

.brand-subtitle {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(75, 43, 43, 0.6);
}

.topbar,
.bottombar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--shell);
  border-radius: 18px;
  padding: 14px 18px;
  box-shadow: var(--shadow);
}

.feed-menu {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  background: var(--shell);
  border-radius: 18px;
  padding: 10px 18px;
  box-shadow: var(--shadow);
}

.menu-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(75, 43, 43, 0.6);
}

.feed-input-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.controls {
  display: flex;
  gap: 12px;
}

.icon-button {
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  border-radius: 14px;
  background: var(--pink-deep);
  color: var(--beige-cream);
}

.preset-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.preset-button {
  border-radius: 12px;
  padding: 8px 14px;
  background: rgba(127, 183, 122, 0.2);
  color: var(--ink);
  border: 1px solid rgba(127, 183, 122, 0.55);
  box-shadow: 0 6px 14px rgba(127, 183, 122, 0.25);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  flex: 1;
}

.field input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(240, 106, 134, 0.4);
  background: var(--beige-cream);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
}

button {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  background: var(--pink);
  color: var(--beige-cream);
  transition: transform 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 8px 18px rgba(240, 106, 134, 0.35);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.feed-shell {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  background: var(--beige-cream);
  border: 2px solid rgba(240, 106, 134, 0.35);
  box-shadow: var(--shadow);
  height: clamp(420px, 70vh, 760px);
}

#feedImage {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: var(--beige-cream);
}

#camera,
#overlay {
  width: 100%;
  height: 100%;
  display: block;
}

#camera {
  transform: scaleX(-1);
}

#overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.camera-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  width: min(220px, 32vw);
  height: auto;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid rgba(127, 183, 122, 0.8);
  background: rgba(246, 239, 226, 0.7);
  box-shadow: 0 10px 18px rgba(134, 196, 109, 0.3);
}

.readout {
  font-size: 13px;
  background: rgba(240, 106, 134, 0.12);
  padding: 6px 10px;
  border-radius: 999px;
  width: fit-content;
  border: 1px solid rgba(240, 106, 134, 0.25);
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(75, 43, 43, 0.6);
}

.debug-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(75, 43, 43, 0.6);
}

.debug-top {
  background: var(--shell);
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
}

@media (max-width: 720px) {
  .topbar,
  .bottombar {
    flex-direction: column;
    align-items: stretch;
  }

  .camera-overlay {
    width: 140px;
    height: 105px;
  }
}
