/* === GENERAL PAGE STYLING === */
@font-face {
    font-family: 'Compacta';
    src: url('../IMAGES/Compacta-Bold.woff2') format('woff2'),
         url('../IMAGES/Compacta-Bold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
}

body {
    margin-left: 20px;
    margin-right: 20px;
    display:flex;
    flex-direction:column;
    justify-content: center;
    align-items: center;
    font-family: 'Compacta', sans-serif; /* Default font */
    background: url('../IMAGES/BACKGROUNDFINAL.png') no-repeat center center fixed;
    background-size: cover; /* Ensures it covers the whole screen */
    background-attachment: fixed; /* Keeps the background from moving when scrolling */
    text-align: center;
    margin: 0;
    padding: 0;
    color: white; /* Makes text white by default */
    overflow: auto; /* Makes the entire page scrollable */
    text-shadow:rgba(0, 0, 0, 0.5)
}

/* === Apply Text Stroke (Black Outline Around Letters) === */
h1, h2, h3, p, .indicator-label, button {
    text-shadow: 
        -1px -1px 0 black, 
         1px -1px 0 black, 
        -1px  1px 0 black, 
         1px  1px 0 black; /* Creates a bold black outline */
    color: white; /* Text remains white */
}

/* === MAIN CONTAINER === */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh; /* Adjusts dynamically based on content */
    padding-bottom: 50px; /* Adds space at the bottom for long scrolling */
}

/* === LOGO === */
.logo {
    display: flex;
    justify-content: center;  /* Center horizontally */
    align-items: center;  /* Center vertically */
    margin-top: 10px;
    margin-bottom: 10px;
}

/* Ensure the image resizes properly */
.logo img {
    width: 380px;  /* Adjust width */
    height: auto;  /* Maintain aspect ratio */
    max-width: 100%;  /* Ensure it remains responsive */
}

/* Game mode Selector */
.mode-bar-wrapper {
    margin-top: 0px;
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 20px;
  }
  
  .mode-bar {
    display: flex;
    gap: 18px;
    align-items: center;
    background: none;
  }
  
  .mode-icon {
    width: 70px;
    height: 70PX;
    background-color: #1e1e1e;
    border: 3px solid #888;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: transform 0.2s, border-color 0.2s;
    cursor: pointer;
  }
  
  .mode-icon img {
    width: 50px;
    height: 50px;
    pointer-events: none;
  }
  
  .mode-icon:hover {
    border-color: #C4A26A;
    transform: scale(1.07);
  }

  .mode-icon:hover .mode-label {
    opacity: 1;
    transform: translateY(0);
  }
  
  .mode-icon.active {
    border-color: orange;
    box-shadow: 0 0 10px rgba(255,165,0,0.6);
  }
  .mode-label {
    position: absolute;
    top: 65px;
    color: white;
    font-size: 0.85rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    text-shadow: -1px -1px 0 black, 1px -1px 0 black,
                 -1px 1px 0 black, 1px 1px 0 black;
  }
  
  .check {
    position: absolute;
    bottom: -8px;
    right: -6px;
    background: #2ecc71;
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 999px;
    font-weight: bold;
  }

/* INFO CONTAINER */

.info-container {
    display: flex;
    justify-content: center;
    background: #333232; /* Light grey background */
    padding: 10px;
    margin-bottom: 8px;
    gap: 20px;
    border-radius: 8px;
    /*border: 2px solid black; /* Added black border */
    border: 2px solid #C4A26A; /* Gold Border */ 
}

/*MODAL BOX STARTS*/

/* === Fighter Roster Modal === */
.fighter-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 50%;
    max-width: 500px;
    background-color: #1E1E1E;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.4);
    text-align: center;
    border: 2px solid #C4A26A; /* Gold border */
}

/* Modal Header */
.fighter-title {
    font-size: 24px;
    font-weight: bold;
    color: white;
    border-bottom: 2px solid #C4A26A;
    padding-bottom: 10px;
}

/* Close Button */
.close-fighter {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    color: white;
    background-color: #C4A26A;
    border-radius: 50%;
    padding: 5px 10px;
    text-align: center;
}

.close-fighter:hover {
    background-color: red;
}

