/* Global Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@keyframes imageLoading {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-spinner {
  position: relative;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
}

.loading-spinner img {
  opacity: 0;
}

.loading-spinner::after {
  content: '';
  position: absolute;
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: imageLoading 1s linear infinite;
}

/* Disable pull-to-refresh / overscroll on mobile */
html, body {
  overscroll-behavior-y: contain;
}

/* Disable pull-to-refresh / overscroll on mobile */
html, body {
  overscroll-behavior-y: contain;
}

/* Base Styles */
body {
  font-family: 'Inter', sans-serif;
  background-color: white;
  color: #111827;
  text-align: center;
  padding: 20px;
}
/* Logo header */
.app-header {
  text-align: center;
  margin-top: 5px;
  margin-bottom: 20px;
}

.app-header img {
  max-width: 150px;     /* or whatever width fits your design */
  height: auto;
  display: inline-block;
}


h1 {
  font-size: 2rem;
  margin-bottom: 20px;
  font-weight: 800;
}

h2 {
  font-size: 1.3rem;
  margin-top: 20px;
}

p {
  font-size: 1rem;
  margin-bottom: 15px;
}

/* Screens */
.screen {
  display: none;
  max-width: 480px;
  margin: 0 auto;
}

.screen.active {
  display: block;
}

/* Buttons */
button {
  background-color: black;
  color: white;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin: 10px 0;
  width: 100%;
  max-width: 400px;
}

button:hover {
  opacity: 0.9;
}

button.selected {
  background-color: white;
  color: black;
  border: 2px solid black;
}

/* App loading overlay */
#appLoadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10001;
}

#appLoadingOverlay .spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #000;
  border-radius: 50%;
  animation: appSpinner 1s linear infinite;
  margin-bottom: 20px;
}

#appLoadingOverlay p {
  font-size: 1.1rem;
  color: #333;
  margin: 0;
}

@keyframes appSpinner {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Inputs & Textareas */
input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: 12px;
  margin: 10px 0 20px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: inherit;
}

textarea {
  resize: vertical;
}

#referenceImage,
#focusImage {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  height: auto;
  margin: 0 auto 20px;
  object-fit: contain;
}

/* Upload Area */
#upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  border: 2px dashed #ccc;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

#upload-area:hover {
  background-color: #f9f9f9;
}

/* Small Links */
.small-link {
  font-size: 0.9rem;
  color: #666;
  text-decoration: underline;
  margin-top: 15px;
  cursor: pointer;
}

/* Small Links */
.text-link {
  font-size: 0.9rem;
  color: #666;
  text-decoration: underline;
  margin-top: 50%;  
  cursor: pointer;
}

/* Screen 4: “How It Works” */
#instructions-screen {
  padding: 20px;
}

/* Title */
.instructions-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: #111827;
}

/* Step list */
.instructions-steps {
  list-style: decimal inside;
  text-align: left;
  margin: 0 auto 1.5rem;
  padding-left: 0;
  max-width: 400px;
  color: #333;
}
.instructions-steps li {
  margin-bottom: 0.75rem;
  line-height: 1.4;
}
.instructions-steps li strong {
  font-weight: 600;
}

/* Final note */
.instructions-text {
  font-size: 1rem;
  color: #666;
  margin-bottom: 2rem;
  line-height: 1.5;
  text-align: center;
}


/* Voting Grid */
#votingGrid,
#submissionsGrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 20px 0;
}

#votingGrid img,
#submissionsGrid img {
  width: 100%;
  border-radius: 6px;
  cursor: pointer;
}

/* Fullscreen Feedback Modal */
#feedback-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: white;
  padding: 20px;
  z-index: 999;
  display: none;
}

/* Download Layout */
/* ------------------------------------------------ */
/* DOWNLOAD SNAPSHOT LAYOUT                         */
/* ------------------------------------------------ */
/* style.css */

#downloadLayout {
  /* remove display:none; */
  width: 1080px;
  height: 1920px;
  background: #fff;
  padding: 40px 20px;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
  position: absolute;
  top: -9999px;    /* offscreen */
  left: -9999px;   /* offscreen */
  z-index: 9999;
  display: flex;           /* keep it laid out as flex */
  flex-direction: column;
  /* …any other styling you already have… */
}


