/* 非言語サポーターアプリ そよぎ — Web版 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  color: #E0E0E0;
}

body {
  background: linear-gradient(135deg, #1a1610 0%, #050505 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* スマホ枠 */
#app {
  position: relative;
  width: 100%;
  max-width: 450px;
  height: 100vh;
  max-height: 900px;
  aspect-ratio: 9 / 16;
  background: #000;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.04);
  touch-action: none;
}

@media (min-width: 480px) {
  #app { border-radius: 32px; height: 94vh; }
}
@media (max-width: 479px) {
  body { background: #000; }
  #app {
    max-height: none;
    height: 100vh;
    aspect-ratio: auto;
    border-radius: 0;
    box-shadow: none;
  }
}

/* Canvas */
#canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* アプリ名 */
.app-name {
  position: absolute;
  top: 36px;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255,255,255,0.13);
  font-size: 13px;
  letter-spacing: 1.5px;
  pointer-events: none;
  z-index: 5;
}

/* タイマー */
.timer-display {
  position: absolute;
  top: 56px;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255,255,255,0.18);
  font-size: 12px;
  letter-spacing: 2px;
  pointer-events: none;
  z-index: 5;
  display: none;
}
.timer-display.active { display: block; }

/* 下部3ボタン */
.bottom-bar {
  position: absolute;
  bottom: 28px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  z-index: 10;
}

.circle-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 21px;
  padding: 0;
}
.circle-btn:active { background: rgba(255,255,255,0.15); }

@keyframes blink {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1.0; }
}
.circle-btn.blinking { animation: blink 1.2s ease-in-out infinite; }

/* 設定パネル */
.settings-panel {
  position: absolute;
  inset: 0;
  background: #0A0A0A;
  z-index: 50;
  overflow-y: auto;
  padding: 28px 28px 32px;
  display: none;
  -webkit-overflow-scrolling: touch;
}
.settings-panel.open { display: block; }

.settings-title {
  color: #E0E0E0;
  font-size: 20px;
  margin-bottom: 28px;
}

.section-label {
  color: rgba(255,255,255,0.54);
  font-size: 13px;
  margin-bottom: 10px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.chip {
  padding: 8px 18px;
  border-radius: 20px;
  border: 1.5px solid rgba(255,255,255,0.12);
  background: transparent;
  color: rgba(255,255,255,0.38);
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.chip.selected {
  border-color: rgba(255,255,255,0.54);
  background: rgba(255,255,255,0.08);
  color: white;
  font-weight: bold;
}

.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  margin-bottom: 16px;
}
.switch-row .label {
  color: #E0E0E0;
  font-size: 16px;
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider-switch {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255,255,255,0.12);
  transition: 0.2s;
  border-radius: 26px;
}
.slider-switch:before {
  position: absolute;
  content: "";
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background-color: rgba(255,255,255,0.24);
  transition: 0.2s;
  border-radius: 50%;
}
.switch input:checked + .slider-switch {
  background-color: rgba(255,255,255,0.24);
}
.switch input:checked + .slider-switch:before {
  transform: translateX(20px);
  background-color: rgba(255,255,255,0.7);
}

/* Slider (range) */
.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.slider-row .endpoint {
  color: rgba(255,255,255,0.38);
  font-size: 12px;
  min-width: 20px;
}
.slider-row input[type=range] {
  flex: 1;
  -webkit-appearance: none;
  background: transparent;
  height: 24px;
}
.slider-row input[type=range]::-webkit-slider-runnable-track {
  height: 2px;
  background: rgba(255,255,255,0.12);
}
.slider-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255,255,255,0.7);
  margin-top: -7px;
  cursor: pointer;
}
.slider-row input[type=range]::-moz-range-track {
  height: 2px;
  background: rgba(255,255,255,0.12);
}
.slider-row input[type=range]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255,255,255,0.7);
  border: none;
  cursor: pointer;
}

.divider {
  border-top: 1px solid rgba(255,255,255,0.12);
  margin: 16px 0;
}

.soyogi-link {
  color: #FFB74D;
  font-size: 13px;
  text-decoration: underline;
  display: block;
  margin-bottom: 8px;
  cursor: pointer;
}

.credit {
  color: rgba(255,255,255,0.38);
  font-size: 11px;
  margin-bottom: 22px;
}

.back-btn {
  display: block;
  width: 100%;
  padding: 14px 0;
  border: 1.5px solid rgba(255,255,255,0.24);
  border-radius: 16px;
  background: transparent;
  color: #E0E0E0;
  font-size: 16px;
  cursor: pointer;
  font-family: inherit;
}
.back-btn:active { background: rgba(255,255,255,0.05); }

/* First hint */
.first-hint {
  position: absolute;
  bottom: 96px;
  left: 0; right: 0;
  text-align: center;
  color: rgba(255,255,255,0.32);
  font-size: 13px;
  letter-spacing: 1px;
  pointer-events: none;
  z-index: 5;
  transition: opacity 0.6s ease;
  opacity: 1;
}
.first-hint.fade { opacity: 0; }
