
.msg-new { border-left: 3px solid #a855f7; animation: pulse-new 2s infinite; }
@keyframes pulse-new {
    0% { background-color: rgba(168, 85, 247, 0); }
    50% { background-color: rgba(168, 85, 247, 0.1); }
    100% { background-color: rgba(168, 85, 247, 0); }
}



/* Maintenance Mode Styles */
#maintenance-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(30,20,60,1) 0%, rgba(5,5,20,1) 100%);
    z-index: 10000; /* Ensure it is above everything else */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.maintenance-content {
    background: rgba(30,20,60,0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 3rem;
    border-radius: 1.5rem;
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.3);
}

.maintenance-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    color: #a78bfa;
}


  :root {
    color-scheme: dark;
  }
  body { padding-bottom: 50px; margin:0; font-family:'Segoe UI', sans-serif; overflow-x:hidden; background: radial-gradient(circle at center, rgba(30,20,60,1) 0%, rgba(5,5,20,1) 100%); color:white; }
  
  /* --- Galaxy Background --- */
  .stars { position:fixed; top:0; left:0; width:200%; height:200%; background:transparent url('/images/stardust.png') repeat; background-size:1000px 1000px; animation: moveStars 100s linear infinite; z-index:-2; opacity:0.5; }
  @keyframes moveStars { from{transform:translate(0,0);} to{transform:translate(-500px,-500px);} }
  
  .galaxy-gradient { position:fixed; top:0; left:0; width:100%; height:100%; background: radial-gradient(ellipse at 30% 30%, rgba(138,43,226,0.4), transparent 70%), radial-gradient(ellipse at 70% 70%, rgba(0,191,255,0.3), transparent 70%); z-index:-1; animation:pulse 15s ease-in-out infinite alternate; }
  @keyframes pulse {0%{transform:scale(1); opacity:0.7;}100%{transform:scale(1.2);opacity:1;}}

  header h1 {
	cursor: pointer;
  }
  /* --- Navigation & Layout --- */
  .tab, .admin-tab { display:none; } .active-tab{display:block;}
  .nav-btn, .admin-nav-btn { cursor:pointer; transition:all 0.3s; padding: 0.5rem 1rem; border-radius: 0.5rem; } 
  .nav-btn:hover, .admin-nav-btn:hover{color:#a78bfa; background: rgba(255,255,255,0.05);}
  .nav-btn.active, .admin-nav-btn.active{font-weight:bold;color:#fff; background: linear-gradient(90deg, #4F46E5 0%, #7C3AED 100%); box-shadow: 0 0 15px rgba(124, 58, 237, 0.5);}
  
  /* --- Cards & UI --- */
  .card { background: rgba(30,20,60,0.6); backdrop-filter: blur(10px); border:1px solid rgba(255,255,255,0.08); transition:transform 0.3s, box-shadow 0.3s; padding:1rem; border-radius:1rem; position: relative; }
  .card:hover { box-shadow:0 10px 25px -5px rgba(138,43,226,0.4); border-color: rgba(138,43,226,0.5); }
  
  .social-links a { display:inline-block;margin-right:8px;color:#bbb; transition:color 0.3s;}
  .social-links a:hover{color:#fff;}
  .online-image{width:100%; display:block;}
  .offline-image{width:50%; margin:0 auto; display:block;}
  .invisible{display: none; width: 0; height: 0;}
  .stream-title{margin: 0 0 15px 0;}
  
  /* --- Colors --- */
  .red{color: #ef4444;}
  .purple{color: #a855f7;}
  .white{color: white;}
  .grey{color: #9ca3af;}
  .tag{margin-bottom: 4px;}

  /* --- Streamer Card specific --- */
  .cover-container {position: relative;}
  .live-status.live {}
  .live-status.offline {bottom: 0px; right: 0px; top: auto; left: auto;}
  .live-status {position: absolute; top: 10px; left: 10px;}
  .live-flag {position: absolute; bottom: 0px; left: 0px;}
  .live-flag img {width: 30px;}
  .live-mature {position: absolute; top: 10px; right: 10px; background-color: #ef4444; color: white; padding: 0 5px; font-size: 0.75rem; border-radius: 4px;}
  .live-viewer {position: absolute; bottom: 0px; right: 0; background-color: rgba(0,0,0,0.8); padding: 2px 6px; border-top-left-radius: 6px;}
  
  #profile .card {
	max-height: fit-content;
  }
  
  #custom-dialog-card {
  	margin: 0 auto;
  	top: 50px;
  }
  
  
  /* NEUES CSS für die E-Mail-Body-Skalierung */
  #detail-body table, 
  #detail-body img,
  #detail-body video,
  #detail-body iframe {
      /* Wichtig: überschreibt inline width="..." und style="width:..." Attribute */
      max-width: 100% !important;
      /* Stellt sicher, dass das Element die volle Breite des Containers nutzt, wenn es schmaler ist */
      width: 100%; 
      height: auto; 
  }
  
  /* Falls die Tabelle noch Ränder oder Padding hat, die überlaufen könnten */
  #detail-body table {
      /* Verhindert, dass das Padding der Zelle über die 100% Breite hinausragt */
      box-sizing: border-box; 
  }
  
  
  
  /* --- Pulse Animation --- */
  .pulse-dot {
    position: relative;
    display: inline-block;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
    margin-left: 5px;
    z-index: 1;
    top: -3px;
    left: 5px;
  }
  .pulse-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: rgba(255, 0, 0, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(1);
    animation: sonar 1.5s infinite;
    z-index: 0;
  }
  @keyframes sonar {
    0% {transform: translate(-50%, -50%) scale(1);opacity: 0.6;}
    70% {transform: translate(-50%, -50%) scale(1.8);opacity: 0.3;}
    100% {transform: translate(-50%, -50%) scale(2);opacity: 0;}
  }
  
  
  /* --- email Animation --- */
  .email-dot {
    position: relative;
    display: inline-block;
    background: rgb(59 130 246);
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
    margin-left: 5px;
    z-index: 1;
    top: -3px;
    left: 5px;
  }
  .email-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: rgba(59, 130, 246, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(1);
    animation: sonar 1.5s infinite;
    z-index: 0;
  }
  
  button i {
    pointer-events: none;
  }
  
  
  /* --- Twitch Grid Fixes --- */
  #twitch-list .card { display: flex; flex-direction: column; height: 100%; transition: transform 0.3s, box-shadow 0.3s, opacity 0.3s; }
  #twitch-list .card.offline { opacity: 0.7; }
  #twitch-list .card.offline:hover { opacity: 1; }
  
  @keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.2); }
    50% { transform: scale(1); }
    75% { transform: scale(1.2); }
  }
  .heart-beat { display: inline-block; animation: heartbeat 1.5s infinite; transform-origin: center; }

  /* --- Bento Grid Home Specifics --- */
  .bento-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(1, 1fr); }
  
   @media (max-width: 471px) {
		nav .p-6 {
			padding: 1.0rem;
		}
		header h1 {
			height: 43px;
		}
    }
  
  #twitch-btn-mobile {
	display: inline-flex;
  }
  
  
  
  
  
  @media (min-width: 768px) {
    .bento-grid { grid-template-columns: repeat(4, 1fr); grid-template-rows: auto auto; }
    .col-span-2 { grid-column: span 2; }
    .col-span-4 { grid-column: span 4; }
    .row-span-2 { grid-row: span 2; }
  }
  
  .glass-header {
      background: rgba(15, 10, 30, 0.6);
      backdrop-filter: blur(12px);
      border-bottom: 1px solid rgba(255,255,255,0.05);
  }
  
  .logout-state {
		color: #f87171 !important; /* Tailwind's text-red-400 color */
	}

	/* To ensure it stays red on hover/active, override existing styles */
	.logout-state:hover {
		color: #ef4444 !important; /* Tailwind's text-red-500 hover color */
	}
  
  /* Add this new block to your existing <style> section */
	#custom-logo {
		/* 1. Set your image */
		background-image: url('/images/gamernova-header-logo.png');
		background-size: contain;
		background-repeat: no-repeat;
		background-position: center;

		/* 2. Apply the gradient as a background */
		background-color: transparent; /* Use transparent as the base */
		background-image: linear-gradient(90deg, #a78bfa 0%, #818cf8 100%); /* Use the same purple/blue gradient colors or your desired logo color */

		/* 3. Use the original image as a mask. This reveals the gradient only where the original image pixels exist. */
		mask: url('/images/gamernova-header-logo.png');
		mask-size: contain;
		mask-repeat: no-repeat;
		mask-position: center;

		/* 4. Match the size of the old icon */
		width: 53px;

		/* 5. Apply the purple drop shadow like the old icon had */
		filter: drop-shadow(0 0 5px rgba(168, 85, 247, 0.6));
	}
    
    /* Styles for the Icon Picker */
    .icon-button:hover i {
        transform: scale(1.2);
        color: white;
    }
    .icon-button i {
        transition: transform 0.2s, color 0.2s;
        color: #ddd;
    }
    .icon-button.selected {
        outline: 3px solid #a78bfa;
        outline-offset: 2px;
    }
	
	/* New style to display the user image as a round icon in the navigation menu */
	.nav-profile-image {
		width: 1.5rem; /* Adjust size to fit next to text */
		height: 1.5rem;
		border-radius: 50%;
		object-fit: cover;
		border: 2px solid #a78bfa; /* Subtle purple border */
		filter: drop-shadow(0 0 5px rgba(168, 85, 247, 0.4)); /* Subtle glow */
		display: inline-block;
	}
	
	#email .folder-item .email-dot {
		height: 20px;
		top: unset;
		left: unset;
		right: unset;
		bottom: unset;
	}
	
	#bulk-action-bar {
		position: fixed; bottom: 30px; z-index: 2; left: 30px;
	}
	
	/* --- Twitch Detail View Styles & Animations --- */
