/*
 * HOME image UI skin
 * Rollback: remove this stylesheet and js/home-image-ui.js from index.html.
 * The legacy style.css and engine.js are intentionally untouched.
 */

:root {
    --home-image-ui-cyan: #d9f7ff;
    --home-image-ui-blue: #8edcff;
    --home-image-ui-pink: #ffbfeb;
}

/* --------------------------------------------------------------------------
   HOME status interface
   -------------------------------------------------------------------------- */

#game-container:not(.exploration-mode) #hud-layer {
    top: 18px !important;
    left: 18px !important;
    width: 1110px !important;
    max-width: 1110px !important;
    pointer-events: none;
}

#game-container:not(.exploration-mode) .eve-hud-panel {
    position: relative;
    display: block;
    overflow: visible;
    width: 1110px !important;
    min-width: 1110px !important;
    max-width: 1110px !important;
    height: 168px;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: url("assets/ui/home_v2/interface.png") center / 100% 100% no-repeat;
    box-shadow: none;
    color: #f4fbff;
    pointer-events: auto;
}

#game-container:not(.exploration-mode) .eve-hud-primary,
#game-container:not(.exploration-mode) .eve-hud-secondary {
    position: static;
    display: block;
    min-height: 0;
    border: 0;
    background: none;
}

#game-container:not(.exploration-mode) .eve-hud-item,
#game-container:not(.exploration-mode) .eve-hud-secondary-item {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 0;
    min-height: 0;
    height: 43px;
    padding: 0 5px;
    overflow: visible;
    border: 0;
    color: var(--home-image-ui-cyan);
    font-size: 14px;
    font-weight: 900;
    line-height: 1.18;
    text-align: center;
    text-overflow: clip;
    text-shadow: 0 1px 5px rgba(0, 18, 32, 0.95), 0 0 8px rgba(92, 211, 255, 0.25);
    white-space: normal;
}

#game-container:not(.exploration-mode) #hud-day-time {
    top: 25px;
    left: 165px;
    width: 125px;
    height: 47px;
    font-size: 16px;
    justify-content: flex-start;
}

#game-container:not(.exploration-mode) #hud-master-hp {
    top: 20px;
    left: 300px;
    width: 262px;
    height: 54px;
    padding-bottom: 18px;
    color: #f3fbff;
}

#game-container:not(.exploration-mode) #hud-eve-hp {
    top: 20px;
    left: 658px;
    width: 258px;
    height: 54px;
    padding-bottom: 18px;
    color: #f3fbff;
}

#game-container:not(.exploration-mode) #hud-master-hp::before,
#game-container:not(.exploration-mode) #hud-eve-hp::before,
#game-container:not(.exploration-mode) #hud-master-hp::after,
#game-container:not(.exploration-mode) #hud-eve-hp::after {
    content: "";
    position: absolute;
    right: 12px;
    bottom: 7px;
    left: 12px;
    height: 8px;
    border-radius: 99px;
}

#game-container:not(.exploration-mode) #hud-master-hp::before,
#game-container:not(.exploration-mode) #hud-eve-hp::before {
    background: rgba(6, 30, 48, 0.84);
    box-shadow: inset 0 0 0 1px rgba(176, 232, 255, 0.2);
}

#game-container:not(.exploration-mode) #hud-master-hp::after,
#game-container:not(.exploration-mode) #hud-eve-hp::after {
    right: auto;
    width: var(--home-image-ui-fill, 100%);
    max-width: calc(100% - 24px);
    background: linear-gradient(90deg, #a9dcff, #6ff8fb);
    box-shadow: 0 0 9px rgba(92, 238, 255, 0.7);
    transition: width 0.25s ease;
}

#game-container:not(.exploration-mode) #hud-food { top: 101px; left: 60px; width: 120px; }
#game-container:not(.exploration-mode) #hud-parts { top: 101px; left: 198px; width: 120px; }
#game-container:not(.exploration-mode) #hud-medicine { top: 101px; left: 337px; width: 118px; font-size: 14px; }
#game-container:not(.exploration-mode) #hud-eve-attack { top: 101px; left: 477px; width: 112px; }
#game-container:not(.exploration-mode) #hud-eve-defense { top: 101px; left: 604px; width: 108px; }
#game-container:not(.exploration-mode) #hud-affection { top: 101px; left: 734px; width: 126px; color: #ffd0eb; }
#game-container:not(.exploration-mode) #hud-link { top: 101px; left: 887px; width: 162px; }

