body {
	margin: 0;
	touch-action: none;
}
#three-canvas {
	position: absolute;
	left: 0;
	top: 0;
}

.view-unity-scene {
	width: 150px;
	height: 40px;
	background: white;
	border: 1px solid gray;
  
	position: absolute;
	bottom: 60px;
	right: 10px;
  }

  main {
	width: calc(100% - 20px);
	max-width: 500px;
	margin: 0 auto;
	font-family: Helvetica, Arial, Sans, sans-serif;
  }

  .chat {
	content: '';
	width: 300px;
	height: 300px;
	background: white;
	padding: 5px 10px;
	position: absolute;
	left: 10px;
	bottom: 60px;
  }
  
  .chat p {
	margin: 0 0 5px 0;
  }
  
  input, button {
	width: 100%;
	font: inherit;
	background: #fff;
	border: none;
	margin-top: 10px;
	padding: 5px 10px;
  }

  #loading.coconut-loading {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 18px;
	padding: 24px;
	background:
		radial-gradient(circle at 50% 35%, rgba(30, 74, 158, 0.22) 0%, transparent 55%),
		linear-gradient(180deg, #0a0e17 0%, #111827 100%);
  }

  .coconut-loading__logo-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	width: min(72vw, 320px);
	aspect-ratio: 1;
	animation: coconut-loading-pulse 1.8s ease-in-out infinite;
	will-change: transform;
  }

  .coconut-loading__logo {
	display: block;
	width: 100%;
	height: auto;
	max-height: min(42vh, 280px);
	object-fit: contain;
	filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.45));
	user-select: none;
	-webkit-user-drag: none;
	pointer-events: none;
  }

  @keyframes coconut-loading-pulse {
	0%, 100% {
		transform: scale(0.94);
	}
	50% {
		transform: scale(1.06);
	}
  }

  .coconut-loading__progress {
	width: min(280px, 78vw);
	height: 10px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.18);
	overflow: hidden;
	box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
  }

  .coconut-loading__progress-bar {
	width: 0%;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, #3a78eb 0%, #4f8cff 55%, #7eb0ff 100%);
	transition: width 0.2s ease-out;
	box-shadow: 0 0 12px rgba(79, 140, 255, 0.45);
  }

  .coconut-loading__percent {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
	font-size: 13px;
	font-weight: 600;
	color: #f5f5f7;
	letter-spacing: 0.02em;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  }

  @-o-keyframes move {
	to{
		background-position-x:1536px
	}	
  }

  @-webkit-keyframes move {
	to{
		background-position-x:1536px
	}	
  }

  @-moz-keyframes move {
	to{
		background-position-x:1536px
	}	
  }

/* ── Coconut HTML UI ── */
:root {
  --coconut-bg: rgba(18, 18, 22, 0.92);
  --coconut-border: rgba(255, 255, 255, 0.14);
  --coconut-text: #f5f5f7;
  --coconut-muted: #b8b8c0;
  --coconut-accent: #4f8cff;
  --coconut-accent-hover: #3a78eb;
  --coconut-danger: #ff6b6b;
  --coconut-radius: 12px;
  --coconut-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.coconut-videos {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: max(98px, calc(88px + env(safe-area-inset-left)));
  right: auto;
  z-index: 35;
  width: min(210px, calc((100vw - 108px) * 0.5));
  pointer-events: none;
}

.coconut-videos:not([hidden]) {
  display: block;
}

.coconut-videos__panel {
  pointer-events: auto;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(10, 10, 14, 0.82);
  box-shadow: var(--coconut-shadow);
  backdrop-filter: blur(8px);
}

.coconut-videos__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}

.coconut-videos__title {
  font-size: 10px;
  font-weight: 700;
  color: #dce6ff;
  letter-spacing: 0.02em;
}

.coconut-videos__count {
  font-size: 10px;
  font-weight: 600;
  color: #9eb8ff;
}

.coconut-videos__names {
  margin: 0 0 6px;
  font-size: 9px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.72);
  word-break: keep-all;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coconut-videos__debug {
  margin: 0 0 6px;
  max-height: 72px;
  overflow-y: auto;
  font-size: 8px;
  line-height: 1.35;
  color: #9eb8ff;
  font-family: monospace;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 4px;
  padding: 4px;
}