.twitch-detail-view-container {
    display: flex; /* To lay out the streamer card and content cards side-by-side */
    flex-wrap: wrap; /* Allow wrapping on small screens */
    gap: 1.5rem;
}
.twitch-card-move-out {
    /*pointer-events: none;*/
    height: fit-content !important;
    margin: 0 !important;
    border: none !important;
	flex: 0 0 300px;
}

.twitch-card-selected {
    /* For the card that moves to the first position */
    transition: all 0.5s ease-in-out, max-width 0.5s, min-width 0.5s;
    grid-column: span 1; /* Reset grid rules */
    margin-right: 1.5rem; /* Add separation */
    min-width: 250px;
}

.twitch-detail-card {
    /* Styles for VOD/Clip cards */
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: auto; /* Reset height */
    max-height: 300px;
	padding: 0;
}

.twitch-vods-clips-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(1, 1fr);
    flex-grow: 1; /* Take up remaining space */
}
@media (min-width: 768px) {
    .twitch-vods-clips-grid {
        grid-template-columns: repeat(3, 1fr);
    }
	.twitch-card-selected {
		max-width: 465px;
	}
}

/* Ensure the original list container and cards have the necessary transitions */
#twitch-list {
    transition: all 0.5s ease-in-out;
}
#twitch-list .card {
    transition: transform 0.3s, box-shadow 0.3s, opacity 0.3s, margin 0.5s, padding 0.5s, height 0.5s;
}

