:root {
  /* メタリックゴールド(黒金デザイン) */
  --gold-1: #f9edb0;
  --gold-2: #e6c65c;
  --gold-3: #c9962f;
  --gold-4: #a9791f;
  --gold-line: rgba(224, 196, 108, 0.45);
  --gold-glow: rgba(224, 196, 108, 0.35);

  --farpen-yellow: #e6c65c;
  --farpen-yellow-soft: #f9edb0;
  --farpen-black: #000000;
  --farpen-blue: #0b2545;
  --farpen-blue-light: #13386b;

  --bg-0: #000000;
  --bg-1: #0b0c10;
  --card-bg: rgba(15, 16, 20, 0.66);
  --card-border: rgba(255, 255, 255, 0.07);
  --text: #eaf0fb;
  --text-sub: #9fb0cc;
  --text-dim: #6c7d9c;
  --danger: #ff5d6c;
  --success: #35d07f;

  --radius: 18px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.75);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(760px 420px at 50% -14%, rgba(224, 196, 108, 0.12), transparent 60%),
    linear-gradient(180deg, #0a0a0b 0%, #000000 70%);
  -webkit-font-smoothing: antialiased;
}

/* 黒金デザインの金色の曲線装飾 */
body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  border: 1px solid var(--gold-line);
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: 150vw;
  height: 150vw;
  top: -95vw;
  right: -55vw;
}

body::after {
  width: 120vw;
  height: 120vw;
  bottom: -85vw;
  left: -60vw;
  border-color: rgba(224, 196, 108, 0.22);
}

header,
main,
footer {
  position: relative;
  z-index: 1;
}

/* ---------- Header ---------- */
header {
  padding: 34px 20px 10px;
  text-align: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand .logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--gold-1), var(--gold-3));
  border: 1px solid rgba(249, 237, 176, 0.5);
  display: grid;
  place-items: center;
  font-size: 20px;
  box-shadow: 0 8px 22px -6px rgba(224, 196, 108, 0.55);
}

header h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

header h1 .accent {
  background: linear-gradient(100deg, var(--gold-1), var(--gold-2) 45%, var(--gold-3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.tagline {
  margin: 10px 0 0;
  color: var(--text-sub);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
}

/* ---------- Layout ---------- */
main {
  max-width: 620px;
  margin: 0 auto;
  padding: 24px 18px 72px;
}

.card {
  background: linear-gradient(180deg, rgba(24, 21, 14, 0.72), rgba(12, 11, 8, 0.72));
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(249, 237, 176, 0.06);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* ---------- Drop zone ---------- */
#drop-zone {
  position: relative;
  border: 1.5px dashed var(--gold-line);
  border-radius: 14px;
  padding: 44px 18px;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  background: rgba(224, 196, 108, 0.02);
}

#drop-zone:hover {
  border-color: var(--gold-2);
  background: rgba(224, 196, 108, 0.05);
}

#drop-zone.dragover {
  border-color: var(--gold-1);
  background: rgba(224, 196, 108, 0.1);
  transform: scale(1.01);
}

#drop-zone .icon {
  font-size: 2.6rem;
  filter: drop-shadow(0 6px 14px rgba(224, 196, 108, 0.4));
}

#drop-zone .dz-title {
  margin: 12px 0 4px;
  font-weight: 700;
  font-size: 1.05rem;
}

#drop-zone p {
  margin: 4px 0;
  color: var(--text-sub);
  font-size: 0.9rem;
}

#drop-zone .notice {
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-top: 10px;
}

#file-input {
  display: none;
}

/* ---------- HP gauge ---------- */
.hp-card {
  padding: 18px 20px;
}

.hp-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.hp-label {
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.hp-tag {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--farpen-black);
  background: var(--farpen-yellow);
  padding: 1px 7px;
  border-radius: 6px;
  margin-left: 4px;
  vertical-align: middle;
}

.hp-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-sub);
  font-variant-numeric: tabular-nums;
}

.hp-bar {
  position: relative;
  height: 22px;
  border-radius: 8px;
  background: #05070c;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.7);
}

