/* ===========================
ROOT VARIABLES & BASE STYLES
=========================== */
:root {
  --bg: #0b0b0b;
  --card: #141414;
  --muted: #8f9;
  --accent: #0ff;
}

body {
  background: linear-gradient(180deg, #070707 0%, #0d0d12 100%);
  color: #e9eef2;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  padding: 28px;
}

h2 {
  font-weight: 700;
  letter-spacing: 0.2px;
  margin-bottom: 18px;
}

/* ===========================
LAYOUT STRUCTURE
=========================== */
.roster {
  display: grid;
  grid-template-columns: minmax(200px, 260px) 1fr minmax(200px, 260px);
  gap: 18px;
  align-items: start;
  justify-content: center;
}

/* ===========================
SIDE COLUMNS
=========================== */
.column {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.03);
  padding: 12px;
  border-radius: 12px;
  min-height: 420px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
}

.column .label {
  font-size: 0.95rem;
  color: #cfd8dc;
  margin-bottom: 6px;
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
  align-content: start;
  justify-content: center;
}

/* ===========================
CHARACTER BUTTONS
=========================== */
.char-btn {
  --size: 72px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .14s ease, box-shadow .14s ease, filter .22s ease, border-color .14s ease, opacity .14s ease;
  cursor: pointer;
  transform-origin: center;
}

.char-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.char-btn:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 10px 28px rgba(0,0,0,0.6);
}

.char-btn.inactive {
  filter: grayscale(100%) brightness(.45) saturate(.7);
  opacity: .55;
  transform: none;
}

.char-btn.highlight {
  box-shadow: 0 0 0 4px rgba(0,255,255,0.06), 0 6px 20px rgba(0,0,0,0.6);
  border-color: rgba(0,255,255,0.18);
  transform: scale(1.06);
}

.char-btn.selected {
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(0,255,255,0.06);
  transform: scale(1.08);
  --accent: #20B2AA; /* Rim highlight click */

}

.char-btn.grey-pulse {
  filter: grayscale(100%) brightness(.6);
  opacity: 0.7;
  animation: pulseGrey 1.2s infinite;
}

/* ===========================
CENTER CARD (MAIN RELATIONSHIP AREA)
=========================== */
.center-card {
  background: linear-gradient(180deg, var(--card), #0f1214);
  border: 1px solid rgba(255,255,255,0.03);
  padding: 14px;
  border-radius: 12px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.neutral-box {
  flex: 0 0 auto;
  padding: 26px;
  text-align: center;
  border-radius: 8px;
  background: rgba(255,255,255,0.01);
  color: #aeb7bd;
  font-size: 1.02rem;
}

.neutral-box img.neutral-img {
  max-width: 100%;
  max-height: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  opacity: 0.9;
}

.relationship-ui {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.side-image {
  width: 110px;
  height: 110px;
  border-radius: 14px;
  overflow: hidden;
  background: #0b0b0b;
  border: 1px solid rgba(255,255,255,0.03);
  flex-shrink: 0;
}

.side-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.name-box {
  flex: 1 1 auto;
  background: rgba(255,255,255,0.02);
  padding: 12px 14px;
  border-radius: 8px;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.large-box {
  background: rgba(255,255,255,0.02);
  padding: 14px;
  border-radius: 8px;
  min-height: 110px;
  overflow: auto;
}

.tabs-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bottom-box {
  background: rgba(255,255,255,0.02);
  padding: 12px;
  border-radius: 8px;
  min-height: 80px;
  overflow: auto;
}

.image-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.thumb {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.03);
  cursor: pointer;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}



.center-card .side-image {
    transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.center-card .side-image:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 10px 28px rgba(0,0,0,0.6);
    z-index: 10; /* Ensure it’s above other elements */
}


.thumb {
    transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.thumb:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 6px 18px rgba(0,0,0,0.5);
    z-index: 10; /* ensures hovered thumb appears above others */
}




/* ===========================
THOUGHTS & EXTRA BOXES
=========================== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.char-thought {
  background: rgba(255,255,255,0.02);
  padding: 10px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-style: italic;
}

.middle-box {
  margin: 1rem 0;
  padding: 1rem;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.03);
  min-height: 80px;
  overflow: auto;
  text-align: center;
  font-size: 0.95rem;
  color: #e9eef2;
  font-style: normal;
}

.tagline-box {
  margin-top: 0.5rem;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.03);
  min-height: 50px;
  overflow-y: auto;
  font-style: italic;
  font-size: 0.85rem;
  text-align: right;
  color: #cfd8dc;
}

/* ===========================
LIGHTBOX (IMAGE PREVIEW)
=========================== */
.lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  background: rgba(2,2,2,0.85);
  visibility: hidden;
  opacity: 0;
  transition: opacity .18s ease, visibility .18s ease;
}

.lightbox.active {
  visibility: visible;
  opacity: 1;
}

.lightbox img {
  max-width: 92%;
  max-height: 92%;
  border-radius: 10px;
  box-shadow: 0 10px 80px rgba(0,0,0,0.8);
}

/* ===========================
ANIMATIONS
=========================== */
.inactive img {
  filter: grayscale(100%) brightness(0.6);
}

.highlight {
  animation: pulseBtn 0.8s infinite;
}

@keyframes pulseBtn {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.selected {
  border: 3px solid #0ff;
}

@keyframes pulseGrey {
  0%   { transform: scale(1); opacity: 0.65; }
  50%  { transform: scale(1.08); opacity: 0.9; }
  100% { transform: scale(1); opacity: 0.65; }
}

/* ===========================
SCROLLABLE CONTENT AREAS
=========================== */
#leftThought,
#rightThought {
  max-height: 150px;
  overflow-y: auto;
  padding-right: 6px;
}

#middleBox {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 6px;
}

#bottomBox {
  max-height: 350px;
  overflow-y: auto;
  padding-right: 6px;
}