/* Scrollable Fighter List Container */
.fighter-container {
    max-height: 300px;
    overflow-y: auto;
    background-color: #2B2B2B;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    text-align: left;
    color: white;
}

/* Individual Fighter Name */
.fighter-container div {
    background-color: #3B3B3B;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    color: white;
    text-align: left;
    font-size: 14px;
}

/* Fighter Name Styling */
.fighter-container div strong {
    color: white;
    font-size: 16px;
    display: block;
    margin-bottom: 5px;
}


/* Patch Notes Image Button */
/* Patch Notes Modal */
.patch-modal {
    display: none; 
    position: fixed;
    z-index: 1000;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 50%;
    max-width: 500px;
    background-color: #1E1E1E;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.4);
    text-align: center;
    border: 2px solid #C4A26A; /* Gold border */
}

/* Modal Header */
.patch-title {
    font-size: 24px;
    font-weight: bold;
    color: white;
    border-bottom: 2px solid #C4A26A;
    padding-bottom: 10px;
}

/* Close Button */
.close-patch-notes {
    float: right;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    color: white;
    background-color: #C4A26A;
    border-radius: 50%;
    padding: 5px 10px;
    text-align: center;
    position: absolute;
    top: 10px;
    right: 10px;
}

.close-patch-notes:hover {
    background-color: red;
}

/* Scrollable Patch Notes Container */
.patch-notes-container {
    max-height: 300px;
    overflow-y: auto;
    background-color: #2B2B2B;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    text-align: left;
}

/* Individual Patch Note Entry */
.patch-notes-container div {
    background-color: #3B3B3B;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    color: white;
    text-align: left;
    font-size: 14px;
}

/* Date Formatting */
.patch-notes-container div strong {
    color: #C4A26A;
    font-size: 16px;
    display: block;
    margin-bottom: 5px;
}

/* Patch Notes Text */
.patch-notes-container div span {
    color: #B3B3B3;
    font-style: italic;
}

/* Tooltip Styling */
/* Ensure the image size stays small */



/* STREAK COUNTER STYLE */

.fire-gif {
    position: relative;
    cursor: pointer;
    width: 50px;  /* Adjust based on your desired size */
    height: 40px; /* Maintain aspect ratio */
    display: inline-block; /* Ensures it doesn't stretch */
}

#streakContainer {
    position: relative;
    display: inline-block;
  }
  
  
  #streakOverlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 1.5rem;
    pointer-events: none;
    color: white; /* or whatever base text color */
    text-shadow:
        -1px -1px 0 black,
         1px -1px 0 black,
         -1px  1px 0 black,
         1px  1px 0 black;
  }

  

.tooltip-hover {
    position: relative;
    cursor: pointer;
    width: 40px;  /* Adjust based on your desired size */
    height: auto; /* Maintain aspect ratio */
    display: inline-block; /* Ensures it doesn't stretch */
}

/* Tooltip Styling */
.tooltip-hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease-in-out, transform 0.2s ease-in-out;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

