/* Unified Modern Game Shell Stylesheet - Self-hosted Web Game Arcade */
:root {
  --shell-bg: rgba(11, 15, 25, 0.75);
  --shell-border: rgba(255, 255, 255, 0.12);
  --shell-text: #F1F5F9;
  --shell-accent: #38BDF8;
  --shell-accent-hover: #0EA5E9;
  --shell-blur: blur(16px);
  --shell-safe-top: env(safe-area-inset-top, 0px);
  --shell-safe-left: env(safe-area-inset-left, 0px);
  --shell-safe-right: env(safe-area-inset-right, 0px);
}

/* Shell Top Bar */
.arcade-shell-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(52px + var(--shell-safe-top));
  padding-top: var(--shell-safe-top);
  padding-left: calc(16px + var(--shell-safe-left));
  padding-right: calc(16px + var(--shell-safe-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(8, 12, 22, 0.9) 0%, rgba(8, 12, 22, 0.4) 75%, transparent 100%);
  backdrop-filter: var(--shell-blur);
  -webkit-backdrop-filter: var(--shell-blur);
  z-index: 99999;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
}

.arcade-shell-bar.shell-hidden {
  opacity: 0;
  transform: translateY(-80%);
  pointer-events: none;
}

/* Hover/Touch sensor zone to reveal bar */
.arcade-shell-sensor {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  z-index: 99998;
  pointer-events: auto;
}

/* Left Group */
.arcade-shell-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.arcade-shell-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  min-width: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--shell-border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--shell-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Noto Sans CJK SC", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}

.arcade-shell-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.arcade-shell-btn:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.22);
}

.arcade-shell-btn.back-btn {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.35);
  color: #BAE6FD;
}
.arcade-shell-btn.back-btn:hover {
  background: rgba(56, 189, 248, 0.28);
  border-color: rgba(56, 189, 248, 0.6);
  color: #FFF;
}

/* Center Title */
.arcade-shell-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #F8FAFC;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.arcade-shell-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.2);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  text-transform: uppercase;
}

/* Right Controls */
.arcade-shell-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.arcade-icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 16px;
}

/* Orientation Modal (Landscape Recommendation) */
.arcade-orientation-warning {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 25, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #F8FAFC;
  padding: 32px;
  text-align: center;
}

.arcade-orientation-warning.active {
  display: flex;
}

.orientation-icon {
  font-size: 54px;
  margin-bottom: 20px;
  animation: rotatePhone 2.5s infinite ease-in-out;
}

@keyframes rotatePhone {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-90deg); }
}

.orientation-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
  color: #38BDF8;
}

.orientation-desc {
  font-size: 14px;
  color: #94A3B8;
  max-width: 300px;
  line-height: 1.5;
  margin-bottom: 24px;
}

.orientation-dismiss {
  padding: 10px 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFF;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* Toast Notifications (Gamepad, Audio, PointerLock) */
.arcade-shell-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #F8FAFC;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100001;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.arcade-shell-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
