/* ============================================================
   Chaos Academy Web Store — Enhanced Gaming Theme
   ============================================================ */

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

:root {
  --bg:          #07070d;
  --bg-card:     rgba(17, 17, 30, 0.82);
  --bg-card-h:   rgba(25, 25, 42, 0.95);
  --bg-overlay:  rgba(6, 6, 14, 0.88);
  --gold:        #f5c538;
  --gold-glow:   rgba(245, 197, 56, 0.35);
  --gold-dim:    rgba(245, 197, 56, 0.12);
  --cyan:        #00f0ff;
  --cyan-glow:   rgba(0, 240, 255, 0.4);
  --cyan-dim:    rgba(0, 240, 255, 0.12);
  --purple:      #a259ff;
  --purple-glow: rgba(162, 89, 255, 0.4);
  --red:         #ff3366;
  --text:        #f0f0ff;
  --text-sub:    #8e8ea8;
  --border:      rgba(255, 255, 255, 0.08);
  --border-h:    rgba(0, 240, 255, 0.35);
  --radius:      18px;
  --radius-sm:   10px;
  --shadow:      0 12px 40px rgba(0, 0, 0, 0.7);
  --transition:  0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Hiragino Sans', 'Noto Sans JP', 'Yu Gothic', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ── Cyber Background Graphic ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: 
    radial-gradient(ellipse at 50% 10%, rgba(162, 89, 255, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 60%, rgba(0, 240, 255, 0.08) 0%, transparent 50%),
    linear-gradient(to bottom, rgba(7, 7, 13, 0.85), rgba(7, 7, 13, 0.96)),
    url('images/bg_battle.png');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  opacity: 0.35;
  pointer-events: none;
  z-index: -1;
}

/* ── Layout ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Header ── */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(8, 8, 16, 0.85);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  padding-bottom: 10px;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.header-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.header-title-box {
  display: flex;
  flex-direction: column;
}
.header-logo {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: .05em;
  color: var(--gold);
  line-height: 1.2;
}
.header-sub {
  font-size: .72rem;
  color: var(--text-sub);
  letter-spacing: .04em;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-link-btn {
  font-size: .8rem;
  font-weight: 700;
  color: var(--cyan);
  background: var(--cyan-dim);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 8px;
  padding: 6px 14px;
  text-decoration: none;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.header-link-btn:hover {
  background: rgba(0, 240, 255, 0.22);
  border-color: var(--cyan);
  box-shadow: 0 0 12px var(--cyan-glow);
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 48px 20px 32px;
  position: relative;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.25);
  margin-bottom: 16px;
}
.hero-logo-img {
  max-width: 380px;
  width: 90%;
  height: auto;
  margin: 0 auto 12px;
  display: block;
  filter: drop-shadow(0 0 32px rgba(245, 197, 56, 0.35));
  animation: floatLogo 4s ease-in-out infinite;
}
@keyframes floatLogo {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.hero p {
  font-size: 1rem;
  color: var(--text-sub);
  max-width: 580px;
  margin: 0 auto 24px;
  line-height: 1.7;
}

/* ── Hero Visual Banner ── */
.hero-visual-frame {
  max-width: 960px;
  margin: 0 auto 36px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow), 0 0 40px rgba(0, 0, 0, 0.8);
  position: relative;
}
.hero-visual-img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 360px;
  object-fit: cover;
  object-position: center;
  filter: brightness(0.92) contrast(1.05);
}
.hero-visual-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(7,7,13,0.95) 0%, rgba(7,7,13,0.2) 50%, transparent 100%);
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  padding: 24px;
}
.hero-visual-caption {
  font-size: .85rem;
  color: #fff;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

/* ── Category Label ── */
.category-label {
  font-size: .85rem;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--text);
  padding: 32px 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.category-label span {
  font-size: .7rem;
  font-weight: 600;
  color: var(--text-sub);
  margin-left: auto;
}

/* ── Product Grid ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
  padding-bottom: 20px;
}

/* ── Featured Pass Card (Hero style card) ── */
.product-card.pass-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 320px 1fr;
  padding: 0;
  background: linear-gradient(135deg, rgba(20, 25, 45, 0.95), rgba(10, 15, 30, 0.95));
  border: 1px solid rgba(0, 240, 255, 0.25);
  box-shadow: 0 12px 36px rgba(0, 240, 255, 0.12);
  align-items: center;
}
@media (max-width: 768px) {
  .product-card.pass-card {
    grid-template-columns: 1fr;
  }
}
.pass-card-img-wrap {
  width: 100%;
  height: 100%;
  min-height: 200px;
  overflow: hidden;
  position: relative;
}
.pass-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.product-card.pass-card:hover .pass-card-img {
  transform: scale(1.05);
}
.pass-card-body {
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Standard Product Card ── */
.product-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.product-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, var(--cyan-dim) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}
.product-card:hover {
  border-color: var(--border-h);
  background: var(--bg-card-h);
  transform: translateY(-4px);
  box-shadow: var(--shadow), 0 0 24px rgba(0, 240, 255, 0.15);
}
.product-card:hover::before { opacity: 1; }

