/* Gig Description Section Styles */
#gig-description-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    font-family: 'Comic Neue', 'Courier New', Courier, monospace;
}

@media (max-width: 768px) {
    #gig-description-container {
        padding: 2rem 20px;
    }
}

.gig-description-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 0.5rem;
    align-items: start;
}

/* 
   Left Column Wrapper 
   Contains Frame and Buttons on Desktop
   On Mobile, we use display: contents to let children participate in the main flex column
*/
.left-column-wrapper {
    grid-column: 1;
    grid-row: 1 / span 3;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    width: 100%;
}

/* Responsive: Mobile/Tablet -> Column with Explicit Order */
@media (max-width: 768px) {
    .gig-description-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Unwrap the left column so we can reorder its children */
    .left-column-wrapper {
        display: contents;
    }

    /* Order 1: Bubble */
    .bubble-wrapper {
        order: 1;
        justify-content: center;
    }

    /* Order 2: Gig Frame */
    .gig-frame-wrapper {
        order: 2;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    /* Order 3: Description */
    .description-box {
        order: 3;
    }

    /* Order 4: Useful Banner & List */
    .useful-section {
        order: 4;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    /* Order 5: Buttons */
    .gig-buttons-container {
        order: 5;
    }
}

/* Frame */
.gig-frame-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    cursor: pointer;
}

.gig-frame-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

.gig-frame-image.basic {
    position: relative;
    z-index: 1;
}

.gig-frame-image.deranged {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.gig-frame-wrapper.active .gig-frame-image.deranged {
    opacity: 1;
}

/* Buttons Container */
.gig-buttons-container {
    width: 100%;
    max-width: 500px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.gig-action-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gig-action-button img {
    width: 100%;
    height: auto;
    display: block;
    max-width: 240px;
    /* Constraint to keep them reasonable */
}

/* General Info Button Hover: Scale */
.general-button {
    transition: transform 0.2s ease;
}

.general-button:hover {
    transform: scale(1.05);
}

/* Wrong Here Button Hover: Swap */
.wrong-button {
    transition: transform 0.2s ease;
}

.wrong-button:hover {
    transform: scale(1.05);
}

.wrong-img-wrapper {
    position: relative;
    width: 100%;
    max-width: 240px;
}

.wrong-img-wrapper img {
    width: 100%;
    height: auto;
}

.wrong-active {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* On hover of the button, show active */
.wrong-button.active-state .wrong-active {
    opacity: 1;
}

.wrong-button:active .wrong-active {
    opacity: 1;
}


/* Right Column Elements */
.bubble-wrapper,
.description-box,
.useful-section {
    grid-column: 2;
    width: 100%;
}

/* Bubble */
.bubble-wrapper {
    width: 100%;
    display: flex;
    justify-content: flex-start;
}

.bubble-image {
    width: 100%;
    max-width: 450px;
    height: auto;
    object-fit: contain;
}

/* Description Box */
.description-box {
    background-color: #f0eee5;
    border: 2px solid #000;
    padding: 1.5rem;
    position: relative;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.2);
    transform: rotate(-1deg);
}

.description-box p {
    font-family: 'Courier New', Courier, monospace;
    line-height: 1.5;
    color: #333;
    margin: 0;
    font-weight: 700;
}

/* Useful For Section */
.useful-section {
    margin-top: 1rem;
}

.useful-banner-img {
    max-width: 250px;
    height: auto;
    display: block;
    margin-bottom: 1rem;
    transform: rotate(2deg);
}

.useful-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.useful-list li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #000;
    line-height: 1.4;
}

.list-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    /* Prevent squishing */
}

/* Useful-For Crossfade Container */
.useful-list-crossfade {
    position: relative;
    width: 100%;
}

.useful-list-basic {
    position: relative;
    z-index: 1;
    opacity: 1;
    transition: opacity 1s ease-in-out;
}

.useful-list-deranged {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.useful-list-crossfade.active .useful-list-basic {
    opacity: 0;
}

.useful-list-crossfade.active .useful-list-deranged {
    opacity: 1;
}

/* Icons */
.bomb-icon::before {
    content: "💣";
}

.default-icon::before {
    content: "💥";
}

/* Modal Styles */
/* Using #general-info-modal for specificity to override chat.css modal styles */
#general-info-modal.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    /* Override chat.css opacity/pointer-events */
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: #fff;
    border: 3px solid #000;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    position: relative;
    box-shadow: 8px 8px 0px rgba(0, 0, 0, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.modal-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-list li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.4;
    font-weight: 700;
    color: #000;
}

.modal-icon {
    flex-shrink: 0;
}

.number-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 28px;
    height: 28px;
    background-color: #000;
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1rem;
}

.hidden {
    display: none !important;
}

/* --- Wrong Button Section Styles --- */

#gig-wrong-section {
    width: 100%;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 4px dashed #000;
}