.mobile-nav .pulse-dot, .mobile-nav .email-dot {
	top: 5px;
}

.image-container {
    position: relative; /* CRUCIAL: Makes it the positioning context */
    overflow: hidden;   /* Keeps the image contained */
}

/* FullCalendar Styling Overrides */
  .fc {
    font-family: 'Segoe UI', sans-serif;
  }
  .fc .fc-toolbar-title {
    color: #fff; /* White title */
    font-size: 1.5rem;
    font-weight: 700;
  }
  .fc .fc-button {
    background-color: #581c87; /* Purple */
    border-color: #581c87;
    color: #fff;
    transition: all 0.2s;
  }
  .fc .fc-button:hover {
    background-color: #7e22ce; /* Lighter Purple on hover */
    border-color: #7e22ce;
  }
  .fc .fc-daygrid-day-number {
    color: #aaa; /* Grayish day number */
    padding: 0.5rem;
    font-weight: 600;
  }
  .fc-daygrid-day-top {
    /* Ensures date numbers are aligned top-right */
    justify-content: flex-end; 
    padding: 0.5rem;
  }
  .fc-theme-standard td, .fc-theme-standard th {
    border-color: #374151; /* Dark border color (gray-700) */
  }
  .fc-day-other .fc-daygrid-day-frame {
    background-color: rgba(0, 0, 0, 0.1); /* Slightly darker for days outside the month */
  }
  .fc-event {
    border-radius: 0.25rem;
    padding: 2px 4px;
    margin-bottom: 2px;
    font-size: 0.85rem;
    cursor: pointer;
  }
  
  /* Custom styling for Streamer events (red border) */
  .streamer-event {
    /* Background for the event container */
    background-color: rgba(255, 0, 0, 0.1); /* Red-500 with low opacity */
    color: #ff0000; /* Light red text */
    border-left: 4px solid #ef4444; /* Solid red border on the left */
  }

  /* Styling for the user profile image inside the event */
  .fc-event-main-content img {
    border-radius: 9999px; /* Tailwind's rounded-full */
    width: 20px;
    height: 20px;
    object-fit: cover;
    margin-right: 4px;
    display: inline-block;
    vertical-align: middle;
  }
  
  .fc .fc-scrollgrid {
	border: 1px solid rgba(15, 10, 30, 0.6);
	border-right: 0px;
	border-radius: 10px;
	overflow: hidden;
  }
  
  .fc-daygrid-day-frame {
	cursor: pointer;
  }
  
  .fc-daygrid-day-frame:hover {
	background-color: rgba(68, 68, 239, 0.1);
  }
  
  .fc .fc-list-sticky .fc-list-day > * {
	background: rgba(15, 10, 30, 0.6);
    backdrop-filter: blur(12px);
  }
  
  .fc-theme-standard .fc-list-day-cushion {
    background-color: transparent;
  }
  
  .fc-theme-standard .fc-list {
	border: 1px solid rgba(15, 10, 30, 0.6);
	border-radius: 10px;
    overflow: hidden;
  }
  
  .fc-col-header  {
	background: rgba(15, 10, 30, 0.6);
    backdrop-filter: blur(12px);
  }
  
  .fc-theme-standard td, .fc-theme-standard th {
    border: 1px solid rgba(15, 10, 30, 0.6);
  }
  
  .fc .fc-list-event:hover td {
    background-color: rgba(68, 68, 239, 0.1);
  }
  
  .fc-h-event {
    background-color: transparent;
    border: transparent;
  }
  
  .fc .fc-daygrid-day.fc-day-today {
    background-color: rgba(88, 28, 135, 0.4);
  }
  
  /* New: Style for Day View User Selection */
  .day-user-card {
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
  }
  .day-user-card:hover {
    border-color: #a78bfa; /* purple-400 */
    transform: translateY(-2px);
  }
  .day-user-card.selected-for-compare {
    border-color: #4f46e5; /* indigo-600 */
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.5);
  }
  
  .fc .fc-list-empty {
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
  }
  
  .bg-clip-text {
	  -webkit-background-clip: text;
	  -webkit-text-fill-color: transparent;
	}
	
	
	.game-tag {
		cursor: pointer;
	}
	
	#twitch-list > a {
		width: 100%;
	}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	#inspector-selection {
    pointer-events: none; /* Let clicks pass through initially */
    touch-action: none;
}

