:root {
  --text: #f7f7fb;
  --muted: #b8b8c5;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #ff5a7a;
  --accent2: #ffcc66;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at top, #2a2035 0, #111114 42%, #08080a 100%);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, a { -webkit-tap-highlight-color: transparent; }

.app-shell {
  width: min(100%, 680px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 22px 18px calc(26px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen { display: none; width: 100%; animation: fadeIn 180ms ease-out; }
.screen.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.brand-badge {
  display: inline-flex;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent2);
  background: rgba(255, 255, 255, 0.06);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 18px;
}

h1, h2, p { margin: 0; }

h1 {
  font-size: clamp(32px, 9vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.06em;
  margin-bottom: 12px;
}

h2 {
  font-size: 32px;
  letter-spacing: -0.05em;
  margin-bottom: 8px;
}

.subtitle, .select-header p, .result-header p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}


.admin-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 28px;
  padding: 22px;
}

.admin-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.input-label {
  display: block;
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.text-input {
  width: 100%;
  min-height: 54px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  padding: 0 16px;
  outline: none;
  margin-bottom: 12px;
}

.text-input:focus { border-color: var(--accent2); }

.booth-admin-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.booth-admin-card {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  border-radius: 22px;
  padding: 16px;
}

.booth-admin-card strong {
  display: block;
  font-size: 18px;
  margin-bottom: 6px;
}

.booth-admin-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 10px;
}

.link-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.2);
  border-radius: 14px;
  padding: 8px;
}

.link-box code {
  color: #fff;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.copy-btn {
  border: none;
  border-radius: 12px;
  background: #fff;
  color: #17171b;
  font-size: 12px;
  font-weight: 900;
  padding: 10px;
  cursor: pointer;
}

.admin-actions { margin-top: 18px; }

.primary-link {
  display: grid;
  place-items: center;
  min-height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), #ff875a);
  color: #fff;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 14px 36px rgba(255, 90, 122, 0.24);
}

.section-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
  margin-top: 20px;
  margin-bottom: 12px;
}

.section-title {
  font-size: 22px;
  margin: 0;
}

.section-hint {
  color: var(--muted);
  font-size: 13px;
}

.frame-type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.frame-type-card {
  border: none;
  background: transparent;
  border-radius: 18px;
  padding: 0;
  cursor: pointer;
  text-align: center;
}

.frame-type-card.selected {
  border: none;
  box-shadow: none;
}

.frame-type-card img {
  width: var(--preview-width, 82%);
  margin: 0 auto;
  display: block;
  border-radius: 16px;
  background: transparent;
  aspect-ratio: var(--preview-ratio, 4 / 5);
  object-fit: contain;
  box-shadow: 0 16px 36px rgba(0,0,0,0.24);
}

.frame-type-name {
  display: block;
  margin-top: 12px;
  font-size: 16px;
  font-weight: 900;
}

.frame-type-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.notice {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 16px;
  margin: 20px 0;
  display: grid;
  gap: 6px;
}

.notice.compact { margin: 16px 0 20px; }
.notice strong { font-size: 14px; }
.notice span { font-size: 14px; color: var(--muted); line-height: 1.5; }

.primary-btn, .secondary-btn, .ghost-wide-btn, .ghost-btn {
  border: none;
  cursor: pointer;
  font-weight: 900;
  transition: transform 120ms ease, opacity 120ms ease;
}

.primary-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.primary-btn:active, .secondary-btn:active, .ghost-wide-btn:active, .ghost-btn:active {
  transform: scale(0.98);
}

.primary-btn {
  width: 100%;
  min-height: 58px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), #ff875a);
  color: #fff;
  font-size: 17px;
  box-shadow: 0 14px 36px rgba(255, 90, 122, 0.24);
}

.shutter-btn {
  min-height: 68px;
  font-size: 20px;
}

.secondary-btn {
  width: 100%;
  min-height: 54px;
  border-radius: 18px;
  background: #fff;
  color: #17171b;
  font-size: 16px;
}

.ghost-wide-btn {
  width: 100%;
  min-height: 52px;
  border-radius: 18px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid var(--line);
  font-size: 16px;
}

.ghost-btn {
  min-height: 36px;
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid var(--line);
  font-size: 12px;
}

.ghost-link {
  display: grid;
  place-items: center;
  min-height: 52px;
  border-radius: 18px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 900;
}

.demo-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

.demo-links span { width: 100%; }
.demo-links a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 10px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.camera-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tiny-badge {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--accent2);
  font-size: 12px;
  font-weight: 800;
}

.shot-status {
  font-size: 15px;
  font-weight: 1000;
  color: var(--accent2);
}

.beauty-status {
  display: block;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.beauty-status:not(:empty) {
  margin-bottom: 10px;
}

.camera-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 28px;
  background: #000;
  border: 1px solid var(--line);
  aspect-ratio: 3 / 4;
}

video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

video.mirrored {
  transform: scaleX(-1);
}

.flash {
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0.9;
  animation: flash 260ms ease-out forwards;
}

@keyframes flash { to { opacity: 0; } }
.hidden { display: none !important; }

.help-text {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 14px 0;
  text-align: center;
}

.camera-actions, .result-actions, .select-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.thumbs img, .select-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.select-header {
  text-align: center;
  margin-bottom: 18px;
}

.select-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.select-card {
  position: relative;
  border: 2px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 8px;
  cursor: pointer;
}

