/* minimalist css reset */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

@font-face {
    font-family: 'AppFont';
    src: url('assets/fonts/font.ttf') format('truetype');
}

body {
    background: #000;
    color: #ccc;
    font-family: 'AppFont', monospace;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    touch-action: none;
}

canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: block;
    outline: none;
}

#toolbar {
    position: fixed;
    top: env(safe-area-inset-top, 0); 
    left: 0; right: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
    z-index: 10;
}

#toolbar button {
    background: rgba(34, 34, 34, 0.8);
    color: #eee;
    border: 1px solid #444;
    padding: 6px 8px;
    font-family: monospace;
    font-size: 12px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 2px;
    min-width: 65px;
    text-align: center;
}

#toolbar button:active { background: #555; }

@media (max-width: 600px) {
    #toolbar button { padding: 12px 16px; font-size: 13px; }
}

#debug-info {
    position: fixed;
    top: 50px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 4px;
    line-height: 1.4;
    white-space: pre;
    pointer-events: none;
    z-index: 10;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

@media (max-width: 600px) {
    #debug-info {
        top: auto;
        bottom: 35px; /* above the info bar */
        left: 5px;
        font-size: 11px;
        padding: 6px 10px;
        line-height: 1.3;
        background: rgba(0, 0, 0, 0.8);
    }
}

#zoom-box {
    position: fixed;
    border: 2px solid yellow;
    background: rgba(255, 255, 0, 0.2);
    pointer-events: none;
    display: none;
    z-index: 5;
}

#info {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    padding: 4px 10px;
    background: rgba(0,0,0,0.6);
    font-size: 11px;
    color: #eee;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    font-family: monospace;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-top: 1px solid rgba(255,255,255,0.1);
}

#info a { color: #fff; text-decoration: none; opacity: 0.8; }
#info a:hover { opacity: 1; text-decoration: underline; }

@media (max-width: 600px) {
    #info { font-size: 9px; padding: 6px 8px; }
    #info span:first-child { display: none; } /* hide long text on mobile */
    #info::before { content: "Scroll/Pinch=Zoom | Drag=Move"; }
}

#loading-screen {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-family: -apple-system, sans-serif;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #333;
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

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