#leftThought::-webkit-scrollbar,
#rightThought::-webkit-scrollbar,
#middleBox::-webkit-scrollbar,
#bottomBox::-webkit-scrollbar {
  width: 6px;
}

#leftThought::-webkit-scrollbar-thumb,
#rightThought::-webkit-scrollbar-thumb,
#middleBox::-webkit-scrollbar-thumb,
#bottomBox::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.3);
  border-radius: 3px;
}

/* ===========================
RESPONSIVE BEHAVIOR
=========================== */
@media (max-width: 1100px) {
  .roster { grid-template-columns: 1fr; }
  .column { min-height: 0; }
  .center-card { order: 2; }
}

@media (max-width: 768px) {
  body { padding: 14px; }
  .roster { grid-template-columns: 1fr; }
  .icon-grid {
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 8px;
  }
  .char-btn { --size: 64px; }
  .char-btn.highlight { transform: scale(1.04); }
  .char-btn.selected { transform: scale(1.06); }
  .side-image { width: 90px; height: 90px; }
  .thumb { width: 70px; height: 70px; }
}

@media (min-width: 1100px) {
  .icon-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  body { padding: 10px; }
  .roster {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .column,
  .center-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .relationship-ui,
  .neutral-box,
  .large-box,
  .bottom-box,
  .middle-box,
  .tagline-box {
    max-width: 100%;
    overflow-x: hidden;
    word-wrap: break-word;
  }
  .side-image { width: 80px; height: 80px; }
  .thumb { width: 64px; height: 64px; }
  .icon-grid {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
  }
  #leftThought,
  #rightThought,
  #middleBox,
  #bottomBox {
    max-height: none;
    overflow-y: visible;
  }
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(71px, max-content));
  gap: 10px;
  justify-content: center;
}

@media (max-width: 600px) and (hover: none) and (pointer: coarse) {
  .top-row {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }
  .side-image {
    width: 64px;
    height: 64px;
  }
  .name-box {
    font-size: 0.85rem;
    padding: 8px;
    min-width: 40%;
  }
}

@media (max-width: 600px) {
  .top-row {
    justify-content: center;
    flex-wrap: wrap;
  }
  .name-box {
    min-width: 40%;
  }
}

@media (max-width: 768px) {
  .icon-grid {
    grid-template-columns: repeat(auto-fit, minmax(60px, max-content));
    gap: 8px;
    justify-content: center;
  }
}

