.coinhunt-cartridge {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    font-family: sans-serif;
}

.coinhunt-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 20px;
}

.coinhunt-coin-container {
    background-color: transparent;
    aspect-ratio: 1 / 1;
    perspective: 1000px;
    cursor: pointer;
}

.coinhunt-coin-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
    transform-style: preserve-3d;
}

.coinhunt-coin-container.is-flipped .coinhunt-coin-inner {
    transform: rotateY(180deg);
}

.coinhunt-coin-container.animate-reveal .coinhunt-coin-inner {
    animation: coinRevealSpin 2s cubic-bezier(0.25, 1, 0.5, 1) 0.5s forwards;
}

/* --- ACTIVE TARGET STYLES --- */
.coinhunt-coin-container.is-next-target {
    position: relative;
    animation: coinhuntHeartbeat 4s infinite;
}

.coinhunt-coin-container.is-next-target::before,
.coinhunt-coin-container.is-next-target::after {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    pointer-events: none;
    animation: coinhuntTooltipFadeIn 0.5s ease 3s forwards;
    z-index: 10;
}

/* Tooltip bubble */
.coinhunt-coin-container.is-next-target::after {
    content: "Click to view Map";
    bottom: calc(100% + 12px);
    background-color: #F15A24;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: "Nuetra", Sans-serif;
    font-size: 1rem;
    white-space: nowrap;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Tooltip triangle pointer */
.coinhunt-coin-container.is-next-target::before {
    content: "";
    bottom: calc(100% + 7px);
    border-width: 5px 5px 0 5px;
    border-style: solid;
    border-color: #F15A24 transparent transparent transparent;
}

@keyframes coinhuntHeartbeat {
    0%, 10%, 100% { transform: scale(1); }
    5% { transform: scale(1.08); }
}

@keyframes coinhuntTooltipFadeIn {
    to { opacity: 1; }
}
/* ---------------------------- */

@keyframes coinRevealSpin {
    0% { transform: rotateY(0deg) scale(1); }
    50% { transform: rotateY(900deg) scale(1.3);
    }
    100% { transform: rotateY(1980deg) scale(1); }
}

.coinhunt-coin-front, .coinhunt-coin-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    overflow: hidden;
    padding: 10px;
}

.coinhunt-coin-front img, .coinhunt-coin-back img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.coinhunt-coin-back {
    transform: rotateY(180deg);
}

.coinhunt-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    align-items: flex-start;
    justify-content: center;
    padding: 50px 15px;
    overflow-y: auto;
}

.coinhunt-modal.is-active {
    display: flex;
}

.coinhunt-modal-content {
    background-color: #fff;
    padding: 0;
    border-radius: 0;
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.coinhunt-popup-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.coinhunt-modal-close {
    color: #F15A24;
    position: absolute;
    top: -20px;
    right: -20px;
    font-size: 42px;
    cursor: pointer;
    z-index: 10;
    background: #fff;
    border-radius: 100px;
    width: 40px;
    text-align: center;
    height: 40px;
    line-height: 1;
}

.coin-desc {
    color: #F15A24;
    font-size: 40px;
    font-weight: 700;
    text-align: center;
    line-height: 1;
    font-family: "Nuetra", Sans-serif;
}

.coin-find-amounts {
    font-family: "Jersey 10", Sans-serif;
    color: #F15A24;
    font-size: 8rem;
    font-weight: 700;
    text-align: center;
    line-height: 0.6;
}

.coinhunt-modal-close:hover,
.coinhunt-modal-close:focus {
    color: #000;
    text-decoration: none;
}

.coinhunt-btn, .btn-coin-hunt, .coinhunt-btn:hover, .btn-coin-hunt:hover, .coinhunt-btn:focus, .btn-coin-hunt:focus  {
    display: inline-block;
    padding: 12px;
    width: 100%;
    text-align: center;
    color: #fff;
    text-transform: uppercase;
    font-weight: 700;
    background: #F15A24;
    border-radius: 0px;
    font-size: 1.5rem;
    font-family: "Nuetra", Sans-serif;
    border: 0px;
}

.mrg-top {
    margin-top: 20px;
}

.coinhunt-btn-primary {
    font-size: 20px;
}

body.coinhunt-player-registered .coinhunt-guest-only {
    display: none !important;
}

#coinhunt-dynamic-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.popups-treasure {
    background: #F15A24;
}

.popups-treasure .coin-desc {
    color: #fff;
    text-transform: uppercase;
    font-size: 1rem;
    text-align: center;
    padding: 10px;
    width: auto;
}

.coinhunt-popup-wrapper.popups-found{
    padding: 20px;
    gap: 0px;
    justify-content: center;
    align-items: center;
}

.coinhunt-popup-wrapper.popups-found .coin-img{
    max-width: 80% !important;
}

.mg-tp-5{
    margin-top: 5px;
}
.mg-bt-5{
    margin-bottom: 5px;
}

.coinhunt-popup-wrapper.popups-howto {
    background: #F15A24;
    padding: 20px;
}
.coinhunt-popup-wrapper.popups-howto .coin-img {
    max-width: 80% !important;
}

.coinhunt-popup-wrapper.popups-howto .coinhunt-btn{
    background: #fff;
    color: #F15A24;
    margin-top: 10px;
}

.coinhunt-popup-wrapper.popups-winner {
    padding: 20px;
    background-color: #f15a24;
}

.coinhunt-popup-wrapper.popups-winner .coin-desc{
    color: #FFFFFF;
}

.coinhunt-popup-wrapper.popups-winner .coinhunt-btn{
    background: #fff;
    color: #F15A24;
    margin-top: 10px;
}