:root {
  color-scheme: light;
  --ink: #191b1f;
  --muted: #66706f;
  --paper: #f5f2ec;
  --panel: rgba(255, 255, 255, 0.82);
  --line: rgba(35, 39, 43, 0.16);
  --accent: #d74f2a;
  --accent-dark: #913418;
  --sea: #2d8c8b;
  --shadow: 0 24px 80px rgba(35, 31, 25, 0.18);
  font-family: "Avenir Next", "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 20%, rgba(215, 79, 42, 0.22), transparent 28rem),
    radial-gradient(circle at 85% 80%, rgba(45, 140, 139, 0.24), transparent 30rem),
    linear-gradient(135deg, #f5f2ec 0%, #dde8df 48%, #f4d9bd 100%);
  overflow: hidden;
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  width: 100vw;
  height: 100vh;
  min-height: 560px;
  padding: 20px;
  gap: 20px;
}

.stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.96), rgba(205, 224, 211, 0.75) 58%, rgba(167, 194, 181, 0.92));
  background-size: 34px 34px, 34px 34px, auto;
  box-shadow: var(--shadow);
}

#vrm-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.status-panel {
  position: absolute;
  left: 16px;
  bottom: 16px;
  max-width: min(520px, calc(100% - 32px));
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  font-size: 0.92rem;
  line-height: 1.45;
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand-block {
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.file-control,
.control-row {
  display: grid;
  gap: 9px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.file-control input {
  width: 100%;
  padding: 12px;
  border: 1px dashed rgba(25, 27, 31, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.action-button {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--sea));
  font-weight: 800;
  cursor: pointer;
}

.action-button:focus-visible,
.file-control input:focus-visible,
input[type="range"]:focus-visible {
  outline: 3px solid rgba(45, 140, 139, 0.28);
  outline-offset: 3px;
}

.hint {
  margin: auto 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

@media (max-width: 820px) {
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    padding: 12px;
  }

  .stage {
    min-height: 62vh;
  }

  .control-panel {
    padding: 18px;
  }
}