* {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  overscroll-behavior: none;
  -webkit-touch-callout: none;
  font-size: 16px;
  line-height: 1.5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #1e1e1e;
  color: #fafaf9;
}

#root {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.screen {
  display: none;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
}

.screen.active {
  display: flex;
}


.screen-loading {
  justify-content: center;
  align-items: center;
  padding: 2rem;
  font-size: 1.25rem;
  opacity: 0.6;
}

.screen-outside {
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: center;
  gap: 1.5rem;
}

.screen-outside img {
  border-radius: 16px;
}

.screen-outside p {
  color: #aaa;
  max-width: 300px;
}

.screen-outside a.btn {
  display: inline-block;
  padding: 1rem 1.5rem;
  background-color: #f8f9fa;
  color: #1e1e1e;
  border-radius: 8px;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
}

.screen-archive {
  padding: 0;
}

.archive-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
}

.artifact-card {
  background-color: #1a1a1a;
  border: 1px solid #2e2e2e;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.artifact-card .card-cover {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-size: cover;
  background-position: center;
  background-color: #111;
  flex-shrink: 0;
}

.artifact-card .card-body {
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1.1rem 1.1rem 1.1rem;
  gap: 0;
}

.artifact-card h2 {
  margin: 0 0 0.2rem 0;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
}

.artifact-card .card-subtitle {
  margin: 0 0 0.75rem 0;
  font-size: 0.85rem;
  opacity: 0.5;
}

.artifact-card .card-description {
  margin: 0 0 1rem 0;
  font-size: 0.85rem;
  opacity: 0.75;
  line-height: 1.6;
  white-space: pre-wrap;
}

.btn-unlock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.9rem 1.5rem;
  font-size: 1rem;
  font-weight: bold;
  font-family: monospace;
  color: #eee;
  background-color: #099268;
  border: 2px solid #38d9a944;
  border-radius: 8px;
  cursor: pointer;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2);
}

.btn-unlock:active {
  background-color: #12b886;
}

.btn-open {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.9rem 1.5rem;
  font-size: 1rem;
  font-weight: bold;
  font-family: monospace;
  color: #1e1e1e;
  background-color: #ffd43b;
  border: 2px solid #ffd43b88;
  border-radius: 8px;
  cursor: pointer;
}

.btn-open:active {
  background-color: #fcc419;
}

.archive-footer {
  text-align: center;
  padding: 1.5rem;
  opacity: 0.3;
  font-size: 0.9rem;
}

.screen-detail {
  padding: 0;
}

.detail-toolbar {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}

.btn-back, .btn-download {
  padding: 0.6rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid #555;
  cursor: pointer;
  font-family: monospace;
}

.btn-back {
  background-color: #333;
  color: #fafaf9;
}

.btn-download {
  background-color: #099268;
  color: #eee;
  border-color: #38d9a944;
  flex: 1;
}

.btn-download:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background-color: #555;
  border-color: #666;
}

.detail-preview-wrap {
  position: relative;
  width: 100%;
}

.detail-preview {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: #111;
}

.detail-preview-banner {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.72);
  color: #ffd43b;
  text-align: center;
  padding: 0.6rem 1rem;
  font-size: 0.8rem;
  font-family: monospace;
  letter-spacing: 0.2px;
  border-top: 1px solid #ffd43b44;
}

.detail-info {
  padding: 1.25rem 1.25rem 0.5rem 1.25rem;
}

.detail-info h2 {
  margin: 0;
  font-size: 1.5rem;
}

.detail-info p {
  margin: 0.25rem 0 0 0;
  opacity: 0.7;
}

.detail-downloadable {
  padding: 1rem 1.25rem 0.5rem 1.25rem;
  border-top: 1px solid #2a2a2a;
  margin-top: 1rem;
}

.detail-downloadable-heading {
  margin: 0 0 0.6rem 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.5;
  font-weight: 600;
}

.detail-downloadable-list {
  margin: 0;
  padding: 0 0 0 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.detail-downloadable-list li {
  font-size: 0.92rem;
  opacity: 0.85;
  line-height: 1.4;
}

.detail-bottom {
  padding: 1rem 1rem 1.5rem 1rem;
}

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

.overlay.active {
  display: flex;
}

.overlay-content {
  background: #2a2a2a;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  max-width: 320px;
  width: 90%;
}

.overlay-content h3 {
  margin: 0 0 0.5rem 0;
}

.overlay-content p {
  margin: 0 0 1.5rem 0;
  opacity: 0.7;
  font-size: 0.9rem;
}

.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid #555;
  border-top-color: #ffd43b;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fafaf9;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.toast.visible {
  opacity: 1;
}

.toast.error {
  background: #c92a2a;
}

.toast.success {
  background: #099268;
}

.testing-banner {
  background: #e67700;
  color: #fff;
  text-align: center;
  padding: 0.25rem;
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 0.5px;
}
