:root {
  --space-dark: #0b0e14;
  --space-card: #131822;
  --star-gold: #d4af37;
  --text-muted: #8a94a6;
}

body {
  background-color: var(--space-dark);
  color: #f8f9fa;
  font-family: 'Space Grotesk', sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

p > img {
  width: 100%;
}

p {
  color: white;
}

.text-justify > h1,
.text-justify > h2,
.text-justify > h3 {
  text-align: center;
}
.text-justify > p {
  text-align: justify;
}

header {
  background: url(star_bg.jpg);
  background-size: cover;
  background-position: center center;
  position: relative;
  overflow: hidden;
}

.header-art {
  width: 100%;
  max-width: 100%;
  height: auto; 
  display: inline-block;
  animation: floatSine 4s ease-in-out infinite;
  will-change: transform;

  position: absolute;
  right: 15px;
  top: 50%;
  vertical-align: center;
}

main {
  border-top: 2px solid var(--star-gold);
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background-color: var(--space-dark);
}

h4 {
  font-weight: 400;
  text-decoration: underline;
}

.zola-anchor {
    font-size: 0.85em;
    color: #63b3ed;
    text-decoration: none !important;
    margin-right: 0.5rem;
    opacity: 0;
    transition: opacity 0.15s ease-in-out, color 0.15s ease;
}

h1 .zola-anchor,
h4 .zola-anchor {
  display: none;
}

h2:hover .zola-anchor,
h3:hover .zola-anchor {
    opacity: 0.7;
}

.zola-anchor:hover {
    opacity: 1 !important;
    color: #4299e1;
}

/*.text-center li {
  text-align: left !important;
}*/

.site-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  letter-spacing: 2px;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

@keyframes floatSine {
  0% {
    transform: translate3d(0, -30%, 0);
  }
  50% {
    transform: translate3d(0, calc(-30% - 10px), 0);
  }
  100% {
    transform: translate3d(0, -30%, 0);
  }
}

.nav-link, .toc-link {
  color: #f8f9fa !important;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-link.active {
  font-weight: 800;
  text-decoration: underline;
}
.nav-link.active:hover {
  color: inherit !important;
}

.nav-link:hover, .toc-link:hover {
  color: var(--star-gold) !important;
}

.nav-item .btn {
  text-wrap: nowrap;
}

.btn-discord {
  background-color: #5865F2;
  color: white;
  border: none;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.btn-app {
  background-color: #a19133;
  color: white;
  border: none;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.btn-youtube {
  background-color: #DD0000;
  color: white;
  border: none;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.btn-discord:hover {
  background-color: #4752C4;
  color: white;
}

.btn-app:hover {
  background-color: #706525;
  color: white;
}

.btn-youtube:hover {
  background-color: #AA0000;
  color: white;
}

main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.5rem;
  letter-spacing: 4px;
  color: var(--star-gold);
  animation: pulse 2s infinite alternate;
}

@keyframes pulse {
  from { opacity: 0.6; text-shadow: 0 0 10px rgba(212,175,55,0.2); }
  to { opacity: 1; text-shadow: 0 0 20px rgba(212,175,55,0.6); }
}

footer {
  background-color: #07090d;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid #1a2333;
}

footer strong {
  color: #ffffff;
}

.card-body {
  color: white;
}

.text-muted {
  color: #dddddd !important;
}

.card {
    background: rgba(26, 32, 44, 0.75) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(8px);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.granted-effect-box {
    background: linear-gradient(90deg, rgba(212, 163, 89, 0.1) 0%, rgba(0, 0, 0, 0) 100%);
    border-left: 3px solid #d4a359;
}
.granted-effect-box p {
  margin-bottom: 0px;
}

/* --- REQ HAND-DECK CARDS WRAPPERS --- */
.req-hand-preview {
    background: rgba(0, 0, 0, 0.15);
    margin: 0 -0.5rem -0.5rem -0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
}

.hand-card-slot {
    width: 45%;
    height: calc(45% * 1.46); /* Perfect YGO card 1:1.46 ratio bounding box alignment */
    border-radius: 3px;
    overflow: hidden;
    background: #0d1117;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.hand-card-slot:hover {
    transform: translateY(-4px) scale(1.35);
    border-color: var(--star-gold);
    z-index: 5;
}

.hand-card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Header Box Initial Rest State */
.collapsible-header {
    background: linear-gradient(135deg, rgba(26, 32, 44, 0.8) 0%, rgba(17, 22, 34, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px; /* Soft rounding all around when closed */
    transition: border-radius 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

/* Adjust header borders only while the content below is expanded/active */
.collapsible-header:not(.collapsed) {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-color: rgba(99, 179, 237, 0.2);
}

/* Interior Content Panel */
.collapsible-body {
    background: rgba(15, 20, 30, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-top: none;
}

.collapsible-header.collapsed .chevron-indicator {
    transform: rotate(0deg);
    color: #63b3ed;
}
.collapsible-header:not(.collapsed) .chevron-indicator {
    transform: rotate(90deg);
    color: var(--star-gold, #f6ad55);
}
.chevron-indicator {
    font-size: 0.85rem;
    display: inline-block;
    transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1), color 0.25s ease;
}

.toc-card-btn {
    transition: transform 0.15s ease-in-out;
}

.toc-card-btn:hover {
    transform: translateY(-3px);
}

.toc-thumb-frame {
    width: 100%;
    aspect-ratio: 1 / 1.46; /* Matching authentic card boundaries */
    background: #000;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.toc-thumb-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(85%);
    transition: filter 0.15s ease;
}

/* Brighten card colors and tint border blue on button hover */
.toc-card-btn:hover .toc-thumb-frame {
    border-color: #63b3ed;
    box-shadow: 0 0 10px rgba(99, 179, 237, 0.4);
}
.toc-card-btn:hover .toc-thumb-frame img {
    filter: brightness(100%);
}

.toc-card-label {
    font-size: 0.6rem;
    color: #a0aec0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    transition: color 0.15s ease;
}

.toc-card-btn:hover .toc-card-label {
    color: #63b3ed;
}

.tutorial-card:target {
    animation: flashTargetGlow 1.5s ease-out;
}

@keyframes flashTargetGlow {
    0% { box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.6); }
    100% { box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2); }
}

#navGroupWrapper, #scrollToPrevBtn, #scrollToNextBtn {
  transition: opacity 0.15s ease-in-out;
}
.pointer-events-none {
    pointer-events: none !important;
}

.ruling-box > p {
  margin-bottom: 0px;
}

/* Supporters */

.twinkle-card {
    background-color: #080d16 !important;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.twinkle-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
    background-size: 160px 160px;
    
    background-image: 
        radial-gradient(2px 2px at 15px 25px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(3px 3px at 50px 100px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 130px 40px, #e2e8f0, rgba(0,0,0,0)),
        radial-gradient(4px 4px at 95px 135px, rgba(99, 179, 237, 1), rgba(0,0,0,0)),
        radial-gradient(2px 2px at 70px 15px, #ffffff, rgba(0,0,0,0));
    
    animation: intenseTwinkleAlpha 2s infinite ease-in-out alternate;
}

.twinkle-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
    background-size: 180px 180px;
    
    background-image: 
        radial-gradient(2px 2px at 35px 140px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(3.5px 3.5px at 150px 95px, rgba(246, 173, 85, 1), rgba(0,0,0,0)), /* Large Gold Star */
        radial-gradient(2px 2px at 80px 65px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(2.5px 2.5px at 115px 160px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 10px 85px, #e2e8f0, rgba(0,0,0,0));

    animation: intenseTwinkleAlpha 3.2s infinite ease-in-out alternate;
    animation-delay: 0.7s; /* Broken timing offset */
}

@keyframes intenseTwinkleAlpha {
    0%, 100% { 
        opacity: 0.1;
    }
    50% { 
        opacity: 1.0;
    }
}