/* style.css - Mobile-First Minecraft Running Video HUD */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation; /* Eliminates 300ms tap delay on mobile */
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed; /* Prevents mobile rubber-banding and pull-to-refresh */
    background-color: #000;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    color: #ffffff;
}

#canvas-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* --- MOBILE-FIRST UI OVERLAY --- */
#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Safe-area insets for modern mobile devices (notches, dynamic island, home bar) */
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
}

/* --- TOP STATUS BAR --- */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 8px;
}

.brand-pill {
    background: rgba(25, 25, 25, 0.88);
    border: 2px solid #4a4a4a;
    border-top-color: #666;
    border-left-color: #666;
    border-bottom-color: #111;
    border-right-color: #111;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.badge-icon {
    font-size: 16px;
}

.brand-text h1 {
    font-size: 10px;
    color: #55ff55;
    text-shadow: 1px 1px #003300;
    letter-spacing: 0.5px;
}

.brand-text .sub {
    font-size: 6px;
    color: #aaaaaa;
    display: block;
    margin-top: 2px;
}

.stats-badge {
    background: rgba(25, 25, 25, 0.88);
    border: 2px solid #4a4a4a;
    border-top-color: #666;
    border-left-color: #666;
    border-bottom-color: #111;
    border-right-color: #111;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.stats-badge .label {
    font-size: 8px;
    color: #ffff55;
    text-shadow: 1px 1px #333300;
}

.fart-num {
    background: #25661b;
    border: 1px solid #5bb843;
    padding: 3px 8px;
    color: #ffffff;
    font-size: 11px;
    border-radius: 3px;
    text-shadow: 1px 1px #000;
    min-width: 24px;
    text-align: center;
    transition: transform 0.15s ease, background 0.15s ease;
}

.fart-num.pop-anim {
    transform: scale(1.4);
    background: #78d460;
}

.icon-btn {
    pointer-events: auto;
    background: rgba(35, 35, 35, 0.9);
    border: 2px solid #555;
    border-top-color: #777;
    border-left-color: #777;
    border-bottom-color: #1a1a1a;
    border-right-color: #1a1a1a;
    color: #fff;
    width: 36px;
    height: 36px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.icon-btn:active {
    transform: scale(0.92);
    background: #222;
}

/* --- CENTER COMIC NOTIFICATION --- */
#fart-toast {
    position: absolute;
    top: 28%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    color: #55ff55;
    text-shadow: 2px 2px #000, 0 0 16px rgba(85, 255, 85, 0.9);
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    text-align: center;
    width: 90%;
}

/* --- BOTTOM THUMB-FRIENDLY CONTROLS --- */
.bottom-bar {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

/* Camera Pills Row */
.cam-selector-row {
    display: flex;
    width: 100%;
    gap: 6px;
    justify-content: center;
}

.cam-pill {
    flex: 1;
    background: rgba(35, 35, 35, 0.88);
    border: 2px solid #555;
    border-top-color: #777;
    border-left-color: #777;
    border-bottom-color: #1a1a1a;
    border-right-color: #1a1a1a;
    color: #ffffff;
    padding: 8px 4px;
    font-family: inherit;
    font-size: 8px;
    cursor: pointer;
    text-align: center;
    border-radius: 4px;
    transition: all 0.12s ease;
}

.cam-pill:active {
    transform: scale(0.95);
}

.cam-pill.active {
    background: #2b7023;
    border-color: #5bb843 #163e12 #163e12 #5bb843;
    color: #ffff55;
}

/* GIANT PRIMARY THUMB BUTTON (Super easy to tap on mobile!) */
.giant-thumb-btn {
    width: 100%;
    background: #2b7023;
    border: 3px solid #5bb843;
    border-right-color: #163e12;
    border-bottom-color: #163e12;
    border-top-color: #78d460;
    border-left-color: #78d460;
    color: #ffffff;
    padding: 16px 20px;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    text-shadow: 2px 2px #000;
    box-shadow: 0 6px 20px rgba(85, 255, 85, 0.45);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.1s ease;
}

.giant-thumb-btn:active {
    background: #1c5216;
    transform: scale(0.97);
    box-shadow: 0 2px 10px rgba(85, 255, 85, 0.7);
}

/* Secondary Utility Bar (Turbo & Save MP4) */
.utility-row {
    display: flex;
    width: 100%;
    gap: 8px;
}

.pill-btn {
    flex: 1;
    background: #444444;
    border: 2px solid #666;
    border-right-color: #222;
    border-bottom-color: #222;
    color: #ffffff;
    padding: 11px 12px;
    font-family: inherit;
    font-size: 9px;
    cursor: pointer;
    text-shadow: 1px 1px #000;
    border-radius: 4px;
    text-align: center;
    transition: all 0.12s ease;
}

.pill-btn:active {
    transform: scale(0.95);
    background: #333;
}

.pill-btn.active {
    background: #2b7023;
    border-color: #5bb843 #163e12 #163e12 #5bb843;
    color: #ffff55;
}

.record-pill {
    background: #8b2626;
    border-color: #d14a4a #471111 #471111 #d14a4a;
}

.record-pill:active {
    background: #6b1d1d;
}

.recording-pulse {
    animation: pulse-red 0.8s infinite alternate;
}

@keyframes pulse-red {
    0% { background: #8b2626; box-shadow: 0 0 4px #ff0000; }
    100% { background: #ff2222; box-shadow: 0 0 16px #ff2222; }
}

/* --- CONVERSION LOADING MODAL --- */
#conversion-status {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.88);
    z-index: 150;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.conversion-box {
    background: #1e1e1e;
    border: 3px solid #55ff55;
    padding: 24px 20px;
    text-align: center;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 0 25px rgba(85, 255, 85, 0.4);
    border-radius: 6px;
}

.conversion-box h3 {
    color: #ffff55;
    font-size: 11px;
    margin-bottom: 10px;
    line-height: 1.5;
}

.conversion-box p {
    font-size: 8px;
    color: #aaa;
    line-height: 1.6;
}

.spinner {
    width: 38px;
    height: 38px;
    border: 4px solid #333;
    border-top-color: #55ff55;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- MOBILE TAP-TO-START INTRO OVERLAY --- */
#audio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.86);
    z-index: 200;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    padding: 20px;
}

.audio-box {
    background: #252525;
    border: 4px solid #4f4f4f;
    border-top-color: #7a7a7a;
    border-left-color: #7a7a7a;
    border-bottom-color: #141414;
    border-right-color: #141414;
    padding: 24px 20px;
    text-align: center;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.9);
    border-radius: 6px;
}

.creature-preview-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.audio-box h2 {
    color: #55ff55;
    font-size: 13px;
    margin-bottom: 12px;
    text-shadow: 2px 2px #003300;
    line-height: 1.5;
}

.audio-box p {
    font-size: 8px;
    color: #dddddd;
    line-height: 1.8;
    margin-bottom: 20px;
}

.prompt-btn {
    background: #2b7023;
    border: 3px solid #5bb843;
    color: #ffffff;
    font-size: 11px;
    padding: 14px 20px;
    font-family: inherit;
    cursor: pointer;
    text-shadow: 1px 1px #000;
    border-radius: 4px;
    width: 100%;
    animation: bounce-prompt 1.2s infinite;
}

@keyframes bounce-prompt {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
