/* =======================================================
   Plague — Clan Recruitment
   Design: "Wanted Poster" adrift on a stormy pirate sea.
   Palette:
     --ink        #0a0f1a  (night sea / page background)
     --ink-2      #101a2c  (secondary panel)
     --parchment  #ecdcae  (aged wanted-poster paper)
     --parchment-2#d9c393  (paper shadow / fold)
     --ember      #d6451f  (bounty stamp red-orange)
     --gold       #c9a227  (rope / trim / accents)
     --ink-text   #241a10  (text on parchment)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Aref+Ruqaa:wght@400;700&family=Cairo:wght@400;600;700;800&display=swap');

:root {
  --ink: #0a0f1a;
  --ink-2: #101a2c;
  --parchment: #ecdcae;
  --parchment-2: #d9c393;
  --ember: #d6451f;
  --ember-dark: #a4300f;
  --gold: #c9a227;
  --gold-light: #e6c65c;
  --ink-text: #2a1d10;
  --font-display: 'Aref Ruqaa', serif;
  --font-body: 'Cairo', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--parchment);
  background: var(--ink);
}

body {
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
}

/* ---------- Atmosphere: stormy sea backdrop ---------- */

.sea-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(214, 69, 31, 0.18), transparent 60%),
    linear-gradient(180deg, #060a12 0%, #0a0f1a 35%, #0d1626 70%, #0a121f 100%);
}

.sea-backdrop::before,
.sea-backdrop::after {
  content: "";
  position: absolute;
  left: -10%;
  width: 120%;
  height: 240px;
  background: repeating-linear-gradient(
    100deg,
    rgba(201, 162, 39, 0.05) 0px,
    rgba(201, 162, 39, 0.05) 2px,
    transparent 2px,
    transparent 40px
  );
  opacity: 0.5;
}

.sea-backdrop::before {
  bottom: 8%;
  transform: rotate(-1deg);
  animation: drift 22s linear infinite;
}

.sea-backdrop::after {
  bottom: -2%;
  transform: rotate(1deg);
  animation: drift 30s linear infinite reverse;
}

@keyframes drift {
  from { background-position-x: 0; }
  to   { background-position-x: 400px; }
}

.embers {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.embers span {
  position: absolute;
  bottom: -10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 8px 2px rgba(214, 69, 31, 0.7);
  opacity: 0;
  animation: rise 9s ease-in infinite;
}

.embers span:nth-child(1) { left: 8%;  animation-delay: 0s;   }
.embers span:nth-child(2) { left: 22%; animation-delay: 1.6s; }
.embers span:nth-child(3) { left: 38%; animation-delay: 3.1s; }
.embers span:nth-child(4) { left: 55%; animation-delay: 0.8s; }
.embers span:nth-child(5) { left: 70%; animation-delay: 4.2s; }
.embers span:nth-child(6) { left: 84%; animation-delay: 2.4s; }
.embers span:nth-child(7) { left: 93%; animation-delay: 5.5s; }

@keyframes rise {
  0%   { opacity: 0; transform: translateY(0) scale(0.6); }
  10%  { opacity: 0.9; }
  90%  { opacity: 0.5; }
  100% { opacity: 0; transform: translateY(-100vh) scale(1.4); }
}

/* ---------- Hero: the wanted poster ---------- */

.poster-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
}

.poster {
  position: relative;
  background:
    linear-gradient(160deg, rgba(0,0,0,0.05), transparent 40%),
    var(--parchment);
  color: var(--ink-text);
  padding: 46px 40px 38px;
  text-align: center;
  border-radius: 3px;
  box-shadow:
    0 30px 60px -20px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(201, 162, 39, 0.35),
    inset 0 0 60px rgba(120, 90, 30, 0.12);
  clip-path: polygon(
    0% 1.5%, 3% 0%, 97% 0.8%, 100% 2.2%,
    99.3% 30%, 100% 60%, 98.8% 98%, 96% 100%,
    60% 99%, 40% 100%, 4% 99.2%, 0% 96%,
    1.2% 55%, 0.4% 25%
  );
}