.coconut-videos__debug:not([hidden]) {
  display: block;
}

.coconut-videos__debug div + div {
  margin-top: 2px;
}

.coconut-videos__grid {
  display: grid;
  gap: 4px;
}

.coconut-videos__grid[data-count="1"] {
  grid-template-columns: 1fr;
}

.coconut-videos__grid[data-count="2"] {
  grid-template-columns: repeat(2, 1fr);
}

.coconut-videos__grid[data-count="3"],
.coconut-videos__grid[data-count="4"] {
  grid-template-columns: repeat(2, 1fr);
}

.coconut-videos__grid[data-count="5"],
.coconut-videos__grid[data-count="6"] {
  grid-template-columns: repeat(3, 1fr);
}

.coconut-videos__tile {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(8, 8, 12, 0.88);
}

.coconut-videos__tile.is-hidden {
  display: none;
}

.coconut-videos__tile video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111;
}

.coconut-videos__tile--remote video {
  object-fit: contain;
}

.coconut-videos__label {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 8px;
  line-height: 1.3;
  pointer-events: none;
}

.coconut-videos__screen {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(0, 0, 0, 0.92);
  pointer-events: auto;
}

.coconut-videos__screen:not([hidden]) {
  display: flex;
  flex-direction: column;
}

.coconut-videos__screen video {
  flex: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.coconut-videos__screen-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 1;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background: rgba(18, 18, 22, 0.9);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.coconut-bottom-dock {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 36;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.coconut-bottom-dock > * {
  pointer-events: auto;
}

.coconut-media-controls {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.coconut-media-controls[hidden] {
  display: none !important;
}

.coconut-media-controls__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 64px;
  min-height: 64px;
  padding: 8px 10px;
  border: 1px solid var(--coconut-border);
  border-radius: var(--coconut-radius);
  background: var(--coconut-bg);
  color: var(--coconut-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
  font-size: 10px;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: var(--coconut-shadow);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.coconut-media-controls__btn:hover,
.coconut-media-controls__btn:focus-visible {
  border-color: var(--coconut-accent);
  outline: none;
}

.coconut-media-controls__btn.is-off {
  background: rgba(28, 14, 18, 0.92);
  border-color: rgba(220, 90, 90, 0.55);
  color: #ffb8b8;
}

.coconut-media-controls__btn.is-on {
  background: #1e4a9e;
  border-color: #6ba3ff;
  color: #ffffff;
}

.coconut-media-controls__icon {
  font-size: 22px;
  line-height: 1;
}

.coconut-media-controls__label {
  font-weight: 600;
}

.coconut-bottom-dock__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 64px;
  min-height: 64px;
  padding: 8px 10px;
  border: 1px solid var(--coconut-border);
  border-radius: var(--coconut-radius);
  background: var(--coconut-bg);
  color: var(--coconut-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
  font-size: 10px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--coconut-shadow);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.coconut-bottom-dock__btn:hover,
.coconut-bottom-dock__btn:focus-visible {
  border-color: var(--coconut-accent);
  outline: none;
  color: var(--coconut-text);
}

.coconut-bottom-dock__btn--home {
  background: rgba(18, 28, 48, 0.94);
  border-color: rgba(107, 163, 255, 0.45);
  color: #dce6ff;
}

.coconut-bottom-dock__btn--help.is-active {
  background: #1e4a9e;
  border-color: #6ba3ff;
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(107, 163, 255, 0.45), var(--coconut-shadow);
}

.coconut-bottom-dock__icon {
  font-size: 22px;
  line-height: 1;
}

.coconut-bottom-dock__label {
  font-weight: 600;
}

@media (max-width: 768px) {
  .coconut-bottom-dock {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
  }

  .coconut-media-controls__btn {
    min-width: 56px;
    min-height: 56px;
    font-size: 9px;
  }

  .coconut-bottom-dock__btn {
    min-width: 56px;
    min-height: 56px;
    font-size: 9px;
  }

  .coconut-media-controls__icon,
  .coconut-bottom-dock__icon {
    font-size: 20px;
  }
}

@media (max-width: 768px) {
  .coconut-videos {
    top: max(8px, env(safe-area-inset-top));
    left: max(98px, calc(88px + env(safe-area-inset-left)));
    right: max(8px, env(safe-area-inset-right));
    width: min(210px, calc(100vw - 108px));
  }

  .coconut-videos__grid[data-count="3"],
  .coconut-videos__grid[data-count="4"],
  .coconut-videos__grid[data-count="5"],
  .coconut-videos__grid[data-count="6"] {
    grid-template-columns: repeat(2, 1fr);
  }
}

.coconut-side-menu {
  position: fixed;
  left: max(10px, env(safe-area-inset-left));
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 88px;
  padding: 0;
  margin: 0;
}

.coconut-side-menu__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 72px;
  margin: 0;
  padding: 8px 6px;
  border: 1px solid var(--coconut-border);
  border-radius: var(--coconut-radius);
  background: var(--coconut-bg);
  color: var(--coconut-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
  font-size: 11px;
  line-height: 1.25;
  cursor: pointer;
  box-shadow: var(--coconut-shadow);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.coconut-side-menu__btn:hover,
.coconut-side-menu__btn:focus-visible {
  border-color: var(--coconut-accent);
  outline: none;
}

.coconut-side-menu__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.coconut-side-menu__btn:disabled:hover,
.coconut-side-menu__btn:disabled:focus-visible {
  border-color: var(--coconut-border);
}

.coconut-side-menu__btn.is-active {
  background: #1e4a9e;
  border-color: #6ba3ff;
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(107, 163, 255, 0.45), var(--coconut-shadow);
}

.coconut-side-menu__icon {
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.coconut-side-menu__icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.coconut-side-menu__label {
  text-align: center;
  word-break: keep-all;
}

.coconut-floor-panel {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  z-index: 45;
  width: min(320px, calc(100vw - 110px));
  max-height: calc(100vh - 20px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--coconut-border);
  border-radius: var(--coconut-radius);
  background: var(--coconut-bg);
  color: var(--coconut-text);
  box-shadow: var(--coconut-shadow);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
}

.coconut-floor-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--coconut-border);
}

.coconut-floor-panel__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.coconut-floor-panel__close {
  width: auto;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--coconut-border);
  border-radius: 8px;
  background: transparent;
  color: var(--coconut-text);
  font-size: 12px;
  cursor: pointer;
}

.coconut-floor-panel__body {
  overflow-y: auto;
  padding: 10px 14px 14px;
}

.coconut-floor-panel__floor + .coconut-floor-panel__floor {
  margin-top: 12px;
}

.coconut-floor-panel__floor-label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--coconut-muted);
}

.coconut-floor-panel__rooms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.coconut-floor-panel__room-btn {
  width: auto;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--coconut-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--coconut-text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}

.coconut-floor-panel__room-btn:hover,
.coconut-floor-panel__room-btn:focus-visible {
  border-color: var(--coconut-accent);
  outline: none;
}

.coconut-floor-panel__room-btn.is-selected {
  border-color: #6ba3ff;
  background: #1e4a9e;
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(107, 163, 255, 0.45);
}

.coconut-character-select {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding:
    max(12px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
  background: rgba(0, 0, 0, 0.55);
  scroll-padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.coconut-character-select__card {
  width: min(480px, 100%);
  margin: 0 auto;
  padding: 20px 18px max(28px, calc(16px + env(safe-area-inset-bottom)));
  border: 1px solid var(--coconut-border);
  border-radius: 16px;
  background: var(--coconut-bg);
  color: var(--coconut-text);
  box-shadow: var(--coconut-shadow);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
}

.coconut-character-select__title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
}

.coconut-character-select__desc {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--coconut-muted);
}

.coconut-character-select__preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.coconut-character-select__preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 140px;
  border: 2px solid var(--coconut-accent);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.coconut-character-select__preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
}

