* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Sukhumvit Set", "Noto Sans Thai", Tahoma, sans-serif;
  background: linear-gradient(180deg, #f5f7fb 0%, #e7ecf5 100%);
  color: #222;
  min-height: 100vh;
}

.screen {
  min-height: 100vh;
  padding: 16px;
  display: flex;
  justify-content: center;
}
.screen.center { align-items: center; }

.card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  padding: 24px 20px;
  width: 100%;
  max-width: 520px;
}

h1 { font-size: 22px; margin: 0 0 12px; }
h2 { font-size: 18px; margin: 12px 0; }
p { line-height: 1.55; }
.muted { color: #888; font-size: 14px; }
.error { color: #c0392b; }

.hello { margin: 0 0 16px; color: #555; }

.terms {
  background: #f7f9fc;
  border-radius: 12px;
  padding: 14px 18px;
  margin: 16px 0 20px;
  font-size: 14px;
}
.terms ol { padding-left: 20px; margin: 8px 0; }
.terms li { margin-bottom: 6px; }

.btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: transform .05s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: #06c755; color: #fff; }
.btn-ghost { background: #eef1f6; color: #444; }
.btn-copy { background: #2c7be5; color: #fff; }

.loader-box { text-align: center; }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid #ddd;
  border-top-color: #06c755;
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.poster-wrap {
  width: 100%;
  background: #f3f4f7;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  margin-bottom: 14px;
}
.poster-img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
}

.poster-preview {
  position: relative;
  width: 100%;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
}
.poster-img.blurred {
  filter: blur(14px);
  transform: scale(1.06);
  opacity: .85;
  pointer-events: none;
  user-select: none;
}
.preview-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.tap-hint {
  background: rgba(0,0,0,.78);
  color: #fff;
  padding: 16px 22px;
  border-radius: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 6px 18px rgba(0,0,0,.3);
}
.tap-icon { font-size: 30px; }
.tap-hint strong { font-size: 16px; }
.tap-hint small { font-size: 12px; opacity: .85; }

.fullscreen {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fullscreen.hidden { display: none; }
.fullscreen img {
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
  -webkit-touch-callout: default;
  -webkit-user-select: none;
  user-select: none;
}
.fs-close {
  position: fixed;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,.22);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  z-index: 2;
  backdrop-filter: blur(6px);
}
.fs-hint {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.78);
  font-size: 12px;
  background: rgba(0,0,0,.4);
  padding: 6px 12px;
  border-radius: 999px;
  z-index: 2;
  pointer-events: none;
}

.warn {
  margin-top: 14px;
  background: #fff8e6;
  border-left: 4px solid #f6c344;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
}
.warn p { margin: 0; }

.upload-btn {
  display: block;
  text-align: center;
  background: #06c755;
  color: #fff;
  padding: 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 14px;
}

.progress {
  text-align: center;
  margin-bottom: 12px;
  font-weight: 600;
  color: #333;
}
.progress #goodCount { color: #06c755; font-size: 20px; }

.upload-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  max-height: 320px;
  overflow-y: auto;
}
.upload-list .item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 4px;
  font-size: 13px;
  background: #f7f9fc;
}
.upload-list .item.good { background: #e8f8ed; }
.upload-list .item.bad { background: #fde9e9; }
.upload-list .idx {
  background: #fff;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
}
.upload-list .name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-list .status { font-size: 12px; }

.success-box {
  background: linear-gradient(135deg, #06c755 0%, #00a040 100%);
  color: #fff;
  border-radius: 14px;
  padding: 22px;
  text-align: center;
  margin-top: 18px;
}
.success-box h2 { margin: 0 0 14px; }
.success-box .muted { color: #d8f6e2; }
.code-box {
  background: rgba(255,255,255,.18);
  border: 2px dashed rgba(255,255,255,.45);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}
.code-box code {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
}

.error-box {
  background: #fde9e9;
  color: #b03a3a;
  padding: 14px;
  border-radius: 10px;
  margin-top: 14px;
  text-align: center;
  font-weight: 600;
}