/* The clickable area for moving (border + thin overlay) */
#inspector-selection.active {
    pointer-events: auto; /* Enable interaction when active */
    cursor: move;
    background: rgba(168, 85, 247, 0.05); /* Slight tint */
}

/* Resize Handles */
.resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: white;
    border: 1px solid #a855f7;
    z-index: 50;
    pointer-events: auto; /* Always clickable */
}

/* Handle Positions */
.handle-nw { top: -6px; left: -6px; cursor: nw-resize; }
.handle-ne { top: -6px; right: -6px; cursor: ne-resize; }
.handle-sw { bottom: -6px; left: -6px; cursor: sw-resize; }
.handle-se { bottom: -6px; right: -6px; cursor: se-resize; }

/* Drag & Drop Visual Cue */
#canvas-wrapper.drag-over {
    border: 4px dashed #a855f7;
    background: rgba(168, 85, 247, 0.1);
}


@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}


.template-card-ratio {
    position: relative;
    width: 100%;
    /* 16 / 9 = 1.777 */
    aspect-ratio: 9 / 16; 
    background: #000;
    overflow: hidden;
}

/* Fallback for older browsers that don't support aspect-ratio */
@supports not (aspect-ratio: 9/16) {
    .template-card-ratio {
        padding-bottom: 177.77%;
    }
}















