* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Comic Neue', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: url('../images/JoeBG.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
}

.desktop-brand {
    position: absolute;
    top: clamp(14px, 3vh, 32px);
    left: clamp(14px, 3vw, 32px);
    font-family: 'Fredoka One', cursive;
    font-size: clamp(20px, 3vw, 32px);
    color: #fff;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.65), 0 0 18px rgba(0, 0, 0, 0.35);
    letter-spacing: 0.5px;
}

.ca-bar {
    position: fixed;
    top: clamp(14px, 3vh, 32px);
    right: clamp(14px, 3vw, 32px);
    z-index: 950;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(10, 10, 15, 0.6);
    backdrop-filter: blur(4px);
    border-radius: 999px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: clamp(11px, 1.4vw, 13px);
}

.ca-label {
    font-family: 'Fredoka One', cursive;
    color: #ffd700;
    letter-spacing: 0.5px;
}

.ca-value {
    font-family: 'Comic Neue', monospace;
    font-weight: 700;
    max-width: 46vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ca-copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
}

.ca-copy-btn:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.24);
}

.ca-copy-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.desktop-hint {
    position: absolute;
    bottom: clamp(14px, 3vh, 28px);
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.65);
    font-size: clamp(12px, 1.6vw, 15px);
    opacity: 0.85;
    text-align: center;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 10, 0.72);
    backdrop-filter: blur(3px);
    z-index: 900;
}

.welcome-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(94vw, 640px);
    max-height: 90vh;
    z-index: 901;
    display: flex;
    flex-direction: column;
    background: rgba(20, 20, 26, 0.7);
    backdrop-filter: blur(6px) saturate(140%);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
    overflow: hidden;
}

.hidden {
    display: none !important;
}

.welcome-titlebar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.35);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.welcome-titlebar-dots {
    display: flex;
    gap: 6px;
}

.titlebar-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: block;
    padding: 0;
    border: none;
}

.dot-red {
    background: #ff5f56;
    cursor: pointer;
}

.dot-red:hover {
    background: #ff8a83;
}

.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.welcome-titlebar-text {
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    font-weight: 700;
}

.welcome-body {
    padding: clamp(14px, 2.5vh, 20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(12px, 2vh, 18px);
    overflow-y: auto;
}

.welcome-video {
    width: 100%;
    aspect-ratio: 1216 / 720;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
    background: #000;
}

.welcome-cta {
    display: block;
    width: 100%;
    text-align: center;
    padding: clamp(10px, 1.6vh, 14px) 18px;
    background: linear-gradient(135deg, #ffd700, #ff6b6b);
    color: #1a1a1a;
    font-family: 'Fredoka One', cursive;
    font-size: clamp(14px, 2vw, 17px);
    text-decoration: none;
    border: none;
    border-radius: 999px;
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.welcome-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.55);
}

.desktop-icons {
    position: absolute;
    top: clamp(70px, 14vh, 120px);
    left: clamp(14px, 3vw, 36px);
    z-index: 501;
    display: flex;
    flex-direction: column;
    gap: clamp(18px, 3vh, 34px);
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: clamp(88px, 14vw, 112px);
    padding: 10px 6px;
    border-radius: 12px;
    text-decoration: none;
    color: #fff;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.7);
    text-align: center;
    transition: background 0.15s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.desktop-icon:hover,
.desktop-icon:focus-visible {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-2px);
}

.desktop-icon:active {
    background: rgba(255, 255, 255, 0.24);
    transform: translateY(0);
}

.icon-image-wrap {
    position: relative;
    width: clamp(56px, 9vw, 72px);
    height: clamp(56px, 9vw, 72px);
    border-radius: 18px;
    background: rgba(10, 10, 15, 0.4);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35), inset 0 0 0 1.5px rgba(255, 255, 255, 0.25);
    overflow: visible;
}

.icon-image-wrap img.icon-base {
    width: 78%;
    height: 78%;
    object-fit: contain;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
}

.icon-image-wrap img.icon-badge {
    position: absolute;
    width: 46%;
    height: 46%;
    object-fit: contain;
    right: -8%;
    bottom: -8%;
    transform: rotate(-8deg);
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}

.icon-label {
    margin-top: 8px;
    font-size: clamp(12px, 1.5vw, 14px);
    font-weight: 700;
    line-height: 1.2;
}

/* Onboarding step 2: blur everything except the desktop icons, and have
   Joe point them out with a speech bubble. */
.explain-blur {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(5, 5, 10, 0.35);
    backdrop-filter: blur(7px);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.explain-blur.visible {
    opacity: 1;
}

.explain-joe {
    position: fixed;
    top: clamp(95px, 20vh, 170px);
    left: clamp(112px, 20vw, 172px);
    z-index: 502;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: min(78vw, 400px);
    opacity: 0;
}

.explain-joe.show {
    animation: explainPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.explain-joe.leaving {
    animation: explainPopOut 0.45s ease forwards;
}

.explain-joe-img {
    width: clamp(64px, 11vw, 92px);
    height: auto;
    flex-shrink: 0;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5));
}

.explain-bubble {
    position: relative;
    background: #fff;
    color: #1a1a1a;
    border-radius: 16px;
    padding: 12px 14px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
}

.explain-bubble::before {
    content: '';
    position: absolute;
    left: -9px;
    top: 22px;
    border-width: 8px 10px 8px 0;
    border-style: solid;
    border-color: transparent #fff transparent transparent;
}

.explain-bubble p {
    margin: 0 0 10px;
    font-size: clamp(12.5px, 1.6vw, 14.5px);
    font-weight: 700;
    line-height: 1.35;
}

.explain-gotit-btn {
    display: block;
    margin-left: auto;
    padding: 6px 16px;
    background: linear-gradient(135deg, #ffd700, #ff6b6b);
    color: #1a1a1a;
    font-family: 'Fredoka One', cursive;
    font-size: 12.5px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.4);
    transition: transform 0.15s ease;
}

.explain-gotit-btn:hover {
    transform: translateY(-2px);
}

@keyframes explainPopIn {
    0% { opacity: 0; transform: translateY(14px) scale(0.85); }
    60% { opacity: 1; transform: translateY(-4px) scale(1.04); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes explainPopOut {
    0% { opacity: 1; transform: scale(1) rotate(0deg); }
    35% { opacity: 1; transform: scale(1.08) rotate(-3deg); }
    100% { opacity: 0; transform: scale(0.35) rotate(10deg) translateY(24px); }
}
