:root {
  --orange: #F14602;
  --orange-dim: rgba(241, 70, 2, 0.15);
  --text: #F0E3DE;
  --text-muted: rgba(255, 253, 251, 0.56);
  --bg-page: #121212;
  --bg-card: #191817;
  --bg-hover: #2A2927;
  --border: rgba(240, 227, 222, 0.13);
  --border-strong: rgba(240, 227, 222, 0.25);
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  --ease: cubic-bezier(0, 0, 0.2, 1);
  --ease-btn: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  background: var(--bg-page);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

main {
  margin: 0 auto;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.hero {
  text-align: center;
}

.title {
  font-size: 42px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 12px;
}

.title::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--orange);
  border-radius: 9999px;
  margin: 14px auto 0;
}

.tagline {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
}

.card {
  position: relative;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 28px;
}

.bracket {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  background: var(--bg-page);
}

.bracket-tl { top: -5px; left: -5px; }
.bracket-tr { top: -5px; right: -5px; }
.bracket-bl { bottom: -5px; left: -5px; }
.bracket-br { bottom: -5px; right: -5px; }

form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

input[type="text"] {
  width: 100%;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  outline: none;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}

input[type="text"]::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

input[type="text"]:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-dim);
}

.settings-row {
  display: flex;
  flex-direction: column;
}

.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--text-muted);
  pointer-events: none;
}

select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  cursor: pointer;
  outline: none;
  transition: border-color 150ms var(--ease);
}

select:hover {
  border-color: var(--border-strong);
}

select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-dim);
}

select option {
  background: var(--bg-card);
  color: var(--text);
}

#poke-btn {
  width: 100%;
  padding: 14px 24px;
  border-radius: 9999px;
  border: 1px solid var(--orange);
  background: var(--orange);
  color: white;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 160ms var(--ease-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

#poke-btn:hover {
  opacity: 0.92;
}

#poke-btn:active {
  transform: translateY(1px) scale(0.98);
}

#poke-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 600ms linear infinite;
}

#poke-btn.loading .btn-text {
  display: none;
}

#poke-btn.loading .btn-spinner {
  display: block;
}

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

.status {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  font-family: var(--font-mono);
}

.status::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  margin-right: 8px;
  vertical-align: middle;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.error {
  font-size: 14px;
  color: #ff6b6b;
  text-align: center;
  padding: 12px 16px;
  background: rgba(255, 107, 107, 0.08);
  border: 1px solid rgba(255, 107, 107, 0.15);
  border-radius: 8px;
}

.footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
}

@media (max-width: 480px) {
  .title { font-size: 34px; }
  .card { padding: 24px 20px; }
  main { padding: 16px; gap: 24px; }
}

/* ---------- Banner ---------- */
.banner {
  position: relative;
  z-index: 1;
  width: 100%;
  height: min(70vh, 640px);
  min-height: 440px;
  overflow: hidden;
  background: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  /* black video background melts into the page; silhouette stays white */
  mix-blend-mode: screen;
  opacity: 0.9;
}

.banner-fade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, transparent 55%, var(--bg-page) 100%),
    radial-gradient(ellipse at center, transparent 40%, rgba(18, 18, 18, 0.6) 100%);
  pointer-events: none;
}

.banner-title {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-family: 'Dela Gothic One', Impact, 'Arial Black', sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  line-height: 0.9;
  font-size: clamp(44px, 10vw, 118px);
  letter-spacing: 0.02em;
  transform: rotate(-6deg) skewX(-8deg);
  pointer-events: none;
  user-select: none;
  animation: title-float 5s ease-in-out infinite;
}

.banner-title .line {
  display: block;
  color: #fff;
  -webkit-text-stroke: 3px var(--bg-page);
  paint-order: stroke fill;
  text-shadow:
    5px 5px 0 var(--orange),
    9px 9px 0 var(--bg-page),
    0 0 40px rgba(241, 70, 2, 0.45);
  animation: title-in 700ms var(--ease) both;
}

.banner-title .l1 { animation-delay: 100ms; }
.banner-title .l2 { animation-delay: 220ms; margin-left: 0.6em; color: var(--orange); text-shadow: 5px 5px 0 #fff, 9px 9px 0 var(--bg-page), 0 0 40px rgba(241, 70, 2, 0.45); }
.banner-title .l3 { animation-delay: 340ms; margin-left: 0.2em; }

.banner-title .jp {
  position: absolute;
  top: -0.3em;
  right: -0.6em;
  writing-mode: vertical-rl;
  font-size: 0.28em;
  letter-spacing: 0.2em;
  color: var(--orange);
  text-shadow: none;
  padding: 0.3em 0.15em;
  border-left: 2px solid var(--orange);
}

@keyframes title-in {
  from { opacity: 0; transform: translateX(-60px) skewX(12deg); }
  to   { opacity: 1; transform: none; }
}

@keyframes title-float {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -10px; }
}

@media (prefers-reduced-motion: reduce) {
  .banner-title, .banner-title .line { animation: none; }
  .banner-video { display: none; }
}

main { padding-top: 0; padding-bottom: 48px; }

/* ---------- Banner tagline ---------- */
.banner-tagline {
  position: absolute;
  right: 5%;
  bottom: 40px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  text-align: right;
  transform: skewX(-8deg);
  font-family: 'Dela Gothic One', Impact, sans-serif;
  text-transform: uppercase;
  pointer-events: none;
  animation: title-in 700ms var(--ease) 500ms both;
}

