@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap");

/* ==========================================================================
   MINES GAME - MAIN STYLING (mines.css)
   ========================================================================== */

   .mines-page-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    max-width: 1100px;
    margin: 0 auto;
}

/* Side-by-Side Layout Container */
.game-main-container {
    display: flex;
    flex-direction: row;
    gap: 0; /* Flush alignment */
    background: #1a2c38;
    border-radius: 8px;
    overflow: hidden;
    min-height: 550px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Ribbon between game panel and history table */
.game-toolbar {
    min-height: 62px;
    background: linear-gradient(180deg, #233b48 0%, #203642 100%);
    border: 1px solid #2f4d5c;
    border-radius: 8px;
    padding: 8px 14px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 18px rgba(0, 0, 0, 0.22);
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar-right {
    justify-content: flex-end;
}

.toolbar-center {
    justify-self: center;
}

.toolbar-icon-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #3a5f71;
    border-radius: 8px;
    background: rgba(16, 33, 44, 0.45);
    color: #b3cfdf;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}

.toolbar-icon-btn:hover {
    background: #2d4a59;
    border-color: #527889;
    color: #e6f1f7;
}

.toolbar-icon-btn:active {
    transform: translateY(1px);
}

.toolbar-brand {
    color: #f2f8fc;
    font-size: 46px;
    line-height: 1;
    font-family: "Brush Script MT", "Segoe Script", "Lucida Handwriting", cursive;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}

.fairness-btn {
    border: 1px solid #4f7586;
    border-radius: 12px;
    background: linear-gradient(180deg, #44697a 0%, #3a5f70 100%);
    color: #eff8ff;
    font-weight: 700;
    font-size: 27px;
    line-height: 1;
    padding: 8px 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition: filter 0.15s, border-color 0.15s, transform 0.1s;
}

.fairness-btn:hover {
    filter: brightness(1.08);
    border-color: #668d9e;
}

.fairness-btn:active {
    transform: translateY(1px);
}

/* ==========================================================================
   SIDEBAR CONTROLS (Left)
   ========================================================================== */
.mines-controls {
    width: 335px;
    background: #1d3442;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
    border-right: 2px solid #0f212e;
}

.control-mode-toggle {
    background: #0f2633;
    border: 1px solid #2f4a59;
    border-radius: 999px;
    padding: 4px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.auto-only {
    display: none;
}

.mines-controls.auto-mode .auto-only {
    display: block;
}

.mines-controls.auto-mode .manual-only {
    display: none;
}

.mode-btn {
    border: none;
    height: 40px;
    border-radius: 999px;
    background: transparent;
    color: #c6d8e3;
    font: 600 16px "Space Grotesk", sans-serif;
    font-weight: 600;
    cursor: pointer;
}

.mode-btn.active {
    background: #42657a;
    color: #f3f8fb;
}

.mode-btn[disabled] {
    opacity: 0.9;
    cursor: not-allowed;
}

.input-infinity {
    min-width: 24px;
    color: #c9dbe7;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.advanced-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.advanced-row label {
    margin-bottom: 0;
}

.mines-toggle-switch {
    width: 52px;
    height: 30px;
    border: 1px solid #4a6c7f;
    border-radius: 999px;
    background: #143041;
    position: relative;
    cursor: pointer;
}

.mines-toggle-switch .toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #d5e7f2;
    transition: transform 0.2s ease;
}

.mines-toggle-switch[aria-pressed="true"] {
    background: #2f90ec;
    border-color: #64aaef;
}

.mines-toggle-switch[aria-pressed="true"] .toggle-knob {
    transform: translateX(22px);
}

.control-group label {
    display: block;
    color: #b1bad3;
    font: 600 16px "Space Grotesk", sans-serif;
    margin-bottom: 6px;
    font-weight: 600;
}

.input-wrapper, .select-wrapper, .gain-input-mimic {
    background: #0f212e;
    border: 1px solid #476575;
    border-radius: 8px;
    display: flex;
    padding: 5px 9px;
    min-height: 48px;
    transition: border-color 0.2s, box-shadow 0.2s;
    align-items: center;
}

.input-wrapper:focus-within {
    border-color: #6f8fa1;
    box-shadow: 0 0 0 2px rgba(83, 129, 154, 0.25);
}

.input-wrapper input, .select-wrapper select, .gain-input-mimic input {
    background: transparent;
    border: none;
    color: #fff;
    padding: 8px 4px;
    width: 100%;
    outline: none;
    font-weight: 600;
    font: 600 18px "Space Grotesk", sans-serif;
    line-height: 1;
}

/* Remove default number spinners for a cleaner control look */
#betAmount {
    -moz-appearance: textfield;
    appearance: textfield;
}

#betAmount::-webkit-outer-spin-button,
#betAmount::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.amount-input-wrapper {
    align-items: stretch;
}

.input-currency {
    min-width: 28px;
    height: 28px;
    align-self: center;
    border-radius: 999px;
    background: #78e300;
    color: #0a190f;
    font-weight: 800;
    font: 800 16px "Space Grotesk", sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
}

.quick-btns {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid #4a6878;
}

.quick-btns button {
    min-width: 42px;
    height: 30px;
    padding: 0 10px;
    border: none;
    background: transparent;
    color: #cfe0ea;
    font: 700 15px "Space Grotesk", sans-serif;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s, background-color 0.15s, transform 0.1s;
    border-radius: 6px;
}

.quick-btns button:hover {
    color: #ffffff;
    background: rgba(64, 99, 117, 0.45);
}

.quick-btns button:active {
    transform: translateY(1px);
}

.select-wrapper select {
    appearance: none;
    font: 600 18px "Space Grotesk", sans-serif;
    padding-right: 28px;
}

.select-wrapper {
    position: relative;
}

.chevron {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #c6d8e3;
    font-size: 16px;
    pointer-events: none;
    font-style: normal;
}

/* Native dropdown list readability */
#mineCount option {
    color: #0f212e;
    background: #eef4f8;
}

.gem-input-mimic {
    background: rgba(34, 60, 76, 0.62);
}

#gemCount {
    color: #d7e5ee;
    font: 600 18px "Space Grotesk", sans-serif;
}