.coconut-character-select__preview-label {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--coconut-text);
}

.coconut-character-select__picker {
  margin: 0 0 18px;
  padding: 0;
  border: none;
}

.coconut-character-select__picker .coconut-field__label {
  margin-bottom: 10px;
}

.coconut-character-select__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.coconut-character-select__char-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin: 0;
  padding: 8px 6px 10px;
  border: 2px solid var(--coconut-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--coconut-text);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s, background 0.15s;
}

.coconut-character-select__char-btn:hover,
.coconut-character-select__char-btn:focus-visible {
  border-color: var(--coconut-accent);
  outline: none;
}

.coconut-character-select__char-btn.is-selected {
  border-color: var(--coconut-accent);
  background: rgba(79, 140, 255, 0.18);
  box-shadow: 0 0 0 1px var(--coconut-accent);
}

.coconut-character-select__char-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
}

.coconut-character-select__char-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--coconut-muted);
  line-height: 1.2;
  text-align: center;
}

.coconut-character-select__char-btn.is-selected .coconut-character-select__char-name {
  color: var(--coconut-text);
}

.coconut-character-select__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.coconut-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.coconut-field__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--coconut-muted);
}

.coconut-field__input {
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--coconut-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--coconut-text);
  font-size: 16px;
  box-sizing: border-box;
}

