* { box-sizing: border-box; margin: 0; padding: 0; }
body { overflow: hidden; font-family: 'Segoe UI', Roboto, sans-serif; background-color: #080c14; }
#canvas-container { width: 100vw; height: 100vh; position: absolute; top: 0; left: 0; }
#css3d-container { width: 100vw; height: 100vh; position: absolute; top: 0; left: 0; pointer-events: none; z-index: 5; }

.top-bar {
  position: absolute; top: 16px; left: 16px; display: flex; gap: 10px; align-items: center; z-index: 10;
}
.badge {
  background: rgba(15, 23, 42, 0.85); color: #ffffff; padding: 8px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 700; border: 1px solid #334155; backdrop-filter: blur(6px);
  display: flex; align-items: center; gap: 8px;
}
.badge-btn {
  cursor: pointer; border: 1px solid #38bdf8; background: rgba(2, 132, 199, 0.3); transition: all 0.2s;
}
.badge-btn:hover { background: #0284c7; color: #fff; }
.badge-logout { background: rgba(225, 29, 72, 0.3); border-color: #f43f5e; color: #fecdd3; }
.badge-logout:hover { background: #e11d48; color: #fff; }

.bottom-banner {
  position: absolute; bottom: 16px; left: 16px; background: rgba(15, 23, 42, 0.8);
  color: #e2e8f0; padding: 12px 20px; border-radius: 8px; font-size: 13px; z-index: 10;
  border-left: 4px solid #3b82f6; border: 1px solid #334155; backdrop-filter: blur(4px);
}

#joystick-container {
  position: absolute; bottom: 32px; left: 32px; width: 128px; height: 128px; z-index: 150;
  touch-action: none; user-select: none; display: none;
}
@media (pointer: coarse), (max-width: 1024px) {
  #joystick-container { display: block; }
  .bottom-banner { display: none; }
}
#joystick-base {
  width: 100%; height: 100%; background: rgba(15, 23, 42, 0.7);
  border: 2px solid #38bdf8; border-radius: 50%; position: relative;
  backdrop-filter: blur(8px); box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}
#joystick-thumb {
  width: 52px; height: 52px; background: rgba(56, 189, 248, 0.85);
  border: 2px solid #ffffff; border-radius: 50%; position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  pointer-events: none; box-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
}

.sholat-control-bar {
  position: absolute; top: 16px; right: 16px; z-index: 10; display: none;
}
.btn-toggle-sholat {
  background: rgba(2, 132, 199, 0.85); color: #fff; border: 1px solid #38bdf8; padding: 10px 18px;
  border-radius: 8px; font-weight: bold; cursor: pointer; transition: all 0.2s; font-size: 13px;
  display: flex; align-items: center; gap: 8px; backdrop-filter: blur(6px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.btn-toggle-sholat.active { background: rgba(22, 101, 52, 0.9); border-color: #22c55e; }
.btn-toggle-sholat:hover { transform: scale(1.03); }

.voice-control-bar {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 100; display: none;
}
.btn-toggle-mic {
  background: rgba(225, 29, 72, 0.85); color: #fff; border: 1px solid #f43f5e; padding: 10px 20px;
  border-radius: 30px; font-weight: bold; cursor: pointer; transition: all 0.2s; font-size: 13px;
  display: flex; align-items: center; gap: 8px; backdrop-filter: blur(6px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.btn-toggle-mic.active { background: rgba(22, 101, 52, 0.9); border-color: #22c55e; }
.btn-toggle-mic:hover { transform: scale(1.05); }

.modal-overlay {
  position: absolute; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(8px);
  display: flex; justify-content: center; align-items: center; z-index: 200;
}
.modal-box {
  background: #0f172a; color: #ffffff; padding: 28px 36px; border-radius: 12px;
  border: 1px solid #38bdf8; box-shadow: 0 10px 30px rgba(0,0,0,0.8); text-align: center;
  max-width: 420px; width: 90%;
}
.modal-box h3 { font-size: 20px; color: #38bdf8; margin-bottom: 6px; }
.modal-box p { font-size: 13px; color: #cbd5e1; margin-bottom: 20px; }
.modal-buttons { display: flex; gap: 12px; justify-content: center; }
.btn-modal {
  padding: 10px 20px; border-radius: 6px; border: none; font-weight: bold;
  cursor: pointer; font-size: 13px; transition: all 0.2s;
}
.btn-yes { background: #0284c7; color: white; border: 1px solid #38bdf8; }
.btn-yes:hover { background: #0369a1; }
.btn-no { background: #334155; color: #94a3b8; border: 1px solid #475569; }
.btn-no:hover { background: #475569; color: white; }

.login-form-group { text-align: left; margin-bottom: 14px; }
.login-form-group label { display: block; font-size: 12px; color: #38bdf8; margin-bottom: 6px; font-weight: bold; }
.login-input {
  width: 100%; padding: 10px 14px; border-radius: 6px; border: 1px solid #334155;
  background: #1e293b; color: #ffffff; font-size: 13px; outline: none; transition: all 0.2s;
}
.login-input:focus { border-color: #38bdf8; box-shadow: 0 0 8px rgba(56, 189, 248, 0.4); }
#login-error-msg { display: none; color: #f43f5e; font-size: 12px; margin-bottom: 14px; text-align: center; }

.game-chat-wrapper {
  position: absolute; top: 80px; bottom: 16px; right: 16px; width: 580px;
  height: calc(100vh - 96px); display: flex; gap: 8px; z-index: 100;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1); pointer-events: none;
}
.game-chat-wrapper * { pointer-events: auto; }
.game-chat-wrapper.hidden { transform: translateX(610px); }

.btn-toggle-chat-slide {
  position: absolute; top: 16px; right: 16px; z-index: 105;
  background: rgba(15, 23, 42, 0.85); color: #38bdf8; border: 1px solid #38bdf8;
  padding: 10px 16px; border-radius: 8px; font-weight: bold; cursor: pointer;
  font-size: 13px; backdrop-filter: blur(6px); box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  transition: all 0.2s; display: flex; align-items: center; gap: 6px;
}
.btn-toggle-chat-slide:hover { background: #0284c7; color: #fff; }

.online-users-sidebar {
  width: 190px; background: rgba(15, 23, 42, 0.65); border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px; backdrop-filter: blur(6px); display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-header {
  background: rgba(30, 41, 59, 0.8); color: #38bdf8; padding: 10px; font-size: 12px; font-weight: bold;
  border-bottom: 1px solid rgba(51, 65, 85, 0.6); text-align: center;
}
.sidebar-user-list {
  flex: 1; padding: 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px;
}
.user-chip {
  background: rgba(30, 41, 59, 0.6); border: 1px solid rgba(51, 65, 85, 0.8); border-radius: 6px;
  padding: 6px 8px; font-size: 11px; color: #f8fafc; cursor: pointer; transition: all 0.2s;
  display: flex; flex-direction: column; gap: 2px;
}
.user-chip:hover { background: rgba(2, 132, 199, 0.4); border-color: #38bdf8; }
.user-chip.active-chat { background: rgba(2, 132, 199, 0.35); border-color: #38bdf8; }
.user-chip.active-private { background: rgba(234, 179, 8, 0.25); border-color: #facc15; }
.user-chip-status { font-size: 9px; color: #4ade80; display: flex; align-items: center; gap: 4px; }

.multiuser-chat-box {
  flex: 1; background: rgba(15, 23, 42, 0.55); border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px; backdrop-filter: blur(6px); display: flex; flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5); overflow: hidden; transition: all 0.3s ease;
}
.multiuser-chat-box.minimized { height: 48px; }
.multiuser-chat-box.minimized .chat-mode-indicator,
.multiuser-chat-box.minimized .chat-target-bar,
.multiuser-chat-box.minimized .chat-logs-area,
.multiuser-chat-box.minimized .chat-input-bar { display: none; }

.chat-header {
  background: rgba(30, 41, 59, 0.8); color: #38bdf8; padding: 10px 14px; font-size: 13px; font-weight: bold;
  border-bottom: 1px solid rgba(51, 65, 85, 0.6); display: flex; justify-content: space-between; align-items: center;
}
.chat-header-btns { display: flex; gap: 6px; align-items: center; }
.btn-chat-action {
  background: rgba(15, 23, 42, 0.6); color: #cbd5e1; border: 1px solid #334155;
  border-radius: 4px; padding: 3px 8px; font-size: 11px; cursor: pointer; transition: all 0.2s;
}
.btn-chat-action:hover { background: #0284c7; color: #fff; border-color: #38bdf8; }
.btn-chat-close { color: #f43f5e; border-color: rgba(244, 63, 94, 0.4); }
.btn-chat-close:hover { background: #e11d48; color: #fff; }

.chat-mode-indicator {
  background: rgba(15, 23, 42, 0.9); padding: 6px 12px; font-size: 11px; font-weight: bold;
  border-bottom: 1px solid rgba(51, 65, 85, 0.6); display: flex; align-items: center; justify-content: space-between;
}
.chat-mode-indicator.mode-global { color: #38bdf8; border-left: 4px solid #38bdf8; }
.chat-mode-indicator.mode-private { color: #facc15; border-left: 4px solid #facc15; }

.chat-target-bar {
  background: rgba(15, 23, 42, 0.6); padding: 8px 12px; font-size: 11px; color: #cbd5e1; border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.chat-target-select {
  background: rgba(30, 41, 59, 0.8); color: #38bdf8; border: 1px solid #334155; border-radius: 4px;
  padding: 4px 8px; font-size: 11px; outline: none; flex: 1;
}
.chat-logs-area {
  flex: 1; padding: 12px; overflow-y: auto; font-size: 12px; display: flex; flex-direction: column; gap: 8px;
  scrollbar-width: thin; scrollbar-color: rgba(56, 189, 248, 0.4) transparent;
}
.chat-item {
  background: rgba(15, 23, 42, 0.65); padding: 8px 12px; border-radius: 8px; border-left: 3px solid #38bdf8;
  backdrop-filter: blur(3px); box-shadow: 0 2px 6px rgba(0,0,0,0.2); animation: fadeInMsg 0.3s ease;
}
@keyframes fadeInMsg { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.chat-item.me { border-left-color: #4ade80; background: rgba(22, 101, 52, 0.35); }
.chat-item.private { border-left-color: #facc15; background: rgba(234, 179, 8, 0.25); }

.chat-sender { font-weight: bold; color: #38bdf8; margin-bottom: 3px; font-size: 11px; display: flex; justify-content: space-between; }
.chat-time { font-weight: normal; font-size: 9px; color: #94a3b8; }
.chat-item.me .chat-sender { color: #4ade80; }
.chat-item.private .chat-sender { color: #facc15; }
.chat-text { color: #f8fafc; word-break: break-word; line-height: 1.4; }
.chat-input-bar {
  padding: 10px; background: rgba(15, 23, 42, 0.7); border-top: 1px solid rgba(51, 65, 85, 0.6); display: flex; gap: 6px;
}
.chat-input-field {
  flex: 1; background: rgba(30, 41, 59, 0.8); border: 1px solid #334155; border-radius: 6px; color: #fff;
  padding: 8px 12px; font-size: 12px; outline: none; transition: all 0.2s;
}
.chat-input-field:focus { border-color: #38bdf8; box-shadow: 0 0 8px rgba(56, 189, 248, 0.3); }
.chat-send-btn {
  background: #0284c7; color: #fff; border: 1px solid #38bdf8; border-radius: 6px;
  padding: 8px 14px; font-weight: bold; cursor: pointer; font-size: 12px; transition: all 0.2s;
}
.chat-send-btn:hover { background: #0369a1; }

#seat-preview-card {
  display: none; position: absolute; z-index: 90;
  background: rgba(15, 23, 42, 0.95); color: #ffffff; padding: 14px 18px;
  border-radius: 10px; border: 1px solid #38bdf8; box-shadow: 0 8px 24px rgba(0,0,0,0.7);
  backdrop-filter: blur(8px); text-align: center; min-width: 230px; pointer-events: auto;
}