.wrong-section-block {
    margin-bottom: 4rem;
}

.wrong-section-header {
    font-family: 'Comic Neue', 'Bangers', cursive;
    font-size: 3rem;
    letter-spacing: 1px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-transform: uppercase;
    color: #000;
    text-shadow: 2px 2px 0px #fff;
}

.header-icon {
    font-size: 3rem;
    line-height: 1;
}

/* Grid Override/Reuse */
.wrong-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    width: 100%;
}

/* Responsive Grid Logic */
@media (max-width: 1200px) {
    .wrong-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .wrong-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .wrong-grid {
        grid-template-columns: 1fr;
    }

    .wrong-section-header {
        font-size: 2rem;
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Hide Utility Classes */
@media (max-width: 1024px) {
    .hide-tablet {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Image Hover Effect for Wrong Grid Cards */
.wrong-grid .gig-image-wrapper {
    position: relative;
}

.wrong-grid .basic-img {
    position: relative;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.wrong-grid .hover-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
}

.wrong-grid .deranged-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wrong-grid .troll-gig-card:hover .deranged-img {
    opacity: 1;
}

.wrong-grid .troll-gig-card:hover .basic-img {
    opacity: 0;
}

/* Loading/Error */
.loading-spinner,
.error-msg {
    text-align: center;
    font-size: 2rem;
    padding: 3rem;
    font-family: 'Bangers', cursive;
    width: 100%;
}

/* --- Tokens Cost Money Section --- */
.tokens-cost-money-divider {
    width: 100%;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 4px dashed #000;
}

.tokens-cost-money-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    animation: tokenWobble 9s ease-in-out infinite;
}

@keyframes tokenWobble {
    0% {
        transform: rotate(-2deg);
    }

    50% {
        transform: rotate(2deg);
    }

    100% {
        transform: rotate(-2deg);
    }
}

.tokens-cost-money-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

.tokens-cost-money-img.tokens-cost-money-first {
    position: relative;
    z-index: 1;
}

.tokens-cost-money-img.tokens-cost-money-second {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.tokens-cost-money-wrapper.active .tokens-cost-money-img.tokens-cost-money-second {
    opacity: 1;
}

/* Pop Art Arrow pointing down */
.tokens-arrow-container {
    display: flex;
    justify-content: center;
    margin: 2.5rem auto 0rem auto;
}

.tokens-arrow-down {
    width: 60px;
    height: 80px;
    filter: drop-shadow(3px 3px 0px rgba(0, 0, 0, 0.8));
}

/* --- Start Button Section --- */
.start-button-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    margin-bottom: 2rem;
    height: 120px;
    /* Pre-allocate space to avoid layout shift when fading */
    position: relative;
    z-index: 100;
}

.start-gig-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
    width: 100%;
    max-width: 340px;
    /* Reduced by ~30% (was 480px) */
    transition: transform 0.2s ease, opacity 1s ease;
    display: flex;
    justify-content: center;
    animation: alivePulse 3s ease-in-out infinite;
}

.start-gig-btn:hover {
    transform: scale(1.05);
    /* Bit bigger on hover */
    animation: none;
    /* Stop pulsing on interaction */
}

/* Subtle "Alive" Animation */
@keyframes alivePulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.04);
    }

    /* Stronger breath */
    100% {
        transform: scale(1);
    }
}

.start-gig-btn.fading-out {
    opacity: 0;
    pointer-events: none;
    animation: none;
}

.start-img-wrapper {
    position: relative;
    width: 100%;
}

.start-img-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

.start-active-img {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Show active on hover or when clicked */
.start-gig-btn:hover .start-active-img,
.start-gig-btn.active .start-active-img {
    opacity: 1;
}

/* --- Countdown Timer --- */
.timer-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Centered exactly where the button was */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    width: 100%;
    z-index: 101;
}