#game-container:not(.exploration-mode) .eve-hud-status-effects {
    position: absolute;
    top: 154px;
    left: 20px;
}

/* --------------------------------------------------------------------------
   Icon-only system menu. Labels are supplied by home-image-ui.js on hover.
   -------------------------------------------------------------------------- */

#game-container:not(.exploration-mode) #system-menu,
#game-container:not(.exploration-mode) #system-menu.is-collapsed {
    top: 15px !important;
    right: 18px !important;
    display: flex;
    box-sizing: border-box;
    width: 650px;
    height: 89px;
    padding: 12px 18px 15px;
    overflow: visible;
    gap: 0;
    border: 0;
    border-radius: 0;
    background: url("assets/ui/home_v2/menubar.png") center / 100% 100% no-repeat;
    box-shadow: none;
}

#game-container:not(.exploration-mode) #system-menu-toggle {
    display: none !important;
}

#game-container:not(.exploration-mode) #system-menu > button:not(#system-menu-toggle),
#game-container:not(.exploration-mode) #system-menu.is-collapsed > button:not(#system-menu-toggle) {
    position: relative;
    display: block;
    box-sizing: border-box;
    width: auto;
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    min-height: 62px;
    padding: 0 !important;
    overflow: visible;
    border: 0;
    border-radius: 9px;
    color: transparent;
    background: transparent;
    font-size: 0 !important;
    opacity: 1;
    pointer-events: auto;
    transition: background 0.16s ease, filter 0.16s ease;
}

#game-container:not(.exploration-mode) #system-menu > button:not(#system-menu-toggle)::before {
    content: none;
}

#game-container:not(.exploration-mode) #system-menu > button:not(#system-menu-toggle)::after {
    content: attr(data-home-image-label);
    position: absolute;
    top: 62px;
    left: 50%;
    z-index: 3;
    width: max-content;
    max-width: 150px;
    padding: 7px 12px;
    border: 1px solid rgba(135, 221, 255, 0.62);
    border-radius: 7px;
    color: #f5fcff;
    background: rgba(7, 26, 43, 0.96);
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.34), 0 0 12px rgba(65, 205, 255, 0.16);
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    opacity: 0;
    transform: translate(-50%, -5px);
    visibility: hidden;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
}

#game-container:not(.exploration-mode) #system-menu > button:not(#system-menu-toggle):hover,
#game-container:not(.exploration-mode) #system-menu > button:not(#system-menu-toggle):focus-visible {
    background: rgba(114, 218, 255, 0.12);
    filter: drop-shadow(0 0 7px rgba(116, 226, 255, 0.55));
}

#game-container:not(.exploration-mode) #system-menu > button:not(#system-menu-toggle):hover::after,
#game-container:not(.exploration-mode) #system-menu > button:not(#system-menu-toggle):focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
    visibility: visible;
}

/* --------------------------------------------------------------------------
   Location plate
   -------------------------------------------------------------------------- */

#game-container:not(.exploration-mode) #home-location-label {
    top: 172px;
    left: 20px;
    box-sizing: border-box;
    width: 290px;
    height: 87px;
    padding: 27px 22px 20px 100px;
    border: 0;
    border-radius: 0;
    color: #e8f9ff;
    background: url("assets/ui/home_v2/location.png") center / 100% 100% no-repeat;
    box-shadow: none;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.15;
    text-align: left;
    text-shadow: 0 1px 5px rgba(0, 15, 29, 0.95), 0 0 8px rgba(103, 213, 255, 0.35);
}

/* --------------------------------------------------------------------------
   HOME action panel: top + one middle slice per button + bottom.
   -------------------------------------------------------------------------- */

#choice-container.eve-home-actions {
    top: 195px !important;
    right: 36px !important;
    bottom: auto !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box;
    width: 390px !important;
    padding: 28px 34px 35px !important;
    gap: 7px !important;
    isolation: isolate;
    overflow: visible;
}

