﻿/* =========================================================
   1. GLOBAL RESET & TYPOGRAPHY
   ========================================================= */
* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #334155; 
  /* Kept the final active gradient; previous redundant duplicates removed */
  background: linear-gradient(180deg, #0f172a 0%, #64748B 100%);
  background-attachment: fixed;
  min-height: 100vh;
  padding-bottom: 30px;
}

/* =========================================================
   2. MASTER HEADER & TOOLS
   ========================================================= */
#master-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1300px; 
  margin: 0 auto;
  padding: 20px 15px;
}

.header-left, .header-right { flex: 1; }

/* The new rounded Dark/Gold Member Login Button */
.member-login-btn {
  background-color: #1e293b;
  color: white;
  padding: 10px 25px;
  border-radius: 50px;
  border: 2px solid #fbbf24; /* Gold trim */
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
  position: relative;
  display: inline-block;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}

.member-login-btn:hover { background-color: #0f172a; transform: translateY(-2px); }

.badge {
  position: absolute; top: -10px; right: -15px;
  background-color: #10b981; /* Minty Green New Badge */
  color: white; font-size: 10px; font-weight: bold;
  padding: 3px 8px; border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.header-center { flex: 0 1 auto; text-align: center; }
.logo { max-width: 300px; width: 100%; height: auto; display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); }

.header-right { display: flex; justify-content: flex-end; align-items: center; }
.desktop-tools { display: flex; align-items: center; gap: 15px; }

/* Rounded Search Pill */
.search-box-wrapper { width: 220px; }
.custom-search-form {
  display: flex; align-items: center;
  background-color: #ffffff; border-radius: 50px;
  padding: 6px 15px; box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.search-input { border: none; background: transparent; outline: none; flex-grow: 1; font-size: 14px; color: #334155; }
.search-submit { background: none; border: none; color: #94a3b8; cursor: pointer; font-size: 14px; }

/* Social Buttons */
.social-share-buttons {
  display: flex;
  width: 300px;
  justify-content: center; /* Centers buttons horizontally */
  align-items: center;     /* Centers buttons vertically (optional) */
  gap: 10px;               /* Adds space between buttons */
  margin-left: auto; 
  margin-right: auto; 
  margin-top: 15px;
  margin-bottom: 15px;
}
.social-btn {
  display: flex; align-items: center; justify-content: center;
  width: 35px; height: 35px; background-color: #475569; color: white;
  border-radius: 50%; text-decoration: none; font-size: 15px; transition: background-color 0.2s;
}
.social-btn:hover { background-color: #64748b; }

/* =========================================================
   3. TOP NAVIGATION (Sleek Blue Pill)
   ========================================================= */
#topnav {
  display: flex;
  justify-content: center;
  margin-bottom: 25px;
}

#topnav ul {
  display: inline-flex;
  background-color: #2b709c; /* Sleek medium blue */
  border-radius: 50px;
  padding: 8px 15px;
  list-style: none;
  box-shadow: 0 6px 15px rgba(0,0,0,0.1);
  gap: 5px;
}

.tab-button {
  color: #ffffff;
  padding: 10px 20px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  border-radius: 50px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-button:hover { background-color: rgba(255,255,255,0.2); }

/* =========================================================
   4. CSS GRID LAYOUT
   ========================================================= */
#wrapper {
  display: grid;
  grid-template-columns: 260px 680px 260px; 
  justify-content: center;
  align-items: start; 
  gap: 25px; 
  max-width: 1300px; 
  margin: 0 auto;
  padding: 0 15px;
}

/* =========================================================
   5. LEFT SIDEBAR (White with Dark Header)
   ========================================================= */
#leftnav {
  background-color: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
  overflow: hidden;
}

.nav-header {
  background-color: #1e3a5f;
  color: #ffffff;
  font-weight: 800;
  font-size: 15px;
  text-align: center;
  padding: 20px 15px;
  letter-spacing: 1px;
}

#leftnav ul { list-style: none; padding: 15px 10px; }
#leftnav li { margin-bottom: 5px; }

#leftnav a {
  display: flex; align-items: center; gap: 15px; padding: 12px;
  text-decoration: none; border-radius: 12px; transition: background 0.2s;
}

#leftnav a:hover { background-color: #f1f5f9; }

.nav-text-container { display: flex; flex-direction: column; }
.nav-title { font-weight: 800; font-size: 14px; color: #1e293b; }
.nav-subtitle { font-size: 11px; color: #64748b; font-weight: 700; }

#leftnav img { width: 32px; height: 32px; object-fit: contain; }

/* =========================================================
   6. CENTER CONTENT (Fully Rounded Card)
   ========================================================= */
#content {
  background-color: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
  padding: 35px 20px; /* Reduced side padding to 20px to fit 640px games perfectly */
}

.content-titles { text-align: center; margin-bottom: 20px; }
.content-titles h2 { font-size: 24px; color: #1e293b; font-weight: 800; }
.content-titles h3 { font-size: 16px; color: #64748b; font-weight: 700; }

#content p { font-size: 14px; line-height: 1.6; margin-bottom: 20px; color: #334155; }

/* The Teal Explore Button */
.center-button-wrapper { text-align: center; margin: 25px 0; }
.explore-btn {
  background-color: #20878e;
  color: white; padding: 12px 30px; border-radius: 50px;
  font-weight: 800; font-size: 14px; text-decoration: none;
  display: inline-block; box-shadow: 0 4px 10px rgba(32, 135, 142, 0.3);
  transition: transform 0.2s, background-color 0.2s;
}
.explore-btn:hover { background-color: #176f75; transform: translateY(-2px); }

/* Premium Dark Box */
.premium-banner {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: white; border-radius: 16px; padding: 25px;
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 30px; margin-bottom: 30px;  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.premium-text h4 { color: #38bdf8; font-size: 14px; font-weight: 800; margin-bottom: 5px; }
.premium-text p { color: #cbd5e1 !important; margin: 0 !important; font-size: 13px !important; }

.premium-btn {
  background-color: #0ea5e9; color: white; padding: 12px 25px;
  border-radius: 50px; font-weight: 800; font-size: 13px; text-decoration: none;
  white-space: nowrap; box-shadow: 0 4px 10px rgba(14, 165, 233, 0.3);
}

/* =========================================================
   7. RIGHT SIDEBAR (Flat Teal)
   ========================================================= */
#rightnav {
  background-color: #3b9b9c; 
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

.sponsored-header {
  color: #ffffff; text-align: center; font-weight: 800;
  font-size: 16px; margin-bottom: 20px;
}

/* =========================================================
   8. GAME IFRAME CONTAINER (Modern Responsive)
   ========================================================= */
.intrinsic-container {
  /* 1. Define the default ratio here */
  --game-ratio: 640 / 480; 
  
  position: relative; 
  width: 100%;
  
  /* THE FIX: Restores your viewport height limit! */
  /* It caps the height at roughly 80% of the screen so your nav bar stays visible */
  max-width: min(640px, calc(80vh * var(--game-ratio))); 
  
  margin: 0 auto 25px auto; 
  border-radius: 12px;
  background-color: #0f172a; 
  box-shadow: inset 0 4px 10px rgba(0,0,0,0.5);
  overflow: hidden;
  
  /* Applies the ratio */
  aspect-ratio: var(--game-ratio); 
}

.intrinsic-container iframe {
  position: absolute; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%; 
  border: none;
}

/* Centers the game with black bars when in fullscreen */
.intrinsic-container:fullscreen, 
.intrinsic-container:-webkit-full-screen {
  max-width: none;
  width: 100vw;
  height: 100vh;
  background-color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
}

.intrinsic-container:fullscreen iframe,
.intrinsic-container:-webkit-full-screen iframe {
  position: static; 
  width: 100%;
  height: 100%;
  
  /* 3. Apply the variable to the fullscreen math! */
  max-width: calc(100vh * var(--game-ratio)); 
}

/* Troubleshoot / Cache Fix Button */
.troubleshoot-box { text-align: center; margin-top: 30px; padding-top: 20px; border-top: 1px solid #e2e8f0; }
.troubleshoot-box p { font-size: 13px !important; color: #64748b !important; margin-bottom: 10px !important; }
.troubleshoot-btn {
  background: transparent; border: 2px solid #cbd5e1; color: #64748b;
  padding: 8px 20px; border-radius: 50px; font-weight: 700; cursor: pointer; transition: all 0.2s;
}
.troubleshoot-btn:hover { background: #f1f5f9; color: #334155; border-color: #94a3b8; }

/* =========================================================
   9. MOBILE MENU & RESPONSIVENESS
   ========================================================= */
.mobile-menu-btn {
  display: none; background: none; border: none;
  color: #cbd5e1; font-size: 32px; cursor: pointer;
}

#mobile-menu-overlay {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background-color: #1e293b; z-index: 9999; padding: 30px; overflow-y: auto;
}

#mobile-menu-overlay.active { display: block; }

.close-menu-btn {
  background: #334155; color: white; border: none; padding: 12px;
  font-size: 16px; font-weight: bold; border-radius: 12px; cursor: pointer;
  margin-bottom: 25px; width: 100%;
}

.mobile-login { display: block; width: 100%; text-align: center; margin-bottom: 25px; }

.mobile-search-wrapper { margin-bottom: 25px; }
.mobile-search-wrapper .custom-search-form { background: #334155; border: none; }
.mobile-search-wrapper .search-input { color: white; }

#mobile-menu-overlay h3 { color: #38bdf8; margin: 30px 0 15px 0; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; }

.mobile-links { list-style: none; padding: 0; }
.mobile-links li { margin-bottom: 15px; }
.mobile-links a {
  color: white; text-decoration: none; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; gap: 15px;
}

.list-links a { font-size: 14px; font-weight: 400; color: #cbd5e1; }

/* --- TABLET LANDSCAPE BREAKPOINT (Restricted to 951px - 1250px) --- */
@media (max-width: 1250px) and (min-width: 951px) {
  /* Default Free Site: Collapse left nav, keep right nav sponsor visible */
  #wrapper { grid-template-columns: 640px 280px; }
  #leftnav { display: none !important; }
  #rightnav { display: block !important; }

  /* Premium Student Site Override: Keep left nav visible, collapse right nav promo */
  body.premium-student-site #wrapper { grid-template-columns: 280px 640px !important; }
  body.premium-student-site #leftnav { display: block !important; }
  body.premium-student-site #rightnav { display: none !important; }
}

@media (max-width: 950px) {
  .desktop-only, .desktop-tools, .header-left { display: none !important; }
  
  /* Added justify-content: center to force the logo to the middle */
  #master-header { position: relative; padding: 15px; justify-content: center; } 
  
  .header-right { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); }
  
  .mobile-menu-btn { display: block; }
  
  #wrapper { display: flex; flex-direction: column; align-items: center; }
  #center-column { width: 100%; max-width: 640px; }
  
  .premium-banner { flex-direction: column; text-align: center; gap: 15px; }
}
/*make logo less wide on portrait mode*/
@media (max-width: 768px) and (orientation: portrait) {
  .logo {
    width: 70vw;
    max-width: 300px; /* Keeps it from exceeding your original desktop max-width on larger portrait tablets */
    margin: 0 auto; 
  }
}

/* =========================================================
   10. CLOUD SAVE & LOAD FORM (Tight Layout & Theme Colors)
   ========================================================= */
#univ-form-container {
    width: 100%;
    background: #f8fafc; 
    border: 2px solid #e2e8f0;
    border-radius: 12px; 
    padding: 12px 15px; /* Reduced vertical padding */
    box-sizing: border-box;
    font-family: inherit; 
    margin-bottom: 20px;
}

#univ-form-header {
    margin-bottom: 10px; /* Tighter margin */
    padding-bottom: 8px;
    border-bottom: 1px solid #cbd5e1; 
    display: flex; 
    justify-content: flex-start;
    width: 100%;
}

.univ-form-title {
    margin: 0;
    color: #1e293b; 
    font-size: 15px; 
    font-weight: 800;
}

/* Horizontal Form Layout */
.univ-horizontal-form {
    display: flex;
    flex-wrap: wrap; 
    gap: 12px; /* Tighter gap */
    align-items: flex-end; 
}

.univ-form-group {
    display: flex;
    flex-direction: column;
    flex: 1 1 130px; 
    min-width: 0; 
}

.univ-email-group {
    flex: 2 1 180px; 
}

/* Labels */
.univ-form-group label {
    font-size: 11px;
    font-weight: 800;
    color: #64748b;
    margin-bottom: 4px; /* Tighter margin */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Input Fields - Shorter height */
.univ-form-group input {
    padding: 8px 12px; /* Reduced height */
    font-size: 14px;
    color: #334155;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: 6px; 
    outline: none;
    font-family: inherit;
    transition: all 0.2s ease;
}

.univ-form-group input:focus {
    border-color: #20878e; 
    box-shadow: 0 0 0 3px rgba(32, 135, 142, 0.15);
}

/* Button & Description Row */
.univ-submit-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center; 
    gap: 12px; 
    flex: 1 1 100% !important; 
    width: 100%;
}

.univ-btn-wrapper {
    display: flex;
    gap: 10px;
    flex: 0 0 auto;
}

/* Buttons */
.univ-btn {
    padding: 8px 20px; /* Reduced vertical padding */
    font-size: 13px;
    font-weight: 800;
    border: none;
    border-radius: 50px; 
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
}

.univ-btn-save {
    background-color: #20878e; /* Matches the Teal Explore Button */
    box-shadow: 0 3px 8px rgba(32, 135, 142, 0.25);
}

.univ-btn-save:hover { background-color: #176f75; transform: translateY(-2px); }

.univ-btn-load {
    background-color: #2b709c; /* Matches the Blue Top Nav Bar */
    box-shadow: 0 3px 8px rgba(43, 112, 156, 0.25);
}

.univ-btn-load:hover { background-color: #1e5275; transform: translateY(-2px); }

.univ-form-desc {
    margin: 0;
    color: #64748b;
    font-size: 12px; 
    line-height: 1.4;
    min-width: 0; 
}

.univ-form-desc strong { color: #ef4444; }

/* Modal Styling */
#univ-modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.75); backdrop-filter: blur(4px);
    z-index: 9999; justify-content: center; align-items: center;
}
.univ-modal-box {
    background: white; padding: 30px; border-radius: 16px;
    max-width: 400px; width: 90%; text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
#univ-modal-title { color: #1e293b; margin: 0 0 12px 0; font-size: 20px; font-weight: 800; }
#univ-modal-message { font-size: 14px; color: #64748b; line-height: 1.5; margin-bottom: 20px; }
#univ-modal-btn-group { display: flex; flex-direction: column; gap: 10px; }
#univ-modal-btn-group button {
    background: #e2e8f0; color: #334155; border: none; border-radius: 50px;
    padding: 10px; font-weight: 800; cursor: pointer; transition: 0.2s;
}
#univ-modal-btn-group button:hover { background: #cbd5e1; }

/* Responsive Snap */
@media (max-width: 850px) {
    .univ-horizontal-form { flex-direction: column; align-items: stretch; }
    .univ-form-group { flex: 1 1 100%; }
    
    /* Keeps buttons side-by-side on mobile */
    .univ-btn-wrapper { width: 100%; justify-content: space-between; }
    .univ-btn { flex: 1; padding: 10px; text-align: center; } 
    
    .univ-form-desc { text-align: center; margin-top: 5px; }
}
/* =========================================================
   10.  END CLOUD SAVE & LOAD FORM (New Theme)
   ========================================================= */
   
/* Custom SVG Left Nav Icons */
.svg-icon-wrapper {
    width: 42px; 
    height: 42px; 
    flex-shrink: 0;
    /* Optional: A soft background circle to make them pop */
    background-color: #f8fafc; 
    border-radius: 12px;
    padding: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.svg-icon-wrapper svg {
    width: 100%; 
    height: 100%; 
    display: block;
}

/* Full Page Lock Modal - Updated to match Cloud Save Theme */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.75); /* Dark blue/grey tint */
    backdrop-filter: blur(4px); /* Beautiful background blur */
    justify-content: center; 
    align-items: center; 
    z-index: 999999; 
}

.modal-content {
    background: #fff; 
    padding: 30px; 
    border-radius: 16px; /* Matched to univ-modal */
    width: 90%; 
    max-width: 400px; 
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3); /* Matched to univ-modal */

    /* Lets the card scroll internally on short screens, without scrolling the page behind it */
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal-content h2 {
    margin: 0 0 12px 0;
    color: #1e293b; /* Matched to univ-modal */
    font-size: 20px;
    font-weight: 800;
}

.modal-content p {
    font-size: 14px; 
    color: #64748b; /* Matched to univ-modal */
    line-height: 1.5; 
    margin-top: 0;
    margin-bottom: 20px;
}

.modal-content input {
    width: 100%; 
    padding: 12px; 
    margin-bottom: 15px;
    border: 1px solid #cbd5e1; 
    border-radius: 8px; 
    box-sizing: border-box;
    font-size: 16px;
    font-family: 'Nunito', sans-serif;
    color: #334155;
}

.modal-content button {
    width: 100%; 
    padding: 12px; 
    background: #D67414; 
    color: white;
    border: none; 
    border-radius: 50px; /* Matched pill shape of univ buttons */
    font-size: 18px; 
    font-weight: 800;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    transition: background 0.2s;
}

.modal-content button:hover { 
    background: #b56110; 
}

#error-msg { 
    color: #dc3545; 
    margin-top: 15px; 
    display: none; 
    font-weight: bold; 
    font-size: 14px;
}

/* Password Visibility Toggle Styles */
.password-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 15px; 
}

.password-wrapper input {
    margin-bottom: 0; /* Let the wrapper handle the spacing */
    padding-right: 45px; /* Make room so text doesn't hide behind the icon */
}

/* Override the orange button style for the eye icon */
.password-wrapper button#togglePasswordBtn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #94a3b8; /* Light grey */
    width: auto;
    padding: 0;
    margin: 0;
    font-size: 18px;
    cursor: pointer;
}

.password-wrapper button#togglePasswordBtn:hover {
    background: transparent;
    color: #1e293b; /* Darkens when they hover over it */
}

/* Next for Responsive YouTube Embed*/
.embed-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* Next for YouTube link button (video not embedded but linked to)*/
.youtube-promo-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
    text-decoration: none;
    margin-bottom: 15px;
    padding: 8px 15px;
    background-color: #f8f9fa; /* Gives it a slight button-like background */
    border-radius: 8px;
    transition: all 0.2s ease;
}

.youtube-promo-btn i {
    color: #ff0000; /* Official YouTube Red */
    font-size: 1.8rem; /* Makes the icon slightly bigger than the text */
}

.youtube-promo-btn:hover {
    background-color: #e2e6ea;
    transform: translateY(-2px); /* Gives it a nice little lift when hovered */
}

/* =========================================================
   TOPIC & QUIZ GAME CARDS (Homepage Circular Style)
   ========================================================= */
.topic-game-card {
    display: flex;
    align-items: center; /* Vertically centers the icon circle with the text */
    gap: 25px;
    margin-bottom: 20px;       
    background-color: #ffffff; /* Crisp white background */
    border: 1px solid #e2e8f0;  
    border-radius: 12px;        
    padding: 20px;              
    box-shadow: 0 1px 3px rgba(0,0,0,0.02); 
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Interactive hover elevation */
.topic-game-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.topic-game-thumb {
    flex-shrink: 0;
}

/* Prevents links around thumbnail elements from showing a text underline */
.topic-game-thumb a, 
.topic-game-thumb a:hover {
    text-decoration: none;
    display: inline-block; /* Removes any browser-calculated text baselines */
}

/* The modern circular wrapper for your SVGs */
.topic-svg-container {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background-color: #f8fafc; /* Subtle grey/blue circle tint */
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    transition: background-color 0.2s ease;
}

/* Overrides only the colors for the quiz variant, inheriting the 90px circle structure */
.topic-svg-container.quiz-blue {
    background-color: #e0f2fe;
    border-color: #bae6fd;
    color: #0284c7;
    font-size: 28px; /* Perfectly sizes the icon inside your 90px circle */
}

.topic-game-card:hover .topic-svg-container {
    background-color: #f1f5f9; /* Shifts slightly dark on card hover */
}

.topic-svg-container img {
    width: 55px;
    height: 55px;
    object-fit: contain;
    display: block;
}

.topic-game-info {
    flex-grow: 1;
}

.topic-game-info h3 {
    margin-top: 0;
    margin-bottom: 6px;
}

/* Clean styling specifically for the introductory paragraph */
.topic-intro-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #4a5568;
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px auto; /* Centers the paragraph block and spaces it above games */
}

/* Mobile Responsiveness: App-Style Centering */
@media (max-width: 600px) {
    .topic-game-card {
        flex-direction: column;   /* Stacks the image on top of the text */
        align-items: center;      /* Centers the image wrapper inside the card */
        gap: 15px;
        padding: 16px;            /* Slightly tighter padding to maximize screen space */
    }

    .topic-game-thumb {
        margin: 0 auto;           /* Guarantees the thumbnail block stays perfectly centered */
    }

    .topic-game-info {
        width: 100%;              /* Ensures the text area fills the width of the card */
    }

    .topic-game-info h3,
    .topic-game-info p {
        text-align: center;       /* Centers the content blocks on mobile */
    }

    /* Centers the worksheet link container if it exists on mobile */
    .topic-game-info div {
        text-align: center;
    }
}

/* Keeps links from turning purple after being visited */
.hyperlinkblue, .hyperlinkblue:visited {
    color: #007bff !important; /* Use your preferred shade of blue */
    text-decoration: none;
}

.hyperlinkblue:hover {
    text-decoration: underline;
    color: #0056b3 !important; /* Slightly darker blue on hover */
}

/* =========================================================
   GATEWAY / SPLASH PAGE STYLES
   ========================================================= */

/* Only applies to the gateway page */
.gateway-body {
    display: flex;
    justify-content: center; /* Keeps it centered horizontally */
    align-items: flex-start; /* Aligns to the top instead of the middle */
    min-height: 100vh;
    margin: 0;
    padding: 8vh 20px 2vh 20px; /* Adds 8vh of space at the top */
    box-sizing: border-box;
}

.gateway-container {
    max-width: 950px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.8s ease-in-out;
}

.gateway-header {
    text-align: center;
    margin-bottom: 3vh; 
    color: #ffffff;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.gateway-logo {
    max-height: 12vh; 
    width: auto;
    max-width: 100%;
    margin-bottom: 2vh;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

.gateway-header h1 {
    font-size: clamp(1.5rem, 3.2vw, 2.1rem); /* Reduced from 2rem/2.8rem to scale down nicely */
    margin-bottom: 1vh;
    font-weight: 800;
}

.gateway-header p.site-description {
    font-size: 1.15rem;
    color: #cbd5e1;
    margin: 0 auto 1.5vh auto;
    max-width: 600px;
    line-height: 1.5;
}

.gateway-header p.prompt-text {
    font-size: 1rem;
    color: #94a3b8;
    font-weight: bold;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gateway-options {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
    justify-content: center;
    margin-bottom: 3vh; 
}

.gateway-card {
    flex: 1;
    min-width: 280px;
    max-width: 450px;
    background-color: #ffffff;
    border-radius: 16px;
    padding: 3vh 30px; 
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
	border: 2px solid #2b709c;
}

.gateway-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}

.gateway-card.premium-path {
    background: linear-gradient(to bottom, #ffffff, #fffbeb);
    border: 2px solid #fbbf24;
}

.gateway-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2vh auto;
    font-size: 30px;
}

.gateway-title {
    font-size: 1.5rem;
    margin-bottom: 1vh;
    font-weight: bold;
    color: #0f172a;
}

.gateway-desc {
    color: #475569;
    margin-bottom: 2.5vh;
    line-height: 1.5;
    font-size: 0.95rem;
    flex-grow: 1;
}

.gateway-btn {
    display: inline-block;
    padding: 12px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.05rem;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.gateway-premium-banner {
    width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
    text-align: center;
    justify-content: center;
    gap: 15px;
    padding: 2vh 20px; 
    margin-top: 0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 650px) {
    .gateway-options { gap: 15px; }
    .gateway-card { padding: 25px 20px; }
    .gateway-body { padding: 4vh 20px; }
}

/* Gateway Footer / Privacy Link */
.gateway-footer {
    margin-top: 3vh;
    text-align: center;
    width: 100%;
}

.gateway-footer a {
    color: #94a3b8; /* Subtle gray so it doesn't distract from the main buttons */
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.2s ease;
    letter-spacing: 0.5px;
}

.gateway-footer a:hover {
    color: #ffffff; /* Brightens up when they hover over it */
    text-decoration: underline;
}

/* Unique Modifier Classes (Safe to add to the bottom) */
.icon-standard {
    background-color: #e0f2fe;
    color: #0284c7;
}
.btn-standard {
    background-color: #0ea5e9;
    color: #ffffff;
}

.icon-premium {
    background-color: #fef3c7;
    color: #d97706;
}
.title-premium {
    color: #92400e;
}
.btn-premium {
    background-color: #1e293b;
    color: #ffffff;
    border: 2px solid #fbbf24;
}

/* Premium Ad-Free Banner Internal Elements */
.gateway-premium-banner .premium-text {
    padding-right: 0;
}
.gateway-premium-banner .premium-text h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}
.gateway-premium-banner .premium-text p {
    font-size: 0.95rem;
    line-height: 1.4;
}
.gateway-premium-banner .premium-btn {
    font-size: 0.95rem;
    padding: 10px 30px;
}

/* =========================================================
   11. QUIZ INFO BOTTOM PANELS (Clean Cards & Lists)
   ========================================================= */
.quiz-info-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-top: 40px;
    margin-bottom: 20px;
}

.quiz-info-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.quiz-info-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 15px;
}

.quiz-info-card-header h3 {
    margin: 0 !important;
    color: #0f172a !important;
    font-size: 1.4rem !important;
    font-weight: 800 !important;
}

.quiz-info-icon-wrapper {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.quiz-icon-why {
    background: #fdf6e3;
    color: #d97706;
}

.quiz-icon-how {
    background: #e0f2fe;
    color: #0284c7;
}

.quiz-info-card p {
    color: #475569 !important;
    line-height: 1.7 !important;
    margin-bottom: 15px !important;
    font-size: 14px !important;
}

.quiz-info-card p:last-child {
    margin-bottom: 0 !important;
}

.quiz-explain-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.quiz-explain-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.quiz-explain-item i {
    color: #94a3b8;
    font-size: 1.2rem;
    margin-top: 4px;
    width: 20px;
    text-align: center;
}

.quiz-explain-text {
    color: #475569;
    line-height: 1.6;
    font-size: 14px;
}

.quiz-explain-text strong {
    color: #0f172a;
}

/* Secondary Modal Button (Ghost Style) */
.modal-secondary-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: #f8fafc;
    color: #475569;
    border: 2px solid #cbd5e1;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
    font-family: 'Nunito', sans-serif;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.modal-secondary-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
    border-color: #94a3b8;
}

/* Secondary Modal Button (Ghost Style) */
.modal-secondary-btn2 {
    display: block;
    width: 100%;
    padding: 12px;
    background: #0C419F;
    color: white;
    border: 2px solid #cbd5e1;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
    font-family: 'Nunito', sans-serif;
    transition: all 0.2s ease;
    box-sizing: border-box;
	margin-top:15px;
}

.modal-secondary-btn2:hover {
    background:#0E067A ;
    border-color: #94a3b8;
}


/* =========================================================
   VIDEO & GAME THUMBNAIL IMAGE SCALING
   ========================================================= */

/* Forces the images to scale down and fit neatly inside the container */
.topic-game-thumb img {
    /*width: 100%;  Note:removed because it interferes with icon size for topics on game and quiz index pages*/
    height: auto;
    max-width: 100%;
    display: block;
    border-radius: 8px; /* Adds a nice modern curved edge to the video thumbnails */
}

/* Ensures the text doesn't crush the thumbnail wrapper on smaller screens */
.topic-game-thumb {
    flex-shrink: 0; 
}

/* Guarantees the card items line up nicely horizontally */
.topic-game-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

/* =========================================================
   12. GATEWAY SEO CONTENT (Vertical Stack & Styling)
   ========================================================= */

/* Force the body to stack the gateway and SEO content vertically */
.gateway-body {
    flex-direction: column !important;
    align-items: center !important;
    height: auto !important; 
    overflow-y: auto !important; /* Ensures scrolling is enabled */
    padding-bottom: 60px !important; /* Extra space at the bottom of the page */
}

/* Ensure the top splash container has space below it 
.gateway-container {
    margin-bottom: 40px !important; 
}
*/

/* Style the new SEO text container to match the gateway cards */
.gateway-seo-content {
    width: 100%;
    max-width: 950px; /* Matches the width of your gateway-container */
    margin: 0px auto;
    padding: 40px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    box-sizing: border-box;
    color: #334155;
    text-align: left;
	/* NEW BORDER STYLES ADDED HERE */
        border: 4px solid #2b709c; /* Branded blue accent bar at the top */
}

/* Ensure text inside the SEO container scales nicely */
.gateway-seo-content h2 {
    color: #0f172a;
    margin-bottom: 15px;
    font-weight: 800;
}

.gateway-seo-content hr {
    border: 0; 
    border-top: 1px solid #e2e8f0; 
    margin: 30px 0;
}

/* Make sure the YouTube button centers correctly inside this div */
.gateway-seo-content .youtube-promo-btn {
    margin-top: 10px;
}

/* Mobile adjustments specifically for the SEO container */
@media (max-width: 650px) {
    .gateway-seo-content {
        padding: 25px 20px;
    }
}

/* =========================================================
   13. SCROLL DOWN INDICATOR (Gateway Page)
   ========================================================= */

/* Enables smooth gliding when the arrow is clicked */
html {
    scroll-behavior: smooth;
}

.scroll-down-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px auto 30px auto; 
    color: #94a3b8; /* Subtle slate-gray that matches your gateway prompt text */
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: color 0.3s ease;
}

.scroll-down-prompt:hover {
    color: #ffffff; /* Brightens when hovered over */
}

/* The bouncing arrow icon */
.scroll-down-prompt i {
    margin-top: 8px;
    font-size: 1.5rem;
    animation: bounce 2s infinite;
}

/* The keyframes that create the bounce effect */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

/* =========================================================
   14. PRICING & MEMBERSHIP CARDS
   ========================================================= */
.pricing-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 40px 0;
    justify-content: center;
    align-items: stretch;
}

.pricing-card {
    flex: 1;
    min-width: 250px;
    max-width: 320px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 35px 25px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

/* Featured / Most Popular Tier */
.pricing-card.featured-tier {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #ffffff;
    border: 2px solid #fbbf24;
    transform: scale(1.03);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.pricing-card.featured-tier:hover {
    transform: scale(1.03) translateY(-5px);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #fbbf24;
    color: #92400e;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 15px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pricing-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: inherit;
    margin-bottom: 10px;
}

.pricing-card:not(.featured-tier) .pricing-title { color: #1e293b; }

.pricing-price {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 5px;
}

.pricing-card:not(.featured-tier) .pricing-price { color: #20878e; }
.pricing-card.featured-tier .pricing-price { color: #38bdf8; }

.pricing-subtitle {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 25px;
}

.pricing-card:not(.featured-tier) .pricing-subtitle { color: #64748b; }
.pricing-card.featured-tier .pricing-subtitle { color: #94a3b8; }

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
    text-align: left;
    flex-grow: 1;
}

.pricing-features li {
    font-size: 0.95rem;
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.pricing-card:not(.featured-tier) .pricing-features li { color: #475569; }
.pricing-card.featured-tier .pricing-features li { color: #cbd5e1; }

.pricing-features li i {
    color: #10b981; /* Green checkmark */
    margin-top: 3px;
}

.pricing-btn {
    display: inline-block;
    width: 100%;
    padding: 12px 20px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.2s ease;
    text-align: center;
}

/* Button colors based on card type */
.pricing-card:not(.featured-tier) .pricing-btn {
    background-color: #f1f5f9;
    color: #334155;
    border: 2px solid #cbd5e1;
}

.pricing-card:not(.featured-tier) .pricing-btn:hover {
    background-color: #20878e;
    color: #ffffff;
    border-color: #20878e;
}

.pricing-card.featured-tier .pricing-btn {
    background-color: #0ea5e9;
    color: #ffffff;
    border: none;
}

.pricing-card.featured-tier .pricing-btn:hover {
    background-color: #0284c7;
}

/* Mobile responsive adjustments */
@media (max-width: 850px) {
    .pricing-card.featured-tier {
        transform: scale(1); /* Removes pop-out scale on small screens to fit better */
    }
    .pricing-card.featured-tier:hover {
        transform: translateY(-5px);
    }
}

/* Secondary Outline Button for Invoices */
.pricing-btn-outline {
    background-color: transparent !important;
    border: 2px solid #cbd5e1 !important;
    color: #475569 !important;
    font-size: 0.9rem;
    padding: 10px 15px;
}

.pricing-btn-outline:hover {
    background-color: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: #1e293b !important;
}

.pricing-card.featured-tier .pricing-btn-outline {
    border-color: #38bdf8 !important;
    color: #e0f2fe !important;
}

.pricing-card.featured-tier .pricing-btn-outline:hover {
    background-color: rgba(56, 189, 248, 0.1) !important;
    color: #ffffff !important;
}

/* Update this section in your CSS */
.pricing-button-group {
    display: flex;
    flex-direction: column;
    margin-top: auto; /* Pushes the buttons to the bottom of the card */
    padding-top: 20px;
}

.pricing-button-group .pricing-btn {
    margin-bottom: 15px; /* Forces space between the top and bottom button */
}

.pricing-button-group .pricing-btn:last-child {
    margin-bottom: 0; /* Removes margin from the bottom button */
}

/* social media share styles*/
.social-share-container {
	display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0 auto; width: 100%;padding-top:20px;
}

/* =========================================================
   PORTRAIT MODE SPONSOR FIX (950px and below)
   Overrides the .desktop-only class just for the rightnav 
   so it drops below the game safely.
   ========================================================= */
@media (max-width: 950px) {
  /* Free Site: Force the sponsor sidebar to show up below the game */
  #rightnav { 
    display: block !important; 
    width: 100%; 
    max-width: 300px; 
    margin: 20px auto 30px auto; 
  }
  
  /* Premium Site: Keep it hidden so students don't see the teacher login */
  body.premium-student-site #rightnav { 
    display: none !important; 
  }
}

/* =========================================================
   TEACHER ZONE LEFT-NAV BOX (Tablet Landscape Only)
   ========================================================= */
/* Hide the box by default (so it doesn't duplicate on large desktop screens) */
.premium-teacher-box {
    display: none;
}

/* ONLY reveal the box when the screen is between 951px and 1250px */
@media (max-width: 1250px) and (min-width: 951px) {
    .premium-teacher-box {
        display: block;
        margin-top: 30px; 
        margin-bottom: 20px;
    }
}

/* Universal tooltip for saving games (Email, Username, Password) */
.univ-username-tooltip {
    display: none;
    position: absolute;
    bottom: 105%; /* Sits safely right above the input box */
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748; /* Dark elegant charcoal */
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
    z-index: 999;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    pointer-events: none; /* Prevents cursor interference */
}

/* Little triangle pointing down at the input box */
.univ-username-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #2d3748 transparent transparent transparent;
}

/* Show the tooltip ONLY when the user clicks/types in ANY input in the form group */
.univ-form-group input:focus ~ .univ-username-tooltip {
    display: block;
}