/* GuessTheIMP - Base & Layout Shell */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}

button, a, input, select, textarea, [role="button"], .btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

html {
  width: 100%;
  height: 100%;
  min-height: 100%;
  background-color: #06070a;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: #06070a;
  color: var(--text-primary);
  font-family: var(--font-family);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* Ambient glow backdrop for desktop presentation */
body::before {
  content: "";
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 42, 85, 0.08) 0%, rgba(0, 229, 255, 0.05) 45%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}

/* Full-screen on mobile — fills entire phone viewport */
#app-container {
  position: relative;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg-dark);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1;
}

/* Desktop bezel / phone frame */
@media (min-width: 481px) {
  body {
    position: fixed;
    inset: 0;
  }
  #app-container {
    width: var(--app-max-width);
    max-width: var(--app-max-width);
    height: 94dvh;
    min-height: unset;
    max-height: 860px;
    border-radius: 36px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.12);
  }
}


/* Header Bar */
.app-header {
  height: 52px;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top, 0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(14, 17, 26, 0.92);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.brand-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-decoration: none;
}

.brand-mini .imp-accent {
  color: var(--imp-red);
  text-shadow: 0 0 10px var(--imp-red-glow);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Main Viewport Container */
.app-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Individual Game Screens */
.game-view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
  overflow: hidden;
  z-index: 1;
}

.game-view.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
  z-index: 2;
}

/* View Content Scrollable Area (only if screen height is extremely small) */
.view-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.view-content::-webkit-scrollbar {
  display: none;
}

/* Bottom Action Area (compact fixed footer) */
.view-bottom-actions {
  flex-shrink: 0;
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
  background: linear-gradient(180deg, transparent 0%, rgba(9, 11, 16, 0.95) 40%, var(--bg-dark) 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 5;
}