.banner-tagline span {
  display: inline-block;
  padding: 4px 12px;
  line-height: 1.3;
}

.tag-top {
  background: #fff;
  color: var(--bg-page);
  font-size: clamp(10px, 1.8vw, 15px);
  letter-spacing: 0.04em;
  box-shadow: 4px 4px 0 var(--orange);
}

.tag-bottom {
  background: var(--orange);
  color: #fff;
  font-size: clamp(11px, 2vw, 16px);
  letter-spacing: 0.06em;
  box-shadow: 4px 4px 0 #fff;
}

/* ---------- Anime-flavoured form & footer ---------- */
.field-label,
.footer {
  font-family: 'Dela Gothic One', Impact, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 400;
}

.field-label { font-size: 12px; color: var(--text); }
.field-label::before { content: '▶ '; color: var(--orange); }

.card {
  border: 2px solid var(--text);
  border-radius: 4px;
  box-shadow: 6px 6px 0 var(--orange);
  position: relative;
  z-index: 3;
}

input[type="text"], select { border-radius: 2px; border-width: 2px; }

#poke-btn {
  border-radius: 2px;
  border: 2px solid var(--text);
  font-family: 'Dela Gothic One', Impact, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  transform: skewX(-8deg);
  box-shadow: 4px 4px 0 var(--text);
  transition: transform 120ms var(--ease-btn), box-shadow 120ms var(--ease-btn);
}
#poke-btn:hover { opacity: 1; transform: skewX(-8deg) translate(-2px, -2px); box-shadow: 6px 6px 0 var(--text); }
#poke-btn:active { transform: skewX(-8deg) translate(3px, 3px); box-shadow: 1px 1px 0 var(--text); }

.status { font-family: var(--font-mono); }
.footer { font-size: 11px; color: var(--text-muted); }

@media (max-width: 640px) {
  .banner { align-items: flex-start; padding-top: 40px; }
  .banner-tagline { right: 50%; translate: 50% 0; align-items: center; text-align: center; bottom: 20px; }
}

/* ---------- Button word cycle: 3s each, slash-wipe transition ---------- */
.btn-text {
  display: grid;
  overflow: hidden;
  padding: 0 6px;
}
.btn-text .word {
  grid-area: 1 / 1;
  text-align: center;
  clip-path: polygon(-20% 0, -20% 0, -20% 100%, -20% 100%);
  animation-duration: 6s;
  animation-iteration-count: infinite;
  animation-timing-function: cubic-bezier(0.7, 0, 0.2, 1);
}
.btn-text .w-a { animation-name: word-a; }
.btn-text .w-b { animation-name: word-b; }

@keyframes word-a {
  0%       { clip-path: polygon(-20% 0, -20% 0, -40% 100%, -40% 100%); transform: translateX(-14px) skewX(-12deg); }
  5%, 45%  { clip-path: polygon(-20% 0, 130% 0, 130% 100%, -40% 100%); transform: none; }
  50%,100% { clip-path: polygon(130% 0, 130% 0, 130% 100%, 130% 100%); transform: translateX(14px) skewX(-12deg); }
}
@keyframes word-b {
  0%, 50%  { clip-path: polygon(-20% 0, -20% 0, -40% 100%, -40% 100%); transform: translateX(-14px) skewX(-12deg); }
  55%, 95% { clip-path: polygon(-20% 0, 130% 0, 130% 100%, -40% 100%); transform: none; }
  100%     { clip-path: polygon(130% 0, 130% 0, 130% 100%, 130% 100%); transform: translateX(14px) skewX(-12deg); }
}

/* impact flash on the button at each swap */
#poke-btn { position: relative; overflow: hidden; }
#poke-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 40%, rgba(255,255,255,0.85) 50%, transparent 60%);
  transform: translateX(-120%);
  animation: slash 3s infinite;
  pointer-events: none;
}
@keyframes slash {
  0%, 82% { transform: translateX(-120%); }
  100%    { transform: translateX(120%); }
}

@media (prefers-reduced-motion: reduce) {
  .btn-text .word, #poke-btn::after { animation: none; }
  .btn-text .w-a { clip-path: none; }
}

.btn-text .w-a, .btn-text .w-b { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.btn-text .jp-word { font-size: 1.05em; }
.btn-text .romaji { font-size: 10px; letter-spacing: 0.1em; opacity: 0.85; text-transform: none; margin-top: 2px; }

/* ---------- Footer ---------- */
.footer {
  width: 100%;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding-top: 20px;
  border-top: 2px solid var(--border);
  text-align: center;
  font-size: 11px;
  line-height: 1.6;
}
.footer .sep {
  width: 28px;
  height: 4px;
  background: var(--orange);
  transform: skewX(-30deg);
}
.footer a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 2px solid var(--orange);
  transition: color 120ms var(--ease), background 120ms var(--ease);
}
.footer a:hover { background: var(--orange); color: #fff; }

/* ---------- Capacity / slots ---------- */
.capacity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 16px;
  text-align: center;
  font-size: 14px;
  border: 2px solid var(--orange);
  background: var(--orange-dim);
  border-radius: 2px;
}
.capacity[hidden] { display: none; }
.deploy-link img { display: block; height: 32px; }

.slots {
  font-family: 'Dela Gothic One', Impact, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  color: var(--text-muted);
}
.slots[hidden] { display: none; }
.slots.full { color: var(--orange); }
