﻿/* CONTAINER TỔNG THỂ - KHÓA TỶ LỆ DẠNG MOBILE DỌC */
.brofish-container {
    position: relative;
    width: 100vw;
    width: 100dvw;
    max-width: 450px;
    height: 100vh;
    height: 100dvh;
    margin: 0 auto;
    background: #020617 url('/images/games/brofish/bg.png') center center / cover no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    overflow: hidden;
    user-select: none;
    touch-action: manipulation;
    font-family: 'DePixel Breit', 'Segoe UI', Tahoma, sans-serif;
    color: #ffffff;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.8);
}

/* 1. TOP HEADER HUD */
.brofish-top-header {
    position: absolute;
    top: 10px;
    left: 0;
    right: 0;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    z-index: 20;
    pointer-events: none;
}

    .brofish-top-header > * {
        pointer-events: auto;
    }

/* NÚT VUÔNG TRÊN HEADER (MENU, SOUND, HISTORY, HOWTOPLAY) */
.brofish-header-btn {
    width: 36px;
    height: 36px;
    background: rgba(10, 20, 38, 0.85);
    border: 1.5px solid #00f0ff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), inset 0 0 6px rgba(0, 240, 255, 0.2);
    transition: transform 0.1s ease, filter 0.1s ease;
    flex-shrink: 0;
}

    .brofish-header-btn:active {
        transform: scale(0.92);
        filter: brightness(1.2);
    }

.brofish-header-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* KHUNG HIỂN THỊ SỐ DƯ Ở GIỮA (THANHTIEN.PNG) */
.brofish-balance-pill {
    flex: 1;
    max-width: 180px;
    height: 36px;
    background: url('/images/games/brofish/thanhtien.png') center center / 100% 100% no-repeat;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px 0 8px;
    box-sizing: border-box;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}

.brofish-coin-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.brofish-balance-val {
    color: #facc15;
    font-family: 'DePixel Breit', monospace, sans-serif;
    font-size: 13px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000000, -1px -1px 2px #000000;
    letter-spacing: 0.5px;
}

/* 2. KHU VỰC BÀN GAME CANVAS */
.brofish-canvas-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.brofish-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

/* 3. BOTTOM CONTROLS OVERLAY */
.brofish-bottom-controls {
    position: absolute;
    bottom: max(10px, env(safe-area-inset-bottom, 10px));
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    z-index: 25;
    pointer-events: none;
}

.brofish-control-btn {
    pointer-events: auto;
    background: transparent;
    border: none;
    outline: none;
    padding: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.1s ease;
}

    .brofish-control-btn:active {
        transform: scale(0.92);
    }

.brofish-btn-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.7));
    transition: filter 0.15s ease, transform 0.15s ease;
}

/* HIỆU ỨNG KHI KÍCH HOẠT (ACTIVE TOGGLE) */
.brofish-control-btn.active-auto .brofish-btn-img,
.brofish-control-btn.active-lock .brofish-btn-img {
    filter: drop-shadow(0 0 10px #00f0ff) brightness(1.25);
    transform: scale(1.08);
}

/* ================= 4. POPUP LỊCH SỬ CƯỢC & HƯỚNG DẪN CHƠI (CLONE TỪ BRODICE) ================= */
.brofish-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    backdrop-filter: blur(3px);
}

.brofish-history-modal-card {
    position: relative;
    width: 92%;
    max-width: 380px;
    height: 80vh;
    max-height: 560px;
    background: transparent url('/images/games/brodice/khung_popup.png') center center / 100% 100% no-repeat;
    display: flex;
    flex-direction: column;
    padding: 24px 18px 20px 18px;
    box-sizing: border-box;
    image-rendering: pixelated;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.95);
    animation: brofishModalPop 0.25s ease-out;
}

@keyframes brofishModalPop {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.brofish-history-modal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    margin-bottom: 14px;
    padding-top: 4px;
}

.brofish-history-title-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.brofish-title-star-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.brofish-title-history-img {
    height: 22px;
    width: auto;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.brofish-title-howtoplay-img {
    height: 22px;
    width: auto;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.brofish-history-close-btn {
    position: absolute;
    top: 0;
    right: 4px;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

    .brofish-history-close-btn:hover {
        filter: brightness(1.25);
    }

    .brofish-history-close-btn:active {
        transform: scale(0.9);
    }

.brofish-close-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    image-rendering: pixelated;
}

/* POPUP HƯỚNG DẪN CHƠI CONTENT */
.brofish-howtoplay-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow-y: auto;
    padding: 10px 8px;
    box-sizing: border-box;
}

.brofish-howtoplay-text {
    font-family: 'DePixel Breit', monospace, sans-serif;
    font-size: 12px;
    line-height: 1.6;
    color: #e2e8f0;
    text-shadow: 1px 1px 2px #000;
    margin: 0;
    text-align: justify;
}

/* POPUP LỊCH SỬ CONTENT */
.brofish-history-table-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
    margin-top: 2px;
}