.select-card.selected {
  border-color: var(--accent2);
  box-shadow: 0 0 0 4px rgba(255, 204, 102, 0.18);
}

.select-number {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--accent2);
  color: #111;
  font-weight: 1000;
  opacity: 0;
}

.select-card.selected .select-number {
  opacity: 1;
}

.filter-chip-row-single {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
}

.filter-chip {
  flex: none;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.filter-chip.selected {
  border-color: var(--accent2);
  background: var(--accent2);
  color: #111;
}

.filter-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.filter-preview-grid img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.result-header {
  text-align: center;
  margin-bottom: 18px;
}

.result-image {
  display: block;
  width: min(100%, 420px);
  margin: 0 auto;
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 70px rgba(0,0,0,0.45);
  background: #222;
}

.tiny-note {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  margin-top: 12px;
  line-height: 1.5;
}

.error-detail {
  white-space: pre-wrap;
  word-break: break-all;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 12px;
  color: #ffbdc9;
  max-height: 160px;
  overflow: auto;
}

@media (min-width: 900px) {
  .app-shell { width: min(100%, 860px); }
  .camera-wrap { aspect-ratio: 16 / 10; }
  .camera-actions, .result-actions, .select-actions {
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
  }
  .select-grid { grid-template-columns: repeat(4, 1fr); }
  .frame-type-grid { grid-template-columns: repeat(4, 1fr); }
  .filter-preview-grid { grid-template-columns: repeat(4, 1fr); }
}


.frame-type-card.selected img {
  outline: 3px solid var(--accent2);
  outline-offset: 5px;
}

.frame-type-card.selected .frame-type-name {
  color: var(--accent2);
}


/* Public content pages for AdSense readiness */
.site-shell {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 24px 18px 48px;
  color: var(--text);
}

.site-shell.narrow {
  width: min(100%, 860px);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 28px;
}

.site-logo {
  color: #fff;
  font-size: 20px;
  font-weight: 1000;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.site-nav-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav-links a,
.site-footer a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 24px;
  align-items: stretch;
  padding: 36px 0 28px;
}

.eyebrow {
  color: var(--accent2);
  font-size: 13px;
  font-weight: 1000;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
}

.hero-copy h1 {
  font-size: clamp(42px, 7vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.08em;
  margin-bottom: 20px;
}

.hero-desc {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
  max-width: 720px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.hero-actions .primary-link,
.hero-actions .site-ghost {
  min-width: 220px;
}

.site-ghost {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line);
}

.hero-card,
.info-box,
.content-section article,
.content-page {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  border-radius: 28px;
  padding: 24px;
}

.hero-card {
  display: grid;
  align-content: center;
  gap: 12px;
}

.hero-card-label {
  color: var(--accent2);
  font-size: 13px;
  font-weight: 900;
}

.hero-card strong {
  font-size: 28px;
  letter-spacing: -0.04em;
}

.hero-card p,
.content-section p,
.content-page p,
.content-page li {
  color: var(--muted);
  line-height: 1.75;
}

.hero-card a {
  color: #fff;
  font-weight: 900;
}

.content-section {
  margin-top: 34px;
}

.content-section h2,
.content-page h1,
.content-page h2 {
  letter-spacing: -0.05em;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.feature-grid h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.split-section {
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 18px;
  align-items: start;
}

.step-list {
  color: var(--muted);
  line-height: 1.85;
}

.article-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.article-list a {
  display: block;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: #fff;
  text-decoration: none;
  background: rgba(255,255,255,0.06);
}

.faq-section details {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  border-radius: 18px;
  padding: 16px;
  margin-top: 10px;
}

.faq-section summary {
  cursor: pointer;
  font-weight: 900;
}

.content-page {
  margin-top: 18px;
}

.content-page h1 {
  font-size: clamp(34px, 6vw, 56px);
  margin-bottom: 18px;
}

.content-page h2 {
  margin-top: 28px;
  font-size: 26px;
}

.content-page ul,
.content-page ol {
  padding-left: 20px;
}

.site-footer {
  display: grid;
  gap: 10px;
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer strong {
  color: #fff;
}

.site-footer div {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.site-footer p {
  margin: 0;
  font-size: 13px;
}

@media (max-width: 820px) {
  .site-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-section,
  .split-section {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions .primary-link,
  .hero-actions .site-ghost {
    width: 100%;
  }
}


/* v13: main page admin shortcut */
.hero-side-stack {
  display: grid;
  gap: 14px;
}

.admin-entry-card {
  border: 1px dashed rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.045);
  border-radius: 24px;
  padding: 22px;
  display: grid;
  gap: 10px;
}

.admin-entry-card strong {
  font-size: 22px;
  letter-spacing: -0.04em;
}

.admin-entry-card p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.admin-entry-card a {
  display: inline-grid;
  place-items: center;
  min-height: 46px;
  border-radius: 14px;
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--line);
  color: #fff;
  text-decoration: none;
  font-weight: 900;
}

.admin-entry-card a:hover,
.hero-card a:hover {
  opacity: 0.86;
}


/* v14: main page only shows admin entry on the right */
.main-admin-card {
  min-height: 320px;
  align-content: center;
}

.main-admin-card strong {
  font-size: 28px;
}


/* v27 contact credibility helpers */
.content-page a {
  word-break: break-word;
}

.tiny-note {
  color: var(--muted);
  font-size: 13px;
}