/* Section Headers (A, B, C...) */
.template-group-header {
    grid-column: 1 / -1; /* Span full width */
    font-size: 1.5rem;
    font-weight: bold;
    color: #a78bfa; /* Purple-400 */
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 0.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    scroll-margin-top: 100px; /* Offset for sticky header scrolling */
}


/* Adjust grid padding to make room for scroller */
#template-list {
    padding-right: 40px; 
}


















#alpha-scroller {
	position: absolute;
    right: 20px;
    top: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    z-index: 20;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    backdrop-filter: blur(4px);
    font-family: monospace;
    font-size: 1.8rem;
    color: #9ca3af;
    overflow-y: auto;
	transition: all 0.2s;
	width: 50px;
}

#alpha-scroller a {
    display: block;
    width: 100%;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.2;
	opacity: 0.5; /* Dim inactive letters slightly */
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#alpha-scroller a:hover {
    color: #fff;
    font-weight: bold;
    transform: scale(1.3);
    color: #a78bfa; /* Purple highlight */
}

/* Hide scrollbar for the alpha-scroller itself */
#alpha-scroller::-webkit-scrollbar {
    display: none; 
}


/* Active state for the Alphabet Scroller */
#alpha-scroller a.active {
    opacity: 1;
    color: #a78bfa;       /* Purple-400 */
    font-weight: 900;     /* Extra Bold */
    font-size: 1.2rem;    /* Scale up font */
    transform: scale(1.5); /* Pop out effect */
    text-shadow: 0 0 15px rgba(167, 139, 250, 0.6); /* Glow */
}

/* Yellow Star for Featured Templates */
.featured-star {
    position: absolute;
    top: 8px;
    right: 8px;
    color: #facc15; /* Yellow-400 */
    font-size: 1.2rem;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}


#templates-count-home {
	font-weight: bold;
    font-size: large;
    color: rgb(129 140 248 / var(--tw-text-opacity, 1));
}










/* --- Custom Scrollbar --- */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px; /* Height for horizontal scrollbars */
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02); /* Very subtle background */
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.3); /* Purple-400 with low opacity */
    border-radius: 3px;
    transition: background 0.2s ease;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.8); /* Bright purple on hover */
}

/* Firefox Compatibility */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(168, 85, 247, 0.3) rgba(255, 255, 255, 0.02);
}

/* Floating Animation */
@keyframes float-slow {
	0%, 100% { transform: translateY(0px); }
	50% { transform: translateY(-10px); }
}
.animate-float {
	animation: float-slow 6s ease-in-out infinite;
}









/* --- Card Flip & Expand Animation Styles --- */

.flip-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9998;
    pointer-events: auto;
}


.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s ease-in-out;
    transform-style: preserve-3d;
}

/* STRICT POSITIONING FOR FACES */
.flip-card-front, .flip-card-back {
    position: absolute !important; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0 !important;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 1rem;
    overflow: hidden;
}

/* FRONT FACE */
.flip-card-front {
    transform: rotateY(0deg);
    background: rgba(30,20,60,0.6);
    z-index: 2;
    display: block; 
    text-align: left;
}