/* ==========================================================================
   GAME AREA (Right)
   ========================================================================== */
.mines-game-area {
    flex-grow: 1;
    background: #0f212e;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.mines-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 480px;
}

/* Tile Styling */
.tile {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #2f4553;
    border-radius: 6px;
    border-bottom: 4px solid #213743;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.1s, background-color 0.1s;
}

.tile:hover:not(.revealed):not(.mine) {
    background-color: #3c5565;
    transform: translateY(-2px);
}

.tile:active {
    transform: translateY(1px);
}

/* Tile States */
.tile.revealed {
    background-color: #1a2c38 !important;
    border-bottom-color: transparent;
    cursor: default;
}

.tile.mine {
    background-color: #ff4444 !important;
    border-bottom-color: transparent;
}

.tile.mine-revealed {
    background-color: #1a2c38 !important;
    border-bottom-color: transparent;
    opacity: 0.5;
}

.tile.auto-picked {
    background: linear-gradient(180deg, #b12cff 0%, #8e00ff 100%);
    border-bottom-color: #5f2a86;
    box-shadow: 0 0 0 1px rgba(203, 129, 255, 0.35), 0 0 16px rgba(150, 35, 255, 0.25);
}

/* ==========================================================================
   BUTTONS & UI ELEMENTS
   ========================================================================== */
.btn-play-primary {
    background: linear-gradient(180deg, #2f88e8 0%, #2373ca 100%);
    color: #f1f8ff;
    border: 1px solid #3f97f1;
    min-height: 50px;
    padding: 10px 16px;
    border-radius: 10px;
    font: 600 18px "Space Grotesk", sans-serif;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.16);
    margin-top: 2px;
    line-height: 1;
}

.btn-play-primary:hover { filter: brightness(1.06); }
.btn-play-primary:active { transform: translateY(1px); }
.btn-play-primary:disabled {
    background: #2b4f69;
    border-color: #3b627d;
    color: #8fb3c8;
    box-shadow: none;
    filter: none;
    cursor: not-allowed;
    opacity: 0.75;
}

.btn-play-primary.stop-autoplay {
    background: linear-gradient(180deg, #9a4b52 0%, #79383f 100%);
    border-color: #d16c72;
    color: #fff2f4;
}

.btn-secondary-placeholder {
    background: #2f4858;
    color: #9ec0d3;
    border: 1px solid #3a5e70;
    border-radius: 10px;
    min-height: 50px;
    padding: 10px 16px;
    font: 600 18px "Space Grotesk", sans-serif;
    line-height: 1;
    cursor: pointer;
    transition: filter 0.15s, transform 0.1s, background-color 0.15s, border-color 0.15s;
}

.btn-secondary-placeholder:hover:not(:disabled) {
    filter: brightness(1.08);
    background: #365568;
    border-color: #4d7386;
}

.btn-secondary-placeholder:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-secondary-placeholder:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-cashout {
    background: linear-gradient(180deg, #3ce27c 0%, #2fbf67 100%) !important;
    border-color: #56e08b !important;
    color: #082014 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 2px 0 rgba(15, 60, 35, 0.55) !important;
}

.net-gain-section {
    margin-top: 2px;
}

#multiplierLabel {
    font: 500 13px "Space Grotesk", sans-serif;
    color: #d5e7f2;
}

#netGainDisplay {
    color: #f3f9ff;
    font: 700 18px "Space Grotesk", sans-serif;
    line-height: 1;
}

.currency-tag-small {
    min-width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #78e300;
    color: #0a190f;
    font: 800 15px "Space Grotesk", sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
}

/* Hidden Utility */
.hidden { display: none !important; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
    .game-main-container {
        flex-direction: column;
    }
    .mines-controls {
        width: 100%;
        border-right: none;
        border-bottom: 2px solid #0f212e;
    }

    .game-toolbar {
        grid-template-columns: 1fr;
        gap: 8px;
        height: auto;
        padding: 10px;
    }

    .toolbar-left,
    .toolbar-center,
    .toolbar-right {
        justify-content: center;
    }

    .toolbar-brand {
        font-size: 34px;
    }

    .fairness-btn {
        font-size: 22px;
    }
}
