/*
Theme Name: Atelier Guild
Theme URI: https://a--te--lier.com
Description: 8bit RPG Guild theme for Atelier community
Version: 1.0
Author: みつき
*/

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Noto+Sans+JP:wght@400;700&display=swap');

/* ===========================
   CSS VARIABLES
=========================== */
:root {
  --black:      #0a0a0f;
  --dark:       #12121a;
  --panel:      #1a1a2e;
  --panel2:     #16213e;
  --border:     #0f3460;
  --gold:       #e2b96f;
  --gold-dim:   #a07840;
  --green:      #4ade80;
  --green-dim:  #166534;
  --red:        #f87171;
  --blue:       #60a5fa;
  --white:      #e8e0cc;
  --gray:       #6b7280;

  --font-pixel: 'Press Start 2P', monospace;
  --font-body:  'Noto Sans JP', sans-serif;

  --pixel-size: 2px;
}

/* ===========================
   RESET & BASE
=========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  image-rendering: pixelated;
}

body {
  background-color: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

/* Scanline overlay */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* Pixel grid background */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-image:
    linear-gradient(rgba(14,14,30,0.8) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14,14,30,0.8) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

/* ===========================
   TYPOGRAPHY
=========================== */
h1, h2, h3, .pixel {
  font-family: var(--font-pixel);
  line-height: 1.8;
  letter-spacing: 0.05em;
}

h1 { font-size: clamp(14px, 2.5vw, 22px); color: var(--gold); }
h2 { font-size: clamp(11px, 1.8vw, 16px); color: var(--gold); }
h3 { font-size: clamp(9px, 1.4vw, 12px); color: var(--white); }

p { font-size: 15px; line-height: 1.8; }

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.1s;
}
a:hover { color: var(--white); }

/* ===========================
   PIXEL PANEL (RPG Window)
=========================== */
.pixel-panel {
  background: var(--panel);
  border: 3px solid var(--gold-dim);
  box-shadow:
    inset 0 0 0 1px var(--black),
    4px 4px 0 var(--border),
    0 0 20px rgba(226,185,111,0.08);
  padding: 24px;
  position: relative;
}

.pixel-panel::before {
  content: '';
  position: absolute;
  top: 3px; left: 3px; right: 3px; bottom: 3px;
  border: 1px solid rgba(226,185,111,0.15);
  pointer-events: none;
}

/* Corner decorations */
.pixel-panel::after {
  content: '◆';
  position: absolute;
  top: -8px; right: 12px;
  color: var(--gold);
  font-size: 10px;
  background: var(--panel);
  padding: 0 4px;
}

/* ===========================
   BUTTONS
=========================== */
.btn {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 10px;
  padding: 12px 24px;
  border: 2px solid var(--gold);
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  position: relative;
  transition: all 0.1s;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.btn::before {
  content: '▶';
  margin-right: 8px;
  font-size: 8px;
}

.btn:hover {
  background: var(--gold);
  color: var(--black);
  box-shadow: 0 0 16px rgba(226,185,111,0.5);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.btn-primary {
  background: var(--gold);
  color: var(--black);
  font-weight: bold;
}

.btn-primary:hover {
  background: var(--white);
  border-color: var(--white);
  color: var(--black);
}

/* ===========================
   NAVIGATION
=========================== */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(10,10,15,0.95);
  border-bottom: 2px solid var(--gold-dim);
  backdrop-filter: blur(8px);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-logo .logo-icon {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

.site-logo span { color: var(--white); }

.main-nav {
  display: flex;
  gap: 0;
  list-style: none;
}

.main-nav a {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--gray);
  padding: 8px 16px;
  display: block;
  border-left: 1px solid var(--border);
  transition: all 0.1s;
  letter-spacing: 0.08em;
}

.main-nav a:hover,
.main-nav .current-menu-item a {
  color: var(--gold);
  background: rgba(226,185,111,0.06);
}

.nav-login {
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 8px 16px;
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  cursor: pointer;
  background: transparent;
  transition: all 0.1s;
}

.nav-login:hover {
  background: var(--gold);
  color: var(--black);
}

/* ===========================
   HERO SECTION
=========================== */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding-top: 80px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(226,185,111,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 20% 80%, rgba(96,165,250,0.04) 0%, transparent 60%);
}

/* Pixel stars */
.hero-stars {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-stars span {
  position: absolute;
  width: 2px; height: 2px;
  background: var(--white);
  animation: twinkle 3s infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
  padding: 40px 24px;
}

.hero-guild-badge {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--green);
  border: 1px solid var(--green-dim);
  padding: 6px 16px;
  margin-bottom: 32px;
  letter-spacing: 0.2em;
  animation: blink-border 2s infinite;
}

@keyframes blink-border {
  0%, 100% { border-color: var(--green-dim); }
  50% { border-color: var(--green); }
}

.hero-title {
  font-family: var(--font-pixel);
  font-size: clamp(16px, 3vw, 28px);
  color: var(--gold);
  line-height: 2;
  margin-bottom: 16px;
  text-shadow: 0 0 30px rgba(226,185,111,0.4);
}

.hero-subtitle {
  font-family: var(--font-pixel);
  font-size: clamp(8px, 1.2vw, 11px);
  color: var(--white);
  line-height: 2.4;
  margin-bottom: 48px;
  opacity: 0.8;
}

.hero-cursor {
  display: inline-block;
  width: 10px; height: 18px;
  background: var(--gold);
  animation: cursor-blink 1s steps(1) infinite;
  vertical-align: middle;
  margin-left: 4px;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* HP/MP bars for flavor */
.hero-stats {
  display: flex;
  gap: 32px;
  justify-content: center;
  margin-top: 48px;
  flex-wrap: wrap;
}

.stat-bar {
  font-family: var(--font-pixel);
  font-size: 8px;
}

.stat-label {
  color: var(--gray);
  margin-bottom: 6px;
  display: block;
}

.stat-track {
  width: 120px;
  height: 10px;
  background: var(--dark);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.stat-fill {
  height: 100%;
  position: absolute;
  left: 0; top: 0;
  transition: width 2s ease;
}

.stat-fill.hp { background: var(--green); width: 85%; }
.stat-fill.mp { background: var(--blue); width: 60%; }
.stat-fill.exp { background: var(--gold); width: 40%; }

/* ===========================
   GUILD RANK SECTION
=========================== */
#guild {
  padding: 100px 24px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-eyebrow {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--green);
  letter-spacing: 0.3em;
  display: block;
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-pixel);
  font-size: clamp(12px, 2vw, 18px);
  color: var(--gold);
  margin-bottom: 16px;
}

.section-divider {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--gold-dim);
  letter-spacing: 0.5em;
}

