body {
  overflow-y: hidden;
  margin: 0;
  height: 100%;
  width: 100%;
}

p, button, input, h1, #winner-item, .tournament-item, #start-button, .items-list, .text-content {
  font-family: 'Roboto', sans-serif;
}

.input-area {
  min-height: 100vh;
  width: 100%;
  height: 100%;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 1.1rem;
  padding: 0.0rem;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.5s, border 0.3s, width 0.3s, height 0.3s;
    font-size: 1.1rem;
    color: #00000080;
}

.input-area p {
  background-color: #00000000;
  border: 0.1rem solid #222222;
  border-radius: 1.1rem;
  box-sizing: border-box;
  padding: 1.4rem 1.4rem;
  width: 25.0rem;
  height: 4.3rem;
  font-size: 1.1rem;
  font-weight: 500;
}

.input-area:hover {
  background-color: #ffffff;
}

.input-area.dragging p {
  pointer-events: none;
  border: none;
  border-radius: 1.1rem;
  color: #000000;
}

#text-input {
  background-color: #00000000;
  border: 0.1rem solid #222222;
  border-radius: 1.1rem;
  box-sizing: border-box;
  padding: 1.4rem 1.4rem;
  width: 25.0rem;
  height: 4.3rem;
  font-size: 1.1rem;
  font-weight: 500;
  outline: none;
  display: inline-block;
  position: absolute;
  background-image: url('img/enter-icon.svg');
  background-position: 22.1rem 1.4rem; 
  background-repeat: no-repeat;
}

#text-input:focus {
  border-color: #000000;
  outline: none;
}

#start-button {
  background-color: #ffffff00;
  border: 0.1rem solid #222222;
  border-radius: 1.1rem;
  box-sizing: border-box;
  color: #222222;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.2rem;
  margin: 0;
  outline: none;
  padding: 1.4rem 3.5rem;
  position: absolute;
  text-align: center;
  text-decoration: none;
  touch-action: manipulation;
  width: auto;
  margin-top: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(50vh - 8.6rem);
  gap: 0.0rem;
  font-style: normal;
  text-transform: none;
}

#start-button:hover {
  color: #fff;
  background-color: #1A1A1A;
}

.preview-area {
  min-height: 60vh;
  width: 100%;
  height: 100%;
  border: none;
  justify-content: center;
  align-items: center;
  transition: background-color 0.3s;
}

.preview-area.dragging {
  background-color: #e5e5e5;
  border-radius: 1.1rem;
}


.file-preview {
  max-width: 18.8rem;
  max-height: 18.8rem;
  min-width: 1.2rem;
  min-height: 1.2rem;
  /* object-fit: contain; */
  box-shadow: rgba(0, 0, 0, 0.25) 0 0.5rem 0.9rem;
  border-radius: 1.1rem;
  position: absolute;
}



#first-file-preview {
  z-index: 2;

}

#second-file-preview {
  z-index: 1;
  transform: rotate(3deg);
}


#file-count {
  padding: 0.9rem 1.2rem;
  border-radius: 1.9rem;
  position: relative;
  right: -9.4rem;
  top: -8.8rem;
  opacity: 1  ;
  z-index: 3;
  transform: translateZ(0);
  border: 0.1rem solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(0.6rem);
  -webkit-backdrop-filter: blur(0.6rem);
  background-color: rgba(0, 0, 0, 0.3);
  background-size: 6.2rem;
  color: #ffffff;
  font-style: normal;
  text-transform: none;
}

#tournament-area{

  position: sticky;
  padding: 0.0rem;
  vertical-align: middle;
  min-height: 100vh;
  height: 100%;
  border: none;
  justify-content: center;
  align-items: center;
}

.tournament-item {
  min-height:18.1rem;
  min-width: 18.1rem;
  height: calc(50vw - 10.0rem);
  width: calc(50vw - 7.8rem);
  margin: 2.5rem;
  border-radius: 1.1rem;
  position: static;
  font-size: clamp(  1.5rem,  10vw,  3.0rem  );
  font-weight: 500;
  text-align: center;
  justify-content: center;
  align-items: center;
  overflow-wrap: break-word;
  cursor: pointer;
  scale: 1;
  transition: transform 0.15s ease-in-out;
  background-color: #ffffff;
  box-shadow: rgba(0, 0, 0, 0.25) 0 0.1rem 0.4rem;
  display: inline-block;
}

.tournament-item:hover {
  transform: scale(1.05);
  box-shadow: rgba(0, 0, 0, 0.15) 0 0.5rem 0.9rem;
  /* transform: perspective(56.2rem) translateY(-5%) rotateY(15deg) translateZ(0); */
  }

.tournament-item img,
#winner-item img {
  height: 100.1%;
  width: 100.1%;
  object-fit: cover;
  border-radius: 1.1rem;
}

.text-content{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.4rem;
  font-weight: 500;
  color: #000000;
  overflow-wrap: anywhere;
}

