:root {
  --navy-950: #031d31;
  --navy-900: #063b67;
  --navy-800: #075481;
  --navy-700: #0b6b9d;
  --leaf-700: #177700;
  --leaf-600: #278e05;
  --leaf-400: #8ed700;
  --sun-500: #f49b13;
  --paper-100: #fff9df;
  --paper-200: #ffe9b5;
  --paper-300: #f7cf80;
  --wood-900: #4b250e;
  --wood-700: #7c4317;
  --ink: #2e1a0d;
  --muted: #6d5d50;
  --danger: #a72b22;
  --white: #fff;
  --shadow: 0 18px 50px rgba(1, 25, 43, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at 15% 20%, rgba(116, 208, 246, 0.22), transparent 28rem),
    linear-gradient(180deg, #e9f7ff 0, #f6fbf5 46%, #e9f3e6 100%);
}

body,
button,
input,
select {
  font: 16px/1.5 Arial, Helvetica, sans-serif;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid #b6f600;
  outline-offset: 3px;
}

.portal-body {
  min-height: 100vh;
}

.portal-header {
  position: sticky;
  z-index: 20;
  top: 0;
  color: var(--white);
  background: linear-gradient(90deg, var(--navy-900), var(--navy-800));
  box-shadow: 0 5px 18px rgba(0, 34, 58, 0.26);
}

.portal-nav-wrap {
  display: flex;
  width: min(1180px, calc(100% - 32px));
  min-height: 68px;
  align-items: center;
  gap: 24px;
  margin: 0 auto;
}

.brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  text-decoration: none;
}

.brand-logo img {
  display: block;
  width: 150px;
  height: 68px;
  object-fit: contain;
}

.portal-nav {
  display: flex;
  align-self: stretch;
}

.portal-nav a {
  position: relative;
  display: grid;
  min-width: 94px;
  padding: 0 18px;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: color 180ms ease, background 180ms ease;
}

.portal-nav a::after {
  position: absolute;
  right: 18px;
  bottom: 0;
  left: 18px;
  height: 4px;
  border-radius: 8px 8px 0 0;
  background: #b6f600;
  content: "";
  opacity: 0;
  transform: scaleX(.45);
  transition: opacity 180ms ease, transform 180ms ease;
}

.portal-nav a:hover,
.portal-nav a.active {
  color: #caff23;
  background: rgba(255, 255, 255, .05);
}

.portal-nav a:hover::after,
.portal-nav a.active::after {
  opacity: 1;
  transform: scaleX(1);
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.account-actions form {
  margin: 0;
}

.account-pill,
.logout-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, .44);
  border-radius: 99px;
  background: linear-gradient(#168769, #066141);
  box-shadow: inset 0 1px rgba(255, 255, 255, .28);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.account-pill svg {
  width: 16px;
  fill: currentColor;
}

.account-pill.active {
  border-color: #c8ff1d;
  box-shadow: 0 0 0 2px rgba(200, 255, 29, .18), inset 0 1px rgba(255, 255, 255, .28);
}

.logout-button {
  border-color: rgba(255, 255, 255, .16);
  background: rgba(1, 35, 58, .5);
}

.logout-button svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.portal-alert {
  position: fixed;
  z-index: 30;
  top: 82px;
  right: 20px;
  width: min(380px, calc(100% - 40px));
  padding: 13px 16px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 12px;
  box-shadow: var(--shadow);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  background: #1a7951;
  animation: slide-in 260ms ease-out;
}

.portal-alert.danger {
  background: #a4352e;
}

.portal-alert.warning {
  background: #9a6811;
}

.home-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  background: url("assets/hero-reference.png") center 42% / cover no-repeat;
}

.home-hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(180deg, #031d31 0, rgba(3, 29, 49, .99) 58px, rgba(3, 29, 49, .82) 112px, transparent 205px),
    linear-gradient(90deg, rgba(2, 25, 43, .94) 0%, rgba(2, 42, 68, .78) 48%, rgba(2, 27, 45, .46) 100%),
    linear-gradient(0deg, rgba(2, 25, 43, .76), transparent 55%);
  content: "";
}

.home-hero-inner {
  display: grid;
  width: min(1180px, calc(100% - 32px));
  min-height: 610px;
  align-items: center;
  grid-template-columns: minmax(0, 1.15fr) minmax(350px, .85fr);
  gap: clamp(36px, 7vw, 90px);
  margin: 0 auto;
  padding: 64px 0;
}