.brofish-history-table-header {
    display: grid;
    grid-template-columns: 1.1fr 1.5fr 1.2fr 1.3fr;
    align-items: center;
    text-align: center;
    font-family: 'DePixel Breit', monospace, sans-serif;
    font-size: 10px;
    color: #88a2d4;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    font-weight: bold;
}

.brofish-history-table-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

    .brofish-history-table-body::-webkit-scrollbar,
    .brofish-howtoplay-content-wrapper::-webkit-scrollbar {
        width: 4px;
    }

    .brofish-history-table-body::-webkit-scrollbar-thumb,
    .brofish-howtoplay-content-wrapper::-webkit-scrollbar-thumb {
        background: rgba(56, 189, 248, 0.5);
        border-radius: 4px;
    }

.brofish-history-row {
    display: grid;
    grid-template-columns: 1.1fr 1.5fr 1.2fr 1.3fr;
    align-items: center;
    text-align: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-family: 'DePixel Breit', monospace, sans-serif;
    font-size: 11px;
}

.col-phien {
    color: #ffffff;
    font-weight: bold;
    word-break: break-all;
}

.col-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.col-bet {
    color: #00f0ff;
    font-weight: bold;
}

.col-win {
    color: #ffe600;
    font-weight: bold;
}

/* ================= CSS CHUẨN NỘI DUNG HƯỚNG DẪN CHƠI BROFISH ================= */
.brofish-howtoplay-content-wrapper {
    font-family: 'DePixel Breit', monospace, sans-serif;
    color: #e2e8f0;
    font-size: 10px; /* Font chữ cơ bản nhỏ gọn chuẩn màn hình pixel */
    line-height: 1.5;
    text-shadow: 1px 1px 2px #000000;
}

    /* Tiêu đề chính h2 */
    .brofish-howtoplay-content-wrapper h2 {
        font-size: 12px;
        color: #facc15; /* Màu vàng rực rỡ nổi bật */
        margin: 12px 0 6px 0;
        font-weight: bold;
        line-height: 1.4;
        border-bottom: 1px dashed rgba(250, 204, 21, 0.3);
        padding-bottom: 4px;
    }

        .brofish-howtoplay-content-wrapper h2:first-child {
            margin-top: 0;
        }

    /* Tiêu đề phụ h3 */
    .brofish-howtoplay-content-wrapper h3 {
        font-size: 11px;
        color: #38bdf8; /* Màu xanh cyan sáng */
        margin: 10px 0 4px 0;
        font-weight: bold;
    }

    /* Đoạn văn bản p */
    .brofish-howtoplay-content-wrapper p {
        font-size: 10px;
        margin: 4px 0;
        color: #cbd5e1;
    }

    /* Thẻ in đậm strong và in nghiêng em */
    .brofish-howtoplay-content-wrapper strong {
        color: #ffffff;
        font-weight: bold;
    }

    .brofish-howtoplay-content-wrapper em {
        color: #94a3b8;
        font-style: italic;
    }

    /* Danh sách <ul> và <ol> */
    .brofish-howtoplay-content-wrapper ul,
    .brofish-howtoplay-content-wrapper ol {
        margin: 4px 0 8px 0;
        padding-left: 16px;
    }

    .brofish-howtoplay-content-wrapper li {
        margin-bottom: 4px;
        font-size: 9.5px;
    }

    /* Khung ghi chú blockquote */
    .brofish-howtoplay-content-wrapper blockquote {
        background: rgba(15, 23, 42, 0.7);
        border-left: 3px solid #facc15;
        margin: 8px 0;
        padding: 6px 8px;
        border-radius: 0 6px 6px 0;
        font-size: 9.5px;
        color: #fef08a;
    }

        .brofish-howtoplay-content-wrapper blockquote p {
            margin: 0;
            font-size: 9.5px;
            color: #fef08a;
        }

    /* Đường gạch ngang hr */
    .brofish-howtoplay-content-wrapper hr {
        border: none;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        margin: 10px 0;
    }