.product-card.title-card {
  background: linear-gradient(135deg, rgba(22, 16, 35, 0.85), rgba(15, 12, 25, 0.9));
}
.product-card.title-card::before {
  background: radial-gradient(ellipse at 50% 0%, var(--purple-glow) 0%, transparent 70%);
  opacity: 0.1;
}
.product-card.title-card:hover {
  border-color: rgba(162, 89, 255, 0.4);
  box-shadow: var(--shadow), 0 0 24px rgba(162, 89, 255, 0.2);
}

.card-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--gold);
  color: #111;
  box-shadow: 0 0 10px var(--gold-glow);
}
.card-badge.limited { background: var(--purple); color: #fff; box-shadow: 0 0 10px var(--purple-glow); }
.card-badge.super   { background: var(--red); color: #fff; box-shadow: 0 0 10px rgba(255,51,102,0.4); }
.card-badge.popular { background: var(--cyan); color: #07070d; box-shadow: 0 0 10px var(--cyan-glow); }

.card-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}
.title-card .card-icon-wrap {
  background: rgba(162, 89, 255, 0.1);
  border-color: rgba(162, 89, 255, 0.25);
}

.card-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}

.card-desc {
  font-size: .84rem;
  color: var(--text-sub);
  flex: 1;
  line-height: 1.5;
}

.card-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 4px;
}
.card-price {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: .02em;
  text-shadow: 0 0 12px var(--gold-glow);
}
.card-price small {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-sub);
  margin-left: 4px;
}