/* Show Tooltip on Hover */
.tooltip-hover:hover::after {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

/* === CONTACT POPUP (Same Style as Patch Notes) === */
/* === CONTACT MODAL (Styled Identical to Patch Notes) === */
.contact-modal {
    display: none;
    position: fixed; /* Ensure it's positioned relative to the viewport */
    z-index: 1000;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 50%;
    max-width: 500px;
    background-color: #1E1E1E;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.4);
    text-align: center;
    border: 2px solid #C4A26A;
}

/* Modal Content */
.contact-modal-content {
    position: relative;
}

/* Modal Header */
.contact-title {
    font-size: 24px;
    font-weight: bold;
    color: white;
    border-bottom: 2px solid #C4A26A;
    padding-bottom: 10px;
}

/* Close Button */
.close-contact {
    float: right;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    color: white;
    background-color: #C4A26A;
    border-radius: 50%;
    padding: 5px 10px;
    text-align: center;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2000;
}

.close-contact:hover {
    background-color: red;
}

/* Ensure no inherited styles affect positioning */
.close-contact a {
    text-decoration: none;
    color: inherit;
}

/* Scrollable Contact Container */
.contact-container {
    max-height: 300px;
    overflow-y: auto;
    background-color: #2B2B2B;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    text-align: left;
}

/* Individual Contact Entry */
.contact-entry {
    background-color: #3B3B3B;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    color: white;
    text-align: left;
    font-size: 14px;
}

/* Contact Entry Labels */
.contact-entry strong {
    color: #C4A26A;
    font-size: 16px;
    display: block;
    margin-bottom: 5px;
}

/* Contact Links */
.contact-entry span a {
    color: #B3B3B3;
    text-decoration: none;
    font-style: italic;
}

.contact-entry span a:hover {
    color: #ffffff;
}

@media (max-width: 768px) {

    * {
        box-sizing: border-box;
      }      
    

    body, html {
        width: 100%;
        margin-bottom: 0;
        padding: 0;
        overflow-x: hidden; /* Prevents horizontal scrolling */
    }

    body {
        background: url('../IMAGES/BACKGROUNDFINAL.png') no-repeat center center fixed;
        background-size: cover; /* Ensures it covers the whole screen */
        background-position: center; /* Centers the background */
        background-attachment: fixed; /* Prevents scrolling issues */
        width: 100%;
        margin: 0;
        padding-bottom: 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        overflow-x: hidden; /* Prevents scrolling to the right */
    }

    .container {
        width: 100%;
        padding:  15px; /* Adds safe spacing */
    }

    .logo {
    display: flex;
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
    width: 80%; /* Full width to ensure centering */
    height: 80%;
    max-width: 400px; /* Adjust if needed */
    margin: 0 auto; /* Centers the logo */
    text-align: center;
    padding: 10px 0;
    }

    .logo img {
        display: block;
        margin: 0 auto; /* Ensures the image itself is centered */
        max-width: 100%; /* Prevents it from overflowing */
        height: auto;
    } 
}



   /* Footer Section */
   .footer {
    height: 200px;
    max-height: 200px;
    color: #ffffff;
    text-align: center;
    padding: 0px;
    padding-bottom: 150px;
  }
  
  .footer-container {
    max-width: 1200px;
    padding: 0 15px;
  }
  
  .social-links {
    margin-bottom: 10px;
  }
  
  .social-links a {
    margin: 0 8px;
    display: inline-block;
    transition: transform 0.3s ease;
  }
  
  .social-links a:hover {
    transform: scale(1.1);
  }
  
  .social-icon {
    width: 40px;
    height: 40px;
  }
  
  @media (max-width: 600px) {
    .social-icon {
      width: 30px;
      height: 30px;
    }
  }

  .copyright {
    font-size: small;
    color: #888;
  }
  
  .socials-text {
    font-size:medium;
    color: white;
    margin-top: -10px
  }










  /* === CONNECTIONS GAME === */
.connections {
    width: 100%;
    max-width: 720px;
    margin: 18px auto 30px;
    background: rgba(30, 30, 30, 0.85);
    border: 2px solid #C4A26A;
    border-radius: 12px;
    padding: 16px;
  }
  
  .connections-title {
    font-size: 28px;
    margin: 0 0 6px;
  }
  
  .connections-subtitle {
    margin: 0 0 14px;
    font-size: 16px;
    color: #ddd;
  }
  
  .connections-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 10px 0 14px;
  }
  
  .connections-tile {
    background: #2b2b2b;
    border: 2px solid #888;
    border-radius: 10px;
    padding: 10px 8px;
    cursor: pointer;
    user-select: none;
    transition: transform 0.12s, border-color 0.12s, background 0.12s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 92px;
  }
  
  .connections-tile:hover {
    border-color: #C4A26A;
    transform: scale(1.02);
  }
  
  .connections-tile.selected {
    border-color: orange;
    box-shadow: 0 0 10px rgba(255,165,0,0.35);
  }
  
  .connections-tile.locked {
    cursor: default;
    opacity: 0.7;
    border-color: #C4A26A;
  }
  
  .connections-tile img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    margin-bottom: 6px;
    object-fit: cover;
  }
  
  .connections-tile-name {
    font-size: 14px;
    line-height: 1.1;
  }
  
  .connections-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
  }
  
  .connections-controls button {
    background: #1e1e1e;
    border: 2px solid #C4A26A;
    border-radius: 10px;
    color: white;
    padding: 10px 12px;
    cursor: pointer;
    font-family: 'Compacta', sans-serif;
    font-size: 16px;
  }
  
  .connections-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  
  .connections-message {
    min-height: 22px;
    font-size: 16px;
    color: #fff;
  }
  
  .connections-solved {
    display: grid;
    gap: 10px;
    margin-bottom: 10px;
  }
  
  .solved-group {
    background: #3b3b3b;
    border: 2px solid #C4A26A;
    border-radius: 10px;
    padding: 10px;
  }
  
  .solved-group-title {
    color: #C4A26A;
    font-size: 16px;
    margin-bottom: 6px;
  }
  
  .solved-group-members {
    font-size: 14px;
    color: #ddd;
  }
  
  @media (max-width: 520px) {
    .connections-board {
      gap: 8px;
    }
    .connections-tile {
      min-height: 80px;
      padding: 8px 6px;
    }
    .connections-tile img {
      width: 38px;
      height: 38px;
    }
    .solved-group { min-height: 80px; }

  }

  /* === CONNECTIONS ANIMATIONS === */
