/* --- มินิเกมตกปลา --- */
.fishing-minigame-root {
    position: fixed;
    inset: 0;
    z-index: 9600;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 12px 12px calc(var(--controls-h) + var(--safe-bottom) + 18px);
    pointer-events: none;
}

.fishing-minigame-root.open {
    display: flex;
    pointer-events: none;
}

.fishing-minigame-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

.fishing-minigame-panel {
    position: relative;
    z-index: 1;
    width: min(100%, 420px);
    padding: 14px 14px 16px;
    background: linear-gradient(165deg, #3a2c22 0%, #1a1410 55%, #120e0a 100%);
    border: 3px solid var(--px-border, #4a3424);
    box-shadow:
        inset 0 1px 0 var(--px-border-light, #8d6e63),
        0 6px 0 var(--px-shadow-deep, #080604),
        0 0 28px rgba(0, 0, 0, 0.5);
    text-align: center;
    /* ไม่รับทัช — กดยืนยันผ่านปุ่มโจมตี / Space เท่านั้น */
    pointer-events: none;
}

.fishing-minigame-title {
    margin: 0 0 6px;
    font-size: var(--text-lg);
    font-weight: bold;
    color: var(--px-gold, #ffd54f);
    text-shadow: 1px 1px 0 #000;
}

.fishing-minigame-hint {
    margin: 0 0 12px;
    font-size: var(--text-sm);
    color: #bcaaa4;
    line-height: 1.4;
}

.fishing-minigame-track {
    position: relative;
    height: 28px;
    border-radius: 3px;
    border: 2px solid #5d4037;
    background:
        repeating-linear-gradient(
            90deg,
            #2a2118 0,
            #2a2118 calc(5% - 1px),
            #1a1410 calc(5% - 1px),
            #1a1410 5%
        );
    box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.fishing-minigame-zones {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.fishing-minigame-zone-band {
    position: absolute;
    top: 1px;
    bottom: 1px;
    border-radius: 2px;
    opacity: 0.92;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        inset 0 -1px 0 rgba(0, 0, 0, 0.18);
    filter: saturate(1.05);
}

.fishing-minigame-zone-band.resolved {
    opacity: 0.4;
    filter: saturate(0.7);
}

.fishing-minigame-zone-band.resolved.struck {
    opacity: 0.95;
    filter: saturate(1.1) brightness(1.05);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 0 10px rgba(255, 236, 179, 0.28);
}

.fishing-minigame-cursor {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 0;
    transform: translateX(-50%);
    z-index: 2;
    pointer-events: none;
}

.fishing-minigame-cursor::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    transform: translateX(-50%);
    background: #fff8e1;
    box-shadow: 0 0 0 1px #5d4037, 0 0 8px rgba(255, 236, 179, 0.8);
}

.fishing-minigame-cursor::after {
    content: '';
    position: absolute;
    left: 50%;
    top: -2px;
    width: 0;
    height: 0;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #ffd54f;
    filter: drop-shadow(0 1px 0 #000);
}

.fishing-minigame-cursor.hit.tier-green::before {
    background: #a5d6a7;
    box-shadow: 0 0 0 1px #1b5e20, 0 0 10px rgba(129, 199, 132, 0.9);
}

.fishing-minigame-cursor.hit.tier-yellow::before {
    background: #fff59d;
    box-shadow: 0 0 0 1px #f57f17, 0 0 10px rgba(255, 238, 88, 0.85);
}

.fishing-minigame-cursor.hit.tier-orange::before {
    background: #ffcc80;
    box-shadow: 0 0 0 1px #e65100, 0 0 10px rgba(255, 183, 77, 0.85);
}

.fishing-minigame-cursor.miss::before {
    background: #ef9a9a;
    box-shadow: 0 0 0 1px #b71c1c, 0 0 10px rgba(239, 154, 154, 0.8);
}

/* มือถือ/ตอนตกปลา: ปุ่มโจมตีอยู่เหนือเกจตกปลา กดได้ */
html.is-fishing #controls-layer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9700;
}

html.is-fishing #btn-attack {
    position: relative;
    z-index: 1;
    box-shadow:
        0 0 0 2px rgba(255, 213, 79, 0.45),
        0 4px 16px rgba(0, 0, 0, 0.45);
}