/* BACK FACE */
.flip-card-back {
    transform: rotateY(180deg);
    background: rgba(15, 10, 30, 0.98);
    /* REMOVED: Fixed border color line */
    /* ADDED: Generic border properties */
    border-width: 1px;
    border-style: solid; 
    /* The color is now handled by the JS-injected Tailwind class (e.g., border-pink-500) */
    
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

/* STATES */
.flip-card-wrapper.is-flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-wrapper.is-expanded {
    top: 5vh !important;
    left: 5vw !important;
    width: 90vw !important;
    height: 90vh !important;
}

body.modal-open {
    overflow: hidden;
}


/* --- Flip Card Modal Animation --- */
.flip-card-wrapper {
    position: fixed;
    z-index: 50;
    
    /* 1. Sync Timing: EXACTLY match the scaler */
    /* 2. Slow Motion: 2.0s duration */
    transition: 
        top 1s cubic-bezier(0.4, 0, 0.2, 1),
        left 1s cubic-bezier(0.4, 0, 0.2, 1),
        width 1s cubic-bezier(0.4, 0, 0.2, 1),
        height 1s cubic-bezier(0.4, 0, 0.2, 1);
        
    perspective: 1000px;
    pointer-events: none;
    will-change: top, left, width, height;
}

/* The state when the modal is fully expanded */
.flip-card-wrapper.is-expanded {
    top: 5% !important;
    left: 5% !important;
    width: 90% !important;
    height: 90% !important;
    z-index: 1001;
    pointer-events: auto; /* Re-enable clicks */
}

/* The trigger for the flip rotation */
.flip-card-wrapper.is-flipped .flip-card-inner {
    transform: rotateY(180deg);
}

/* Ensure inner card handles the rotation transition */
.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s ease-in-out;
    transform-style: preserve-3d;
}

/* --- Modal Internal Content Styling --- */
.modal-content-container {
    max-width: 1000px;
    margin: 0 auto;
    padding-bottom: 2rem;
}

.modal-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.modal-screenshot-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 4rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1.5rem;
    padding: 1.5rem;
    transition: transform 0.3s;
}

.modal-screenshot-wrapper {
    width: 100%;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-screenshot-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

.modal-screenshot-text h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: white;
}

.modal-screenshot-text p {
    color: #94a3b8;
    line-height: 1.6;
    font-size: 1rem;
}

@media (min-width: 768px) {
    .modal-screenshot-group { padding: 2rem; }
}


/* --- Internal Scaler for the "Miniature" Effect --- */
.modal-scaler {
    position: absolute;
    top: 0;
    left: 0;
    height: auto;
    min-height: 100%;
    
    transform-origin: top left;
    
    /* EXACTLY match the wrapper's timing and curve */
    transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
    
    backface-visibility: hidden;
    will-change: transform;
    
    /* Prevent blurry text during scale */
    -webkit-font-smoothing: antialiased;
}

/* Ensure the back face clips the massive scaled content initially */
.flip-card-back {
    display: block; /* Remove 'flex' which might center/offset the absolute child */
    overflow: hidden !important; 
    /* Ensure background is opaque so we don't see the front card through it */
    background: #0f111a; 
}

/* Enable scroll only when fully expanded */
.flip-card-wrapper.is-expanded .flip-card-back {
    overflow-y: auto !important;
}






/* Nebula Drifting */
@keyframes drift-slow {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-30px, 20px); }
}
@keyframes drift-mid {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(40px, -30px); }
}
.animate-drift-slow { animation: drift-slow 15s ease-in-out infinite; }
.animate-drift-mid { animation: drift-mid 12s ease-in-out infinite; }

/* Scanning Line Animation */
@keyframes scan {
    0% { transform: translateY(-100%); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(300%); opacity: 0; }
}
.animate-scan { animation: scan 3s cubic-bezier(0.4, 0, 0.2, 1) infinite; }

/* Discovery Entrance */
@keyframes discovery-entrance {
    0% { transform: scale(0.5); opacity: 0; filter: brightness(2) blur(10px); }
    100% { transform: scale(1); opacity: 1; filter: brightness(1) blur(0px); }
}
.animate-premium-entrance { 
    animation: discovery-entrance 1s cubic-bezier(0.2, 1, 0.3, 1) forwards; 
}

/* Floating Icon (Enhanced) */
@keyframes float-space {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-10px) rotate(2deg); }
    66% { transform: translateY(5px) rotate(-2deg); }
}
.animate-float {
    animation: float-space 6s ease-in-out infinite;
}

/* Orbital Rotation */
@keyframes orbital-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.animate-spin-slow { animation: orbital-spin 20s linear infinite; }