@keyframes tileShakeSmall {
    0%   { transform: translateX(0); }
    20%  { transform: translateX(-3px); }
    40%  { transform: translateX(3px); }
    60%  { transform: translateX(-2px); }
    80%  { transform: translateX(2px); }
    100% { transform: translateX(0); }
  }
  
  @keyframes tileShakeBig {
    0%   { transform: translateX(0); }
    15%  { transform: translateX(-6px); }
    30%  { transform: translateX(6px); }
    45%  { transform: translateX(-5px); }
    60%  { transform: translateX(5px); }
    75%  { transform: translateX(-3px); }
    90%  { transform: translateX(3px); }
    100% { transform: translateX(0); }
  }
  
  @keyframes tileCorrectFlash {
    0%   { filter: brightness(1); }
    50%  { filter: brightness(1.35); }
    100% { filter: brightness(1); }
  }
  
  .connections-tile.shake-picked {
    animation: tileShakeSmall 420ms ease-in-out;
  }
  
  .connections-tile.shake-wrong {
    animation: tileShakeBig 520ms ease-in-out;
  }
  
  .connections-tile.correct-flash {
    animation: tileCorrectFlash 520ms ease-in-out;
  }
  
  /* === TIER COLORS === */
:root{
    --tier-easy: #f1c40f;     /* yellow */
    --tier-moderate: #2ecc71; /* green */
    --tier-hard: #3498db;     /* blue */
    --tier-hardest: #9b59b6;  /* purple */
  }
  
  /* Make solved group "boxes" match tile height */
  .solved-group {
    min-height: 92px;           /* match .connections-tile min-height */
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    border-width: 2px;
  }
  
  /* Color-coded outlines by tier */
  .solved-group.tier-easy { border-color: var(--tier-easy); }
  .solved-group.tier-moderate { border-color: var(--tier-moderate); }
  .solved-group.tier-hard { border-color: var(--tier-hard); }
  .solved-group.tier-hardest { border-color: var(--tier-hardest); }
  
  /* Optional: make the solved title match the tier too */
  .solved-group.tier-easy .solved-group-title { color: var(--tier-easy); }
  .solved-group.tier-moderate .solved-group-title { color: var(--tier-moderate); }
  .solved-group.tier-hard .solved-group-title { color: var(--tier-hard); }
  .solved-group.tier-hardest .solved-group-title { color: var(--tier-hardest); }
  
  /* When you flash a correct guess, tint the outline too */
  .connections-tile.correct-tier-easy { border-color: var(--tier-easy); box-shadow: 0 0 12px color-mix(in srgb, var(--tier-easy) 55%, transparent); }
  .connections-tile.correct-tier-moderate { border-color: var(--tier-moderate); box-shadow: 0 0 12px color-mix(in srgb, var(--tier-moderate) 55%, transparent); }
  .connections-tile.correct-tier-hard { border-color: var(--tier-hard); box-shadow: 0 0 12px color-mix(in srgb, var(--tier-hard) 55%, transparent); }
  .connections-tile.correct-tier-hardest { border-color: var(--tier-hardest); box-shadow: 0 0 12px color-mix(in srgb, var(--tier-hardest) 55%, transparent); }
  
  /* === MISTAKES HEARTS === */
