/* ============================================================
   Mill Gallery 62 — Stylesheet
   ============================================================ */

.mg62-wrap {
    position: relative;
    width: 100%;
    height: 680px;
    overflow: hidden;
    background: #1a2d1a;
    font-family: 'Georgia', serif;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 1.0s;
}
.mg62-wrap.night { background: #060e10; }

/* ── Canvas ──────────────────────────────────────────────── */
.mg62-canvas-host {
    position: absolute; inset: 0; z-index: 1;
}
.mg62-canvas-host canvas {
    display: block; width: 100% !important; height: 100% !important;
}

/* ── Paddle overlay ──────────────────────────────────────── */
.mg62-paddles-overlay {
    position: absolute; inset: 0; z-index: 2; pointer-events: none;
}

.mg62-paddle {
    position: absolute;
    pointer-events: all;
    cursor: pointer;
    will-change: transform;
    transform-origin: center center;
    transition: box-shadow 0.15s;
}

.mg62-paddle-board {
    position: relative;
    width: 100%; height: 100%;
    border-radius: 2px;
    overflow: hidden;
    box-shadow:
        0 0 0 3px #3a2408,
        0 0 0 5px #6a4818,
        0 4px 18px rgba(0,0,0,0.75),
        inset 0 0 12px rgba(0,0,0,0.4);
    border: 3px solid #5a3a18;
    transition: box-shadow 0.15s;
}

.mg62-paddle:hover .mg62-paddle-board {
    box-shadow:
        0 0 0 3px #4a8050,
        0 0 0 5px #80c090,
        0 4px 24px rgba(60,160,80,0.4),
        inset 0 0 12px rgba(0,0,0,0.3);
    border-color: #6ab080;
}

.mg62-paddle-board img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    filter: saturate(0.9) brightness(0.95);
    transition: filter 0.2s;
}
.mg62-paddle:hover .mg62-paddle-board img {
    filter: saturate(1.1) brightness(1.05);
}

/* Water-wet sheen on boards submerged in water */
.mg62-paddle.wet .mg62-paddle-board {
    box-shadow:
        0 0 0 3px #1a3a4a,
        0 0 0 5px #2a5a6a,
        0 2px 10px rgba(0,50,80,0.6),
        inset 0 0 16px rgba(0,40,60,0.5);
    border-color: #2a5a6a;
}
.mg62-paddle.wet .mg62-paddle-board img { filter: saturate(0.7) brightness(0.75) hue-rotate(190deg) opacity(0.85); }

/* Wood grain overlay on boards */
.mg62-paddle-board::before {
    content: '';
    position: absolute; inset: 0; z-index: 3;
    background: repeating-linear-gradient(
        88deg,
        transparent 0px,
        transparent 6px,
        rgba(0,0,0,0.06) 6px,
        rgba(0,0,0,0.06) 7px
    );
    pointer-events: none;
}

/* Rivets at corners */
.mg62-paddle-board::after {
    content: '';
    position: absolute; top: 4px; left: 4px; z-index: 4;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #aaa 0%, #666 45%, #333 100%);
    box-shadow: calc(100% - 10px) 0 0 -1px #666, 0 calc(100% - 10px) 0 -1px #666, calc(100% - 10px) calc(100% - 10px) 0 -1px #666;
    pointer-events: none;
}

.mg62-paddle-caption {
    position: absolute;
    bottom: -20px; left: 50%;
    transform: translateX(-50%);
    font-size: 9px; letter-spacing: 1.5px;
    color: #80c090; text-transform: uppercase;
    white-space: nowrap;
    text-shadow: 0 1px 4px rgba(0,0,0,0.95);
    opacity: 0.8; pointer-events: none;
}