/* ===========================
MISC
=========================== */
.instruction-text {
  color: #adb5bd;
  font-weight: 600;
  font-style: italic;
}

#tabsRow .nav-link,
#tabsRow button,
#tabsRow a {
  color: #e9eef2;
  border: 1px solid rgba(255,255,255,0.08);
}

#tabsRow .nav-link:hover,
#tabsRow button:hover,
#tabsRow a:hover {
  background-color: #4a4a4a;
}

#tabsRow .nav-link.active,
#tabsRow button.active,
#tabsRow a.active {
  background-color: #500;
}

.label a {
    color: inherit;        /* Makes link color match surrounding text */
    text-decoration: none; /* Removes underline */
      font-weight: 600;
       color: inherit;
}

.label a:hover {
    color: #DC143C;        /* Keeps same color on hover */
    text-decoration: underline; /* Optional: underline on hover */
    cursor: pointer;       /* Shows pointer cursor */
}



/* ===========================
   NAVIGATION STYLES (grouped)
============================*/

/* Invisible hover zone around nav circle */
.nav-hover-zone {
    position: fixed;
    bottom: 15px;
    right: 0;
    width: 60%;   /* <-- Adjust this % to control hover activation width */
    height: 60%;  /* <-- Adjust this % to control hover activation height */
    max-width: 250px;
    max-height: 250px;
    z-index: 9998; /* below nav itself */
    pointer-events: auto; /* must detect hover */
}

/* Mobile nav circle container */
.mobile-nav {
    position: fixed;
    bottom: 15px;
    right: 0;
    height: 250px;
    width: 250px;
    border-radius: 50% 0 0 50%;
    background: rgba(255,255,255,0.02);
    border: 2px solid #9f2a2a;
    z-index: 9999;
    pointer-events: none; /* ignore clicks on circle itself */
    transition: right 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    opacity: 0.2;
    backdrop-filter: blur(3px); /* increase for more blur */
}


/* Slide in nav when hover zone is hovered */
.nav-hover-zone:hover + .mobile-nav {
    right: 0 !important;
    opacity: 1;
}

/* Side nav links inside circle */
.side-nav {
    position: absolute;
    bottom: 15px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
    pointer-events: auto; /* make links clickable */
    z-index: 10000;
}

/* Shared nav-link styles */
.nav-link {
    display: inline-block;
    background: #9f2a2a;
    color: white;
    text-decoration: none;
    padding: 1px 20px;
    border-radius: 20px 0 0 70px;
    transition: all 0.3s ease;
    gap: 10px;
    font-family: monospace;
    letter-spacing: 2px;
    text-align: left;
    position: relative;
    text-transform: uppercase;
    white-space: nowrap;
}

.nav-link .nav-content {
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.3s ease;
}

.nav-link span {
    display: inline-block;
    transition: transform 0.3s ease;
}

.nav-link:hover {
    background: #b53333;
    padding-left: 70px;
    color: #ffcccc;
    box-shadow: -6px 6px 16px rgba(0,0,0,0.4);
    transform: scale(1.02);
}

.nav-link:hover .nav-content {
    transform: translateX(-20px);
}

.nav-link i {
    margin-right: 8px;
    font-size: 14px;
    min-width: 16px;
}



/* ===========================
   SIDE NAVIGATION HIDING
=========================== */

/* Base state: partially hidden */
.mobile-nav {
    position: fixed;
    bottom: 15px;
    right: -140px !important; /* hides most of nav offscreen except small part */
    z-index: 9999;
    transition: right 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

/* On hover: slide nav fully in */
.mobile-nav:hover {
    right: 0 !important;
    opacity: 1;
}

/* Keep hover effect consistent for nav links */
.mobile-nav .nav-link {
    white-space: nowrap;
}

/* ===========================
   MOBILE NAV SHRINKING
=========================== */
@media (max-width: 768px) {
    .mobile-nav {
        transform: scale(0.65);
        transform-origin: bottom right;
        right: -80px !important; /* less hidden on mobile */
    }
}

.mobile-nav {
    width: 200px !important;
    height: 260px !important;
    border-radius: 70% 0 0 70% !important;
}