#downloadLayout.visible {
  display: flex;            /* flex so we can center the grid if you like */
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

/* Header Download Layout */

#downloadLayout h2 {
  font-size: 48px;
  margin-bottom: 50px;
}

/* turn the inner container into a true grid */
#downloadLayout .download-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 0;
  width: 100%;              /* fill the artboard width */
  height: calc(100% - 100px); /* leave room for the header */
  
  }

  /* give every cell a bottom & right border */
  #downloadLayout .download-grid > div {
    border-right: 1px solid #D9D9D9;
    border-bottom: 1px solid #D9D9D9;
  }

  /* remove the extra right‐hand border on the right‐most column */
  #downloadLayout .download-grid > div:nth-child(2),
  #downloadLayout .download-grid > div:nth-child(4) {
    border-right: none;
  }

  /* remove the extra bottom border on the bottom row */
  #downloadLayout .download-grid > div:nth-child(3),
  #downloadLayout .download-grid > div:nth-child(4) {
    border-bottom: none;
  }


/* make sure each cell’s img scales to fit */
#downloadLayout .download-grid img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* style the little labels */
#downloadLayout .download-grid .label {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 10px;
}

/* #downloadLayout .poll-block p {
  font-size: 28px;        
  line-height: 1.2;      
  margin: 0;              
}*/

/* make the poll cell a positioning context */
#downloadLayout .poll-block {
  position: relative;
  padding: 20px;           /* optional—you can tweak inner padding */
  box-sizing: border-box;
}

/* top text stays at the top by default; bump its size if you like */
#downloadLayout .poll-text-top {
  font-size: 28px;         /* your +4pt bump */
  margin: 0 0 1em;
  font-weight: bold;
}

/* 1) Title sizes: first line normal, second line 30% smaller */
#downloadTitle {
  font-size: 48px;      /* adjust this base size however you like */
  line-height: 1.1;     /* tighten up the two lines */
  margin-bottom: 40px;  /* space between title and grid */
}
#downloadTitle .subtitle {
  display: block;       /* so the <br> + this always stack */
  font-size: 0.5em;     /* 70% of 48px ≈ 34px */
  margin-top: 4px;      /* a hair of separation if you like */
}

/* 2) Give Player A / B blocks 10px padding top & bottom */
#downloadLayout .player-block {
  padding: 10px 0;
}

/* (optional) If you want to center the “Player A” / “Player B” labels above their images: */
#downloadLayout .player-block .label {
  margin-bottom: 10px;
  font-weight: 600;
}

/* bottom text sits 10% up from the bottom edge */
#downloadLayout .poll-text-bottom {
  position: absolute;
  bottom: 30%;             /* exactly 10% of the block’s height */
  left: 20px;              /* match your horizontal padding */
  right: 20px;
  font-size: 28px;
  margin: 0;               /* reset default margins */
  text-align: center;
}
/* center the original image vertically in its cell */
#downloadLayout .prompt-block {
  display: block;
 
}

#downloadLayout .prompt-block img {
  display: block;
  margin: 20px auto;  
}
#downloadLayout .download-grid {
  margin-top: 32px;
}

.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

/* Upload Area */
  .thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
  }


/* Processing Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.overlay-content {
  text-align: center;
  color: #fff;
  font-size: 1.1rem;
}

.progress-bar {
  width: 200px;
  height: 8px;
  background: #444;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 12px;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: #4caf50;
  animation: loadIndeterminate 2s linear infinite;
}

@keyframes loadIndeterminate {
  0%   { width: 0; }
  50%  { width: 80%; }
  100% { width: 0; }
}

.modal.active {
  display: flex;
}
.modal-content {
  position: relative;
  width: 90%;
  max-width: 480px;
  height: 90%;
  background: white;
  border-radius: 8px;
  overflow: hidden;
}
.modal-content iframe {
  width: 100%;
  height: 100%;
  border: none;
}
.modal-close {
  position: absolute;
  top: 8px; right: 8px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
}


#app {
  visibility: visible;
}

#leaveModal .modal-content p {
  font-size: 1rem;
  color: #111827;
  text-align: center;
}

#leaveModal button {
  width: auto;
  flex: 1;
  max-width: 120px;
}
