/* ==========================================================================
   RYUTA PROFILE PAGE - ROYAL EXHIBITION GALLERY STYLES (profile.css)
   ========================================================================== */

/* --- Container & Layout --- */
.profile-page-body {
  background-color: #0f172a;
  margin: 0;
  padding: 0;
  font-family: var(--font-base);
}

.profile-page-container {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 45px 16px 85px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 100%;
  box-sizing: border-box;
  background: url('../assets/profile_bg_pc.png') center top / cover no-repeat;
  position: relative;
  animation: profileFadeIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes profileFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.985);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Background Royal Stained Glass Glow */
.profile-page-container::before {
  content: '';
  position: absolute;
  top: 4%;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 580px;
  height: 480px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.18) 0%, rgba(217, 119, 6, 0.05) 55%, transparent 75%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 1;
}

/* --- Header Section --- */
.profile-header-section {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0;
  z-index: 5;
  width: 100%;
  max-width: 560px;
  position: relative;
}

.profile-ribbon-banner {
  position: relative;
  width: 100%;
  max-width: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.4));
}

.profile-ribbon-img {
  width: 100%;
  height: auto;
  display: block;
}

.profile-curved-title-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.profile-title-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* --- Royal Exhibition Gallery Stage --- */
.profile-gallery-section {
  width: 100%;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0;
  position: relative;
  z-index: 5;
}

.gallery-exhibition-stage {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0 20px;
}

/* Left Top Speech Bubble */
.gallery-speech-bubble {
  position: absolute;
  top: 15px;
  left: -10px;
  background: linear-gradient(135deg, #ffffff 0%, #fef3c7 100%);
  border: 2px solid #f59e0b;
  border-radius: 18px;
  padding: 10px 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  z-index: 6;
  max-width: 155px;
  text-align: center;
}

.gallery-speech-bubble span {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 12px;
  font-weight: 800;
  color: #78350f;
  line-height: 1.4;
}

/* Speech Bubble Tail */
.gallery-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -9px;
  right: 24px;
  border-width: 9px 8px 0 8px;
  border-style: solid;
  border-color: #fef3c7 transparent transparent transparent;
}

/* Central Gold Royal Arch Portrait Frame */
.gallery-gold-frame-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 5;
}


.gallery-gold-arch-frame {
  width: 270px;
  height: 274px;
  position: relative;
  overflow: visible;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.45));
}



.gallery-frame-bg-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  z-index: 1;
}

.gallery-portrait-img {
  position: absolute;
  top: 12.2%;
  left: 16.2%;
  width: 67.5%;
  height: 78.3%;
  object-fit: contain;
  border-radius: 130px 130px 0 0;
  display: block;
  z-index: 2;
}

/* Gold Nameplate Below Frame */
.gallery-nameplate {
  margin-top: -8px;
  z-index: 7;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 50%, #f59e0b 100%);
  border: 2px solid #ffffff;
  border-radius: 20px;
  padding: 6px 22px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  gap: 8px;
}

.nameplate-sparkle {
  color: #b45309;
  font-size: 11px;
}

.nameplate-text {
  font-family: var(--font-circus), 'Rye', cursive;
  font-size: 15px;
  font-weight: 800;
  color: #78350f;
  letter-spacing: 1.5px;
}

/* Right Side Book Decor */
.gallery-book-decor {
  position: absolute;
  right: -5px;
  bottom: 25px;
  z-index: 4;
}

.decor-book-spine {
  width: 70px;
  height: 140px;
  background: linear-gradient(135deg, #1e3a8a 0%, #1e1b4b 100%);
  border: 2px solid #fbbf24;
  border-radius: 6px 12px 12px 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
}

.book-spine-txt {
  font-family: var(--font-circus), cursive;
  font-size: 13px;
  font-weight: 700;
  color: #fef08a;
  letter-spacing: 2px;
}

/* --- Basic Meta Info Card Grid --- */
.profile-basic-info-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 18px;
  margin-bottom: 22px;
}

/* PC: Top 3 cells take 2 columns each (33.3% width), Bottom 2 cells take 3 columns each (50% width) */
.info-cell:nth-child(1),
.info-cell:nth-child(2),
.info-cell:nth-child(3) {
  grid-column: span 2;
}

.info-cell:nth-child(4),
.info-cell:nth-child(5) {
  grid-column: span 3;
}