.home-hero-copy {
  max-width: 680px;
  text-shadow: 0 3px 18px rgba(0, 0, 0, .68);
}

.hero-game-logo {
  display: block;
  width: min(430px, 78%);
  height: auto;
  margin: 0 0 10px;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .38));
}

.home-hero .kicker {
  color: #c8ff1d;
}

.home-hero-copy h1 {
  margin: 10px 0 18px;
  font-size: clamp(42px, 6vw, 72px);
  line-height: .98;
  letter-spacing: -.035em;
  text-transform: uppercase;
}

.home-hero-copy > p {
  max-width: 610px;
  margin: 0;
  color: #eef8ff;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.6;
}

.hero-actions,
.account-quick-actions,
.community-actions,
.download-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.hero-actions {
  margin-top: 28px;
}

.hero-secondary {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border: 1px solid rgba(255, 255, 255, .68);
  border-radius: 99px;
  background: rgba(1, 32, 53, .32);
  color: #fff;
  font-weight: 900;
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition: border-color 180ms ease, background 180ms ease;
}

.hero-secondary:hover {
  border-color: #c8ff1d;
  background: rgba(1, 32, 53, .62);
}

.hero-secondary.dark {
  border-color: #9ab08f;
  background: #fff;
  color: #315529;
  backdrop-filter: none;
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin: 25px 0 0;
  padding: 0;
  color: #e6f4dc;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
}

.hero-trust span {
  color: #c8ff1d;
}

.auth-card {
  padding: clamp(26px, 4vw, 38px);
  border: 1px solid rgba(255, 255, 255, .66);
  border-radius: 22px;
  background: rgba(255, 251, 231, .96);
  box-shadow: 0 28px 70px rgba(0, 18, 31, .42), inset 0 1px rgba(255, 255, 255, .85);
  color: var(--ink);
  text-shadow: none;
  scroll-margin-top: 88px;
}

.auth-eyebrow {
  color: var(--leaf-700);
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: .18em;
}

.auth-card h2 {
  margin: 7px 0 6px;
  color: var(--wood-900);
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.15;
}

.auth-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.home-auth-form {
  display: grid;
  gap: 13px;
  margin-top: 22px;
}

.home-auth-form label {
  display: grid;
  gap: 6px;
  color: #5e3219;
  font-size: 12px;
  font-weight: 900;
}

.home-auth-form input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid #c9955d;
  border-radius: 10px;
  outline: 0;
  background: rgba(255, 255, 255, .88);
  color: #311a0d;
}

.home-auth-form input:focus {
  border-color: #328a0c;
  box-shadow: 0 0 0 3px rgba(59, 145, 12, .2);
}

.auth-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.home-auth-form .primary-button {
  width: 100%;
  border: 0;
}

.form-error {
  min-height: 0;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
}

.form-error:empty {
  display: none;
}

.auth-card .auth-switch {
  margin-top: 15px;
  text-align: center;
}

.auth-switch a {
  color: var(--leaf-700);
  font-weight: 900;
}

.account-quick-actions {
  margin-top: 24px;
}

.home-feature-strip {
  border-top: 1px solid rgba(255, 255, 255, .18);
  border-bottom: 1px solid #c7d8c2;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 10px 35px rgba(21, 65, 72, .09);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-link {
  display: flex;
  min-height: 112px;
  align-items: center;
  gap: 16px;
  padding: 22px 28px;
  border-right: 1px solid #dce7d9;
  text-decoration: none;
  transition: background 180ms ease;
}

.feature-link:last-child {
  border-right: 0;
}

.feature-link:hover {
  background: #f2faee;
}

