body, html {
  margin: 0;
  padding: 0;
  background: #000;
  overflow: hidden;
}

/* ===== 9:16 CENTER WRAPPER ===== */
.screen {
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ===== 9:16 STORY CONTAINER ===== */
#story-container {
  aspect-ratio: 9 / 16;
  height: 100vh;
  width: auto;
  max-width: 100vw;
  position: relative; /* IMPORTANT for child absolute elements */
  overflow: hidden;
  background: #000;
}

/* story image */
#story-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* click zones */
#left, #right {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  z-index: 10;
}

#left { left: 0; }
#right { right: 0; }

/* ===== PROGRESS BAR (FIXED) ===== */
#progress-bar {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  padding: 0 10px; /* keeps inside container */
  display: flex;
  gap: 5px;
  z-index: 20;
  box-sizing: border-box;
}

.bar {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.3);
  overflow: hidden;
}

.fill {
  height: 100%;
  width: 0%;
  background: #fff;
}

/* popup message */
#instruction-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.popup-content {
  background: #111;
  color: #fff;
  padding: 20px;
  text-align: center;
  border-radius: 10px;
  width: 80%;
  max-width: 300px;
}

.popup-content button {
  margin-top: 15px;
  padding: 10px 20px;
  border: none;
  background: #fff;
  color: #000;
  cursor: pointer;
  border-radius: 5px;
}

/* disable selection */
.noselect {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

input, textarea, button, select, a {
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}