.hp-fill {
  height: 100%;
  width: 100%;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-3));
  box-shadow: 0 0 14px rgba(224, 196, 108, 0.6);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1), background 0.4s, box-shadow 0.4s;
}

/* RPG風のセグメント目盛りを重ねる */
.hp-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.35) 0,
    rgba(0, 0, 0, 0.35) 1px,
    transparent 1px,
    transparent 24px
  );
  pointer-events: none;
}

.hp-fill.low {
  background: linear-gradient(180deg, #ffb347, #e07d0e);
  box-shadow: 0 0 14px rgba(240, 140, 20, 0.5);
}

.hp-fill.critical {
  background: linear-gradient(180deg, #ff6b78, #e23140);
  box-shadow: 0 0 16px rgba(226, 49, 64, 0.6);
  animation: hp-pulse 1s ease-in-out infinite;
}

@keyframes hp-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.hp-note {
  margin: 10px 0 0;
  font-size: 0.76rem;
  color: var(--text-dim);
}

.hp-note.limit {
  color: var(--danger);
  font-weight: 700;
}

/* ---------- File list ---------- */
.file-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
}

.file-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  gap: 12px;
}

.file-list li:last-child {
  border-bottom: none;
}

.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
  font-weight: 500;
}

.file-size {
  color: var(--text-dim);
  font-size: 0.8rem;
  white-space: nowrap;
}

.progress-bar-track {
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--farpen-yellow), var(--farpen-yellow-soft));
  transition: width 0.25s ease;
}

.progress-bar-fill.done {
  background: linear-gradient(90deg, var(--success), #6ee7a8);
}

.progress-bar-fill.error {
  background: linear-gradient(90deg, var(--danger), #ff8a95);
}

/* ---------- Buttons ---------- */
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(145deg, var(--gold-1) 0%, var(--gold-2) 45%, var(--gold-3) 100%);
  color: #241a02;
  border: 1px solid rgba(249, 237, 176, 0.55);
  border-radius: 12px;
  padding: 14px 22px;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 10px 24px -10px rgba(224, 196, 108, 0.65);
}

button:hover,
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -12px rgba(224, 196, 108, 0.8);
}

button:active,
.btn:active {
  transform: translateY(0);
}

button:disabled {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-dim);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  box-shadow: none;
  border: 1px solid var(--card-border);
}

.btn.secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

#upload-btn {
  width: 100%;
  margin-top: 20px;
  padding: 16px;
  font-size: 1.05rem;
}

/* ---------- Result ---------- */
#result {
  display: none;
  animation: rise 0.35s ease;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  margin: 0 0 6px;
}

.result-head .check {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--success);
  color: #04220f;
  display: grid;
  place-items: center;
  font-size: 15px;
}

#share-url-box {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

#share-url {
  flex: 1;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
}

#copy-btn {
  padding: 13px 18px;
  white-space: nowrap;
}

.notice {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 12px;
}

.error-box {
  color: var(--danger);
  font-size: 0.88rem;
  margin-top: 12px;
}

/* ---------- Share page ---------- */
.share-file-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.share-file-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.share-file-list li:last-child {
  border-bottom: none;
}

.share-file-list .btn {
  padding: 11px 18px;
  font-size: 0.9rem;
}

.save-all-btn {
  width: 100%;
  margin-bottom: 16px;
  padding: 15px;
  font-size: 1.02rem;
}

.expire-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 212, 0, 0.08);
  border: 1px solid rgba(255, 212, 0, 0.25);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.82rem;
  color: var(--farpen-yellow-soft);
  margin-bottom: 18px;
}

footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.75rem;
  padding: 0 20px 30px;
  letter-spacing: 0.04em;
}

/* ---------- Admin ---------- */
.admin-zone {
  text-align: center;
  margin-top: 6px;
}

.admin-btn {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid rgba(255, 93, 108, 0.35);
  box-shadow: none;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 0.8rem;
  font-weight: 600;
}

.admin-btn:hover {
  background: rgba(255, 93, 108, 0.12);
  color: var(--danger);
  border-color: var(--danger);
  transform: none;
  box-shadow: none;
}

.admin-btn:disabled {
  opacity: 0.5;
}
