/* ── Welcome wrapper ── */
#welcomeWrapper {
  opacity: 0;
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: 100%;
  display: none;
  padding: 0 1rem;
  transform: translateY(24px);
}

#welcomeWrapper.showHub {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 1;
  transform: translateY(0);
}

/* ── Hub title ── */
.hubTitle {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-align: center;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.7);
}

/* ── Action grid ── */
.classicGrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  width: 100%;
  max-width: 340px;
}

/* ── Action buttons ── */
.classicBtn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 0.75rem;
  border-radius: 16px;
  font-size: 0.82rem;
  font-family: inherit;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.8);
  min-height: 80px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.classicBtn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(142, 45, 226, 0.1), rgba(99, 102, 241, 0.06));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.classicBtn:active {
  transform: scale(0.97);
  border-color: rgba(142, 45, 226, 0.4);
}

.classicBtn:active::before {
  opacity: 1;
}

@media (hover: hover) {
  .classicBtn:hover {
    border-color: rgba(142, 45, 226, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(142, 45, 226, 0.15);
    color: #fff;
  }

  .classicBtn:hover::before {
    opacity: 1;
  }
}

.classicBtn span {
  color: #a855f7;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.3px;
  position: relative;
}

/* ── Footer ── */
#footerInfo {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.25);
  line-height: 1.2;
  font-family: monospace;
  letter-spacing: 1px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 1;
}

@media (max-width: 360px) {
  #footerInfo {
    font-size: 0.55rem;
    bottom: 8px;
  }

  #accessibilityToggle {
    bottom: 1rem;
    right: 1rem;
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }
}

/* ── Accessibility toggle ── */
#accessibilityToggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  font-size: 1.1rem;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.25s ease;
  z-index: 100;
}

#accessibilityToggle:active {
  transform: scale(0.92);
  background: rgba(142, 45, 226, 0.2);
}

@media (hover: hover) {
  #accessibilityToggle:hover {
    background: rgba(142, 45, 226, 0.2);
    border-color: rgba(142, 45, 226, 0.4);
  }
}

/* ── Terms popup ── */
#termsPopup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 1.5rem;
}

.termsBox {
  background: rgba(18, 18, 24, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2rem 1.5rem;
  max-width: 400px;
  width: 100%;
  text-align: center;
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.termsBox p {
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 0 0 0.5rem;
}

.termsBox a {
  color: #a855f7;
  text-decoration: none;
  font-weight: 600;
}

.termsBox a:active {
  opacity: 0.7;
}

@media (hover: hover) {
  .termsBox a:hover {
    text-decoration: underline;
  }
}

#continueBtn, #closeConstruction {
  margin-top: 1.25rem;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, #8e2de2, #6366f1);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(142, 45, 226, 0.3);
  letter-spacing: 0.2px;
  width: 100%;
}

#continueBtn:active, #closeConstruction:active {
  transform: scale(0.98);
}

@media (hover: hover) {
  #continueBtn:hover, #closeConstruction:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 22px rgba(142, 45, 226, 0.45);
    transform: translateY(-1px);
  }
}

/* ── Pulse animation for title ── */
@keyframes pulse {
  0%   { opacity: 1; }
  50%  { opacity: 0.65; }
  100% { opacity: 1; }
}

.pulse {
  animation: pulse 3s ease-in-out infinite;
}

/* ── Access mode overrides ── */
body.access-mode .classicBtn {
  font-size: 0.9rem;
  min-height: 90px;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

body.access-mode .classicBtn span {
  font-size: 0.8rem;
}

body.access-mode .hubTitle {
  font-size: 1.35rem;
}

body.access-mode #storyText {
  font-size: 1.1rem;
}

body.access-mode #enterBtn,
body.access-mode #skipBtn {
  font-size: 1rem;
  padding: 0.9rem 2rem;
}

/* ── Responsive ── */
@media (max-width: 360px) {
  .classicGrid {
    max-width: 300px;
    gap: 0.6rem;
  }

  .classicBtn {
    min-height: 72px;
    padding: 0.85rem 0.6rem;
    font-size: 0.76rem;
  }

  .hubTitle {
    font-size: 1rem;
  }

  .termsBox {
    padding: 1.5rem 1.25rem;
  }
}
