* {
  box-sizing: border-box;
}

body {
  font-family: 'Nunito', 'Segoe UI', Arial, Helvetica, sans-serif;
  background: radial-gradient(circle at top, #1c2b4a 0%, #0c1526 55%, #070c17 100%);
  color: #eef2fb;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

#app {
  width: 100%;
  max-width: 720px;
  height: fit-content;
  background: linear-gradient(180deg, #1a2745 0%, #131f38 100%);
  border: 2px solid #2f4370;
  border-radius: 18px;
  box-shadow: 0 4px 0 #0a1326, 0 20px 45px rgba(0, 0, 0, 0.45);
  padding: 32px 36px 36px;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.roblox-logo {
  height: 44px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.35));
}

.disclaimer {
  text-align: center;
  font-size: 11px;
  color: #64749a;
  margin: 28px 0 0;
  line-height: 1.5;
}

/* Progress bar */
.progress-bar {
  display: flex;
  justify-content: space-between;
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
}

.progress-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  text-align: center;
}

.progress-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 15px;
  left: 55%;
  width: 90%;
  height: 3px;
  background: #2f4370;
  z-index: 0;
  transition: background 0.35s ease;
}

.progress-step.completed:not(:last-child)::after {
  background: #4fb2ff;
}

.progress-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #22314f;
  border: 2px solid #2f4370;
  color: #7f8fb5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  position: relative;
  z-index: 1;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.progress-label {
  font-size: 11px;
  color: #7f8fb5;
  font-weight: 700;
  transition: color 0.25s ease;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.progress-circle-check {
  font-size: 15px;
}

.progress-step.active .progress-circle {
  background: linear-gradient(180deg, #4fb2ff 0%, #0089e0 100%);
  border-color: #0089e0;
  color: #fff;
  transform: scale(1.12);
  box-shadow: 0 0 0 4px rgba(79, 178, 255, 0.25);
}

.progress-step.active .progress-label {
  color: #ffffff;
}

.progress-step.completed .progress-circle {
  background: linear-gradient(180deg, #4fb2ff 0%, #0089e0 100%);
  border-color: #0089e0;
  color: #fff;
}

.progress-step.completed .progress-label {
  color: #4fb2ff;
}

/* Steps */
.step {
  animation: fade-in-up 0.3s ease;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hidden {
  display: none !important;
}

.step h2 {
  margin-top: 0;
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
}

.highlight {
  color: #4fb2ff;
}

/* Item grid */
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

#items-continue-btn {
  width: 100%;
}

.item-card {
  position: relative;
  background: linear-gradient(180deg, #24345a 0%, #182645 100%);
  border: 2px solid #34486f;
  border-radius: 14px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 3px 0 #101a30;
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  animation: fade-in-up 0.3s ease backwards;
}

.item-card:hover {
  border-color: #4fb2ff;
  transform: translateY(-3px);
  box-shadow: 0 6px 0 #101a30, 0 8px 16px rgba(79, 178, 255, 0.25);
}

.item-card:active {
  transform: translateY(0);
  box-shadow: 0 1px 0 #101a30;
}

.item-card.selected {
  border-color: #ffcd3c;
  background: linear-gradient(180deg, #3a3419 0%, #241f10 100%);
  box-shadow: 0 3px 0 #101a30, 0 0 0 3px rgba(255, 205, 60, 0.2);
}

.item-card.selected::after {
  content: '✓';
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffdd66 0%, #ffb400 100%);
  color: #3a2c00;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 0 #9c7200, 0 0 0 3px #131f38;
}

.item-card img {
  width: 100%;
  height: 90px;
  object-fit: contain;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
}

.item-card span {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
}

.item-code {
  font-family: 'Courier New', monospace;
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #8a9bc4 !important;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.empty-message {
  color: #8a9bc4;
  font-size: 14px;
}

/* Forms */
form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
  font-size: 14px;
  color: #ffffff;
}

form input[type="text"] {
  width: 100%;
  padding: 13px 14px;
  margin-bottom: 8px;
  border-radius: 10px;
  border: 2px solid #34486f;
  background: #101b32;
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

form input[type="text"]::placeholder {
  color: #647399;
}

form input[type="text"]:focus {
  outline: none;
  border-color: #4fb2ff;
  box-shadow: 0 0 0 3px rgba(79, 178, 255, 0.25);
}

button {
  padding: 13px 26px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, #4fb2ff 0%, #0089e0 100%);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.2px;
  box-shadow: 0 4px 0 #0060a0;
  transition: background 0.15s ease, transform 0.08s ease, box-shadow 0.08s ease;
}

button:hover {
  background: linear-gradient(180deg, #63bcff 0%, #0094f0 100%);
}

button:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #0060a0;
}

button:disabled {
  background: #2a3c5c;
  color: #7f8fb5;
  box-shadow: 0 4px 0 #1a2740;
  cursor: not-allowed;
}

#start-over-btn {
  background: linear-gradient(180deg, #2f4370 0%, #22314f 100%);
  color: #ffffff;
  box-shadow: 0 4px 0 #101a30;
}

#start-over-btn:hover {
  background: linear-gradient(180deg, #3a5088 0%, #2a3c5c 100%);
}

.back-btn {
  background: transparent;
  color: #8a9bc4;
  padding: 4px 0;
  margin-bottom: 14px;
  border-radius: 0;
  font-weight: 700;
  box-shadow: none;
}

.back-btn:hover {
  color: #4fb2ff;
  background: transparent;
  transform: none;
  box-shadow: none;
}

.error-message {
  color: #ff5c5c;
  font-size: 13px;
  margin: 0 0 8px;
  font-weight: 700;
}

.task-instructions {
  color: #b7c4de;
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 20px;
}

.task-waiting-message {
  color: #b7c4de;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  margin: 14px 0 0;
}

/* Selected item preview card (task step) */
.task-item-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(180deg, #24345a 0%, #182645 100%);
  border: 2px solid #ffcd3c;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: 0 3px 0 #101a30, 0 0 0 3px rgba(255, 205, 60, 0.15);
}

.task-item-image {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
}

.task-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.task-item-label {
  font-size: 11px;
  font-weight: 700;
  color: #ffcd3c;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.task-item-name {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Roblox profile preview card (confirm step) */
.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #101b32;
  border: 2px solid #2f4370;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 3px solid #4fb2ff;
  background: #22314f url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle cx='32' cy='24' r='12' fill='%238a9bc4'/%3E%3Cpath d='M8 58c0-14 10-22 24-22s24 8 24 22' fill='%238a9bc4'/%3E%3C/svg%3E") center/70% no-repeat;
  object-fit: cover;
  box-shadow: 0 3px 0 #0a1326;
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.profile-display-name {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-username-handle {
  font-size: 13px;
  font-weight: 600;
  color: #8a9bc4;
}

.profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.profile-stat {
  font-size: 11px;
  font-weight: 700;
  color: #b7c4de;
  background: #1a2745;
  border: 1px solid #2f4370;
  border-radius: 20px;
  padding: 3px 10px;
}

.profile-stat:empty {
  display: none;
}

.confirm-actions {
  display: flex;
  gap: 12px;
}

.confirm-actions button {
  flex: 1;
  padding-left: 12px;
  padding-right: 12px;
  font-size: 13px;
  white-space: nowrap;
}

@media (max-width: 420px) {
  .confirm-actions {
    flex-direction: column;
  }
}

.secondary-btn {
  background: linear-gradient(180deg, #2f4370 0%, #22314f 100%);
  color: #ffffff;
  box-shadow: 0 4px 0 #101a30;
}

.secondary-btn:hover {
  background: linear-gradient(180deg, #3a5088 0%, #2a3c5c 100%);
}

/* Summary card used in confirm + final steps */
.summary-card {
  background: #101b32;
  border: 1px solid #2f4370;
  border-radius: 12px;
  padding: 6px 18px;
  margin-bottom: 20px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #2f4370;
  font-size: 14px;
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-row span {
  color: #8a9bc4;
  font-weight: 700;
}

.summary-row strong {
  color: #ffffff;
  font-weight: 800;
}

.status-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  background: #4a3a12;
  color: #ffcd3c;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-badge[data-status="completed"],
.status-badge[data-status="approved"],
.status-badge[data-status="delivered"] {
  background: #12401f;
  color: #57e08a;
}

.status-badge[data-status="rejected"],
.status-badge[data-status="failed"] {
  background: #401616;
  color: #ff6b6b;
}

/* "Is This You?" modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 18, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: fade-in 0.15s ease;
}

.modal-dialog {
  background: linear-gradient(180deg, #1a2745 0%, #131f38 100%);
  border: 2px solid #2f4370;
  border-radius: 16px;
  padding: 28px 28px 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 4px 0 #0a1326, 0 20px 50px rgba(0, 0, 0, 0.4);
  animation: pop-in 0.2s ease;
}

.modal-dialog h2 {
  margin-top: 0;
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
}

/* Loading dialog */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 18, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fade-in 0.15s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.loading-dialog {
  background: linear-gradient(180deg, #1a2745 0%, #131f38 100%);
  border: 2px solid #2f4370;
  border-radius: 16px;
  padding: 32px 36px;
  width: 260px;
  max-width: 90vw;
  box-shadow: 0 4px 0 #0a1326, 0 20px 50px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: pop-in 0.2s ease;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid #2f4370;
  border-top-color: #4fb2ff;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#loading-text {
  font-size: 14px;
  color: #ffffff;
  font-weight: 800;
  text-align: center;
  margin: 0;
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #101b32;
  border: 1px solid #2f4370;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4fb2ff 0%, #0089e0 100%);
  border-radius: 4px;
}

@media (max-width: 480px) {
  #app {
    padding: 24px 20px 28px;
  }
}