.countdown-321 {
    font-family: 'Bangers', cursive;
    font-size: 8rem;
    color: #000;
    /* text-shadow: 3px 3px 0px #fff; */
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gig-timer-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 4rem;
    font-weight: 700;
    color: #000;
    background: #fff;
    padding: 0.5rem 1rem;
    border: 3px solid #000;
    box-shadow: 5px 5px 0px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 1s ease;
}

.gig-timer-display.visible {
    opacity: 1;
}

.beat-time-label {
    font-family: 'Bangers', cursive;
    font-size: 2.5rem;
    color: #ff0000;
    text-shadow: 2px 2px 0px #000;
    transform: rotate(-3deg);
    margin-bottom: 0.5rem;
    opacity: 0;
    transition: opacity 1s ease;
    white-space: nowrap;
}

.beat-time-label.visible {
    opacity: 1;
}

/* Fast Blinking Animation */
@keyframes blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.gig-timer-display.blinking {
    animation: blink 0.2s steps(2, start) infinite;
    /* steps(2, start) makes it hard on/off */
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    80% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .start-gig-btn {
        max-width: 280px;
        /* Bigger on mobile for contrast */
    }

    .countdown-321 {
        font-size: 5rem;
    }

    .gig-timer-display {
        font-size: 2.5rem;
    }
}

/* --- Three Button Layout --- */
.gig-buttons-container.three-buttons {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 480px) {
    .gig-buttons-container.three-buttons {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.3rem;
    }

    .gig-buttons-container.three-buttons .gig-action-button img {
        max-width: 100%;
    }
}

/* Gems Button Hover */
.gems-button {
    transition: transform 0.2s ease;
}

.gems-button:hover {
    transform: scale(1.05);
}

/* --- Gems Modal Styles --- */
#gems-modal.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    opacity: 1;
    pointer-events: auto;
}

.gems-modal-content {
    background-color: #fff;
    border: 3px solid #000;
    padding: 2rem;
    max-width: 700px;
    width: 100%;
    position: relative;
    box-shadow: 8px 8px 0px rgba(0, 0, 0, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.gems-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.gem-item {
    border: 2px solid #000;
    background-color: #f0eee5;
    box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gem-item:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0px rgba(0, 0, 0, 0.4);
}

.gem-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
}

.gem-icon-wrapper {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.gem-icon-wrapper img,
.gem-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Hover effect: rotate clockwise and grow */
.gem-item:hover .gem-icon-wrapper {
    transform: rotate(15deg) scale(1.15);
}

.gem-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow: hidden;
}

.gem-name {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: #000;
    word-break: break-all;
    line-height: 1.3;
}

.gem-description {
    font-family: 'Comic Neue', 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    font-weight: 400;
    color: #555;
    line-height: 1.4;
}

.gem-item-empty {
    text-align: center;
    font-family: 'Comic Neue', cursive;
    font-size: 1.2rem;
    font-weight: 700;
    color: #666;
    padding: 2rem;
}

@media (max-width: 600px) {
    .gems-modal-content {
        padding: 1.5rem;
    }

    .gem-link {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .gem-icon-wrapper {
        width: 40px;
        height: 40px;
    }

    .gem-name {
        font-size: 0.9rem;
    }

    .gem-description {
        font-size: 0.8rem;
    }
}

/* --- Example Video Modal Styles --- */
#example-video-modal.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    opacity: 1;
    pointer-events: auto;
}

.example-video-modal-content {
    background-color: #000;
    border: 3px solid #000;
    padding: 2.5rem 1rem 1rem 1rem;
    max-width: 800px;
    width: 100%;
    position: relative;
    box-shadow: 8px 8px 0px rgba(0, 0, 0, 1);
}

.example-video-modal-content .modal-close-btn {
    color: #fff;
    z-index: 10;
}

.example-video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 aspect ratio */
}

.example-video-thumbnail-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.example-video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.example-video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.85;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.example-video-thumbnail-wrapper:hover .example-video-play-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.example-video-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* General Info Button Crossfade (same pattern as gig-frame basic/deranged) */
.general-btn-img-wrapper {
    position: relative;
    width: 100%;
    max-width: 240px;
}

.general-btn-img-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

.general-info-default {
    position: relative;
    z-index: 1;
}

.general-info-example {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

#general-info-btn.example-active .general-info-example {
    opacity: 1;
}