.connections-hearts {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 10px 0 6px;
    font-size: 22px;
    line-height: 1;
  }
  
  .connections-hearts .heart.lost {
    filter: grayscale(1);
    opacity: 0.35;
  }
  
  /* Fighter image ring */
.connections-tile img {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    object-fit: cover;
  
    border: 2px solid #888;           /* default ring */
    box-sizing: border-box;
    transition: border-color 180ms ease, box-shadow 180ms ease;
  }
  
  /* Optional: selection ring */
  .connections-tile.selected img {
    border-color: orange;
    box-shadow: 0 0 10px rgba(255,165,0,0.25);
  }
  
  /* Tier ring colors (applied during correct animation because you add correct-tier-*) */
  .connections-tile.correct-tier-easy img { border-color: var(--tier-easy); }
  .connections-tile.correct-tier-moderate img { border-color: var(--tier-moderate); }
  .connections-tile.correct-tier-hard img { border-color: var(--tier-hard); }
  .connections-tile.correct-tier-hardest img { border-color: var(--tier-hardest); }
  

.dt-hero__timer {
    margin: 0.4rem;
    padding: 0.9rem 1.8rem;
    border-radius: 16px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
  
    border: 0px solid #c3a169;       /* gold-ish border */
            /* soft gold glow */
  }
  
  .dt-timer-label {
    font-size: 1.0rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.85);
  }
  
  .dt-timer-value {
    font-family: "SF Mono", ui-monospace, Menlo, Consolas, "Roboto Mono", monospace;
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    margin-top: 0.15rem;
    margin-bottom: 0.15rem;
  
    color: #ffe7b0; /* warm gold */
    text-shadow:
      0 0 8px rgba(255, 204, 120, 0.9),
      0 0 18px rgba(0, 0, 0, 0.95);
  }
  
  .dt-timer-note {
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
  }
  
  /* When timer hits 00:00:00 */
  .dt-timer-live .dt-timer-value {
    animation: dt-timer-pulse 1s infinite alternate;
  }
  
  @keyframes dt-timer-pulse {
    from {
      transform: scale(1);
      text-shadow:
        0 0 8px rgba(255, 204, 120, 0.8),
        0 0 18px rgba(0, 0, 0, 1);
    }
    to {
      transform: scale(1.04);
      text-shadow:
        0 0 14px rgba(255, 230, 170, 1),
        0 0 24px rgba(0, 0, 0, 1);
    }
  }
  
  .dt-hero__timer {
    /* your existing styles here */
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
  }
  
  .dt-timer-underline {
    margin-top: 0.1rem;
    margin-bottom: 0.3rem;
    width: 100%;                 /* adjust width if you like */
    height: 3px;
    border-radius: 999px;
  
    background: linear-gradient(
      to right,
      transparent,
      #ffda8a,
      #ffe9b8,
      #ffda8a,
      transparent
    );
  
    box-shadow:
      0 0 8px rgba(255, 218, 138, 0.8),
      0 0 14px #3A3A3A(0, 0, 0, 0.9);
  }

  .connections h1 {
    margin: 0 0 10px;
    font-size: 1.9rem;
    letter-spacing: 0.5px;
  }
  
  .connections p {
    margin: 0 0 10px;
    font-size: 1.05rem;
    line-height: 1.4;
    color: #f2f2f2;
  }
  
  .connections strong {
    color: #C4A26A;
    font-weight: 700;
  }
  
  .connections-howto {
    margin: 10px 0 12px;
    padding-left: 18px;
  }
  
  .connections-howto li {
    margin: 8px 0;
    font-size: 1.02rem;
    line-height: 1.35;
    color: #e9e9e9;
  }
  
  .connections-howto li::marker {
    color: #C4A26A;
  }
  
  .connections-howto-note {
    margin-top: 8px;
    font-size: 0.98rem;
    color: #cfcfcf;
    font-style: italic;
  }
  
  
  /* Mobile tweaks */
  @media (max-width: 600px) {
    .connections {
      padding: 14px 14px 12px;
      border-radius: 10px;
    }
  
    .connections h1 {
      font-size: 1.6rem;
    }
  
    .connections p,
    .connections-howto li {
      font-size: 0.98rem;
    }
  
    .connections .dt-timer-value {
      font-size: 1.55rem;
    }
    .victory-next-button img {
      max-width: 100%;
      height: auto;
      display: block;
    }
  }

  /* =========================
   One Away Sticky Banner
   ========================= */
