/* Minimal styles for index.html - most visuals are handled by JavaScript canvas */
html, body { 
    height: 100%; 
    margin: 0; 
    background: #000; 
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
    min-height: 100vh;
    min-height: calc(100vh - env(safe-area-inset-bottom, 0));
    padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
    box-sizing: border-box;
}

canvas { 
    display: block; 
    width: 100%; 
    height: 100%; 
    background: #000; 
    touch-action: none;
}

/* Live RainGame.js / calc readout (bottom-right, resizable) */
.rain-code-panel {
    position: fixed;
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    z-index: 20;
    width: min(320px, 42vw);
    height: 168px;
    min-width: 160px;
    min-height: 88px;
    max-width: min(90vw, 720px);
    max-height: min(80vh, 560px);
    display: flex;
    flex-direction: column;
    pointer-events: none;
    overflow: hidden;
    box-sizing: border-box;
    border: 1px solid rgba(0, 204, 68, 0.45);
    background: rgba(0, 0, 0, 0.78);
    color: #00cc44;
    font-family: "Courier New", Courier, monospace;
    font-size: 10px;
    line-height: 1.35;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.rain-code-panel.is-resizing {
    user-select: none;
    border-color: rgba(102, 238, 153, 0.85);
}

.rain-code-panel__resize {
    position: absolute;
    top: 0;
    left: 0;
    width: 16px;
    height: 16px;
    pointer-events: auto;
    cursor: nwse-resize;
    touch-action: none;
    z-index: 2;
}

.rain-code-panel__resize::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 9px;
    height: 9px;
    border-top: 2px solid rgba(102, 238, 153, 0.85);
    border-left: 2px solid rgba(102, 238, 153, 0.85);
}

.rain-code-panel__header {
    flex: 0 0 auto;
    padding: 4px 8px 4px 18px;
    border-bottom: 1px solid rgba(0, 204, 68, 0.35);
    color: #66ee99;
    letter-spacing: 0.02em;
    background: rgba(0, 40, 12, 0.55);
}

.rain-code-panel__body {
    flex: 1 1 auto;
    margin: 0;
    padding: 6px 8px;
    overflow: auto;
    white-space: pre;
    word-break: normal;
    color: #00cc44;
    opacity: 0.92;
}

/* Responsive Design */
@media (max-width: 768px) {
    html, body {
        font-size: 14px;
    }
    
    canvas {
        /* Ensure canvas scales properly on mobile */
        max-width: 100vw;
        max-height: 100vh;
    }

    .rain-code-panel {
        width: min(240px, 55vw);
        height: 132px;
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    html, body {
        font-size: 12px;
    }

    .rain-code-panel {
        width: min(200px, 58vw);
        height: 110px;
        font-size: 8px;
        bottom: max(6px, env(safe-area-inset-bottom, 0px));
        right: max(6px, env(safe-area-inset-right, 0px));
    }
}
