/* ── Serenia Fantasy Portal – shared styles ── */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Open+Sans:wght@400;600&display=swap');

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

:root {
  --gold:      #e8c96a;
  --gold-dark: #b8952a;
  --gold-glow: rgba(232,201,106,0.35);
  --bg-dark:   #0b0c10;
  --bg-panel:  rgba(10, 10, 18, 0.88);
  --border:    rgba(232,201,106,0.35);
  --text:      #e8dfc8;
  --text-muted:#9e9070;
  --red:       #e05555;
  --green:     #5ec97a;
}

html, body {
  height: 100%;
  font-family: 'Open Sans', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text);
  overflow: hidden;
}

/* ── Background ── */
.portal-bg {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.7) 100%),
    url('../assets/original/pic/loading/upscale-1.jpg') center/cover no-repeat;
  z-index: 0;
}
.portal-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.7) 100%);
}

/* ── Particle overlay (pure CSS stars) ── */
.stars {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 10% 15%, rgba(255,255,220,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 35% 45%, rgba(255,255,220,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 20%, rgba(255,255,220,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 80% 70%, rgba(255,255,220,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 25% 80%, rgba(255,255,220,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 10%, rgba(255,255,220,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 50% 60%, rgba(255,255,220,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 35%, rgba(255,255,220,0.7) 0%, transparent 100%);
}

/* ── Center wrapper ── */
.portal-wrap {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

/* ── Logo / title ── */
.portal-logo {
  text-align: center;
  margin-bottom: 28px;
}
.portal-logo h1 {
  font-family: 'Cinzel', serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 20px var(--gold-glow), 0 2px 4px rgba(0,0,0,0.8);
  letter-spacing: 3px;
  line-height: 1.2;
}
.portal-logo p {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 4px;
  margin-top: 4px;
  text-transform: uppercase;
}

/* ── Card panel ── */
.portal-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 36px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 0 40px rgba(0,0,0,0.8), inset 0 0 0 1px rgba(255,255,255,0.03);
  backdrop-filter: blur(12px);
}

/* corner decorations */
.portal-card::before,
.portal-card::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-color: var(--gold);
  border-style: solid;
  opacity: 0.6;
}
.portal-card { position: relative; }
.portal-card::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.portal-card::after  { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

/* ── Form elements ── */
.portal-card h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  color: var(--gold);
  letter-spacing: 2px;
  margin-bottom: 24px;
  text-align: center;
}

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

.form-group label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(232,201,106,0.2);
  border-radius: 3px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: 'Open Sans', sans-serif;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus {
  border-color: rgba(232,201,106,0.6);
  box-shadow: 0 0 0 3px rgba(232,201,106,0.1);
}
.form-group input::placeholder { color: rgba(255,255,255,0.2); }

/* ── "Remember me" row ── */
.form-remember {
  margin: -4px 0 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
  user-select: none;
}
.form-remember .remember-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 2px;
  transition: color 0.15s;
}
.form-remember .remember-label:hover { color: var(--text); }
.form-remember input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(232,201,106,0.4);
  border-radius: 3px;
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.15s, background-color 0.15s;
}
.form-remember input[type="checkbox"]:hover {
  border-color: rgba(232,201,106,0.7);
}
.form-remember input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #c9993a 0%, #e8c96a 100%);
  border-color: var(--gold);
}
.form-remember input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 0px;
  width: 5px;
  height: 10px;
  border: solid #1a1200;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.form-remember input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(232,201,106,0.5);
  outline-offset: 2px;
}

/* ── Buttons ── */
.btn {
  display: block;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 3px;
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.btn-gold {
  background: linear-gradient(135deg, #c9993a 0%, #e8c96a 50%, #c9993a 100%);
  color: #1a1200;
  text-shadow: 0 1px 0 rgba(255,255,255,0.3);
  box-shadow: 0 2px 12px rgba(184,149,42,0.4);
}
.btn-gold:hover {
  background: linear-gradient(135deg, #d4a845 0%, #f0d47a 50%, #d4a845 100%);
  box-shadow: 0 4px 20px rgba(184,149,42,0.6);
  transform: translateY(-1px);
}
.btn-gold:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(232,201,106,0.2);
  font-size: 0.8rem;
  padding: 8px;
  margin-top: 10px;
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); background: rgba(232,201,106,0.05); }

/* ── Links ── */
.portal-links {
  text-align: center;
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.portal-links a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.2s;
}
.portal-links a:hover { color: #fff; }
.portal-links span { margin: 0 8px; opacity: 0.3; }

/* ── Alert messages ── */
.alert {
  padding: 10px 14px;
  border-radius: 3px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: none;
}
.alert.show { display: block; }
.alert-error   { background: rgba(224,85,85,0.15);  border: 1px solid rgba(224,85,85,0.4);  color: #f08080; }
.alert-success { background: rgba(94,201,122,0.15); border: 1px solid rgba(94,201,122,0.4); color: #80e09a; }

/* ── Divider ── */
.divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
  margin: 20px 0;
}

/* ── Play page specific ── */
.play-wrap {
  text-align: center;
}

.welcome-text {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  letter-spacing: 1px;
}
.welcome-text span { color: var(--gold); }

.btn-start {
  display: inline-block;
  width: auto;
  min-width: 260px;
  padding: 18px 48px;
  font-size: 1.2rem;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #8b2e2e 0%, #c0392b 40%, #8b2e2e 100%);
  color: #ffe8c8;
  border: 1px solid rgba(255,180,100,0.3);
  box-shadow: 0 0 30px rgba(192,57,43,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
  animation: pulse-glow 2.5s ease-in-out infinite;
}
.btn-start:hover {
  background: linear-gradient(135deg, #a03535 0%, #d44 40%, #a03535 100%);
  box-shadow: 0 0 50px rgba(220,80,60,0.7), inset 0 1px 0 rgba(255,255,255,0.15);
  transform: translateY(-2px);
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 30px rgba(192,57,43,0.5), inset 0 1px 0 rgba(255,255,255,0.1); }
  50%       { box-shadow: 0 0 50px rgba(220,80,60,0.7), inset 0 1px 0 rgba(255,255,255,0.15); }
}

.char-info {
  margin-top: 24px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: 'Cinzel', serif;
  letter-spacing: 1px;
}

/* ── Loading spinner ── */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 480px) {
  .portal-card { padding: 24px 20px; }
  .portal-logo h1 { font-size: 1.8rem; }
}
