* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
  background: #0a0a0f;
  color: #e0d8cc;
  overflow: hidden;
  height: 100vh;
  user-select: none;
  -webkit-user-select: none;
}

.chat-status {
  display: inline-block;
  font-size: 10px;
  margin-left: 4px;
  cursor: help;
  transition: color 0.3s;
}
.chat-status--on { color: #4ade80; text-shadow: 0 0 6px rgba(74,222,128,0.6); animation: pulse-on 2s infinite; }
.chat-status--off { color: #f87171; }
.chat-status--connecting { color: #fbbf24; animation: pulse-conn 1s infinite; }
@keyframes pulse-on { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes pulse-conn { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
#app { display: flex; flex-direction: column; height: 100vh; padding-top: 20px; }

#header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 10px; background: rgba(20,18,25,0.95);
  border-bottom: 1px solid rgba(255,200,150,0.08);
  z-index: 10; flex-shrink: 0; gap: 6px; min-height: 36px;
}
.logo { font-size: 13px; font-weight: 700; color: #f0a050; white-space: nowrap; }

#interact-row { display: flex; gap: 2px; overflow-x: auto; flex-shrink: 0; }
#interact-row::-webkit-scrollbar { display: none; }
.interact-btn {
  background: rgba(255,255,255,0.04); border: 1px solid transparent;
  color: #786c60; padding: 6px 12px; border-radius: 16px; cursor: pointer;
  font-size: 20px; transition: all 0.2s; line-height: 1;
}
.interact-btn:hover { color: #b0a090; background: rgba(255,200,150,0.08); }
.interact-btn.active {
  background: rgba(240,160,80,0.15); color: #f0a050;
  border-color: rgba(240,160,80,0.3);
}
.user-info { font-size: 10px; color: #786c60; white-space: nowrap; }

#stats-bar {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 2px 10px; font-size: 10px; color: #685c50;
  background: rgba(20,18,25,0.5);
  border-bottom: 1px solid rgba(255,200,150,0.04);
  flex-shrink: 0;
  flex-wrap: wrap;
}
#stats-bar strong { color: #f0a050; }
#timer-display { color: #f0a050; font-weight: 600; font-size: 12px; min-width: 40px; text-align: center; }
#totals { letter-spacing: 0.5px; font-size: 9px; color: #6a5e50; white-space: nowrap; }

#main { display: flex; flex: 1; overflow: hidden; position: relative; }

#canvas-wrap {
  flex: 1; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #0a0a1a 0%, #1a1525 50%, #0d0d18 100%);
}
#main-canvas {
  width: 100%; height: 100%; display: block;
  cursor: pointer; touch-action: none;
}

#chat-bar {
  position: absolute; bottom: 8px; left: 8px; right: 8px;
  display: flex; gap: 4px; z-index: 10;
}
#chat-input {
  flex: 1; background: rgba(20,18,25,0.7); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px; padding: 6px 12px; color: #e0d8cc; font-size: 12px; outline: none;
  backdrop-filter: blur(4px);
}
#chat-input:focus { border-color: rgba(240,160,80,0.2); }
#chat-input::placeholder { color: #584c40; }
#chat-send {
  background: rgba(240,160,80,0.1); border: 1px solid rgba(240,160,80,0.15);
  color: #f0a050; padding: 6px 12px; border-radius: 16px; cursor: pointer; font-size: 11px;
}

#end-options {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; gap: 12px;
  z-index: 9999; align-items: center;
}
#end-options button {
  background: #2a2018; border: 1px solid #f0a050;
  color: #f0a050; padding: 12px 28px; border-radius: 20px;
  cursor: pointer; font-size: 15px; font-weight: 600;
  transition: all 0.25s; white-space: nowrap;
  min-width: 140px; letter-spacing: 1px;
}
#end-options button:hover {
  background: #3a3028; border-color: #ffb860;
  color: #ffb860; transform: scale(1.06);
}
#end-options button:active {
  transform: scale(0.96);
}

@media (max-width: 768px) {
  #header { padding: 3px 6px; min-height: 32px; }
  .logo { font-size: 11px; }
  .interact-btn { font-size: 18px; padding: 5px 10px; }
  #stats-bar { font-size: 9px; gap: 8px; padding: 2px 6px; }
  #timer-display { font-size: 10px; }
  #totals-bar { font-size: 8px; padding: 1px 6px; }
  #chat-bar { bottom: 6px; left: 6px; right: 6px; }
  #chat-input { font-size: 11px; padding: 5px 10px; }
  #chat-send { font-size: 10px; padding: 5px 10px; }
}