.coconut-field__input:focus {
  outline: none;
  border-color: var(--coconut-accent);
}

.coconut-field__hint {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.62);
}

.coconut-character-select__submit {
  width: 100%;
  margin: 4px 0 0;
  padding: 13px 16px;
  border: none;
  border-radius: 10px;
  background: var(--coconut-accent);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  scroll-margin-bottom: max(24px, env(safe-area-inset-bottom));
}

body.coconut-character-select-open {
  overflow: hidden;
}

body.coconut-character-select-open .coconut-bottom-dock {
  display: none !important;
}

.coconut-character-select__submit:hover,
.coconut-character-select__submit:focus-visible {
  background: var(--coconut-accent-hover);
  outline: none;
}

.coconut-chat-panel {
  position: fixed;
  left: max(10px, env(safe-area-inset-left));
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 45;
  width: min(420px, calc(100vw - 20px));
  max-height: min(360px, 50vh);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--coconut-border);
  border-radius: var(--coconut-radius);
  background: var(--coconut-bg);
  color: var(--coconut-text);
  box-shadow: var(--coconut-shadow);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
}

.coconut-chat-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--coconut-border);
}

.coconut-chat-panel__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.coconut-chat-panel__expand {
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--coconut-border);
  border-radius: 8px;
  background: transparent;
  color: var(--coconut-text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.coconut-chat-panel__expand:hover,
.coconut-chat-panel__expand:focus-visible {
  border-color: var(--coconut-accent);
  outline: none;
}

.coconut-chat-panel--expanded {
  left: 50%;
  right: auto;
  width: min(720px, calc(100vw - 24px));
  max-height: min(72vh, 680px);
  transform: translateX(-50%);
}

.coconut-chat-panel--expanded .coconut-chat-panel__messages {
  min-height: 280px;
  max-height: calc(72vh - 150px);
}

.coconut-chat-panel__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.coconut-chat-panel__close {
  width: auto;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--coconut-border);
  border-radius: 8px;
  background: transparent;
  color: var(--coconut-text);
  font-size: 12px;
  cursor: pointer;
}

.coconut-chat-panel__messages {
  flex: 1;
  min-height: 140px;
  max-height: 220px;
  overflow-y: auto;
  padding: 10px 12px;
  -webkit-overflow-scrolling: touch;
}

.coconut-chat-panel__line {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.coconut-chat-panel__line--ai-question {
  color: #dce6ff;
}

.coconut-chat-panel__line--ai-answer {
  color: #b8f0c8;
  white-space: pre-wrap;
}

.coconut-chat-panel__line--ai-loading {
  color: #9eb8ff;
  font-style: italic;
}

.coconut-chat-panel__line--ai-error,
.coconut-chat-panel__line--ai-system {
  color: #ffb8b8;
}

.coconut-chat-panel__hint {
  margin: 0;
  padding: 8px 12px 0;
  font-size: 11px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.58);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.coconut-chat-panel__form {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--coconut-border);
}

.coconut-chat-panel__input {
  flex: 1;
  width: auto;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--coconut-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--coconut-text);
  font-size: 16px;
}