#winner-area {
  padding: 0.0rem;
  vertical-align: middle;
  min-height: 100vh;
  height: 100%;
  border: none;
  justify-content: center;
  align-items: center;
}
h1 {
  position: absolute;
  width: 100%;
  margin: 0;
  text-align: center;
  font-size: 2.4rem;
  top: calc(7.5% - 1.4rem);
  color: #000000;
  overflow-wrap: anywhere;
}

 #winner-item {
  position: sticky;
  height: 70vh;
  width: 70vh; 
  background-color: #ffffff;
  box-shadow: rgba(0, 0, 0, 0.25) 0 0.5rem 0.9rem;
  border-radius: 1.1rem;
  display: inline-block;
}

.items-list {
  z-index: 1;
  position: absolute;
  height: calc(50vh - 5.0rem);
  overflow-y: auto;
  flex-flow: column;
  justify-content: flex-end;
  width: 22.8rem;
  gap: 0.6rem;
  line-height: 2.2rem;
  bottom: calc(50vh + 3.0rem);
  left: calc(50vW - 11.1rem);
  vertical-align: bottom;
  font-weight: 500;
}


/* ── Mobile / touch layout ───────────────────────────────────────── */

/* Hidden file input — triggered programmatically by JS */
#mobile-file-input {
  display: none;
}

/* Mobile section hidden on desktop by default */
.mobile-input {
  display: none;
}

@media (pointer: coarse) {
  /* Allow body to scroll on mobile (items list can grow) */
  body {
    overflow-y: auto;
  }

  /* Hide desktop drag zone on touch devices */
  .input-area {
    display: none !important;
  }

  /* Mobile input section: full-screen centered flex column */
  .mobile-input {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    gap: 1.2rem;
    padding: 2rem 1rem;
    box-sizing: border-box;
  }

  .mobile-btn-row {
    display: flex;
    gap: 1rem;
  }

  /* Buttons look the same as desktop Start button */
  .mobile-btn {
    background-color: transparent;
    border: 0.1rem solid #222222;
    border-radius: 1.1rem;
    color: #222222;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 1.4rem 3rem;
    touch-action: manipulation;
    transition: background-color 0.15s, color 0.15s;
  }

  .mobile-btn:active {
    background-color: #1a1a1a;
    color: #ffffff;
  }

  /* Mobile text input field */
  #mobile-text-field {
    background-color: transparent;
    border: 0.1rem solid #222222;
    border-radius: 1.1rem;
    box-sizing: border-box;
    font-size: 1.1rem;
    font-weight: 500;
    height: 4.3rem;
    outline: none;
    padding: 1.4rem 1.4rem;
    width: min(80vw, 25rem);
  }

  #mobile-text-field:focus {
    border-color: #000000;
  }

  /* Photo count badge */
  .mobile-photo-count {
    background: rgba(0, 0, 0, 0.07);
    border-radius: 1.1rem;
    color: #222222;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.6rem 1.4rem;
  }

  /* Items list: in normal flow inside mobile-input column */
  .items-list {
    position: static;
    width: min(80vw, 22.8rem);
    height: auto;
    max-height: 30vh;
    bottom: auto;
    left: auto;
    text-align: center;
  }

  /* Start button: in normal flow inside mobile-input column */
  #start-button {
    position: static;
    bottom: auto;
    left: auto;
    transform: none;
    margin-top: 0;
  }

  /* Tournament: stack items vertically on mobile */
  #tournament-area {
    flex-direction: column;
    min-height: 100vh;
    gap: 1.5rem;
    padding: 1.5rem 0;
  }

  .tournament-item {
    height: 42vh;
    width: calc(100vw - 3rem);
    margin: 0;
    min-height: 8rem;
    min-width: 0;
    font-size: clamp(1.2rem, 7vw, 2.4rem);
  }

  /* Winner area on mobile */
  #winner-item {
    height: 70vw;
    width: 70vw;
  }

  h1 {
    font-size: 1.8rem;
  }

  /* ── Active state: after Text or Photo mode is chosen ── */

  /* Container locks to full screen height; only items-list scrolls internally */
  .mobile-input.mobile-active {
    justify-content: flex-end;
    height: 100vh;
    overflow: hidden;
    padding: 0 1.5rem 2rem;
    gap: 1rem;
  }

  /* Items list fills all space above the input field */
  .mobile-input.mobile-active .items-list {
    flex: 1;
    min-height: 0;   /* required for overflow-y to work inside a flex child */
    max-height: none;
    width: min(80vw, 25rem);
  }

  /* Input field and photo count match the list width */
  .mobile-input.mobile-active #mobile-text-field,
  .mobile-input.mobile-active .mobile-photo-count {
    width: min(80vw, 25rem);
    flex-shrink: 0;
  }

  /* Start button stays static at the bottom */
  .mobile-input.mobile-active #start-button {
    flex-shrink: 0;
  }
}