.feature-icon {
  display: grid;
  width: 52px;
  flex: 0 0 52px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(145deg, #147bb1, #07507d);
  color: #fff;
  box-shadow: 0 8px 18px rgba(4, 59, 92, .22);
}

.feature-icon svg {
  width: 26px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.feature-link > span:last-child {
  display: grid;
  gap: 3px;
}

.feature-link b {
  color: var(--wood-900);
  font-size: 17px;
}

.feature-link small {
  color: var(--muted);
  font-size: 12px;
}

.community-section {
  padding: 64px 0;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(3, 29, 49, .97), rgba(7, 84, 129, .92)),
    url("assets/hero-reference.png") center 68% / cover;
}

.community-panel,
.download-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.community-panel > div:first-child,
.download-banner > div:first-child {
  max-width: 700px;
}

.community-panel .kicker {
  color: #c8ff1d;
}

.community-panel h2,
.download-banner h2 {
  margin: 8px 0 8px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
}

.community-panel p,
.download-banner p {
  margin: 0;
  color: #d5eafa;
}

.download-banner {
  margin-top: 68px;
  margin-bottom: 68px;
  padding: 34px 38px;
  border: 2px solid #b66d25;
  border-radius: 22px;
  background: linear-gradient(145deg, #fffbe2, #ffe6ad);
  box-shadow: var(--shadow);
}

.download-banner h2 {
  color: var(--wood-900);
  font-size: clamp(26px, 3.4vw, 38px);
}

.download-banner p {
  color: var(--muted);
}

.page-hero {
  position: relative;
  display: grid;
  min-height: 320px;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  background: url("assets/hero-reference.png") center 30% / cover no-repeat;
}

.page-hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(180deg, #031d31 0, rgba(3, 29, 49, .99) 54px, rgba(3, 29, 49, .8) 104px, transparent 180px),
    linear-gradient(90deg, rgba(2, 27, 45, .88), rgba(2, 43, 70, .55) 55%, rgba(2, 31, 51, .7)),
    linear-gradient(0deg, rgba(1, 29, 48, .72), transparent 65%);
  content: "";
}

.events-hero {
  background-position: center 19%;
}

.topup-hero {
  background-position: center 53%;
}

.support-hero {
  background-position: center 72%;
}

.account-hero {
  min-height: 280px;
  background-position: center 45%;
}

.page-hero-copy {
  width: min(1180px, calc(100% - 32px));
  text-shadow: 0 3px 14px rgba(0, 0, 0, .65);
}

.page-hero-copy h1 {
  max-width: 720px;
  margin: 8px 0 10px;
  font-size: clamp(38px, 6vw, 70px);
  line-height: .98;
  text-transform: uppercase;
}

.page-hero-copy p {
  max-width: 650px;
  margin: 0;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.55;
}

.kicker {
  color: #6a8a04;
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: .18em;
}

.page-hero .kicker {
  color: #c8ff1d;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.section-space {
  padding: 58px 0 74px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.section-heading h2,
.parchment-card h2,
.instruction-card h2,
.support-card h2,
.faq-section h2 {
  margin: 5px 0 0;
  color: var(--wood-900);
  font-size: clamp(24px, 3.2vw, 36px);
  line-height: 1.15;
}

.count-chip,
.unavailable-chip {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 13px;
  border: 1px solid #bdd3b6;
  border-radius: 99px;
  background: rgba(255, 255, 255, .72);
  color: #46683d;
  font-size: 13px;
  font-weight: 800;
}

.event-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.event-card {
  overflow: hidden;
  border: 1px solid rgba(123, 76, 28, .24);
  border-radius: 18px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 16px 40px rgba(21, 65, 72, .12);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.event-card:hover {
  box-shadow: 0 22px 48px rgba(21, 65, 72, .2);
  transform: translateY(-4px);
}

.event-thumb {
  position: relative;
  display: grid;
  min-height: 190px;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 194, 49, .76), transparent 28%),
    linear-gradient(135deg, #167db1, #0a4167);
}

.event-thumb img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.event-seal {
  position: relative;
  display: grid;
  width: 72px;
  aspect-ratio: 1;
  place-items: center;
  border: 4px solid rgba(255, 255, 255, .8);
  border-radius: 50%;
  background: rgba(167, 43, 34, .84);
  color: #fff;
  font-size: 31px;
  font-weight: 900;
  box-shadow: 0 8px 25px rgba(0, 0, 0, .26);
}

.event-card-body {
  padding: 20px 20px 22px;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 15px;
  color: #7a6d61;
  font-size: 12px;
  font-weight: 700;
}

.event-card h3 {
  margin: 10px 0 8px;
  color: var(--wood-900);
  font-size: 20px;
  line-height: 1.3;
}

.event-card h3 a {
  text-decoration: none;
}

.event-card p {
  display: -webkit-box;
  min-height: 48px;
  margin: 0 0 18px;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.text-link,
.back-link {
  color: var(--leaf-700);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.article-page {
  min-height: calc(100vh - 156px);
  padding: 50px 0 70px;
}

.article-shell {
  max-width: 900px;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
}

.article-card,
.parchment-card,
.instruction-card {
  border: 3px solid #b66d25;
  border-radius: 23px 14px 26px 16px;
  background:
    linear-gradient(145deg, rgba(255, 251, 226, .98), rgba(255, 230, 172, .98)),
    repeating-linear-gradient(0deg, transparent 0 7px, rgba(121, 71, 22, .05) 7px 8px);
  box-shadow: inset 0 0 30px rgba(190, 111, 28, .18), var(--shadow);
}

.article-card {
  padding: clamp(24px, 5vw, 54px);
}

.article-card h1 {
  margin: 8px 0 13px;
  color: var(--wood-900);
  font-size: clamp(31px, 5vw, 50px);
  line-height: 1.08;
}

.article-image {
  display: block;
  width: 100%;
  max-height: 480px;
  margin: 28px 0;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 10px 28px rgba(82, 47, 13, .25);
}

.article-content {
  color: #3e2c20;
  font-size: 17px;
  line-height: 1.75;
}

.article-content a {
  color: var(--leaf-700);
}

.article-content img {
  max-width: 100%;
}

.empty-state {
  padding: 48px 24px;
  border: 1px dashed #a6bda1;
  border-radius: 18px;
  background: rgba(255, 255, 255, .72);
  color: #5d6d59;
  text-align: center;
}

.empty-state strong {
  display: block;
  color: #34502f;
  font-size: 22px;
}

.empty-state p {
  margin: 8px 0 0;
}

.empty-state.compact {
  padding: 24px;
}

.error-state {
  border-color: #d8a29e;
  color: #78443f;
  background: #fff3f0;
}

.error-state strong {
  color: #8c2e26;
}

.login-gate {
  max-width: 620px;
  margin: 0 auto;
  padding: 42px;
  text-align: center;
}

.seal-icon {
  display: grid;
  width: 72px;
  margin: 0 auto 12px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: #a52d20;
  color: #fff;
  font-size: 30px;
  font-weight: 900;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .55), 0 8px 20px rgba(91, 37, 14, .25);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  border: 2px solid #615000;
  border-radius: 99px;
  background: linear-gradient(#4eb914, #147c04);
  box-shadow: inset 0 2px rgba(255, 255, 255, .34), 0 4px 9px rgba(66, 54, 0, .22);
  color: #fff;
  font-weight: 900;
  text-decoration: none;
  text-shadow: 0 1px 1px #164c00;
  transition: filter 180ms ease, transform 180ms ease;
}

.primary-button:hover,
.secondary-button:hover {
  filter: brightness(1.09);
  transform: translateY(-2px);
}

.payment-result {
  display: grid;
  grid-template-columns: 1.4fr .7fr;
  gap: 34px;
  margin-bottom: 30px;
  padding: 32px;
}

.payment-details {
  display: grid;
  gap: 10px;
  margin: 24px 0 0;
}

.payment-details > div {
  display: grid;
  grid-template-columns: 105px 1fr;
  gap: 14px;
}

.payment-details dt {
  color: #75614f;
  font-weight: 700;
}

.payment-details dd {
  margin: 0;
  font-weight: 800;
}

code {
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(95, 53, 16, .1);
  color: #572d10;
  font-family: Consolas, monospace;
  font-size: .9em;
}

.copy-button {
  min-height: 34px;
  margin-left: 6px;
  padding: 0 10px;
  border: 1px solid #a6763e;
  border-radius: 7px;
  background: #fff8e7;
  color: #663716;
  font-size: 12px;
  font-weight: 800;
}

.qr-panel {
  display: grid;
  place-items: center;
  padding: 12px;
  border: 2px dashed #c38d50;
  border-radius: 16px;
  background: rgba(255, 255, 255, .76);
}

.qr-panel img {
  width: min(100%, 280px);
  aspect-ratio: 1;
  object-fit: contain;
}

.topup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 26px;
}

.topup-grid > * {
  padding: 32px;
}

.portal-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.portal-form label {
  display: grid;
  gap: 7px;
  color: #5e3219;
  font-size: 13px;
  font-weight: 800;
}

.portal-form input,
.portal-form select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #c9955d;
  border-radius: 10px;
  outline: 0;
  background: rgba(255, 255, 255, .86);
  color: #311a0d;
}

.portal-form input:focus,
.portal-form select:focus {
  border-color: #328a0c;
  box-shadow: 0 0 0 3px rgba(59, 145, 12, .2);
}

.portal-form input:disabled {
  color: #5e5b50;
  background: rgba(235, 226, 202, .7);
}

.portal-form small {
  color: #756b5e;
  font-weight: 500;
}

.portal-form .primary-button {
  width: 100%;
}

.instruction-card {
  color: #453223;
  background: linear-gradient(145deg, #efffc9, #d6ed92);
  border-color: #6d8f17;
}

.instruction-card ol {
  display: grid;
  gap: 13px;
  padding-left: 22px;
}

.discount-note {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .55);
  color: #496a0a;
  font-weight: 800;
}

.history-section,
.faq-section {
  margin-top: 54px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #c8d6c4;
  border-radius: 16px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 13px 35px rgba(21, 65, 72, .09);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  white-space: nowrap;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid #e0e8dd;
  text-align: left;
}

th {
  color: #3e6035;
  background: #eff8ec;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.status-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 99px;
  color: #fff;
  background: #9b771b;
  font-size: 12px;
  font-weight: 800;
}

.status-badge.success { background: #218047; }
.status-badge.danger { background: #a7372e; }
.status-badge.muted { background: #6e7474; }

.server-notice {
  margin-bottom: 28px;
  padding: 18px 20px;
  border-left: 5px solid #ec9412;
  border-radius: 10px;
  background: #fff5d9;
  box-shadow: 0 10px 25px rgba(99, 65, 16, .08);
}

.server-notice p {
  margin: 5px 0 0;
}

.support-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.support-card {
  padding: 28px;
  border: 1px solid #c9d8c5;
  border-radius: 18px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 14px 35px rgba(21, 65, 72, .1);
}

.support-icon {
  display: grid;
  width: 50px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, #147bb1, #07507d);
  color: #fff;
  font-size: 21px;
  font-weight: 1000;
  box-shadow: inset 0 1px rgba(255, 255, 255, .35), 0 7px 16px rgba(4, 59, 92, .2);
}

.download-icon {
  width: 58px;
  font-size: 13px;
}

.support-card h2 {
  margin-top: 18px;
  font-size: 22px;
}

.support-card p {
  min-height: 48px;
  color: var(--muted);
}

.download-hub {
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 24px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(3, 29, 49, .98), rgba(7, 84, 129, .94)),
    url("assets/hero-reference.png") center 72% / cover;
  box-shadow: var(--shadow);
  scroll-margin-top: 88px;
}

.download-hub-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.download-hub-heading > div:first-child {
  max-width: 720px;
}

.download-hub .kicker {
  color: #c8ff1d;
}

.download-hub h2 {
  margin: 7px 0 10px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
}

.download-hub-heading p {
  margin: 0;
  color: #d5eafa;
}

.version-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.version-badges span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 99px;
  background: rgba(255, 255, 255, .1);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.patch-note {
  margin-top: 22px;
  padding: 14px 16px;
  border-left: 4px solid #c8ff1d;
  border-radius: 10px;
  background: rgba(255, 255, 255, .1);
}

.patch-note p {
  margin: 4px 0 0;
  color: #e5f1f8;
  font-size: 13px;
}

.download-platform-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.download-platform-card {
  display: flex;
  min-height: 285px;
  align-items: flex-start;
  flex-direction: column;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 17px;
  background: rgba(255, 255, 255, .95);
  color: var(--ink);
  box-shadow: 0 14px 30px rgba(0, 20, 34, .2);
  transition: border-color 180ms ease, transform 180ms ease;
}

.download-platform-card:hover {
  border-color: #c8ff1d;
  transform: translateY(-3px);
}

.download-platform-card.featured {
  border-color: #91c636;
  box-shadow: 0 14px 34px rgba(98, 153, 24, .22);
}

.platform-icon {
  display: grid;
  width: 52px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, #147bb1, #07507d);
  color: #fff;
}

.platform-icon svg {
  width: 29px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.download-platform-card:first-child .platform-icon,
.download-platform-card:nth-child(2) .platform-icon,
.download-platform-card:last-child .platform-icon {
  fill: currentColor;
}

.download-platform-card:first-child .platform-icon svg,
.download-platform-card:nth-child(2) .platform-icon svg,
.download-platform-card:last-child .platform-icon svg {
  fill: currentColor;
  stroke: none;
}

.platform-copy {
  flex: 1;
}

.platform-label {
  display: block;
  margin-top: 16px;
  color: var(--leaf-700);
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: .16em;
}

.platform-copy h3 {
  margin: 4px 0 7px;
  color: var(--wood-900);
  font-size: 20px;
}

.platform-copy p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.download-button {
  display: inline-flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #615000;
  border-radius: 99px;
  background: linear-gradient(#4eb914, #147c04);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  transition: filter 180ms ease;
}

.download-button:hover {
  filter: brightness(1.08);
}

.download-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.download-platform-card .unavailable-chip {
  width: 100%;
  justify-content: center;
}

.install-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, .2);
}

.install-guide > div {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.install-guide span {
  display: grid;
  width: 30px;
  flex: 0 0 30px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: #c8ff1d;
  color: #173209;
  font-size: 12px;
  font-weight: 1000;
}

.install-guide p {
  margin: 2px 0 0;
  color: #d5eafa;
  font-size: 12px;
}

.install-guide strong {
  color: #fff;
}

.support-channel-heading {
  margin-top: 56px;
}

.account-layout {
  display: grid;
  grid-template-columns: minmax(260px, .7fr) minmax(0, 1.3fr);
  gap: 26px;
  align-items: start;
}

.account-summary-card,
.settings-card {
  border: 1px solid #c9d8c5;
  border-radius: 20px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 16px 42px rgba(21, 65, 72, .11);
}

.account-summary-card {
  padding: 30px;
}

.account-avatar {
  display: grid;
  width: 72px;
  margin-bottom: 18px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 20px;
  background: linear-gradient(145deg, #147bb1, #07507d);
  color: #fff;
  box-shadow: 0 10px 24px rgba(4, 59, 92, .22);
}

.account-avatar svg {
  width: 36px;
  fill: currentColor;
}

.account-summary-card h2,
.settings-card h2 {
  margin: 6px 0 8px;
  color: var(--wood-900);
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.15;
}

.account-state {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  margin-bottom: 24px;
  padding: 0 11px;
  border-radius: 99px;
  background: #777;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.account-state.active {
  background: #218047;
}

.account-stats {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1px solid #e0e8dd;
}

.account-stats > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid #e0e8dd;
}

.account-stats dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.account-stats dd {
  margin: 0;
  color: #315529;
  font-weight: 900;
}

.character-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.character-list strong {
  width: 100%;
  color: var(--wood-900);
  font-size: 13px;
}

.character-list span {
  padding: 6px 10px;
  border: 1px solid #c7d8c2;
  border-radius: 8px;
  background: #f2faee;
  color: #46683d;
  font-size: 12px;
  font-weight: 800;
}

.account-db-note {
  color: var(--danger);
  font-size: 13px;
}

.account-settings {
  display: grid;
  gap: 20px;
}

.settings-card {
  padding: clamp(24px, 4vw, 36px);
}

.settings-card > p,
.logout-card p {
  margin: 0;
  color: var(--muted);
}

.password-form {
  max-width: 620px;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 70px;
}

.password-field button {
  position: absolute;
  top: 50%;
  right: 7px;
  min-width: 54px;
  min-height: 34px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  color: #315529;
  background: #e5f2df;
  font-size: 12px;
  font-weight: 900;
  transform: translateY(-50%);
}

.logout-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logout-card h2 {
  font-size: 24px;
}

.danger-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border: 1px solid #8f2a23;
  border-radius: 99px;
  background: #a7372e;
  color: #fff;
  font-weight: 900;
  transition: background 180ms ease;
}

.danger-button:hover {
  background: #88251e;
}

.danger-button svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.secondary-button {
  min-height: 42px;
  padding: 0 18px;
  border-width: 1px;
  font-size: 14px;
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-list details {
  overflow: hidden;
  border: 1px solid #cad7c6;
  border-radius: 13px;
  background: rgba(255, 255, 255, .88);
}

.faq-list summary {
  padding: 18px 20px;
  color: #3a2b20;
  cursor: pointer;
  font-weight: 900;
}

.faq-list details[open] summary {
  color: #2f6a20;
  background: #eff8e9;
}

.faq-list p {
  margin: 0;
  padding: 0 20px 20px;
  color: var(--muted);
}

.portal-footer {
  display: flex;
  min-height: 110px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px max(16px, calc((100% - 1180px) / 2));
  color: #d5eafa;
  background: var(--navy-950);
}

.portal-footer > div {
  display: grid;
  gap: 3px;
}

.portal-footer strong {
  color: #b9f500;
}

.portal-footer span {
  font-size: 13px;
}

.portal-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.portal-footer a {
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

@keyframes slide-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 860px) {
  .portal-nav-wrap {
    min-height: 60px;
    gap: 12px;
  }

  .brand-logo img {
    width: 130px;
    height: 60px;
  }

  .portal-nav {
    overflow-x: auto;
  }

  .portal-nav a {
    min-width: auto;
    padding: 0 12px;
    white-space: nowrap;
  }

  .portal-nav a::after {
    right: 12px;
    left: 12px;
  }

  .event-grid,
  .support-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .download-platform-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topup-grid,
  .payment-result,
  .account-layout {
    grid-template-columns: 1fr;
  }

  .home-hero-inner {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 54px 0;
  }

  .home-hero-copy {
    max-width: 760px;
  }

  .auth-card {
    max-width: 620px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .feature-link {
    min-height: 92px;
    border-right: 0;
    border-bottom: 1px solid #dce7d9;
  }

  .feature-link:last-child {
    border-bottom: 0;
  }

  .community-panel,
  .download-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .qr-panel {
    order: -1;
  }
}

@media (max-width: 600px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .portal-nav-wrap {
    width: 100%;
    min-height: 0;
    flex-wrap: wrap;
    gap: 0;
    padding: 0 10px;
  }

  .brand,
  .account-actions {
    min-height: 56px;
  }

  .account-actions {
    gap: 6px;
  }

  .brand-logo img {
    width: 126px;
    height: 58px;
  }

  .portal-nav {
    order: 3;
    width: calc(100% + 20px);
    min-height: 48px;
    margin: 0 -10px;
    overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, .12);
    background: rgba(2, 45, 75, .42);
  }

  .portal-nav a {
    min-width: 0;
    flex: 1 1 20%;
    padding: 0 5px;
    font-size: 11px;
    text-align: center;
    white-space: nowrap;
  }

  .portal-nav a::after {
    right: 7px;
    left: 7px;
  }

  .account-pill {
    width: 42px;
    padding: 0;
    font-size: 0;
  }

  .account-pill svg {
    width: 17px;
  }

  .logout-button {
    width: 42px;
    padding: 0;
  }

  .logout-button span {
    display: none;
  }

  .page-hero {
    min-height: 260px;
  }

  .page-hero-copy h1 {
    font-size: 38px;
  }

  .home-hero-inner {
    width: calc(100% - 24px);
    padding: 34px 0 40px;
  }

  .home-hero-copy h1 {
    font-size: clamp(34px, 10.5vw, 40px);
    line-height: 1.02;
  }

  .hero-game-logo {
    width: min(280px, 78%);
  }

  .auth-card,
  .download-hub {
    scroll-margin-top: 116px;
  }

  .hero-trust {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-card {
    width: 100%;
    padding: 24px 20px;
  }

  .auth-form-row {
    grid-template-columns: 1fr;
  }

  .hero-actions > *,
  .account-quick-actions > *,
  .community-actions > *,
  .download-actions > * {
    width: 100%;
  }

  .feature-link {
    padding: 18px 12px;
  }

  .community-section {
    padding: 46px 0;
  }

  .download-banner {
    margin-top: 46px;
    margin-bottom: 46px;
    padding: 26px 22px;
  }

  .section-space {
    padding: 40px 0 54px;
  }

  .event-grid,
  .support-grid {
    grid-template-columns: 1fr;
  }

  .download-hub-heading,
  .install-guide {
    grid-template-columns: 1fr;
  }

  .download-hub-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .version-badges {
    justify-content: flex-start;
  }

  .download-platform-grid {
    grid-template-columns: 1fr;
  }

  .download-platform-card {
    min-height: 0;
  }

  .section-heading {
    align-items: flex-start;
  }

  .count-chip {
    display: none;
  }

  .article-card,
  .topup-grid > *,
  .payment-result,
  .login-gate,
  .support-card {
    padding: 22px;
  }

  .payment-details > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .copy-button {
    margin: 7px 0 0;
  }

  .portal-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .logout-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .logout-card form,
  .danger-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
