*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #1a1418;
  --ink: #f8f0e4;
  --muted: #b8a8b8;
  --mint: #5ee0b8;
  --grape: #6b3a8a;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: "Hiragino Sans", Meiryo, sans-serif;
  background: radial-gradient(ellipse at 30% 0%, #3a2848, var(--bg) 60%);
  color: var(--ink);
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 12px 24px;
}

.back {
  color: var(--mint);
  font-weight: 700;
  text-decoration: none;
}

.canvas-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(165deg, #9aa8b8 0%, #788898 45%, #687888 100%);
  border-radius: 12px;
  min-height: min(52vh, 440px);
  margin: 8px 0;
  padding: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

#invite-canvas {
  touch-action: none;
  max-width: 100%;
  height: auto;
  display: block;
}

.btn-primary,
.btn-secondary,
.btn-share,
.tray button,
.tool-row button {
  min-height: 44px;
  font: inherit;
  border-radius: 10px;
  cursor: pointer;
}

.btn-primary {
  width: 100%;
  border: none;
  font-weight: 800;
  background: linear-gradient(180deg, var(--grape), #3a2048);
  color: #fff8f0;
  margin-top: 8px;
}

.btn-secondary {
  width: 100%;
  margin-top: 8px;
  border: 1px solid #6a5068;
  background: transparent;
  color: var(--ink);
}

.tray {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.tray button {
  flex: 1 1 30%;
  border: 1px solid #8a6888;
  background: rgba(107, 58, 138, 0.35);
  color: var(--ink);
  font-weight: 700;
}

.tool-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

label {
  display: block;
  margin-top: 8px;
  font-size: 0.9rem;
}

input,
textarea,
select {
  width: 100%;
  margin-top: 4px;
  font: inherit;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid #6a5068;
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  padding: 8px;
}

.warn-line {
  color: #e87848;
  font-weight: 700;
  text-align: center;
}

.live {
  min-height: 1.2em;
  color: #3ad8a8;
  font-weight: 700;
}

.eval-hint {
  text-align: center;
  color: #2a9870;
  font-weight: 700;
  font-size: 0.92rem;
  margin: 4px 0;
}

html[data-promo="shot"] .app {
  max-width: 390px;
  padding-bottom: 12px;
}

html[data-promo="shot"] .canvas-stage {
  min-height: min(46vh, 400px);
}

html[data-promo="shot"] label,
html[data-promo="shot"] .tray button {
  font-size: 0.82rem;
}

html[data-promo="shot"] textarea {
  min-height: 38px;
  rows: 1;
}

html[data-promo="shot"] .masthead {
  display: none;
}

html[data-capture="1"] .capture-hide {
  display: none !important;
}

@media (min-width: 720px) {
  .app {
    max-width: 720px;
  }
  .canvas-stage {
    min-height: 520px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