/* ── Sluice control ──────────────────────────────────────── */
.mg62-sluice-ctrl {
    position: absolute;
    left: 18px; top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    touch-action: none;
}
.mg62-sluice-track {
    width: 20px; height: 150px;
    background: linear-gradient(to bottom, #0a1e2a, #1a3a4a, #0a1e2a);
    border: 1px solid #2a5a6a; border-radius: 4px;
    box-shadow: inset 0 0 8px rgba(0,0,0,0.8), 0 0 10px rgba(0,0,0,0.6);
    position: relative; cursor: ns-resize;
}
.mg62-sluice-gate {
    position: absolute; left: -4px; right: -4px;
    height: 24px; top: 20%;
    background: linear-gradient(to bottom, #5a3a18, #8a5e28, #5a3a18);
    border: 1px solid #6a4818; border-radius: 3px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.7), 0 0 4px rgba(120,80,20,0.3);
    cursor: ns-resize;
    transition: box-shadow 0.1s;
}
.mg62-sluice-gate:hover,
.mg62-sluice-gate.dragging { box-shadow: 0 2px 12px rgba(60,180,100,0.5), 0 0 8px rgba(60,180,100,0.3); }
.mg62-sluice-label {
    font-size: 9px; letter-spacing: 2.5px; color: #4a8060;
    text-transform: uppercase;
}

/* ── HUD ─────────────────────────────────────────────────── */
.mg62-hud {
    position: absolute; bottom: 16px; right: 16px;
    z-index: 10; display: flex; flex-direction: column; gap: 6px; align-items: flex-end;
}
.mg62-hud-row { display: flex; align-items: center; gap: 8px; }
.mg62-hud-label {
    font-size: 9px; letter-spacing: 2.5px; color: #80c090; text-transform: uppercase;
}
.mg62-hud-bar {
    width: 100px; height: 7px;
    background: #081208; border: 1px solid #2a5020; border-radius: 4px;
    overflow: hidden; box-shadow: inset 0 1px 4px rgba(0,0,0,0.9);
}
.mg62-hud-fill {
    height: 100%; width: 20%;
    background: linear-gradient(to right, #082808, #1a6030, #40c070, #80ffe0);
    border-radius: 4px; transition: width 0.15s ease-out;
    box-shadow: 0 0 6px rgba(60,200,100,0.6);
}
.mg62-hud-rpm {
    font-size: 11px; color: #60a078;
    font-variant-numeric: tabular-nums; letter-spacing: 1px; min-width: 40px; text-align: right;
}

/* ── Night toggle ────────────────────────────────────────── */
.mg62-night-btn {
    position: absolute; top: 14px; right: 14px; z-index: 10;
    width: 30px; height: 30px;
    background: #0a180a; border: 1px solid #2a4030; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 16px; line-height: 1;
    box-shadow: 0 1px 6px rgba(0,0,0,0.8); transition: background 0.2s;
}
.mg62-night-btn:hover { background: #102818; box-shadow: 0 0 10px rgba(60,200,120,0.25); }

/* ── Lightbox ────────────────────────────────────────────── */
.mg62-lb-backdrop {
    display: none; position: fixed; inset: 0;
    background: rgba(2,8,4,0.95); z-index: 9998;
    cursor: pointer; backdrop-filter: blur(6px);
}
.mg62-lightbox {
    display: none; position: fixed; top: 50%; left: 50%;
    transform: translate(-50%,-50%) scale(0.93);
    z-index: 9999; max-width: 90vw; text-align: center;
    opacity: 0; transition: opacity 0.25s, transform 0.25s;
}
.mg62-lightbox.open {
    display: block; opacity: 1; transform: translate(-50%,-50%) scale(1);
}
.mg62-lb-backdrop.open { display: block; }

.mg62-lb-paddle {
    display: inline-block;
    border: 5px solid #5a3a18;
    box-shadow:
        0 0 0 2px #3a2408,
        0 0 0 6px #6a4818,
        0 20px 60px rgba(0,0,0,0.95),
        inset 0 0 20px rgba(0,0,0,0.3);
    border-radius: 2px; overflow: hidden; position: relative;
}
.mg62-lb-paddle::before {
    content: '';
    position: absolute; inset: 0; z-index: 3;
    background: repeating-linear-gradient(88deg, transparent 0px, transparent 8px, rgba(0,0,0,0.05) 8px, rgba(0,0,0,0.05) 9px);
    pointer-events: none;
}
.mg62-lb-img {
    max-width: 100%; max-height: 72vh; object-fit: contain; display: block;
}
.mg62-lb-caption {
    color: #80c090; font-size: 13px; letter-spacing: 2px;
    text-transform: uppercase; margin-top: 14px;
}
.mg62-lb-link {
    display: inline-block; margin-top: 6px;
    color: #60a078; font-size: 12px; letter-spacing: 1.5px;
    text-decoration: none; border-bottom: 1px solid #2a5030;
    transition: color 0.2s;
}
.mg62-lb-link:hover { color: #a0ffc0; }
.mg62-lb-link[href='#'] { display: none; }
.mg62-lb-close {
    position: absolute; top: -14px; right: -14px;
    width: 30px; height: 30px;
    background: #2a4020; border: 2px solid #60a070; color: #80c090;
    border-radius: 50%; cursor: pointer; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    z-index: 10000; transition: background 0.2s;
}
.mg62-lb-close:hover { background: #1a4030; }

/* ── Night overrides ─────────────────────────────────────── */
.mg62-wrap.night .mg62-hud-label  { color: #3a7050; }
.mg62-wrap.night .mg62-hud-fill   { box-shadow: 0 0 10px rgba(40,180,100,0.8); }
.mg62-wrap.night .mg62-paddle-board {
    box-shadow: 0 0 0 3px #1a2408, 0 0 0 5px #2a4018, 0 4px 18px rgba(0,0,0,0.95), inset 0 0 12px rgba(0,0,0,0.6);
}

/* ── Responsive ──────────────────────────────────────────── */
@media(max-width:768px){
    .mg62-wrap { height:500px; }
    .mg62-hud-bar { width:72px; }
    .mg62-sluice-track { height:110px; }
}
@media(max-width:480px){
    .mg62-wrap { height:400px; }
    .mg62-sluice-ctrl { left:8px; }
}
