:root {
  --line: #ffffff1f;
  --text: #f7f2e8;
  --muted: #aab3c5;
  --gold: #d9ad5b;
  --teal: #5bc0d9;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Inter, sans-serif;
  background: radial-gradient(
    circle at 50% 0,
    #203452 0,
    #0b1220 38%,
    #050810 100%
  );
  min-height: 100vh;
}

body:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  pointer-events: none;
  opacity: 0.35;
  background:
    linear-gradient(#fff1 1px, transparent 1px),
    linear-gradient(90deg, #fff1 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(#000, transparent 78%);
}

nav {
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 6%;
  border-bottom: 1px solid var(--line);
  background: #050810d9;
  position: sticky;
  top: 0;
  z-index: 5;
}

.logo {
  font: 700 20px Cinzel;
  letter-spacing: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.logo:hover {
  opacity: 0.85;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 22px;
}

.org {
  font: 700 18px Cinzel;
  letter-spacing: 4px;
  color: var(--gold, #d9ad5b);
  user-select: none;
}

.tag {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted);
}

.hero {
  min-height: calc(100vh - 60px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 50px 20px;
  position: relative;
  overflow: hidden;
  background-image: url('water BG.png');
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, rgba(7, 11, 20, 0.5) 0%, rgba(5, 8, 16, 0.5) 100%);
  pointer-events: none;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 0, 0, 0.7);
}

.kicker {
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 4px;
}

.hero h1 {
  font: 800 clamp(36px, 6vw, 64px)/1.05 Cinzel;
  letter-spacing: 3px;
  margin: 16px 0;
}

.hero h1 em {
  font-style: normal;
  color: var(--gold);
}

.sub {
  font: 600 clamp(14px, 1.8vw, 19px) Cinzel;
  color: #d7dbe4;
}

.quote {
  max-width: 560px;
  margin: 20px auto 28px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d9ad5b99;
  border-radius: 8px;
  padding: 12px 22px;
  background: linear-gradient(135deg, #d9ad5b, #a87831);
  color: #080b11;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  text-decoration: none;
  text-shadow: none;
  transition: 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.section {
  max-width: 1240px;
  margin: auto;
  padding: 40px 6%;
  width: 100%;
}

#trials {
  min-height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  box-sizing: border-box;
  scroll-margin-top: 70px;
}

.head {
  text-align: center;
  margin-bottom: 12px;
  width: 100%;
  max-width: 700px;
}

.head h2 {
  font: 700 26px Cinzel;
  margin: 6px 0;
  margin-bottom: 0px;
}

.head p {
  color: var(--muted);
  font-size: 13.5px;
}

/* =========================
   GATES CONTAINER (CENTERED)
========================= */

.gates {
  width: 100%;
  max-width: 1140px;
  margin: 36px auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  justify-content: center;
  align-items: stretch;
}

/* =========================
   GATE CARD (ROUNDED & GPU ACCELERATED)
========================= */

.gate {
  position: relative;
  min-height: 480px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  border-radius: 26px;
  overflow: visible;
  background:
    linear-gradient(
      145deg,
      #8a6833 0%,
      #2a2015 12%,
      #10151f 35%,
      #141923 70%,
      #684d24 100%
    );
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(218, 171, 77, 0.35);
  transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.25s cubic-bezier(0.2, 0, 0, 1);
}

.gate:hover {
  transform: translateY(-5px);
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.8),
    0 0 24px rgba(218, 171, 77, 0.25);
}

.gate::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 26px;
  border: 1px solid rgba(218, 171, 77, 0.4);
  pointer-events: none;
}

/* Inner frame */
.gate-frame {
  position: relative;
  height: 100%;
  min-height: 468px;
  display: flex;
  flex-direction: column;
  overflow: visible;
  border-radius: 20px;
  background:
    linear-gradient(
      180deg,
      #131a25 0%,
      #0c121c 45%,
      #080d15 100%
    );
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.gate-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  opacity: 0.08;
  background-image:
    repeating-linear-gradient(
      115deg,
      transparent 0,
      transparent 18px,
      rgba(255, 255, 255, 0.1) 19px,
      transparent 20px
    );
  pointer-events: none;
}

.gate .gate-state {
  display: none;
  flex-direction: column;
  height: 100%;
  width: 100%;
  flex: 1;
}

.gate.locked .state-locked {
  display: flex;
}

.gate.active .state-unlocked,
.gate.unlocked .state-unlocked {
  display: flex;
}

.gate.active .state-locked,
.gate.unlocked .state-locked {
  display: none;
}

