@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-1: #0a0e1a;
  --bg-2: #131a2e;
  --card: rgba(23, 27, 43, 0.72);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --accent: #7c6cf0;
  --accent-2: #4f9dff;
  --text: #eef0f8;
  --muted: #9aa1b8;
  --success: #34d399;
  --error: #f66565;
  --shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: 'Kanit', 'Inter', -apple-system, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 15%, rgba(124, 108, 240, 0.20), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(79, 157, 255, 0.16), transparent 45%),
    linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
}

.card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 34px 32px;
  box-shadow: var(--shadow);
  animation: rise .45s cubic-bezier(.2,.8,.2,1);
}
@keyframes rise { from { opacity:0; transform:translateY(14px);} to { opacity:1; transform:translateY(0);} }

h1 { font-size: 23px; font-weight: 600; margin: 0 0 4px; }
p.sub { color: var(--muted); margin: 0 0 26px; font-size: 14px; font-weight: 300; }

input[type=password], input[type=text] {
  width: 100%; padding: 13px 16px; border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(10,14,26,0.65); color: var(--text);
  font-family: inherit; font-size: 15px; margin-bottom: 12px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
input:focus {
  outline: none; border-color: var(--accent);
  background: rgba(10,14,26,0.9);
  box-shadow: 0 0 0 4px rgba(124,108,240,0.16);
}

button, .btn {
  width: 100%; padding: 13px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  background-size: 160% 160%; background-position: 0% 50%;
  color: white; font-family: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background-position .35s, transform .12s;
  display: block; text-align: center; text-decoration: none;
  box-shadow: 0 8px 20px -6px rgba(124,108,240,0.55);
}
button:hover, .btn:hover { background-position: 100% 50%; }
button:active, .btn:active { transform: scale(.985); }

.msg { margin-bottom: 16px; padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.msg.error { background: rgba(246,101,101,.1); color: var(--error); border: 1px solid rgba(246,101,101,.28); }
.msg.success { background: rgba(52,211,153,.1); color: var(--success); border: 1px solid rgba(52,211,153,.28); }

.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: 14px;
  padding: 32px 16px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .15s;
  background: rgba(255,255,255,0.015);
}
.dropzone:hover { transform: translateY(-1px); border-color: var(--accent); background: rgba(124,108,240,0.08); }
.dropzone.dragover { border-color: var(--accent); background: rgba(124,108,240,0.08); }
.dropzone svg { width: 38px; height: 38px; color: var(--muted); margin-bottom: 10px; flex-shrink: 0; }
.dropzone div { line-height: 1.5; }
.dropzone .filename { margin-top: 10px; font-size: 13px; color: var(--accent-2); font-weight: 500; word-break: break-all; }

.result { margin-top: 20px; padding: 16px; background: rgba(52,211,153,.06); border: 1px solid rgba(52,211,153,.25); border-radius: 14px; }
.result img { width: 100%; border-radius: 10px; margin-bottom: 12px; max-height: 240px; object-fit: contain; background: #000; }
.link-row { display: flex; gap: 8px; }
.link-row input { flex: 1; margin-bottom: 0; padding: 10px 12px; font-size: 13px; font-family: 'Inter', monospace; }
.link-row button.copy { width: auto; padding: 10px 18px; font-size: 13px; white-space: nowrap; }

.hint { color: var(--muted); font-size: 12px; margin-top: 14px; text-align: center; font-weight: 300; }

.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.topbar a { color: var(--muted); font-size: 13px; text-decoration: none; padding: 6px 12px; border-radius: 8px; transition: .15s; }
.topbar a:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin-top: 22px; }
.gallery a { display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); transition: transform .18s, border-color .18s, box-shadow .18s; }
.gallery a:hover { transform: translateY(-3px) scale(1.02); border-color: var(--border-strong); box-shadow: 0 10px 22px -8px rgba(0,0,0,.6); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.gallery a:hover img { transform: scale(1.06); }