.coconut-chat-panel__input:focus {
  outline: none;
  border-color: var(--coconut-accent);
}

.coconut-chat-panel__send {
  width: auto;
  margin: 0;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: var(--coconut-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.coconut-help {
  position: fixed;
  inset: 0;
  z-index: 58;
  pointer-events: none;
}

.coconut-help__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 18, 0.42);
  pointer-events: auto;
}

.coconut-help__close {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 61;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(107, 163, 255, 0.55);
  border-radius: 50%;
  background: rgba(18, 28, 48, 0.96);
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--coconut-shadow);
  pointer-events: auto;
}

.coconut-help__close:hover,
.coconut-help__close:focus-visible {
  border-color: #6ba3ff;
  outline: none;
  background: #1e4a9e;
}

.coconut-help__layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.coconut-help__center {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 60;
  transform: translate(-50%, -50%);
  max-width: min(320px, calc(100vw - 32px));
  padding: 14px 18px;
  border: 1px solid rgba(107, 163, 255, 0.5);
  border-radius: 10px;
  background: rgba(18, 28, 48, 0.94);
  color: rgba(238, 243, 255, 0.96);
  text-align: center;
  box-shadow: var(--coconut-shadow);
  pointer-events: none;
}

.coconut-help__center-line {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.coconut-help__center-line + .coconut-help__center-line {
  margin-top: 8px;
}

.coconut-help__center-line strong {
  color: #9ec0ff;
  font-weight: 700;
}

@media (max-width: 768px) {
  .coconut-help__center {
    top: calc(max(12px, env(safe-area-inset-top)) + 54px);
    left: 50%;
    transform: translateX(-50%);
    max-width: min(280px, calc(100vw - 24px));
    padding: 10px 14px;
  }

  .coconut-help__center-line {
    font-size: 12px;
  }

  .coconut-help__center-line--pc {
    display: none;
  }

  .coconut-help__center-line + .coconut-help__center-line {
    margin-top: 0;
  }
}

.coconut-help__callout {
  position: fixed;
  z-index: 60;
  width: max-content;
  max-width: min(200px, calc(100vw - 110px));
  margin: 0;
  padding: 5px 8px;
  border: 1px solid rgba(107, 163, 255, 0.45);
  border-radius: 6px;
  background: rgba(18, 28, 48, 0.96);
  color: rgba(238, 243, 255, 0.95);
  font-size: 10px;
  line-height: 1.35;
  white-space: normal;
  word-break: keep-all;
  box-shadow: var(--coconut-shadow);
  pointer-events: none;
}

.coconut-help__callout[data-placement="right"]::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 5px solid rgba(107, 163, 255, 0.45);
}

.coconut-help__callout[data-placement="left"]::before {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 5px solid rgba(107, 163, 255, 0.45);
}

.coconut-help__callout[data-placement="top"]::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid rgba(107, 163, 255, 0.45);
}

body.coconut-help-open .coconut-side-menu__btn,
body.coconut-help-open .coconut-bottom-dock__btn,
body.coconut-help-open .coconut-media-controls__btn {
  position: relative;
  z-index: 59;
}

@media (max-width: 480px) {
  .coconut-side-menu {
    width: 76px;
  }

  .coconut-side-menu__btn {
    min-height: 64px;
    font-size: 10px;
  }

  .coconut-side-menu__icon {
    font-size: 20px;
  }

  .coconut-floor-panel {
    width: calc(100vw - 96px);
  }

  .coconut-character-select__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .coconut-character-select__char-img {
    width: 64px;
    height: 64px;
  }
}

@media (max-height: 740px) {
  .coconut-character-select__title {
    font-size: 20px;
  }

  .coconut-character-select__desc {
    margin-bottom: 12px;
    font-size: 13px;
  }

  .coconut-character-select__preview-wrap {
    margin-bottom: 12px;
  }

  .coconut-character-select__preview {
    width: 112px;
    height: 112px;
  }

  .coconut-character-select__picker {
    margin-bottom: 14px;
  }

  .coconut-character-select__char-img {
    width: 56px;
    height: 56px;
  }

  .coconut-character-select__form {
    gap: 12px;
  }
}