/* Portal (Decreased height and padded to center symbol) */
.gate-portal {
  position: relative;
  height: 155px;
  margin: 5px 5px 0;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 14px;
  box-sizing: border-box;
  background:
    radial-gradient(
      circle at center,
      #2c3d50 0%,
      #152230 35%,
      #0a121b 70%,
      #050910 100%
    );
  border-radius: 16px 16px 0 0;
  border: 2px solid #303d4a;
  box-shadow:
    inset 0 0 35px rgba(0, 0, 0, 0.9),
    inset 0 -15px 25px rgba(0, 0, 0, 0.8);
}

.gate-portal::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 12px 12px 0 0;
  border: 1px solid rgba(203, 161, 76, 0.4);
  box-shadow:
    inset 0 0 18px rgba(214, 170, 75, 0.12);
  pointer-events: none;
}

/* Portal Glow */
.portal-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(211, 164, 67, 0.35) 0%,
    rgba(211, 164, 67, 0.1) 45%,
    transparent 70%
  );
  pointer-events: none;
}

/* Portal Symbol (Centered and clean) */
.portal-symbol {
  position: relative;
  z-index: 2;
  font-size: 56px;
  color: #d7a84f;
  text-shadow:
    0 0 14px rgba(218, 169, 67, 0.6),
    0 0 32px rgba(218, 169, 67, 0.25);
  font-family: "Cinzel", serif;
  line-height: 1;
}

/* Floating Emblem (Sticking out at top of card) */
.gate-emblem {
  position: absolute;
  z-index: 20;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  width: 62px;
  height: 62px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  background:
    radial-gradient(
      circle,
      #202a35,
      #080d14
    );
  border: 3px solid #ad7e2d;
  box-shadow:
    0 0 0 3px #10151c,
    0 0 0 5px rgba(173, 126, 45, 0.65),
    0 8px 22px rgba(0, 0, 0, 0.9);
}

.gate-emblem span {
  font-size: 22px;
  filter: drop-shadow(0 0 6px rgba(226, 176, 74, 0.5));
}

/* Gate Content */
.gate-content {
  position: relative;
  padding: 16px 20px 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}

.gate-level {
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #d7a84f;
  margin-bottom: 6px;
}

.gate h2 {
  margin: 0;
  font-family: "Cinzel", serif;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #eee6d4;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 8px auto 12px;
  color: #bd8b35;
  font-size: 9px;
}

.ornament span {
  width: 45px;
  height: 1px;
  background:
    linear-gradient(
      90deg,
      transparent,
      #bd8b35
    );
}

.ornament span:last-child {
  background:
    linear-gradient(
      90deg,
      #bd8b35,
      transparent
    );
}

.gate p {
  margin: 0 auto;
  max-width: 340px;
  font-family: "Inter", sans-serif;
  font-size: 12.5px;
  line-height: 1.6;
  color: #9da8b7;
}

.gate-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 0;
}

.gate-stats div {
  position: relative;
}

.gate-stats div:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 4px;
  width: 1px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
}

.gate-stats strong {
  display: block;
  font-family: "Cinzel", serif;
  font-size: 16px;
  color: #d5a44c;
}

.gate-stats small {
  display: block;
  margin-top: 3px;
  font-size: 8px;
  letter-spacing: 1.5px;
  color: #77818f;
}

.gate-button {
  width: 100%;
  height: 46px;
  border-radius: 8px;
  border: 1px solid #bd8b35;
  background:
    linear-gradient(
      180deg,
      #d5a74e 0%,
      #9c6d25 100%
    );
  color: #080b10;
  font-family: "Cinzel", serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.5),
    inset 0 1px rgba(255, 255, 255, 0.3);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}

.gate-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.7),
    0 0 16px rgba(202, 156, 66, 0.25);
}

.gate-button span {
  margin-left: 8px;
}

.gate-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* =========================
   LOCKED GATES
========================= */

.locked {
  background:
    linear-gradient(
      145deg,
      #47515d 0%,
      #1a222c 12%,
      #0d131a 35%,
      #121820 70%,
      #3a434d 100%
    );
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(90, 110, 130, 0.3);
}

.locked:hover {
  transform: translateY(-5px);
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.8),
    0 0 20px rgba(90, 130, 160, 0.2);
}

.locked .gate-emblem {
  border-color: #53606e;
  box-shadow:
    0 0 0 4px #10151c,
    0 0 0 6px rgba(60, 75, 90, 0.6),
    0 8px 20px rgba(0, 0, 0, 0.8);
}

.locked .gate-level {
  color: #b48b42;
}

.locked .portal-glow {
  background: radial-gradient(
    circle,
    rgba(70, 130, 160, 0.3) 0%,
    rgba(70, 130, 160, 0.08) 45%,
    transparent 70%
  );
}

