﻿* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background: #000;
  color: #fff;
  font-family: Arial, sans-serif;
}

.app-shell {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 4px 8px 12px;
}

/* HEADER */
.top-header {
  height: 78px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px 6px;
}

.back-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.22);
  font-size: 24px;
  line-height: 1;
  color: #fff;
  text-decoration: none;
}

.top-header .logo {
  width: auto;
  max-width: 285px;
  max-height: 74px;
  height: auto;
  object-fit: contain;
  display: block;
}

/* SECTIONS */
.section {
  width: 100%;
  margin-bottom: 7px;
}

/* CANVAS */
.canvas-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #090909;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,43,214,0.75);
  position: relative;
}

#introGif {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.canvas-wrap.intro-done #introGif {
  opacity: 0;
  pointer-events: none;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  z-index: 1;
}

/* INPUTS */
textarea,
input,
select {
  width: 100%;
  display: block;
  min-height: 38px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.065);
  color: #fff;
  margin: 0 0 6px;
  font-size: 13px;
  outline: none;
  font-family: Arial, sans-serif;
}

textarea {
  min-height: 58px;
  resize: vertical;
  line-height: 1.25;
}

.prompt-section textarea {
  border-color: rgba(0,229,255,0.9);
  background: rgba(0,229,255,0.09);
}

textarea:focus,
input:focus,
select:focus {
  border-color: rgba(0,229,255,1);
  background: rgba(0,229,255,0.12);
}

textarea::placeholder,
input::placeholder {
  color: rgba(255,255,255,0.65);
}

select {
  appearance: none;
  -webkit-appearance: none;
}

/* ROWS */
.row {
  width: 100%;
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.row > * {
  flex: 1 1 0;
  min-width: 0;
}

.row select {
  margin-bottom: 0;
}

/* BUTTONS */
button,
.upload-box {
  width: 100%;
  min-height: 40px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.07);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  line-height: 1.1;
  cursor: pointer;
  font-family: Arial, sans-serif;
  text-align: center;
}

button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.primary-btn {
  background: rgba(255,43,214,0.18);
  border-color: rgba(255,43,214,0.8);
}

.secondary-btn {
  background: rgba(255,255,255,0.055);
  border-color: rgba(255,255,255,0.24);
}

.x-btn {
  background: rgba(255,255,255,0.065);
  border-color: rgba(255,255,255,0.36);
}
.contest-section {
  padding-top: 2px;
}

.contest-btn {
  background: linear-gradient(135deg, rgba(255,43,214,0.32), rgba(0,229,255,0.22));
  border-color: rgba(0,229,255,0.8);
  box-shadow: 0 0 18px rgba(255,43,214,0.18);
}

.contest-link {
  display: block;
  margin-top: 6px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.22);
  color: #00e5ff;
  background: rgba(255,255,255,0.045);
  text-align: center;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
}

/* UPLOAD BUTTON */
.upload-box {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 6px;
}

.upload-box span {
  opacity: 0.65;
  font-weight: 700;
  margin-left: 4px;
}

.upload-box input {
  display: none;
}

/* X HELP */
.x-instructions {
  font-size: 10.5px;
  color: rgba(255,255,255,0.62);
  margin: 0 0 4px;
  line-height: 1.25;
  text-align: center;
}

/* STATUS */
.status {
  min-height: 14px;
  font-size: 12px;
  line-height: 1.25;
  color: #00e5ff;
  margin: 3px 0 0;
}

.status.working {
  color: #ffeb00;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { opacity: .4; }
  50% { opacity: 1; }
  100% { opacity: .4; }
}

/* HIDDEN CAPTION FIELD */
#captionText[hidden] {
  display: none;
}

/* TAP */
button:active,
.upload-box:active,
.back-btn:active,
.contest-link:active {
  transform: scale(0.97);
}

/* SMALL PHONES */
@media (max-width: 380px) {
  .top-header {
    height: 70px;
  }

  .top-header .logo {
    max-width: 250px;
    max-height: 66px;
  }

  textarea {
    min-height: 52px;
  }

  button,
  textarea,
  input,
  select,
  .upload-box {
    font-size: 12px;
    padding: 9px;
  }
}