/* Rank Cards */
.rank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2px;
  margin-top: 48px;
}

.rank-card {
  background: var(--panel);
  border: 2px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  position: relative;
  transition: all 0.15s;
  cursor: default;
}

.rank-card:hover {
  border-color: var(--gold-dim);
  background: var(--panel2);
  transform: translateY(-4px);
  box-shadow: 0 8px 0 var(--border), 0 0 20px rgba(226,185,111,0.1);
}

.rank-card.featured {
  border-color: var(--gold);
  background: linear-gradient(180deg, var(--panel2) 0%, rgba(226,185,111,0.05) 100%);
}

.rank-card.featured::before {
  content: '★ FEATURED';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--gold);
  background: var(--black);
  padding: 2px 12px;
  border: 1px solid var(--gold);
  white-space: nowrap;
}

.rank-sprite {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  image-rendering: pixelated;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

.rank-name {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--gold);
  margin-bottom: 8px;
  display: block;
}

.rank-jp {
  font-size: 11px;
  color: var(--gray);
  margin-bottom: 16px;
  display: block;
}

.rank-price {
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--white);
  display: block;
  margin-bottom: 4px;
}

.rank-price-sub {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--gray);
  display: block;
  margin-bottom: 20px;
}

.rank-perks {
  list-style: none;
  text-align: left;
  font-size: 12px;
  color: var(--gray);
  line-height: 2;
}

.rank-perks li::before {
  content: '▷ ';
  color: var(--gold-dim);
  font-family: var(--font-pixel);
  font-size: 8px;
}

.rank-perks li.active {
  color: var(--white);
}

.rank-perks li.active::before {
  content: '▶ ';
  color: var(--green);
}

/* ===========================
   QUEST BOARD (Schedule)
=========================== */
#schedule {
  padding: 100px 24px;
  background: var(--dark);
  position: relative;
  z-index: 1;
}

.quest-board {
  max-width: 900px;
  margin: 0 auto;
}

.quest-board-frame {
  background: var(--panel);
  border: 3px solid var(--gold-dim);
  padding: 4px;
}

.quest-board-header {
  background: var(--gold-dim);
  padding: 12px 24px;
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--black);
  display: flex;
  align-items: center;
  gap: 12px;
}

.quest-board-header::before { content: '📋'; }

.quest-list {
  padding: 24px;
}

.quest-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.quest-item:last-child { border-bottom: none; }

.quest-date {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--gold);
  text-align: center;
  background: var(--panel2);
  border: 1px solid var(--border);
  padding: 8px 4px;
}

.quest-date .month { color: var(--gray); display: block; font-size: 7px; }
.quest-date .day   { font-size: 16px; display: block; margin: 4px 0; }
.quest-date .dow   { color: var(--green); display: block; font-size: 7px; }

.quest-info {}

.quest-title {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--white);
  margin-bottom: 6px;
}

