* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #000;
  color: #fff;
  touch-action: none;
}

/* 3Dキャンバス */
#canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#canvas-container canvas {
  display: block;
}

/* UIオーバーレイ */
#ui-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}

#ui-overlay > * {
  pointer-events: auto;
}

/* ルーム情報（上部） */
#room-info {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#room-name {
  font-weight: bold;
  font-size: 14px;
}

#user-count {
  background: rgba(255,255,255,0.2);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
}

/* チャットエリア */
#chat-container {
  position: absolute;
  bottom: 140px;
  left: 12px;
  width: calc(100% - 24px);
  max-width: 360px;
}

#chat-messages {
  max-height: 150px;
  overflow-y: auto;
  margin-bottom: 8px;
  padding: 8px;
  background: rgba(0,0,0,0.5);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}

#chat-messages:empty {
  display: none;
}

.chat-message {
  margin-bottom: 4px;
  word-break: break-word;
}

.chat-message .name {
  font-weight: bold;
  color: #4fc3f7;
  margin-right: 8px;
}

#chat-form {
  display: flex;
  gap: 8px;
}

#chat-input {
  flex: 1;
  padding: 10px 14px;
  border: none;
  border-radius: 20px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 14px;
  outline: none;
}

#chat-input::placeholder {
  color: rgba(255,255,255,0.5);
}

#chat-form button {
  padding: 10px 18px;
  border: none;
  border-radius: 20px;
  background: #4fc3f7;
  color: #000;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
}

/* 応援ボタン（下部） */
#reaction-buttons {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 0 12px;
}

.reaction-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 16px;
  border: none;
  border-radius: 16px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  cursor: pointer;
  transition: transform 0.1s, background 0.2s;
  min-width: 70px;
}

.reaction-btn:active {
  transform: scale(0.95);
  background: rgba(255,255,255,0.3);
}

.reaction-btn .icon {
  font-size: 24px;
  margin-bottom: 4px;
}

.reaction-btn .label {
  font-size: 11px;
}

/* ペンライト色選択 */
#penlight-colors {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  padding: 12px;
  background: rgba(0,0,0,0.8);
  border-radius: 12px;
}

#penlight-colors.hidden {
  display: none;
}

.color-btn {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s;
}

.color-btn:active {
  transform: scale(0.9);
}

.color-btn.selected {
  border-color: #fff;
  box-shadow: 0 0 10px currentColor;
}

/* ステージコントロール */
#stage-controls {
  position: absolute;
  top: 60px;
  right: 12px;
  z-index: 10;
}

#request-stage-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
}

/* スピーカーコントロール */
#speaker-controls {
  position: absolute;
  top: 60px;
  right: 12px;
  z-index: 10;
  display: flex;
  gap: 8px;
}

#speaker-controls.hidden {
  display: none;
}

#mic-toggle-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 20px;
  background: #4caf50;
  color: #fff;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
}

#mic-toggle-btn.muted {
  background: #f44336;
}

#leave-stage-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 20px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}

/* ユーティリティ */
.hidden {
  display: none !important;
}

/* スクロールバー */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
}