.info-cell {
  background: linear-gradient(135deg, rgba(255, 253, 243, 0.96) 0%, rgba(254, 243, 199, 0.92) 100%);
  border: 2px solid #f59e0b;
  border-radius: 14px;
  padding: 8px 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.info-cell-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.info-cell-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.info-label {
  font-family: var(--font-circus), cursive;
  font-size: 9px;
  font-weight: 700;
  color: #b45309;
  letter-spacing: 0.5px;
}

.info-val {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 12.5px;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.2;
}

/* --- 5 Category Navigation Tabs --- */
.gallery-category-tabs {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 14px;
}

.cat-tab {
  flex: 1;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(241, 245, 249, 0.85) 100%);
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  padding: 8px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cat-tab.active {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  border-color: #ffffff;
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.45);
}

.tab-ic {
  font-size: 15px;
}

.tab-txt {
  font-family: var(--font-circus), cursive;
  font-size: 9px;
  font-weight: 800;
  color: #334155;
  letter-spacing: 0.5px;
}

.cat-tab.active .tab-txt {
  color: #78350f;
}

/* --- Active Detail Parchment Card Display Area --- */
.gallery-detail-card-wrapper {
  width: 100%;
  position: relative;
  min-height: 260px;
}

.gallery-detail-card {
  display: none;
  background: linear-gradient(135deg, rgba(255, 253, 245, 0.98) 0%, rgba(254, 243, 199, 0.95) 100%);
  border: 3px solid #f59e0b;
  border-radius: 20px;
  padding: 22px 20px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 0 16px rgba(255, 255, 255, 0.8);
  position: relative;
  box-sizing: border-box;
  animation: cardFadeSlide 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.gallery-detail-card.active {
  display: block;
}

@keyframes cardFadeSlide {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-badge-num {
  position: absolute;
  top: -14px;
  left: 20px;
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #ffffff;
  font-family: var(--font-circus), cursive;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 14px;
  border-radius: 14px;
  box-shadow: 0 3px 8px rgba(180, 83, 9, 0.35);
  border: 1.5px solid #ffffff;
}

.card-main-heading {
  font-family: var(--font-circus), cursive;
  font-size: 22px;
  font-weight: 800;
  color: #b45309;
  margin: 0;
  letter-spacing: 1px;
}

.card-sub-heading {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 12.5px;
  font-weight: 800;
  color: #78350f;
  margin: 2px 0 14px;
}

.card-body-text {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  line-height: 1.7;
}

.card-body-text p {
  margin: 0 0 10px;
}

.card-body-text p:last-child {
  margin-bottom: 0;
}

/* Skills Acrobat Illustration (Transparent PNG) */
.skills-card-content {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.skills-acrobat-wrapper {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.skills-acrobat-img {
  width: 182px;
  height: 182px;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(180, 83, 9, 0.22));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
}

.skills-acrobat-img:hover {
  transform: translateY(-4px) scale(1.05) rotate(-2deg);
  filter: drop-shadow(0 8px 16px rgba(180, 83, 9, 0.32));
}

/* Card Bottom Navigation Button */
.card-bottom-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.card-history-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #f59e0b;
  border-radius: 18px;
  padding: 6px 16px;
  color: #78350f;
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(180, 83, 9, 0.2);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card-history-link:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 16px rgba(180, 83, 9, 0.35);
  color: #451a03;
}

.arrow-icon {
  font-size: 14px;
}

/* Lock body scrolling while VIP Pass overlay is active */
body.pass-overlay-active,
html.pass-overlay-active {
  overflow: hidden;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  touch-action: none;
}

.royal-pass-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  touch-action: none;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
  opacity: 1;
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.7s;
}

.royal-pass-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.royal-pass-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: linear-gradient(145deg, #1e1b4b 0%, #0f172a 60%, #1e293b 100%);
  border: 2px solid #fbbf24;
  border-radius: 20px;
  padding: 30px 24px 26px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 35px rgba(245, 158, 11, 0.35);
  box-sizing: border-box;
  text-align: center;
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  animation: passCardPopIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards 0.1s;
}

.royal-pass-overlay.is-hidden .royal-pass-card {
  transform: scale(1.1) translateY(-20px);
  opacity: 0;
  transition: transform 0.6s ease, opacity 0.6s ease;
}

/* Corners Decor */
.pass-corner-decor {
  position: absolute;
  font-size: 12px;
  color: #fbbf24;
  opacity: 0.7;
}

.pass-corner-tl {
  top: 10px;
  left: 12px;
}

.pass-corner-tr {
  top: 10px;
  right: 12px;
}

.pass-corner-bl {
  bottom: 10px;
  left: 12px;
}

.pass-corner-br {
  bottom: 10px;
  right: 12px;
}

/* Badge Top */
.pass-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #78350f 0%, #451a03 100%);
  border: 1px solid #f59e0b;
  border-radius: 20px;
  padding: 5px 14px;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.pass-crown {
  font-size: 15px;
}

.pass-badge-txt {
  font-family: var(--font-circus), cursive;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #fef08a;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Main Title */
.pass-subtitle {
  display: block;
  font-family: var(--font-jap);
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.pass-main-title {
  margin-bottom: 16px;
}

.pass-heading {
  font-family: var(--font-circus), cursive;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffffff;
  background: linear-gradient(135deg, #ffffff 0%, #fde047 50%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
  margin: 0;
}

/* Footer Info & Stamp */
.pass-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed rgba(251, 191, 36, 0.4);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 18px;
}

.pass-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.pass-label {
  font-size: 9px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 1.5px;
}

.pass-val {
  font-family: var(--font-circus), cursive;
  font-size: 11px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Stamp Animation */
.pass-stamp {
  position: relative;
  width: 58px;
  height: 58px;
  border: 2px dashed #ef4444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ef4444;
  transform: scale(2.5) rotate(-15deg);
  opacity: 0;
}

.pass-stamp.is-stamped {
  animation: stampImpact 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.stamp-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}

.stamp-crown {
  font-size: 11px;
}

.stamp-txt {
  font-size: 7.5px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-align: center;
}

/* Action Button */
.pass-enter-btn {
  width: 100%;
  padding: 11px 20px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: none;
  border-radius: 30px;
  color: #ffffff;
  font-family: var(--font-jap);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: btnPulse 2s ease-in-out infinite alternate 1s;
}

.pass-enter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.6);
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
}

.pass-enter-btn:active {
  transform: translateY(1px);
}

/* Keyframe Animations */
@keyframes passCardPopIn {
  0% {
    opacity: 0;
    transform: scale(0.85) translateY(25px);
  }

  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes stampImpact {
  0% {
    opacity: 0;
    transform: scale(2.5) rotate(-25deg);
  }

  70% {
    opacity: 1;
    transform: scale(0.9) rotate(-10deg);
  }

  100% {
    opacity: 1;
    transform: scale(1) rotate(-15deg);
  }
}

@keyframes btnPulse {
  0% {
    box-shadow: 0 6px 18px rgba(217, 119, 6, 0.4);
    transform: scale(1);
  }

  100% {
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.75);
    transform: scale(1.02);
  }
}

/* ==========================================================================
   MEDIA QUERIES (Grouped at Bottom per AGENTS.md rules)
   ========================================================================== */

/* --- 4. Mobile Phone SP (max-width: 480px) --- */
@media (max-width: 480px) {
  .profile-ribbon-banner {
    max-width: 380px;
  }

  .profile-page-container {
    padding: 36px 10px 75px;
    background-image: url('../assets/profile_bg_sp.png');
    background-position: center top;
    background-size: cover;
  }

  .gallery-gold-arch-frame {
    width: 220px;
    height: 223px;
  }

  .gallery-speech-bubble {
    top: 5px;
    left: -5px;
    max-width: 125px;
    padding: 6px 10px;
  }

  .gallery-speech-bubble span {
    font-size: 10.5px;
  }

  .profile-basic-info-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .info-cell:nth-child(1),
  .info-cell:nth-child(2),
  .info-cell:nth-child(3),
  .info-cell:nth-child(4) {
    grid-column: span 1;
  }

  .info-cell:nth-child(5) {
    grid-column: span 2;
  }

  .info-cell {
    padding: 6px;
  }

  .info-val {
    font-size: 11.5px;
  }

  .cat-tab {
    padding: 6px 1px;
  }

  .tab-txt {
    font-size: 8px;
  }

  .card-main-heading {
    font-size: 18px;
  }

  .card-body-text {
    font-size: 12px;
    line-height: 1.6;
  }

  .skills-card-content {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .skills-acrobat-img {
    width: 125px;
    height: 125px;
  }

  /* VIP Pass Mobile SP Fixes */
  .royal-pass-card {
    padding: 22px 14px 18px;
    max-width: 340px;
  }

  .pass-heading {
    font-size: 20px;
  }

  .pass-footer {
    padding: 8px 10px;
    margin-bottom: 14px;
  }

  .pass-info {
    text-align: left;
    align-items: flex-start;
  }

  .pass-val {
    font-size: 10px;
    letter-spacing: 0.3px;
    white-space: nowrap;
  }

  .pass-stamp {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
  }
}