html,
body {
  height: 100%;
  width: 100%;
}

body {
  margin: 0;
  overflow: hidden;
}

#webcam {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

#start-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  padding: 20px;
  font-size: 1.2rem;
  cursor: pointer;
}

#hashtag-strip {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 42px;
  background-color: #1565c0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-sizing: border-box;
  z-index: 10;
  color: white;
  font-family: sans-serif;
  font-weight: bold;
}

#hashtag-strip img {
  height: 28px;
}

#photo-counter {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 200;
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 12px;
  border-radius: 20px;
  backdrop-filter: blur(5px);
}

.photo-icon {
  font-size: 1.4rem;
  transition: all 0.3s ease;
}

.photo-icon.spent {
  opacity: 0.4;
  filter: grayscale(1);
}

#aux-controls {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#aux-controls button {
  background: rgba(255, 255, 255, 0.9);
  border: none;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

#aux-controls svg {
  width: 24px;
  height: 24px;
  fill: #333;
}

#bottom-interface {
  position: absolute;
  bottom: 60px;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  z-index: 100;
  pointer-events: none;
}

#bottom-interface * {
  pointer-events: auto;
}

#model-carousel {
  display: flex;
  gap: 12px;
  padding: 10px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  transition: all 0.3s ease;
  border-radius: 30px;
}

#model-carousel::-webkit-scrollbar {
  display: none;
}

.model-bubble {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  border: 2px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.model-bubble.active {
  background: white;
  transform: scale(1.15);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

#model-carousel.highlight {
  background: rgba(0, 242, 255, 0.15);
  box-shadow: 0 0 20px rgba(0, 242, 255, 0.2);
  transform: scale(1.05);
}

#capture-btn {
  width: 76px;
  height: 76px;
  background: white;
  border-radius: 50%;
  border: 4px solid white;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.4);
  cursor: pointer;
  outline: none;
  transition: transform 0.1s;
}

#capture-btn:active {
  transform: scale(0.9);
}

@media (orientation: landscape) {
  #bottom-interface {
    right: 20px;
    left: auto;
    bottom: 50px;
    width: auto;
    flex-direction: row-reverse;
  }

  #model-carousel {
    flex-direction: column;
  }
}

#preview-screen {
  position: fixed;
  inset: 0;
  background: black;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5500;
  padding: 20px;
  box-sizing: border-box;
}

#preview-img {
  max-width: 100%;
  max-height: 65vh;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  margin-bottom: 25px;
}

.preview-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  max-width: 320px;
}

#download-btn {
  background: #1565c0;
  color: white;
  border: none;
  border-radius: 12px;
  padding: 16px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(21, 101, 192, 0.4);
}

#repeat-btn {
  background: transparent;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  padding: 12px;
  font-size: 1rem;
  cursor: pointer;
}

#face-select-overlay-container {
  position: absolute;
  inset: 0;
  z-index: 105;
  pointer-events: none;
}

.face-selection-overlay {
  position: absolute;
  border: 3px dashed rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease,
    border-color 0.2s,
    box-shadow 0.2s;
}

.face-selection-overlay.active {
  border-color: #00f2ff !important;
  border-style: solid;
  background: rgba(0, 242, 255, 0.15);
  box-shadow: 0 0 25px rgba(0, 242, 255, 0.4);
  opacity: 1 !important;
}

.face-selection-overlay::after {
  content: '✨';
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(25%, -25%);
  font-size: 1.2rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.face-selection-overlay:hover {
  transform: scale(1.05);
  border-color: #ffd700;
  background: rgba(255, 255, 255, 0.2);
}

#face-select-overlay-container.has-selection .face-selection-overlay:not(.active) {
  opacity: 0.3;
}

.face-selection-overlay:active {
  transform: scale(0.95);
}

#toggle-3d-btn.active svg {
  fill: #1565c0;
}

.a-canvas {
  width: 100% !important;
  height: 100% !important;
  position: absolute !important;
  top: 0;
  left: 0;
  z-index: 0;
}

.a-enter-vr,
.a-enter-ar {
  display: none !important;
}

#splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 5000;
  padding: 20px;
  box-sizing: border-box;
}

#splash-card {
  background: white;
  width: 100%;
  max-width: 400px;
  text-align: center;
  font-family: sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.splash-logo {
  width: 120px;
  margin-bottom: 10px;
}

#splash-card h1 {
  font-size: 1.6rem;
  color: #1565c0;
  margin-bottom: 10px;
  font-weight: 800;
}

.photo-limit-msg {
  background: #e3f2fd;
  color: #1565c0;
  padding: 8px 15px;
  border-radius: 20px;
  font-weight: bold;
  display: inline-block;
  margin-bottom: 30px;
}

.splash-info-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 15px;
  margin-top: 15px;
  margin-left: auto;
  margin-right: auto;
  color: #555;
  width: 300px;
}

.splash-info-row span {
  font-size: 1.5rem;
  width: 40px;
  text-align: center;
  flex-shrink: 0;
}

.splash-info-row p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.3;
  text-align: left;
}

#start-experience-btn {
  background: #1565c0;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 15px;
  width: 100%;
  font-size: 1.3rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
  box-shadow: 0 4px 15px rgba(21, 101, 192, 0.3);
}

#start-experience-btn:active {
  transform: scale(0.98);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 7000;
  padding: 20px;
  box-sizing: border-box;
}

.modal-card {
  background: white;
  width: 100%;
  max-width: 400px;
  border-radius: 15px;
  padding: 25px;
  font-family: sans-serif;
  box-sizing: border-box;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-card h3 {
  color: #1565c0;
  margin-top: 0;
  font-size: 1.6rem;
}

.credits-content {
  text-align: left;
  font-size: 1.1rem;
  color: #444;
}

.credits-content ul {
  padding-left: 20px;
  margin-bottom: 15px;
}

.modal-close-btn {
  background: #1565c0;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  width: 100%;
  font-weight: bold;
  font-size: 1.15rem;
  cursor: pointer;
  margin-top: 10px;
}
