:root {
  --ink: #1e2a35;
  --brass: #b8923a;
  --brass-light: #e8d5a0;
  --glass: rgba(255, 252, 245, 0.88);
  --mint: #5ec4a8;
  --accent: #d4622a;
  --panel: rgba(30, 45, 58, 0.72);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  color: #f5f0e6;
  background: #243d48;
}

.museum-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(120, 180, 190, 0.25), transparent 55%),
    linear-gradient(165deg, #1a3d45 0%, #2a2848 45%, #3d2450 100%);
}

.masthead {
  padding: 12px 16px 0;
}

.back {
  color: var(--brass-light);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
}

.back:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}

.studio-app {
  max-width: 520px;
  margin: 0 auto;
  padding: 8px 16px 40px;
}

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

.kicker {
  margin: 0 0 4px;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  color: var(--brass-light);
  opacity: 0.85;
}

.hero h1 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.15;
  color: #fff8ef;
}

.hero h1 span {
  color: #f0b85a;
}

.catch {
  margin: 6px 0 0;
  font-weight: 800;
  color: #ffe8c8;
  font-size: 0.95rem;
}

.rule-lead {
  margin: 8px 0 0;
  font-size: 0.88rem;
  color: rgba(245, 240, 230, 0.85);
  line-height: 1.45;
}

.burapi-wrap {
  margin: 0;
  position: relative;
  flex-shrink: 0;
}

.burapi-char {
  width: 72px;
  height: auto;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
  transition: transform 0.35s ease;
}

.burapi-char.burapi-watch {
  transform: rotate(-8deg) scale(1.05);
}

.burapi-char.burapi-celebrate {
  transform: translateY(-4px) scale(1.08);
}

.craft-tag {
  position: absolute;
  bottom: -4px;
  right: -6px;
  font-size: 0.62rem;
  background: var(--brass);
  color: #2a2010;
  padding: 2px 6px;
  border-radius: 999px;
  font-weight: 800;
}

.stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.canvas-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-width: min(100%, 420px);
  margin: 0 auto;
  border-radius: 50%;
  padding: 8px;
  background: linear-gradient(145deg, rgba(200, 160, 80, 0.55), rgba(120, 90, 40, 0.35));
  box-shadow:
    0 0 0 2px rgba(255, 230, 180, 0.25),
    0 16px 40px rgba(0, 0, 0, 0.35),
    inset 0 0 24px rgba(255, 255, 255, 0.12);
}

.guide-label {
  position: absolute;
  top: 14%;
  right: 22%;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  color: rgba(255, 220, 160, 0.9);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  z-index: 2;
}

#pattern-canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  touch-action: none;
  cursor: crosshair;
}

#pattern-canvas:focus-visible {
  outline: 3px solid var(--mint);
  outline-offset: 4px;
}

.dial-panel {
  background: var(--panel);
  border: 1px solid rgba(200, 160, 80, 0.35);
  border-radius: 16px;
  padding: 12px;
  backdrop-filter: blur(6px);
}

.dial-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.dial-row:last-child {
  margin-bottom: 0;
}

.dial-label {
  flex: 0 0 3.2rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--brass-light);
}

.dial-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.dial-btn {
  border: 1px solid rgba(200, 160, 80, 0.45);
  background: rgba(255, 252, 245, 0.08);
  color: #f5f0e6;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.dial-btn.is-active,
.dial-btn.is-on {
  background: linear-gradient(180deg, #e8c878, #c8923a);
  color: #2a2010;
  border-color: #f0d890;
}

.dial-btn:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}

.dial-row--slider {
  flex-direction: column;
  align-items: stretch;
}

.dial-row--slider label {
  font-size: 0.82rem;
  font-weight: 700;
}

#rotation {
  width: 100%;
  accent-color: var(--accent);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-primary,
.btn-ghost {
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  font-family: inherit;
  border: none;
}

.btn-primary {
  background: linear-gradient(180deg, #f0b85a, #d4622a);
  color: #2a1808;
}

.btn-ghost {
  background: rgba(255, 252, 245, 0.12);
  color: #f5f0e6;
  border: 1px solid rgba(200, 160, 80, 0.4);
}

.btn-primary:focus-visible,
.btn-ghost:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}

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

.live-msg {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  min-height: 1.4em;
  color: #ffe8c8;
}

.kb-hint {
  margin: 4px 0 0;
  font-size: 0.75rem;
  opacity: 0.75;
}

.utility-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.btn-text {
  background: none;
  border: none;
  color: var(--brass-light);
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
}

.disclaimer {
  margin-top: 12px;
  font-size: 0.72rem;
  opacity: 0.7;
  line-height: 1.5;
}

.capture-hud {
  text-align: center;
  font-weight: 800;
  font-size: 1rem;
  color: #ffe8c8;
  margin: 8px 0;
}

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

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

html:not([data-capture="1"]) .capture-only {
  display: none !important;
}

html[data-capture="1"] .studio-app {
  max-width: 100%;
  padding-top: 4px;
}

html[data-capture="1"] .canvas-shell {
  max-width: min(92vw, 380px);
}

html[data-capture="1"] .capture-safe {
  padding-left: 8px;
  padding-right: 36px;
}

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

html[data-promo-shot="1"] .studio-app {
  max-width: 100%;
  padding: 6px 12px 16px;
}

html[data-promo-shot="1"] .hero {
  margin-bottom: 6px;
}

html[data-promo-shot="1"] .hero h1 {
  font-size: 1.35rem;
}

html[data-promo-shot="1"] .catch,
html[data-promo-shot="1"] .rule-lead {
  font-size: 0.78rem;
  margin-top: 4px;
}

html[data-promo-shot="1"] .burapi-char {
  width: 64px;
}

html[data-promo-shot="1"] .canvas-shell {
  max-width: min(100%, 360px);
  padding: 6px;
}

html[data-promo-shot="1"] .dial-panel {
  padding: 8px 10px;
}

html[data-promo-shot="1"] .dial-row {
  margin-bottom: 6px;
}

html[data-promo-shot="1"] .dial-btn {
  padding: 5px 10px;
  font-size: 0.76rem;
}

html[data-promo-shot="1"] .btn-primary,
html[data-promo-shot="1"] .btn-ghost {
  padding: 8px 12px;
  font-size: 0.8rem;
}

html[data-promo-shot="1"] .live-msg {
  display: none !important;
}

html[data-promo-shot="1"] .stage {
  gap: 8px;
}

@media (min-width: 720px) {
  .studio-app {
    max-width: 560px;
  }

  .hero h1 {
    font-size: 1.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .burapi-char {
    transition: none;
  }
}