.quest-meta {
  font-size: 12px;
  color: var(--gray);
}

.quest-rank {
  font-family: var(--font-pixel);
  font-size: 7px;
  padding: 4px 10px;
  border: 1px solid;
}

.quest-rank.open { color: var(--green); border-color: var(--green-dim); }
.quest-rank.members { color: var(--gold); border-color: var(--gold-dim); }

/* ===========================
   ABOUT / LORE SECTION
=========================== */
#lore {
  padding: 100px 24px;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.lore-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin-top: 48px;
}

.lore-panel {
  background: var(--panel);
  border: 2px solid var(--border);
  padding: 32px;
}

.lore-panel-title {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--gold-dim);
  letter-spacing: 0.2em;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.lore-panel p {
  font-size: 14px;
  color: rgba(232,224,204,0.8);
  line-height: 2;
}

/* ===========================
   APPLY SECTION
=========================== */
#apply {
  padding: 100px 24px;
  background: var(--dark);
  position: relative;
  z-index: 1;
  text-align: center;
}

.apply-inner {
  max-width: 600px;
  margin: 0 auto;
}

.apply-steps {
  display: flex;
  justify-content: center;
  gap: 0;
  margin: 48px 0;
  flex-wrap: wrap;
}

.apply-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.apply-step:not(:last-child)::after {
  content: '▶';
  position: absolute;
  right: -16px;
  top: 24px;
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--gold-dim);
}

.step-num {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--gold);
  width: 48px; height: 48px;
  border: 2px solid var(--gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  background: var(--panel);
}

.step-label {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--gray);
  text-align: center;
  width: 80px;
  line-height: 1.8;
  padding: 0 8px;
}

.apply-notice {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--red);
  border: 1px solid rgba(248,113,113,0.3);
  padding: 12px 20px;
  margin-bottom: 32px;
  display: inline-block;
}

.apply-notice::before { content: '! '; }

/* ===========================
   FOOTER
=========================== */
#site-footer {
  background: var(--dark);
  border-top: 2px solid var(--border);
  padding: 40px 24px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.footer-logo {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--gold);
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  list-style: none;
}

.footer-links a {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--gray);
}

.footer-links a:hover { color: var(--gold); }

.footer-copy {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--gray);
}

/* ===========================
   MEMBER AREA
=========================== */
.member-dashboard {
  max-width: 1000px;
  margin: 100px auto 60px;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.dashboard-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 48px;
}

.player-card {
  background: var(--panel);
  border: 2px solid var(--gold-dim);
  padding: 20px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}

.player-sprite {
  font-size: 48px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.player-info {}

.player-name {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--gold);
  margin-bottom: 8px;
}

.player-rank {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--green);
  margin-bottom: 12px;
}

.player-exp {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--gray);
  margin-bottom: 6px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.dashboard-panel {
  background: var(--panel);
  border: 2px solid var(--border);
  padding: 24px;
}

.dashboard-panel-title {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--gold-dim);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.2em;
}

/* ===========================
   LOGIN FORM
=========================== */
.login-wrap {
  max-width: 440px;
  margin: 120px auto 60px;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.login-title {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--gold);
  text-align: center;
  margin-bottom: 8px;
}

.login-sub {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--gray);
  text-align: center;
  margin-bottom: 32px;
}

.login-form {
  background: var(--panel);
  border: 2px solid var(--gold-dim);
  padding: 32px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--gold-dim);
  display: block;
  margin-bottom: 8px;
  letter-spacing: 0.1em;
}

.form-input {
  width: 100%;
  background: var(--dark);
  border: 2px solid var(--border);
  color: var(--white);
  padding: 12px 16px;
  font-family: var(--font-pixel);
  font-size: 10px;
  outline: none;
  transition: border-color 0.1s;
}

.form-input:focus {
  border-color: var(--gold-dim);
}

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 768px) {
  .lore-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .rank-grid { grid-template-columns: 1fr 1fr; }
  .main-nav { display: none; }
  .quest-item { grid-template-columns: 60px 1fr; }
  .quest-rank { display: none; }
  .apply-steps { gap: 16px; }
  .apply-step:not(:last-child)::after { display: none; }
}

@media (max-width: 480px) {
  .rank-grid { grid-template-columns: 1fr; }
}

/* ===========================
   ANIMATIONS
=========================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pixelIn {
  0%   { clip-path: inset(0 100% 0 0); }
  100% { clip-path: inset(0 0% 0 0); }
}

.animate-in {
  animation: fadeInUp 0.4s ease forwards;
}

.pixel-reveal {
  animation: pixelIn 0.6s steps(10) forwards;
}

/* Pixel glow pulse */
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(226,185,111,0.2); }
  50%       { box-shadow: 0 0 24px rgba(226,185,111,0.5); }
}

.glow { animation: glow-pulse 3s infinite; }