.locked .portal-symbol {
  color: #7595aa;
  text-shadow:
    0 0 14px rgba(80, 150, 180, 0.35);
}

.unlock-form {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-top: auto;
}

.unlock-msg {
  font-size: 11px;
  color: #f87171;
  min-height: 14px;
  margin-bottom: 4px;
  line-height: 1.3;
  word-break: break-word;
}

.unlock-box {
  position: relative;
  margin: 10px 0 8px;
}

.unlock-box input {
  width: 100%;
  height: 44px;
  box-sizing: border-box;
  padding: 0 40px 0 14px;
  background: #070b11;
  border: 1px solid #303945;
  border-radius: 8px;
  color: #ddd;
  outline: none;
  font-family: "Inter", sans-serif;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.unlock-box input::placeholder {
  color: #596473;
  text-transform: none;
  letter-spacing: normal;
}

.unlock-box input:focus {
  border-color: #a77b31;
  box-shadow: 0 0 14px rgba(184, 137, 51, 0.15);
}

.unlock-box span {
  position: absolute;
  right: 14px;
  top: 13px;
  color: #9a7a42;
  pointer-events: none;
}

.locked .gate-button {
  background:
    linear-gradient(
      180deg,
      #687685,
      #3c4652
    );
  border-color: #788593;
  color: #d9dee3;
}

/* =========================
   ACTIVE GLOW
========================= */

.active, .unlocked {
  transform: translateY(-4px);
}

.active .gate-frame, .unlocked .gate-frame {
  box-shadow:
    inset 0 0 35px rgba(190, 140, 45, 0.08);
}

.active .gate-portal, .unlocked .gate-portal {
  border-color: #b18435;
  background:
    radial-gradient(
      circle at center,
      #503e22 0%,
      #221d15 35%,
      #0d1117 75%
    );
}

.notice {
  width: 100%;
  max-width: 760px;
  margin: 24px auto 0;
  text-align: center;
  border: 1px dashed #d9ad5b55;
  border-radius: 12px;
  padding: 14px 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  box-sizing: border-box;
}

footer {
  text-align: center;
  padding: 20px 20px;
  border-top: 1px solid var(--line);
  color: #737c8d;
  font-size: 11px;
  letter-spacing: 1px;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20;
  place-items: center;
  background: #000b;
  backdrop-filter: blur(8px);
  padding: 20px;
}

.modal.show {
  display: grid;
}

.box {
  max-width: 500px;
  width: 100%;
  background: #0e1626;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 30px;
  box-shadow: 0 25px 90px #000;
}

.box h3 {
  font: 700 21px Cinzel;
  margin-top: 0;
}

.box p {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.secondary {
  background: transparent;
  color: var(--text);
  box-shadow: none;
}

@media (max-width: 990px) {
  .gates {
    grid-template-columns: 1fr;
    max-width: 440px;
  }

  .tag {
    display: none;
  }
}

/* =========================
   BRIGHTER THEME
   Lifts the home page out of near-black: a lighter ocean-blue backdrop, a clearer hero
   image, softer card shadows and higher-contrast text. Overrides the rules above.
========================= */

:root {
  --line: #ffffff2e;
  --text: #fffaf0;
  --muted: #d3dbea;
}

body {
  background:
    radial-gradient(circle at 50% 0, #4f86b8 0, #2a5784 34%, #17355a 72%, #112a4a 100%);
}

body:before { opacity: 0.22; }

/* nav {
  background: rgba(22, 52, 88, 0.72);
  border-bottom-color: rgba(255, 255, 255, 0.22);
} */

/* Hero: let the water photo show through; keep just enough shade under the text */
.hero::after {
  background:
    radial-gradient(ellipse at 50% 48%, rgba(8, 24, 48, 0.42) 0%, rgba(8, 24, 48, 0.12) 62%, rgba(8, 24, 48, 0) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(23, 53, 90, 0.5) 100%);
}
.hero-content { text-shadow: 0 2px 12px rgba(6, 18, 38, 0.75), 0 0 24px rgba(6, 18, 38, 0.45); }
.sub { color: #f1f4fa; }
.quote { color: #e6ecf6; }

.notice { border-color: rgba(240, 197, 112, 0.55); }
footer { color: #c3cde0; background: rgba(17, 42, 74, 0.5); }
.box { background: #1f3552; }

/* Hero bottom: fade the water photo into the page background instead of ending on a hard edge */
.hero {
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 60%, rgba(0, 0, 0, 0.55) 80%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 60%, rgba(0, 0, 0, 0.55) 80%, transparent 100%);
  padding-bottom: 110px;
}