.one-away-banner {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translate(-50%, -120%);
    z-index: 9999;
  
    background: rgba(30, 30, 30, 0.92);
    border: 2px solid #C4A26A;
    border-radius: 12px;
    padding: 10px 16px;
  
    color: #fff;
    font-family: 'Compacta', sans-serif;
    font-size: 1.25rem;
    letter-spacing: 0.6px;
  
    box-shadow: 0 10px 22px rgba(0,0,0,0.35);
    opacity: 0;
  
    transition: transform 220ms ease, opacity 220ms ease;
    pointer-events: none;
  
    /* keep your black outline vibe */
    text-shadow:
      -1px -1px 0 black,
       1px -1px 0 black,
      -1px  1px 0 black,
       1px  1px 0 black;
  }
  
  .one-away-banner.show {
    transform: translate(-50%, 0);
    opacity: 1;
  }
  
  /* Mobile: slightly smaller and tighter */
  @media (max-width: 600px) {
    .one-away-banner {
      font-size: 1.1rem;
      padding: 9px 14px;
      top: 10px;
    }
  }

 /* Minimal endgame card like your screenshot */
.endgame-card.endgame-min{
  margin: 22px auto 34px;
  max-width: 760px;
  width: calc(100% - 44px);

  background: rgba(30, 30, 30, 0.85);
  border: 2px solid #C4A26A;
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.55);
  overflow: hidden;

  padding: 28px 26px 22px;
  text-align: center;

  opacity: 0;
  transform: translateY(18px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.endgame-card.endgame-min.is-visible{
  opacity: 1;
  transform: translateY(0);
}

.endgame-card.endgame-min .endgame-title{
  margin: 0;
  font-size: 32px;
  line-height: 1;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 4px 0 rgba(0,0,0,0.55);
}

.endgame-card.endgame-min .endgame-subtitle{
  margin: 14px auto 12px;
  max-width: 640px;
  font-size: 16px;
  line-height: 1.25;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 2px 0 rgba(0,0,0,0.55);
}

/* tiny “extra detail” without noise */
.endgame-meta{
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.endgame-pill{
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(196,162,106,0.55);
  background: rgba(0,0,0,0.28);
  color: rgba(255,255,255,0.86);
  font-size: 14px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

.endgame-pill strong{
  color: #fff;
  font-weight: 900;
}

/* keep result pill subtle */
.endgame-pill-result{
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
}

.endgame-grid-wrap{
  display: grid;
  place-items: center;
  margin: 8px 0 18px;
}

.endgame-grid{
  margin: 0;
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(0,0,0,0.25);
  border: 2px solid rgba(196,162,106,0.50);

  font-size: 28px;
  line-height: 1.35;
  letter-spacing: 0.22em;
  color: #fff;
  text-align: center;
  white-space: pre;
  text-shadow: 0 2px 0 rgba(0,0,0,0.65);
}

.endgame-btn{
  padding: 14px 28px;
  border-radius: 999px;
  border: 2px solid rgba(196,162,106,0.85);
  background: rgba(0,0,0,0.25);
  color: #fff;
  font-weight: 900;
  font-size: 18px;
  cursor: pointer;
  text-shadow: 0 2px 0 rgba(0,0,0,0.7);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  transition: transform 140ms ease, filter 140ms ease, background 140ms ease;
}

.endgame-btn:hover{
  transform: translateY(-1px);
  filter: brightness(1.08);
  background: rgba(196,162,106,0.10);
}

.endgame-toast{
  margin-top: 10px;
  min-height: 18px;
  font-size: 14px;
  color: rgba(255,255,255,0.75);
}

/* responsive */
@media (max-width: 560px){
  .endgame-card.endgame-min .endgame-title{ font-size: 52px; }
  .endgame-card.endgame-min .endgame-subtitle{ font-size: 18px; }
  .endgame-grid{ font-size: 24px; }
}

/* Victory Card Buttons */
.victory-next-button {
  margin-top: 20px;
  text-align: center;
  border-radius: 8px;
}

.victory-next-button img {
  display: flex;
  justify-content: center;
  flex-direction: column;
  width: 400px;
  max-width: 400px;
  height: auto;
  cursor: pointer;
  border-radius: 8px;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
}

.victory-next-button img:hover {
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 1.0));
  transform: scale(1.05);
}
.checkmark {
  display: none;
  position: absolute;
  bottom: -8px;
  right: -6px;
  background: #2ecc71;
  color: white;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 999px;
  font-weight: bold;
  pointer-events: none;
}
/* ---------- Mobile: make Connections board compact + square tiles ---------- */
@media (max-width: 520px) {
  /* Header */
  .connections-title {
    font-size: 26px;
    line-height: 1.1;
  }

  .connections-subtitle {
    font-size: 14px;
    line-height: 1.25;
    opacity: 0.9;
  }

  /* Board grid */
  .connections-board {
    /* keep 4 columns but smaller */
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 10px;
  }

  /* Tile becomes a square */
  .connections-tile {
    aspect-ratio: 1 / 1;         /* square */
    padding: 8px 6px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
  }

  /* Smaller headshot + ring */
  .connections-tile img {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;

    /* keep your vibe */
    border: 2px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.35);
    background: rgba(0, 0, 0, 0.25);
  }

  /* Smaller name text */
  .connections-tile-name {
    font-size: 11px;
    line-height: 1.1;
    text-align: center;
    max-width: 100%;
    opacity: 0.95;

    /* stop tall tiles caused by long names */
    display: -webkit-box;
    -webkit-line-clamp: 2;       /* max 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Selected state stays readable */
  .connections-tile.selected {
    outline-width: 2px; /* if you use outline */
  }

  /* Hearts row smaller so it doesn't shove layout */
  .connections-hearts .heart {
    font-size: 18px;
    margin: 0 2px;
  }

  /* Buttons a bit smaller */
  .connections-controls button {
    font-size: 14px;
    padding: 10px 12px;
  }
}

/* Extra-small phones: slightly tighter */
@media (max-width: 380px) {
  .connections-board {
    gap: 6px;
    padding: 8px;
  }

  .connections-tile img {
    width: 42px;
    height: 42px;
  }

  .connections-tile-name {
    font-size: 10px;
  }
}

/* ---- Mobile hard clamp: prevent horizontal overflow ---- */
@media (max-width: 520px) {
  /* stop page-side overflow */
  html, body {
    overflow-x: hidden;
  }

  /* whatever wrapper you use around the game */
  .connections,
  .game-container,
  .container {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* board must NEVER be wider than its parent */
  .connections-board {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;

    /* tighten the math */
    padding: 8px;
    gap: 6px;

    /* important: allow grid items to shrink */
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  /* tiles must be allowed to shrink too */
  .connections-tile {
    box-sizing: border-box;
    min-width: 0;        /* key for grid overflow */
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 6px 4px;
    border-radius: 12px;
  }

  /* shrink headshots + text a bit more */
  .connections-tile img {
    width: 40px;
    height: 40px;
  }

  .connections-tile-name {
    font-size: 10px;
    line-height: 1.05;
  }
}

/* Extra-tight phones (most iPhones): smaller again */
@media (max-width: 420px) {
  .connections-board {
    padding: 6px;
    gap: 5px;
  }

  .connections-tile {
    padding: 5px 3px;
    border-radius: 11px;
  }

  .connections-tile img {
    width: 36px;
    height: 36px;
  }

  .connections-tile-name {
    font-size: 9px;
  }
}

/* ===========================
   Endgame card: mobile sizing
   =========================== */

   .endgame-card.endgame-min {
    max-width: 720px;          /* desktop cap */
    margin: 18px auto 26px;
    padding: 22px 18px 18px;
    box-sizing: border-box;
  }
  
  /* keep the grid from stretching weirdly */
  .endgame-grid-wrap {
    width: 100%;
    display: grid;
    place-items: center;
  }
  
  .endgame-grid {
    margin: 12px 0 0;
    padding: 12px 14px;
    border-radius: 14px;
    box-sizing: border-box;
    white-space: pre;
  }
  
  /* make sure images/buttons never overflow */
  .endgame-card img,
  .endgame-card button,
  .endgame-card a {
    max-width: 100%;
  }
  
  /* -------- Phones -------- */
  @media (max-width: 520px) {
    .endgame-card.endgame-min {
      max-width: 360px;        /* stops it feeling gigantic */
      margin: 14px auto 18px;
      padding: 16px 14px 14px;
      border-width: 2px;       /* thinner gold border */
      border-radius: 14px;
    }
  
    .endgame-title {
      font-size: 44px;
      line-height: 1.02;
      margin: 0 0 6px;
      text-shadow: 0 3px 0 rgba(0,0,0,0.55);
    }
  
    .endgame-subtitle {
      font-size: 15px;
      line-height: 1.25;
      margin: 0 auto 10px;
      max-width: 320px;
    }
  
    .endgame-meta {
      margin-top: 8px;
    }
  
    .endgame-pill {
      font-size: 13px;
      padding: 8px 12px;
      border-radius: 999px;
    }
  
    .endgame-grid {
      font-size: 18px;         /* smaller emoji blocks */
      line-height: 1.25;
      letter-spacing: 0.16em;
      padding: 10px 12px;
      border-radius: 14px;
      border-width: 2px;
    }
  
    .endgame-btn {
      margin-top: 14px;
      padding: 12px 16px;
      font-size: 16px;
      border-width: 2px;
      width: min(320px, 92%);
    }
  
    .victory-next-button {
      margin-top: 12px;
      width: min(340px, 94%);
    }
  
    .victory-next-button .game-image {
      width: 100%;
      height: auto;
      border-radius: 12px;
      display: block;
    }
  
    .endgame-toast {
      margin-top: 10px;
      font-size: 12px;
    }
  }
  
  /* -------- Smaller phones (iPhone SE-ish) -------- */
  @media (max-width: 390px) {
    .endgame-card.endgame-min {
      max-width: 330px;
      padding: 14px 12px 12px;
    }
  
    .endgame-title {
      font-size: 40px;
    }
  
    .endgame-subtitle {
      font-size: 14px;
      max-width: 300px;
    }
  
    .endgame-grid {
      font-size: 16px;
      letter-spacing: 0.14em;
      padding: 9px 10px;
    }
  
    .endgame-btn {
      font-size: 15px;
      padding: 11px 14px;
    }
  }
  
  /* Desktop / default stays as-is */
.mode-bar-wrapper {
  padding: 0 10px;
}

/* iOS-style horizontal scroll on small screens */
 /* Desktop / default stays as-is */
.mode-bar-wrapper {
  padding: 0 10px;
}

/* iOS-style horizontal scroll on small screens */
@media (max-width: 700px) {
  .mode-bar-wrapper {
    justify-content: flex-start;          /* align to left for scroll feel */
    overflow-x: auto;                      /* enable horizontal scroll */
    -webkit-overflow-scrolling: touch;     /* smooth iOS scrolling */
    scrollbar-width: none;                /* Firefox hide scrollbar */
  }

  .mode-bar-wrapper::-webkit-scrollbar {
    display: none;                         /* Chrome/Safari hide scrollbar */
  }

  .mode-bar {
    flex-wrap: nowrap;                     /* IMPORTANT: prevent wrapping */
    gap: 14px;
    padding: 6px 4px 14px;                 /* room for labels */
    width: max-content;                    /* shrink to content so it scrolls */
  }

  /* Make buttons bigger on phones (iOS included) */
  .mode-icon {
    width: 78px;
    height: 78px;
    flex: 0 0 auto;                        /* don't shrink in flex row */
    border-width: 3px;
  }

  .mode-icon img {
    width: 52px;
    height: 52px;
  }

  /* On touch devices, show labels without hover */
  .mode-label {
    top: 78px;
    font-size: 0.85rem;
    opacity: 1;
    transform: translateY(0);
  }

  /* Give space for label so it doesn't overlap next row */
  .mode-icon {
    margin-bottom: 18px;
  }
}

/* Extra small phones */
@media (max-width: 380px) {
  .mode-icon {
    width: 72px;
    height: 72px;
  }

  .mode-icon img {
    width: 48px;
    height: 48px;
  }

  .mode-label {
    top: 72px;
    font-size: 0.8rem;
  }
}

@media (max-width: 700px) {
  .mode-bar-wrapper {
    scroll-snap-type: x mandatory;
  }
  .mode-icon {
    scroll-snap-align: start;
  }
}