.poster::before {
  /* aged paper grain / stains */
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 20%, rgba(120, 90, 30, 0.18), transparent 22%),
    radial-gradient(circle at 88% 78%, rgba(120, 90, 30, 0.15), transparent 25%),
    radial-gradient(circle at 70% 10%, rgba(120, 90, 30, 0.10), transparent 20%);
  mix-blend-mode: multiply;
  pointer-events: none;
}

.poster-pin {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #6b6b6b, #2b2b2b 70%);
  box-shadow: 0 3px 4px rgba(0,0,0,0.5);
}
.poster-pin.tl { top: 10px; left: 14px; }
.poster-pin.tr { top: 10px; right: 14px; }

.poster-eyebrow {
  position: relative;
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: 3px;
  color: var(--ember-dark);
  border-top: 2px solid var(--ember-dark);
  border-bottom: 2px solid var(--ember-dark);
  padding: 5px 14px;
  margin-bottom: 18px;
}

.poster-title {
  position: relative;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(42px, 9vw, 60px);
  line-height: 1.05;
  margin: 0 0 6px;
  color: var(--ink-text);
  text-shadow: 0 1px 0 rgba(255,255,255,0.15);
}

.poster-title span {
  color: var(--ember);
}

.poster-sub {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  color: #4a3a22;
  max-width: 380px;
  margin: 0 auto 26px;
  line-height: 1.9;
}

.poster-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 0 24px;
  color: var(--gold);
}
.poster-divider::before,
.poster-divider::after {
  content: "";
  height: 1px;
  width: 60px;
  background: linear-gradient(90deg, transparent, var(--ember-dark), transparent);
}
.poster-divider i {
  font-size: 20px;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.2));
}

.bounty-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.bounty-chip {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--parchment);
  background: var(--ink-text);
  border-radius: 20px;
  padding: 7px 16px;
  letter-spacing: 0.3px;
  box-shadow: inset 0 0 0 1px rgba(201,162,39,0.5);
}