.btn-buy {
  margin-top: 4px;
  width: 100%;
  padding: 13px 0;
  border-radius: var(--radius-sm);
  border: none;
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: .06em;
  cursor: pointer;
  background: linear-gradient(135deg, #00c8e8, #0088ff);
  color: #fff;
  transition: all var(--transition);
  box-shadow: 0 6px 20px rgba(0, 144, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-buy:hover  {
  opacity: .92;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 144, 255, 0.55);
}
.btn-buy:active { transform: translateY(0); }
.btn-buy:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.title-card .btn-buy {
  background: linear-gradient(135deg, #a259ff, #6c5ce7);
  box-shadow: 0 6px 20px rgba(162, 89, 255, 0.35);
}
.title-card .btn-buy:hover {
  box-shadow: 0 8px 24px rgba(162, 89, 255, 0.55);
}

/* ── Loading Overlay ── */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  z-index: 999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
}
.loading-overlay.active { display: flex; }
.spinner {
  width: 54px;
  height: 54px;
  border: 4px solid rgba(0, 240, 255, 0.15);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin .75s linear infinite;
  box-shadow: 0 0 20px var(--cyan-glow);
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: var(--text); font-size: .95rem; font-weight: 700; }

/* ── Toast ── */
.toast {
  display: none;
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: #181828;
  border: 1px solid var(--border-h);
  border-radius: var(--radius-sm);
  padding: 14px 28px;
  font-size: .9rem;
  color: var(--text);
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0,0,0,0.7);
  animation: slideUp .25s ease;
}
.toast.error { border-color: var(--red); color: #ff8fa3; }
.toast.show   { display: block; }
@keyframes slideUp { from { opacity:0; transform:translateX(-50%) translateY(12px); } to { opacity:1; transform:translateX(-50%) translateY(0); } }

/* ── Code Box (success page) ── */
.code-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: var(--radius);
  padding: 36px;
  text-align: center;
  max-width: 540px;
  margin: 32px auto;
  box-shadow: var(--shadow), 0 0 30px rgba(0, 240, 255, 0.15);
}
.code-card h2 {
  font-size: 1.1rem;
  color: var(--text-sub);
  font-weight: 600;
  margin-bottom: 20px;
}
.gift-code-display {
  font-family: 'Courier New', monospace;
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: .18em;
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: var(--radius-sm);
  padding: 18px 24px;
  margin-bottom: 20px;
  text-shadow: 0 0 20px var(--cyan-glow);
  word-break: break-all;
}
.btn-copy {
  padding: 12px 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-h);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: .95rem;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-copy:hover   { background: var(--cyan-dim); border-color: var(--cyan); box-shadow: 0 0 16px var(--cyan-glow); }
.btn-copy.copied  { color: var(--cyan); border-color: var(--cyan); }

/* ── Steps ── */
.steps {
  max-width: 520px;
  margin: 0 auto 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.steps h3 {
  font-size: .95rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: .06em;
  text-align: center;
  margin-bottom: 18px;
}
.step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.step:last-child { border-bottom: none; }
.step-num {
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: .82rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-text { font-size: .88rem; line-height: 1.6; color: var(--text-sub); }
.step-text strong { color: var(--text); }

/* ── Notice Banner ── */
.notice {
  background: rgba(245, 197, 56, 0.08);
  border: 1px solid rgba(245, 197, 56, 0.25);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: .84rem;
  color: #eed56a;
  line-height: 1.7;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 40px;
  margin-top: 60px;
  text-align: center;
  font-size: .78rem;
  color: var(--text-sub);
  line-height: 1.8;
  background: rgba(6, 6, 12, 0.95);
}
.site-footer a { color: var(--cyan); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ── Back Link ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-sub);
  font-size: .88rem;
  text-decoration: none;
  padding: 24px 0 0;
  transition: color var(--transition);
}
.back-link:hover { color: var(--cyan); }

/* ── Auth Gate Modal ── */
.auth-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(6, 6, 12, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.auth-gate-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.auth-gate-card {
  background: linear-gradient(145deg, rgba(20, 20, 36, 0.98), rgba(12, 12, 24, 0.99));
  border: 1px solid rgba(0, 240, 255, 0.3);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 240, 255, 0.15);
  border-radius: 20px;
  padding: 40px 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  position: relative;
}
.auth-gate-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}
.auth-gate-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 12px rgba(0, 240, 255, 0.4));
}
.auth-gate-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: .05em;
  margin-bottom: 8px;
}
.auth-gate-desc {
  font-size: .88rem;
  color: var(--text-sub);
  line-height: 1.6;
  margin-bottom: 24px;
}
.auth-gate-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-gate-input {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 18px;
  background: rgba(10, 10, 18, 0.9);
  border: 1px solid var(--border-h);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 1.1rem;
  text-align: center;
  letter-spacing: .15em;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.auth-gate-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.35);
}
.auth-gate-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--cyan), #0088ff);
  color: #06060c;
  font-weight: 900;
  font-size: 1rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.3);
  transition: transform var(--transition), box-shadow var(--transition);
}
.auth-gate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 240, 255, 0.5);
}
.auth-gate-error {
  display: none;
  color: #ff5577;
  font-size: .84rem;
  font-weight: 700;
}
.auth-gate-error.show {
  display: block;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .hero { padding: 36px 16px 20px; }
  .hero-logo-img { max-width: 280px; }
  .product-grid { grid-template-columns: 1fr; }
  .code-card { padding: 24px 16px; }
  .gift-code-display { font-size: 1.6rem; letter-spacing: .12em; padding: 14px 12px; }
  .auth-gate-card { padding: 32px 20px; }
}
