*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0a0a0f;
  --surface: #13131a;
  --border: #2a2a3d;
  --accent: #e8ff47;
  --accent2: #ff4757;
  --accent3: #47c6ff;
  --text: #f0f0f5;
  --muted: #6b6b8a;
  --glow: rgba(232,255,71,0.15);
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Syne', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(232,255,71,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232,255,71,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 660px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Header */
.header { text-align: center; }
.header .tag {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  display: block;
}
.header h1 {
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.header h1 span { color: var(--accent); }

/* Search card */
.search-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
}
.search-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.6;
}
.field-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  display: block;
}
.input-row {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}
#linkId {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  color: var(--text);
  font-family: 'Space Mono', monospace;
  font-size: 1.1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#linkId:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); }
#linkId::placeholder { color: var(--muted); }
#checkBtn {
  background: var(--accent);
  color: #0a0a0f;
  border: none;
  border-radius: 10px;
  padding: 0.85rem 1.4rem;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 130px;
  justify-content: center;
}
#checkBtn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(232,255,71,0.3); }
#checkBtn:disabled { opacity: 0.7; cursor: not-allowed; }
.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(10,10,15,0.3);
  border-top-color: #0a0a0f;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hint {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.7;
}
.hint strong { color: var(--accent); font-weight: 400; }
#status {
  font-family: 'Space Mono', monospace;
  font-size: 0.78rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  display: none;
  align-items: center;
  gap: 0.6rem;
}
#status.searching { display: flex; background: rgba(232,255,71,0.07); color: var(--accent); border: 1px solid rgba(232,255,71,0.2); }
#status.error     { display: flex; background: rgba(255,71,87,0.08); color: var(--accent2); border: 1px solid rgba(255,71,87,0.2); }
#status.info      { display: flex; background: rgba(71,198,255,0.07); color: var(--accent3); border: 1px solid rgba(71,198,255,0.2); }

/* Unlock card */
#unlockCard {
  display: none;
  flex-direction: column;
  gap: 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  animation: slideUp 0.4s cubic-bezier(0.22,1,0.36,1);
}
#unlockCard::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent3), transparent);
  opacity: 0.6;
}
.unlock-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.id-badge {
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  color: var(--accent);
  background: rgba(232,255,71,0.08);
  border: 1px solid rgba(232,255,71,0.2);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  letter-spacing: 0.1em;
}
.unlock-title { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em; }
.unlock-sub {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.7;
}
.unlock-sub strong { color: var(--accent3); font-weight: 400; }
.steps { display: flex; flex-direction: column; gap: 0.6rem; }
.step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.5;
}
.step-num {
  min-width: 22px; height: 22px;
  background: var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; color: var(--text);
  flex-shrink: 0; margin-top: 1px;
}
.step.done .step-num { background: var(--accent); color: #0a0a0f; }
.step.done { color: var(--accent); }
#timerWrap { display: none; flex-direction: column; gap: 0.5rem; }
.timer-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.68rem; color: var(--muted);
  display: flex; justify-content: space-between;
}
.timer-label span { color: var(--accent3); }
.bar-bg { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
#timerBar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent3), var(--accent));
  border-radius: 99px;
  transition: width 1s linear;
}
#unlockBtn {
  background: var(--accent);
  color: #0a0a0f;
  border: none;
  border-radius: 10px;
  padding: 0.9rem 1.4rem;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
#unlockBtn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(232,255,71,0.3); }
#unlockBtn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Result card */
#resultCard {
  display: none;
  flex-direction: column;
  gap: 1.25rem;
  background: var(--surface);
  border: 1px solid rgba(232,255,71,0.25);
  border-radius: 16px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  animation: slideUp 0.4s cubic-bezier(0.22,1,0.36,1);
}
#resultCard::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.result-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.reset-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.reset-btn:hover { border-color: var(--accent2); color: var(--accent2); }

/* Link sections */
.section-title {
  font-family: 'Space Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.links-group { display: flex; flex-direction: column; gap: 0.5rem; }
.link-row {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: border-color 0.2s;
}
.link-row:hover { border-color: var(--accent3); }
.link-num {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  color: var(--muted);
  min-width: 20px;
  flex-shrink: 0;
}
.link-url {
  flex: 1;
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}
.link-url:hover { text-decoration: underline; }
.btn-open {
  background: transparent;
  border: 1px solid var(--accent3);
  border-radius: 7px;
  color: var(--accent3);
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.btn-open:hover { background: var(--accent3); color: #0a0a0f; }

.photo-row {
  background: var(--bg);
  border: 1px solid rgba(232,255,71,0.15);
  border-radius: 10px;
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: border-color 0.2s;
}
.photo-row:hover { border-color: var(--accent); }
.photo-icon {
  font-size: 0.9rem;
  flex-shrink: 0;
}
.photo-url {
  flex: 1;
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}
.photo-url:hover { text-decoration: underline; }
.btn-open-photo {
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 7px;
  color: var(--accent);
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.btn-open-photo:hover { background: var(--accent); color: #0a0a0f; }

.divider {
  height: 1px;
  background: var(--border);
  border: none;
  margin: 0.25rem 0;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dots::after {
  content: '';
  animation: dots 1.2s steps(4, end) infinite;
}
@keyframes dots {
  0%  { content: ''; }  25% { content: '.'; }
  50% { content: '..'; } 75% { content: '...'; }
}

/* Mobile floating circle */
.floating-circle {
  position: fixed;
  width: 50px; height: 50px;
  background: var(--accent);
  border-radius: 50%;
  z-index: 9999;
  cursor: grab;
  box-shadow: 0 4px 20px rgba(232,255,71,0.4);
  touch-action: none;
}
.floating-circle.locked { cursor: ns-resize; background: var(--accent3); }