.fab-wrap {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.fab-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 24px;
  background: linear-gradient(160deg, var(--ember) 0%, var(--ember-dark) 100%);
  color: var(--parchment);
  box-shadow:
    0 10px 24px -8px rgba(166, 48, 15, 0.75),
    inset 0 0 0 2px rgba(255, 220, 180, 0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.fab-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow:
    0 14px 30px -8px rgba(166, 48, 15, 0.9),
    inset 0 0 0 2px rgba(255, 220, 180, 0.4);
}

.fab-btn.is-open { transform: rotate(45deg); }

.fab-panel {
  width: 230px;
  background: linear-gradient(180deg, #16233a, #0f1a2c);
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: 14px;
  padding: 16px 16px 14px;
  box-shadow: 0 20px 45px -14px rgba(0,0,0,0.65);
  animation: riseIn 0.22s cubic-bezier(.2,.8,.2,1);
}

.fab-title {
  margin: 0 0 12px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 13.5px;
  color: var(--gold-light);
  text-align: center;
}

.fab-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.fab-option {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  color: var(--parchment);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(201, 162, 39, 0.22);
  border-radius: 9px;
  padding: 9px 12px;
  text-align: right;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.fab-option:hover {
  background: rgba(255, 255, 255, 0.09);
  transform: translateX(-2px);
}

.fab-option.is-selected {
  background: rgba(214, 69, 31, 0.22);
  border-color: var(--ember);
  color: var(--gold-light);
}

.fab-enter {
  width: 100%;
  border: none;
  border-radius: 9px;
  padding: 11px 14px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  color: var(--parchment);
  background: linear-gradient(160deg, var(--ember), var(--ember-dark));
  box-shadow: 0 8px 18px -6px rgba(166,48,15,0.55);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.fab-enter:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.fab-enter:not(:disabled):hover { transform: translateY(-1px); }

@media (max-width: 480px) {
  .fab-wrap { right: 14px; bottom: 14px; }
  .fab-panel { width: 200px; }
}

.seal-btn {
  position: relative;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 17px;
  color: var(--parchment);
  background: linear-gradient(160deg, var(--ember) 0%, var(--ember-dark) 100%);
  border: none;
  border-radius: 999px;
  padding: 16px 42px;
  cursor: pointer;
  letter-spacing: 0.3px;
  box-shadow:
    0 10px 22px -8px rgba(166, 48, 15, 0.7),
    inset 0 0 0 2px rgba(255, 220, 180, 0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.seal-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 14px 28px -8px rgba(166, 48, 15, 0.85),
    inset 0 0 0 2px rgba(255, 220, 180, 0.4);
}

.seal-btn:active { transform: translateY(0) scale(0.98); }

.seal-btn:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--gold-light);
  outline-offset: 2px;
}

.poster-footnote {
  margin-top: 20px;
  font-size: 11.5px;
  color: #6b5836;
  letter-spacing: 0.5px;
}

/* ---------- Modal: the pirate dossier ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(4, 6, 12, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #16233a, #0f1a2c);
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: 14px;
  padding: 30px 28px 26px;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,0.7);
  animation: riseIn 0.3s cubic-bezier(.2,.8,.2,1);
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--gold-light);
  margin: 0;
}

.modal-x {
  background: transparent;
  border: none;
  color: var(--parchment);
  font-size: 20px;
  cursor: pointer;
  opacity: 0.6;
  line-height: 1;
  padding: 4px;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.modal-x:hover { opacity: 1; transform: rotate(90deg); }

.modal-sub {
  font-size: 13px;
  color: rgba(236, 220, 174, 0.65);
  margin: 0 0 24px;
  line-height: 1.7;
}

.field {
  margin-bottom: 18px;
  text-align: right;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 7px;
  letter-spacing: 0.2px;
}

.field input[type="text"],
.field input[type="number"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-bottom: 2px solid rgba(201, 162, 39, 0.45);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 14.5px;
  color: var(--parchment);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.field input::placeholder { color: rgba(236, 220, 174, 0.35); }

.field input[type="text"]:focus,
.field input[type="number"]:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.07);
  border-bottom-color: var(--ember);
}

.file-field {
  border: 1px dashed rgba(201, 162, 39, 0.4);
  border-radius: 10px;
  padding: 14px;
  background: rgba(255,255,255,0.02);
}

.file-field input[type="file"] {
  width: 100%;
  color: rgba(236, 220, 174, 0.75);
  font-family: var(--font-body);
  font-size: 12.5px;
}

.file-field input[type="file"]::file-selector-button {
  background: var(--gold);
  color: #241a10;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  margin-inline-end: 10px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.file-field input[type="file"]::file-selector-button:hover {
  background: var(--gold-light);
}

.field-hint {
  display: block;
  margin-top: 8px;
  font-size: 11.5px;
  color: rgba(236, 220, 174, 0.5);
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 26px;
}

.btn-submit,
.btn-cancel {
  flex: 1;
  border-radius: 9px;
  padding: 13px 16px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 14.5px;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn-submit {
  background: linear-gradient(160deg, var(--ember), var(--ember-dark));
  color: var(--parchment);
  box-shadow: 0 8px 18px -6px rgba(166,48,15,0.6);
}
.btn-submit:hover { transform: translateY(-1px); }

.btn-cancel {
  background: rgba(255,255,255,0.06);
  color: rgba(236,220,174,0.8);
  border: 1px solid rgba(201,162,39,0.25);
}
.btn-cancel:hover { background: rgba(255,255,255,0.1); }

.hidden { display: none !important; }

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
  .poster { padding: 36px 22px 30px; }
  .poster-title { font-size: 38px; }
  .modal-card { padding: 24px 18px 20px; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .sea-backdrop::before,
  .sea-backdrop::after,
  .embers span,
  .modal-overlay,
  .modal-card {
    animation: none !important;
  }
}