#choice-container.eve-home-actions > :not(.home-image-ui-panel-bg) {
    position: relative;
    z-index: 2;
}

.home-image-ui-panel-bg {
    position: absolute;
    top: -17px;
    right: -18px;
    left: -18px;
    z-index: 0;
    display: flex;
    flex-direction: column;
    min-height: calc(145px + (var(--home-image-ui-middle-count, 1) * 70px));
    pointer-events: none;
}

.home-image-ui-panel-piece {
    display: block;
    flex: 0 0 auto;
    width: 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

.home-image-ui-panel-piece.is-top {
    height: 86px;
    background-image: url("assets/ui/home_v2/panel_top.png");
}

.home-image-ui-panel-piece.is-middle {
    height: 70px;
    margin-top: -2px;
    background-image: url("assets/ui/home_v2/panel_middle.png");
}

.home-image-ui-panel-piece.is-bottom {
    height: 62px;
    margin-top: -2px;
    background-image: url("assets/ui/home_v2/panel_bottom.png");
}

#choice-container.eve-home-actions .eve-home-structure-note,
#choice-container.eve-home-actions .eve-home-submenu-header {
    box-sizing: border-box;
    min-height: 54px;
    margin: 0 4px 4px;
    padding: 8px 14px 8px 92px;
    border: 0;
    border-radius: 0;
    color: #f3fbff;
    background: transparent;
    box-shadow: none;
    font-size: 16px;
    text-shadow: 0 1px 5px rgba(0, 15, 29, 0.95);
}

#choice-container.eve-home-actions .eve-home-submenu-header strong {
    font-size: 16px;
}

#choice-container.eve-home-actions .eve-home-submenu-header small {
    font-size: 10px;
}

#choice-container.eve-home-actions .scenario-choice-btn {
    box-sizing: border-box;
    width: 100% !important;
    min-height: 67px !important;
    padding: 10px 58px 10px 66px !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: #eaf9ff !important;
    background-color: transparent !important;
    background-image: url("assets/ui/home_v2/action_select.png") !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-size: 100% 100% !important;
    box-shadow: none !important;
    font-size: 17px !important;
    font-weight: 900;
    line-height: 1.15;
    text-align: center;
    text-shadow: 0 1px 5px rgba(0, 17, 32, 0.95);
    transition: filter 0.16s ease, transform 0.16s ease !important;
}

#choice-container.eve-home-actions .scenario-choice-btn:hover:not(:disabled),
#choice-container.eve-home-actions .scenario-choice-btn:focus-visible:not(:disabled) {
    filter: brightness(1.16) drop-shadow(0 0 8px rgba(74, 211, 255, 0.58));
    transform: translateX(-4px) !important;
}

#choice-container.eve-home-actions .scenario-choice-btn:disabled {
    filter: grayscale(0.65) brightness(0.68);
    opacity: 0.7;
}

#choice-container.eve-home-actions .scenario-choice-btn small {
    color: #b7d5e3;
    font-size: 10px;
    text-shadow: 0 1px 4px rgba(0, 15, 29, 0.95);
}

#choice-container.eve-home-actions .scenario-choice-btn.home-image-ui-affinity {
    color: #fff0fb !important;
    background-image: url("assets/ui/home_v2/action_affinity.png") !important;
}

#choice-container.eve-home-actions .scenario-choice-btn.eve-home-move-btn {
    background-image: url("assets/ui/home_v2/action_move.png") !important;
}

#choice-container.eve-home-actions .scenario-choice-btn.eve-home-explore-fixed {
    position: fixed !important;
    right: 38px !important;
    bottom: 40px !important;
    z-index: 24;
    width: 385px !important;
    min-height: 91px !important;
    padding-right: 72px !important;
    padding-left: 86px !important;
    background-image: url("assets/ui/home_v2/action_explore.png") !important;
    font-size: 24px !important;
}

#choice-container.eve-home-actions .eve-home-back-btn {
    opacity: 0.92;
}

/* HOME action dialogue and CG modes keep the engine's original visibility rules. */
#choice-container.eve-home-dialogue-running {
    display: none !important;
}
