/* Hawaii2 — Graphical Island Board, Tabbed Village Mats & Right-Side Player Panel */

#content {
    background-color: #0c5286;
    background-image: url('../images/caribbean_bg.webp');
    background-repeat: no-repeat;
    background-position: left bottom;
    background-size: cover;
}

#gamePage #game,
#gamePage #board {
    background: transparent !important;
}

#Hawaii2 {
    --hw-sand: #f7eed7;
    --hw-sand-deep: #eadab6;
    --hw-wood: #593a22;
    --hw-wood-dark: #382210;
    --hw-ink: #1e252b;
    --hw-gold: #ffd24c;
    --hw-select: #00e5ff;
    position: relative;
    min-height: 100%;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px 10px;
    color: var(--hw-ink);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: transparent !important;
    overflow-x: hidden;
    container-type: inline-size;
}

#Hawaii2 *,
#Hawaii2 *::before,
#Hawaii2 *::after {
    box-sizing: border-box;
}

.hw-sea-bg {
    display: none;
}

#Hawaii2 .hw-tutorial-link {
    position: absolute;
    top: 8px;
    right: 12px;
    z-index: 25;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    box-sizing: border-box;
    height: clamp(40px, 5.2vw, 54px);
    aspect-ratio: 49 / 62;
    padding: 4px 3px;
    background: rgba(8, 38, 52, 0.82);
    border: 1px solid rgba(90, 195, 230, 0.55);
    border-radius: 7px;
    font-size: 9.5px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.1px;
    color: #e2f5fa;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 15, 28, 0.38);
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
    user-select: none;
    white-space: nowrap;
    pointer-events: auto;
}

#Hawaii2 .hw-tutorial-link:hover,
#Hawaii2 .hw-tutorial-link:focus-visible {
    background: rgba(14, 58, 80, 0.94);
    border-color: rgba(130, 220, 250, 0.85);
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 25, 42, 0.5);
    outline: 2px solid rgba(0, 229, 255, 0.55);
    outline-offset: 1px;
}

#Hawaii2 .hw-tutorial-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.hw-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ==========================================================================
   2-Column Main Layout: [Left: Villages with Player Info] [Right: Island Board]
   ========================================================================== */
.hw-main-layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(360px, var(--hw-villages-max, 560px)) minmax(460px, var(--hw-island-max, 840px));
    gap: 20px;
    align-items: start;
    justify-content: center;
    width: 100%;
    max-width: 1640px;
    margin: 0 auto;
}

.hw-col-villages {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    width: 100%;
}

.hw-col-island {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
    width: 100%;
}

/* ==========================================================================
   Center Column: Graphical Island Board (660 x 675 coordinate space)
   ========================================================================== */
.hw-island-board {
    position: relative;
    width: 100%;
    max-width: var(--hw-island-max, 840px);
    aspect-ratio: 660 / 675;
    user-select: none;
    background: transparent !important;
}

.hw-score-track {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 4;
}

.hw-score-marker {
    position: absolute;
    width: 11px;
    height: 11px;
    border-radius: 2px;
    transform: translate(-50%, -50%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6), inset 1px 1px 0 rgba(255, 255, 255, 0.45), inset -1px -1px 0 rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 0, 0, 0.45);
    pointer-events: auto;
    cursor: help;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, left 0.3s ease, top 0.3s ease;
}

.hw-score-marker.hw-score-marker-single {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.hw-score-marker.hw-score-marker-lapped {
    width: 16px;
    height: 14px;
    border-color: rgba(255, 240, 150, 0.9);
}

.hw-score-marker.hw-score-marker-single.hw-score-marker-lapped {
    width: 21px;
    height: 16px;
}

.hw-score-lap {
    font-size: 7.5px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.4px;
    color: #ffffff;
    text-shadow: 0 0 2px #000, 0 1px 2px #000, 1px 0 1px rgba(0, 0, 0, 0.9), -1px 0 1px rgba(0, 0, 0, 0.9);
    pointer-events: none;
    white-space: nowrap;
}

.hw-score-marker.hw-score-marker-single .hw-score-lap {
    font-size: 8.5px;
}

.hw-score-marker:hover {
    transform: translate(-50%, -50%) scale(1.4);
    z-index: 10;
}

.hw-board-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    object-fit: fill;
    background: transparent !important;
}

.hw-map,
.hw-beach,
.hw-start-order,
.hw-order,
.hw-round-area {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    pointer-events: none;
}

.hw-fishing {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    pointer-events: none;
    z-index: 8;
}

.hw-docks {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    pointer-events: none;
    z-index: 20;
}

/* 10 Island Locations (each 161 x 94 on the 660 x 675 board) */
.hw-place {
    position: absolute;
    pointer-events: auto;
    border-radius: 4px;
}

.hw-place-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
    border-radius: 3px;
}

.hw-prices,
.hw-chiefs,
.hw-stock {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hw-price-btn,
.hw-price-empty {
    position: absolute;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 0;
    line-height: 0;
    pointer-events: auto;
    cursor: default;
}

.hw-price-btn img,
.hw-price-empty img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
}

.hw-chief {
    background: radial-gradient(ellipse at center, rgba(255, 253, 245, 0.94) 0%, rgba(255, 253, 245, 0.74) 56%, rgba(255, 253, 245, 0) 84%);
    border-radius: 50%;
}

.hw-chiefs>.hw-chief {
    position: absolute;
    object-fit: contain;
    z-index: 4;
    pointer-events: none;
}

/* Tile stacks on Locations */
.hw-stock-tile {
    position: absolute;
    display: block;
    pointer-events: auto;
    cursor: pointer;
    border-radius: 4px;
}

.hw-stock-tile>.hw-tile-base {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
}

.hw-stock-tile>.hw-tile {
    position: absolute;
    left: 1%;
    top: 19%;
    width: 97%;
    height: 73%;
    object-fit: fill;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.hw-stock-tile>.hw-tile.hw-stacked {
    top: 2%;
}

/* Outrigger canoe (boat3) on location 6 */
.hw-stock-tile[data-tile="22"]>img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    box-shadow: none;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55));
}

/* Kahuna (loc 7) and Tiki (loc 8) token alcoves */
.hw-stock-tile.hw-token-pile>.hw-pile-back {
    position: absolute;
    left: 3%;
    top: 4%;
    width: 42%;
    height: 92%;
    object-fit: contain;
    box-shadow: none;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55));
}

.hw-stock-tile.hw-token-pile>.hw-pile-front {
    position: absolute;
    left: 52%;
    top: 4%;
    width: 42%;
    height: 92%;
    object-fit: contain;
    box-shadow: none;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55));
}

.hw-hidden-god>img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Remaining supply count & inspect button on tiles */
.hw-supply-badge {
    position: absolute;
    left: 2px;
    bottom: 1px;
    z-index: 3;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: rgba(18, 28, 38, 0.88);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    pointer-events: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.hw-supply-badge:empty {
    display: none;
}

.hw-inspect {
    position: absolute;
    right: 1px;
    top: 1px;
    z-index: 5;
    width: 15px;
    height: 15px;
    padding: 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.7) !important;
    border-radius: 50% !important;
    background: rgba(18, 35, 52, 0.78) !important;
    color: #fff !important;
    font-size: 10px !important;
    line-height: 13px !important;
    text-align: center;
    opacity: 0.72;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.hw-stock-tile:hover .hw-inspect,
.hw-village-piece:hover .hw-inspect,
.hw-inspect:focus-visible {
    opacity: 1;
    transform: scale(1.08);
}

/* Beach: Current Round Order (1..5), Next Round Order, Round Tile, Fishing, Docks */
.hw-start-spot {
    position: absolute;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hw-start-spot>img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.hw-order-slot {
    position: absolute;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 0;
    line-height: 0;
    pointer-events: auto;
    cursor: default;
}

.hw-order-slot>img {
    position: absolute;
    inset: 4% 4%;
    width: 92%;
    height: 92%;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.hw-order-slot>.hw-chief {
    position: absolute;
    left: 3%;
    top: -12%;
    width: 94%;
    height: 112%;
    object-fit: contain;
    z-index: 3;
}

.hw-round {
    position: absolute;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    pointer-events: auto;
    cursor: pointer;
    border-radius: 5px;
}

.hw-round>img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
}

.hw-round-inspect {
    position: absolute;
    right: auto;
    top: auto;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    font-size: 9.5px !important;
    line-height: 1 !important;
    opacity: 0.85;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45) !important;
}

.hw-round-inspect:hover,
.hw-round-inspect:focus-visible {
    opacity: 1;
    transform: scale(1.12);
}

.hw-fish-spot,
.hw-fish-token {
    position: absolute;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 0;
    line-height: 0;
    pointer-events: auto;
    cursor: default;
    border-radius: 50%;
    z-index: 6;
}

.hw-fish-token>img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

.hw-fishing>.hw-chief {
    position: absolute;
    object-fit: contain;
    z-index: 15;
    pointer-events: none;
}

.hw-dock {
    position: absolute;
    pointer-events: auto;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1px;
    overflow: visible;
    z-index: 10;
}

#Hawaii2 .hw-dock.hw-active {
    z-index: 11;
}

#Hawaii2 .hw-dock.hw-selected {
    z-index: 12;
}

#Hawaii2 .hw-dock:hover,
#Hawaii2 .hw-dock.hw-dock-hover,
#Hawaii2 .hw-dock:focus-within {
    z-index: 120 !important;
}

.hw-dock>.hw-chief {
    width: 46%;
    height: 92%;
    object-fit: contain;
    z-index: 3;
}

/* Rich Floating Hover Tooltip: feet & points only */
.hw-dock-tooltip {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    display: none;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: 6px;
    background: #181410;
    color: #fff;
    border: 1px solid rgba(255, 210, 76, 0.5);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    z-index: 150;
}

.hw-dock:hover .hw-dock-tooltip,
.hw-dock.hw-dock-hover .hw-dock-tooltip,
.hw-dock:focus-visible .hw-dock-tooltip {
    display: flex;
    transform: translateX(-50%) translateY(-6px);
}

.hw-dock[data-dock="3"] .hw-dock-tooltip {
    left: auto;
    right: 0;
    transform: translateY(4px);
}

.hw-dock[data-dock="3"]:hover .hw-dock-tooltip,
.hw-dock[data-dock="3"].hw-dock-hover .hw-dock-tooltip,
.hw-dock[data-dock="3"]:focus-visible .hw-dock-tooltip {
    transform: translateY(-6px);
}

.hw-dock-tooltip img {
    width: 14px;
    height: 14px;
    object-fit: contain;
    vertical-align: middle;
}

.hw-dock-tip-feet {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #ffe082;
    font-weight: 700;
}

.hw-dock-tip-pts {
    color: #ffab91;
    font-weight: 700;
}

.hw-dock-tip-sep {
    color: rgba(255, 255, 255, 0.4);
}

.hw-help-dock-cost {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    margin: 4px 0 8px;
}

.hw-help-dock-cost img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    vertical-align: middle;
}

.hw-dock-cost-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #593a22;
}

.hw-dock-cost-pts {
    color: #c43805;
    font-weight: 700;
}

.hw-dock-cost-sep {
    color: rgba(90, 64, 34, 0.4);
}

.hw-island-tile {
    position: absolute;
    pointer-events: auto;
    cursor: pointer;
    border-radius: 10px;
    transition: transform 0.14s ease;
}

.hw-island-tile:hover {
    transform: translateY(-2px);
}

.hw-island-tile>img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 3px 6px rgba(4, 28, 54, 0.55));
}

/* ==========================================================================
   Contextual Action Controls Bar (below Island Board)
   ========================================================================== */
.hw-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 820px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(10, 44, 78, 0.78);
    border: 1px solid rgba(145, 215, 255, 0.35);
    box-shadow: 0 4px 12px rgba(4, 22, 42, 0.35);
}

.hw-controls:empty {
    display: none;
}

.hw-controls .btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    font-size: 13px;
    font-weight: 600;
    color: #1c2833;
    background: linear-gradient(180deg, #fffdf7 0%, #f0e4c8 100%);
    border: 1px solid #c5a871;
    border-radius: 7px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.22);
    cursor: pointer;
}

.hw-controls .btn:hover {
    background: linear-gradient(180deg, #ffffff 0%, #f7ecd4 100%);
    border-color: #9e7d43;
}

.hw-opt-tile {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.hw-opt-tile .hw-tile {
    height: 36px;
    width: auto;
    border-radius: 3px;
}

/* Tile Purchase Modal Window (Bootstrap Modal) */
.hw-tile-modal .modal-dialog {
    max-width: min(94vw, max(260px, calc(var(--hw-tile-cols, 4) * 112px + 24px)));
}

.hw-tile-modal .modal-dialog.hw-tile-dialog-compact {
    max-width: min(92vw, 270px);
}

.hw-tile-dialog-body {
    padding: 8px;
}

.hw-tile-grid {
    display: grid;
    grid-template-columns: repeat(var(--hw-tile-cols, 4), minmax(0, 1fr));
    gap: 6px;
}

@media (max-width: 520px) {
    .hw-tile-grid {
        grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
    }
}

.hw-tile-dialog-compact .hw-tile-grid {
    grid-template-columns: 1fr 1fr;
}

.hw-tile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 6px 6px;
    background: #ffffff;
    border: 1.5px solid #d4c4a8;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}

.hw-tile-card.hw-tile-card-enabled {
    cursor: pointer;
}

.hw-tile-card.hw-tile-card-enabled:hover {
    transform: translateY(-2px);
    border-color: #0f6c85;
    box-shadow: 0 5px 14px rgba(15, 108, 133, 0.25);
    background: #f4fafb;
}

.hw-tile-card.hw-tile-card-enabled:active {
    transform: translateY(0);
}

.hw-tile-card.hw-tile-card-disabled {
    opacity: 0.42;
    filter: grayscale(85%);
    cursor: default;
    background: #f0ede8;
    border-color: #ccc4b4;
}

.hw-tile-card-art {
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    width: 100%;
    position: relative;
}

.hw-tile-card-art .hw-tile {
    height: 48px;
    width: auto;
    max-width: 90%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.15s ease;
}

/* 2 overlapping tiles for Option 2 (Kahuna / Tiki) */
.hw-tile-card-art.hw-tile-count-2 {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hw-tile-card-art.hw-tile-count-2 .hw-tile:first-child {
    transform: translateX(10px);
    z-index: 1;
}

.hw-tile-card-art.hw-tile-count-2 .hw-tile.hw-tile-second {
    transform: translateX(-10px);
    z-index: 2;
    filter: drop-shadow(-2px 2px 4px rgba(0, 0, 0, 0.4));
}

.hw-tile-card-name {
    font-size: 12px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 4px;
    line-height: 1.2;
}

.hw-tile-card-price {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    margin-top: auto;
}

.hw-tile-card-price .hw-res-pill {
    padding: 1px 7px;
    border-radius: 12px;
    background: #f8f1e5;
    border: 1px solid #d9c5a5;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #3b2a1a;
}

.hw-tile-card-price .hw-res-pill img {
    height: 14px;
    width: auto;
}

.hw-tile-disabled-reason {
    font-size: 10px;
    font-weight: 600;
    color: #c0392b;
    margin-top: 2px;
    display: block;
}

.hw-opt-fleet {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.hw-opt-fleet img {
    height: 24px;
    width: auto;
    object-fit: contain;
}

.hw-opt-pay {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.hw-resources {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.hw-res-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(90, 64, 34, 0.25);
    font-size: 12px;
}

.hw-res-pill img {
    width: 15px;
    height: 15px;
    object-fit: contain;
}

/* ==========================================================================
   Left Column: Graphical Village Mats (Own Village + Opponent Tabs)
   ========================================================================== */
.hw-village-card {
    background: linear-gradient(180deg, rgba(16, 72, 124, 0.86) 0%, rgba(11, 52, 92, 0.92) 100%);
    border: 1px solid rgba(150, 218, 255, 0.35);
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(4, 24, 46, 0.38);
    overflow: hidden;
}

.hw-own-village-card {
    border-top: 3px solid var(--hw-player, #2879b7);
}

/* ==========================================================================
   Left Column: Graphical Village Mats (Integrated Player Info Headers)
   ========================================================================== */
.hw-village-card {
    background: linear-gradient(180deg, rgba(16, 72, 124, 0.86) 0%, rgba(11, 52, 92, 0.92) 100%);
    border: 1px solid rgba(150, 218, 255, 0.35);
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(4, 24, 46, 0.38);
    overflow: hidden;
}

.hw-own-village-card {
    border-top: 3px solid var(--hw-player, #2879b7);
}

.hw-village-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 8px;
    background: linear-gradient(90deg, rgba(248, 238, 212, 0.97) 0%, rgba(235, 219, 182, 0.97) 100%);
    border-bottom: 1px solid rgba(92, 62, 30, 0.28);
    border-left: 5px solid var(--hw-player, #2879b7);
    color: #24190e;
    box-sizing: border-box;
}

.hw-vh-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.hw-player-id {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    overflow: hidden;
}

.hw-player-meeple {
    width: 19px;
    height: 26px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.hw-player-name {
    font-size: 14.5px;
    font-weight: 700;
    color: #23180d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hw-score-pill {
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid #b8985b;
    background: linear-gradient(180deg, #fffdf8 0%, #e7d4a7 100%);
    color: #2b1d0e;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.hw-score-pill:hover {
    background: linear-gradient(180deg, #ffffff 0%, #f1e2bd 100%);
}

.hw-vh-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: wrap;
}

/* Resources & Round Price Target Row */
.hw-player-stats {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 2px;
    border-radius: 6px;
    background: rgba(92, 62, 30, 0.08);
    border: 1px solid rgba(92, 62, 30, 0.14);
}

.hw-stat-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 3px 7px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(110, 80, 42, 0.22);
    font-size: 14.5px;
    line-height: 1;
    color: #22170b;
    min-width: 0;
}

.hw-stat-chip img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.hw-stat-chip b {
    font-size: 14.5px;
    font-weight: 700;
}

.hw-chip-price {
    background: rgba(255, 245, 225, 0.92);
    border-color: rgba(168, 92, 42, 0.32);
    white-space: nowrap;
}

.hw-chip-price.hw-price-qualified {
    background: rgba(220, 248, 225, 0.95);
    border-color: rgba(46, 142, 68, 0.55);
    color: #164f24;
}

.hw-surfer-plus {
    font-size: 11px;
    font-weight: 700;
    color: #1b6ca8;
    margin-left: 1px;
}

.hw-price-target {
    font-size: 11.5px;
    color: #6a563d;
    margin-left: 1px;
}

.hw-boats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;
}

.hw-boats img {
    height: 32px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.hw-boats img.hw-used {
    opacity: 0.55;
    filter: grayscale(40%) drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
}

.hw-own-village-card .hw-vh-bottom {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
}

.hw-own-village-card .hw-player-stats {
    gap: 5px;
    padding: 1px 3px;
}

.hw-own-village-card .hw-stat-chip {
    padding: 3px 8px;
    gap: 5px;
    font-size: 15.5px;
}

.hw-own-village-card .hw-stat-chip img {
    width: 22px;
    height: 22px;
}

.hw-own-village-card .hw-stat-chip b {
    font-size: 16px;
}

.hw-own-village-card .hw-price-target {
    font-size: 13px;
}

.hw-own-village-card .hw-surfer-plus {
    font-size: 12.5px;
}

.hw-own-village-card .hw-boats:empty {
    display: none;
}

.hw-own-village-card .hw-boats img {
    height: 34px;
}

/* Opponent Village Tabs Bar */
.hw-village-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 5px 7px;
    background: rgba(8, 36, 66, 0.85);
    border-bottom: 1px solid rgba(145, 215, 255, 0.25);
}

.hw-village-tab {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(160, 220, 255, 0.22);
    background: rgba(22, 68, 114, 0.65);
    color: #d9eeff;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.hw-village-tab:hover {
    background: rgba(38, 98, 158, 0.82);
    color: #fff;
}

.hw-village-tab.active {
    background: linear-gradient(180deg, #faf1dc 0%, #ead7b1 100%);
    color: #23170b;
    border-color: #d4b475;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.28);
}

.hw-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--hw-player, #2879b7);
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
}

.hw-tab-name {
    max-width: 105px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hw-tab-points {
    font-size: 12px;
    font-weight: 700;
    color: #ffd685;
}

.hw-village-tab.active .hw-tab-points {
    color: #8c4e09;
}

.hw-opp-villages-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hw-opp-village-item.hw-tab-hidden {
    display: none !important;
}

/* Graphical Village Mat (350+ x 278 coordinate space) */
.hw-village-mat {
    position: relative;
    width: 100%;
    user-select: none;
    background: radial-gradient(circle at 40% 50%, #3199de 0%, #2487d3 72%, #1d78c1 100%);
}

.hw-village-bg {
    position: absolute;
    object-fit: fill;
    pointer-events: none;
}

.hw-tiki-spot,
.hw-kahuna-spot {
    position: absolute;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    cursor: pointer;
    z-index: 3;
}

.hw-tiki-spot>img,
.hw-kahuna-spot>img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55));
}

.hw-start-hut,
.hw-village-piece {
    position: absolute;
    z-index: 2;
}

.hw-start-hut>img,
.hw-village-piece>.hw-tile {
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.48);
}

.hw-village-piece {
    cursor: pointer;
}

#Hawaii2 .hw-kahuna-spot.hw-unqualified-end > img,
#Hawaii2 .hw-village-piece.hw-unqualified-end > .hw-tile {
    filter: grayscale(85%) opacity(0.52);
}

#Hawaii2 .hw-kahuna-spot.hw-unqualified-end::after,
#Hawaii2 .hw-village-piece.hw-unqualified-end::after {
    content: "✕";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 900;
    color: #d32f2f;
    text-shadow: 0 0 3px #ffffff, 0 0 5px #ffffff;
    pointer-events: none;
    z-index: 4;
}

.hw-village {
    position: absolute;
    z-index: 2;
    border: 0;
    border-radius: 4px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
}

.hw-row-number {
    font-size: 13px;
    font-weight: 800;
    color: #c81414;
    text-shadow: 0 0 3px #ffffff, 0 0 6px #ffffff;
    pointer-events: none;
}

/* ==========================================================================
   High-Contrast Click Targets (.hw-active) & Chosen (.hw-selected)
   ========================================================================== */
#Hawaii2 .hw-active,
#Hawaii2 .hw-selected {
    cursor: pointer !important;
    z-index: 8;
}

/* Enforce Rule U-11: Pointer only on available interactions.
   Bootstrap defaults button cursor to pointer; override to default for inactive elements. */
#Hawaii2 .hw-price-btn:not(.hw-active):not(.hw-selected),
#Hawaii2 .hw-order-slot:not(.hw-active):not(.hw-selected),
#Hawaii2 .hw-fish-spot:not(.hw-active):not(.hw-selected),
#Hawaii2 .hw-fish-token:not(.hw-active):not(.hw-selected) {
    cursor: default !important;
}

/* Yellow CSS Target Ring on Price Tokens, Order Slots, Docks, Fishing Spot & Fish Tokens */
#Hawaii2 .hw-price-btn.hw-active::after,
#Hawaii2 .hw-order-slot.hw-active::after,
#Hawaii2 .hw-dock.hw-active::after,
#Hawaii2 .hw-fish-spot.hw-active::after,
#Hawaii2 .hw-fish-token.hw-active:not(.hw-selected)::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 118%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 3px solid #ffd500;
    box-shadow: 0 0 0 1.5px rgba(25, 18, 10, 0.78), 0 2px 6px rgba(0, 0, 0, 0.65);
    background: transparent;
    pointer-events: none;
    z-index: 9;
    box-sizing: border-box;
}

#Hawaii2 .hw-dock.hw-active::after {
    width: 90%;
}

#Hawaii2 .hw-order-slot.hw-active::after {
    width: 115%;
}

#Hawaii2 .hw-fish-spot.hw-active::after {
    width: 96%;
}

#Hawaii2 .hw-fish-token.hw-active:not(.hw-selected)::after {
    width: 120%;
}

#Hawaii2 .hw-price-btn.hw-active:hover,
#Hawaii2 .hw-order-slot.hw-active:hover,
#Hawaii2 .hw-dock.hw-active:hover,
#Hawaii2 .hw-fish-spot.hw-active:hover {
    transform: scale(1.1);
    z-index: 20;
}

/* Selectable Tile Stacks on Locations */
#Hawaii2 .hw-stock-tile.hw-active {
    outline: 2.5px solid #ffffff !important;
    outline-offset: 1px;
    box-shadow: 0 0 0 5.5px #e61919, 0 5px 14px rgba(0, 0, 0, 0.75) !important;
}

#Hawaii2 .hw-stock-tile.hw-active:hover {
    transform: translateY(-2px);
    z-index: 20;
}

/* Selectable Village Row Spaces (free1.webp, free2.webp, free3.webp) */
#Hawaii2 .hw-village.hw-active {
    opacity: 1 !important;
    pointer-events: auto !important;
    background: url('../images/free2.webp') center / 100% 100% no-repeat !important;
    filter: drop-shadow(0 0 4px #ffffff) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.65));
    z-index: 9;
}

#Hawaii2 .hw-village.hw-active[data-free-len="1"] {
    background-image: url('../images/free1.webp') !important;
}

#Hawaii2 .hw-village.hw-active[data-free-len="3"] {
    background-image: url('../images/free3.webp') !important;
}

#Hawaii2 .hw-village.hw-active:hover {
    transform: scale(1.04);
}

#Hawaii2 .hw-controls .btn.hw-active {
    outline: 2.5px solid #ffffff !important;
    box-shadow: 0 0 0 4px #e61919, 0 3px 8px rgba(0, 0, 0, 0.45) !important;
}

#Hawaii2 .hw-selected {
    outline: 3px solid #ffffff !important;
    outline-offset: 1px;
    box-shadow: 0 0 0 5.5px var(--hw-select), 0 3px 12px rgba(0, 0, 0, 0.65) !important;
    z-index: 10;
}

#Hawaii2 .hw-price-btn.hw-selected,
#Hawaii2 .hw-order-slot.hw-selected {
    border-radius: 50%;
}

#Hawaii2 .hw-fish-spot.hw-selected {
    outline: none !important;
    box-shadow: none !important;
}

#Hawaii2 .hw-place.hw-selected {
    outline: 2px solid rgba(0, 229, 255, 0.85) !important;
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.55) !important;
    z-index: 5;
}

#Hawaii2 .hw-log-location {
    outline: 3px solid #ff5722 !important;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(255, 87, 34, 0.45) !important;
    z-index: 8;
}

/* ==========================================================================
   Popovers (Tile Inspection, Island Help, Round Target, Score Breakdown)
   ========================================================================== */
.hawaii-popover {
    max-width: 340px !important;
    border: 1px solid #b5945b !important;
    border-radius: 10px !important;
    background: #fcf6e8 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42) !important;
    color: #23180c !important;
}

.hawaii-popover.hawaii-popover-wide {
    max-width: min(94vw, 480px) !important;
    width: min(92vw, 430px);
}

.hawaii-popover.hawaii-popover-round {
    max-width: min(95vw, 340px) !important;
    width: min(93vw, 320px);
}

.hawaii-popover.hawaii-popover-round .popover-body {
    padding: 8px 10px !important;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

.hawaii-popover .popover-header {
    background: linear-gradient(90deg, #ead6ad 0%, #dec28c 100%) !important;
    border-bottom: 1px solid #c2a268 !important;
    color: #23180c !important;
    font-weight: 700;
    padding: 6px 10px !important;
}

.hw-pop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.hw-pop-close {
    border: 0;
    background: rgba(0, 0, 0, 0.1);
    color: #23180c;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 14px;
    line-height: 18px;
    padding: 0;
    cursor: pointer;
}

.hw-pop-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

.hw-help {
    font-size: 12.5px;
    line-height: 1.4;
}

.hw-help>.hw-tile,
.hw-help>.hw-help-island {
    display: block;
    max-width: 140px;
    height: auto;
    margin: 0 auto 8px;
    border-radius: 4px;
}

.hw-help>.hw-help-round {
    display: block;
    width: 240px;
    max-width: 100%;
    height: auto;
    margin: 0 auto 10px;
    border-radius: 6px;
}

.hawaii-popover.hawaii-popover-round .hw-help-round {
    width: 220px;
    margin-bottom: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
}

.hw-round-pop-target {
    font-size: 12.5px;
    font-weight: 600;
    color: #3a2611;
    margin: 0 !important;
}

.hw-round-players {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 7px;
}

.hw-round-player-row {
    background: linear-gradient(90deg, rgba(248, 238, 212, 0.97) 0%, rgba(235, 219, 182, 0.97) 100%);
    border: 1px solid rgba(92, 62, 30, 0.24);
    border-left: 5px solid var(--hw-player, #2879b7);
    border-radius: 6px;
    padding: 4px 7px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: #24190e;
}

.hw-round-player-row .hw-player-meeple {
    width: 16px;
    height: 22px;
}

.hw-round-player-row .hw-player-name {
    font-size: 13px;
}

.hw-round-player-row .hw-player-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    width: 100%;
    background: transparent;
    border: 0;
    padding: 0;
}

.hw-round-player-row .hw-stat-chip {
    padding: 2px 6px;
    gap: 4px;
    font-size: 13.5px;
}

.hw-round-player-row .hw-stat-chip img {
    width: 17px;
    height: 17px;
}

.hw-round-player-row .hw-stat-chip b {
    font-size: 13.5px;
}

@media (max-width: 380px) {
    .hw-round-player-row .hw-stat-chip {
        padding: 2px 4px;
        gap: 3px;
        font-size: 12px;
    }

    .hw-round-player-row .hw-stat-chip img {
        width: 15px;
        height: 15px;
    }

    .hw-round-player-row .hw-stat-chip b {
        font-size: 12px;
    }
}

.hw-help-rounds-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.hw-help-round-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 5px 6px 6px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.65);
    border: 1.5px solid rgba(140, 105, 54, 0.25);
    transition: opacity 0.15s ease;
}

.hw-help-round-item:last-child {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc(50% - 4px);
}

.hw-help-round-label {
    font-size: 11.5px;
    font-weight: 700;
    color: #3a2611;
    line-height: 1.1;
}

.hw-help-round-img {
    display: block;
    width: 195px;
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.28);
}

.hw-help-round-item.hw-round-past {
    opacity: 0.48;
    filter: grayscale(65%);
    background: rgba(235, 228, 214, 0.5);
}

.hw-help-round-item.hw-round-current {
    background: #fff9e6;
    border: 2px solid #d48806;
    box-shadow: 0 0 0 2px rgba(255, 200, 40, 0.45), 0 3px 8px rgba(0, 0, 0, 0.2);
}

.hw-help-round-item.hw-round-current .hw-help-round-label {
    color: #a85800;
    font-weight: 800;
}

.hw-help-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.hw-help-card {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(140, 105, 54, 0.25);
    border-radius: 6px;
    padding: 6px;
    text-align: center;
}

.hw-help-card .hw-tile {
    width: 100%;
    max-width: 110px;
    height: auto;
    margin: 0 auto 4px;
    display: block;
    border-radius: 3px;
}

.hw-help-card strong {
    display: block;
    font-size: 11.5px;
    margin-bottom: 3px;
}

.hw-help-card p,
.hw-help p {
    margin: 0;
}

.hw-help-sub {
    font-weight: 700;
    margin-bottom: 4px !important;
    color: #523618;
}

.hw-score-breakdown {
    min-width: 190px;
}

.hw-bd-row,
.hw-bd-total {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 3px 0;
}

.hw-bd-total {
    margin-top: 4px;
    padding-top: 5px;
    border-top: 1px solid rgba(110, 80, 42, 0.35);
    font-size: 13.5px;
}

/* ==========================================================================
   Game Bootstrap Modals (Rules B-05, U-01, U-02, U-03, U-11)
   ========================================================================== */
.hw-pay-modal .modal-dialog {
    max-width: min(92vw, 380px);
}

.hw-modal .modal-content {
    background: #faf8f5;
    border: 2px solid #0e5a6f;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    color: #2c2523;
    font-family: inherit;
    user-select: none;
    overflow: hidden;
}

.hw-modal .hw-pay-header {
    background: linear-gradient(135deg, #135d72 0%, #0a3d4c 100%);
    color: #ffffff;
    border-bottom: 2px solid #dfa234;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: grab;
    touch-action: none;
}

.hw-modal .hw-pay-header.hw-dragging {
    cursor: grabbing;
}

.modal-backdrop.hw-modal-backdrop {
    --bs-backdrop-opacity: 0.14;
}

.hw-modal .hw-pay-title {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    margin: 0;
}

.hw-modal .hw-pay-close {
    opacity: 0.85;
}

.hw-modal .hw-pay-close:hover {
    opacity: 1;
}

.hw-pay-body {
    padding: 12px;
}

.hw-pay-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
}

.hw-pay-option-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 8px;
    padding: 6px 12px;
    min-height: 44px;
    /* Rule U-01 */
    background: #ffffff;
    border: 1.5px solid #d2cbbe;
    border-radius: 8px;
    color: #2c2523;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.hw-pay-option-btn:hover {
    background: #f0f8fa;
    border-color: #135d72;
}

.hw-pay-option-btn.active,
.hw-pay-option-btn.hw-selected {
    background: #e4f4f7 !important;
    border: 2px solid #0f6c85 !important;
    color: #063440 !important;
    box-shadow: 0 0 0 2px rgba(15, 108, 133, 0.35);
}

.hw-pay-option-btn.active b,
.hw-pay-option-btn.hw-selected b {
    color: #063440;
}

.hw-pay-opt-res {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.hw-pay-opt-res img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.hw-pay-cost-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 10px;
    background: #eef6f8;
    border: 1.5px solid #9cc3ce;
    border-radius: 8px;
    color: #063440;
}

.hw-pay-cost-main {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 700;
}

.hw-pay-cost-main img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.hw-pay-cost-main b {
    font-size: 18px;
    font-weight: 800;
    color: #0a4a5c;
}

.hw-pay-alt-badge {
    font-size: 12.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    background: #fff7e6;
    border: 1px solid #dfb66b;
    color: #7c4d0e;
}

.hw-pay-owned {
    font-size: 13px;
    font-weight: 600;
    color: #6b5d4d;
}

.hw-pay-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hw-pay-picker-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 10px;
    background: #ffffff;
    border: 1px solid #d9d0be;
    border-radius: 8px;
}

.hw-pay-picker-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #2c2523;
}

.hw-pay-picker-label img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.hw-pay-picker-ctrl {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hw-pay-step-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1.5px solid #c9c0b1;
    border-radius: 6px;
    background: #f8f5ef;
    color: #2c2523;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hw-pay-step-btn:hover:not(:disabled) {
    background: #e4f4f7;
    border-color: #135d72;
}

.hw-pay-step-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.hw-pay-step-val {
    min-width: 24px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: #063440;
}

.hw-pay-picker-status {
    text-align: right;
    font-size: 13px;
    font-weight: 700;
    padding: 2px 4px 0;
}

.hw-pay-picker-status.hw-valid {
    color: #1b6e2d;
}

.hw-pay-picker-status.hw-invalid {
    color: #b8621b;
}

.hw-modal .hw-pay-footer {
    background: #f5f2eb;
    border-top: 1px solid #dcd4c5;
    padding: 8px 12px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.hw-pay-cancel {
    min-height: 44px;
    /* Rule U-01 */
    padding: 4px 14px;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
}

.hw-pay-confirm {
    min-height: 44px;
    /* Rule U-01 */
    padding: 4px 18px;
    font-weight: 700;
    font-size: 13.5px;
    background: #0f6c85;
    border-color: #0b4e60;
    color: #ffffff;
    cursor: pointer;
}

.hw-pay-confirm:disabled {
    cursor: default;
}

.hw-pay-confirm:hover:not(:disabled) {
    background: #0b4e60;
    border-color: #083c4b;
}

/* ==========================================================================
   Boat Selection Modal & Visual Foot Deduction on Fish Tokens
   ========================================================================== */
.hw-boat-modal .modal-dialog {
    max-width: min(92vw, 400px);
}

.hw-boat-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hw-boat-hint {
    font-size: 13px;
    font-weight: 600;
    color: #3c2e21;
}

.hw-boat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 8px;
}

.hw-boat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 6px;
    min-height: 92px;
    background: #ffffff;
    border: 1.5px solid #d2cbbe;
    border-radius: 8px;
    color: #2c2523;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.hw-boat-card:hover {
    background: #f0f8fa;
    border-color: #135d72;
}

.hw-boat-card.active,
.hw-boat-card.hw-selected {
    background: #e4f4f7 !important;
    border: 2px solid #0f6c85 !important;
    color: #063440 !important;
    box-shadow: 0 0 0 2px rgba(15, 108, 133, 0.35);
}

.hw-boat-card-art img {
    height: 34px;
    width: auto;
    max-width: 90px;
    object-fit: contain;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.hw-boat-card-name {
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.15;
}

.hw-boat-card-cap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.hw-boat-card-cap img {
    width: 15px;
    height: 15px;
    object-fit: contain;
}

.hw-boat-card-cap img.hw-boat-printed-foot {
    filter: sepia(0.6) hue-rotate(-15deg) saturate(1.5);
}

.hw-boat-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    background: #f0ece1;
    border: 1px solid #d9d0be;
    font-size: 13.5px;
    font-weight: 700;
    color: #2c2523;
}

.hw-boat-summary img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.hw-fish-foot-badge {
    position: absolute;
    right: -5px;
    bottom: -5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 250, 235, 0.96);
    border: 1.5px solid #8a561e;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 12;
}

.hw-fish-foot-badge img {
    width: 12px !important;
    height: 12px !important;
    object-fit: contain;
}

.hw-stat-chip.hw-chip-spent {
    background: rgba(255, 236, 209, 0.96);
    border-color: rgba(196, 98, 22, 0.65);
    color: #8c3800;
}

.hw-flying-foot {
    position: fixed;
    z-index: 2000;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255, 252, 242, 0.96);
    border: 1.5px solid #b8621b;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    font-size: 12px;
    font-weight: 800;
    color: #9e3500;
}

.hw-flying-foot img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* ==========================================================================
   Fishing Step-by-Step Payment & Auto-Fish Modal (#hwFishModal)
   ========================================================================== */
.hw-fish-modal .modal-dialog {
    max-width: min(92vw, 340px);
}

.hw-fish-body {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.hw-fish-body .hw-boat-hint {
    font-size: 12px;
    line-height: 1.25;
}

.hw-fish-slots-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 8px;
    border-radius: 7px;
    background: #f3efe4;
    border: 1px solid #ded5c3;
}

.hw-fish-fleet-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #52453e;
}

.hw-fish-fleet-bar .hw-opt-fleet {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.hw-fish-fleet-bar .hw-opt-fleet img {
    height: 30px;
    width: auto;
    object-fit: contain;
}

.hw-fish-slots-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 2px 0;
}

.hw-fish-slot {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
}

.hw-fish-slot img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.hw-fish-slot-empty {
    border: 2px dashed #c7bca6;
    background: rgba(255, 255, 255, 0.55);
}

.hw-fish-slot-empty .hw-slot-ghost {
    opacity: 0.2;
    filter: grayscale(1);
}

.hw-fish-slot-printed {
    border: 2px solid #b59b72;
    background: #ede2cc;
    opacity: 0.55;
}

.hw-fish-slot-printed.hw-slot-used {
    opacity: 1;
    border-color: #2e7d32;
    background: #e8f5e9;
}

.hw-fish-slot-filled {
    border: 2px solid #2e6b9e !important;
    background: #eef6fc !important;
    box-shadow: 0 2px 5px rgba(24, 90, 157, 0.22);
    cursor: pointer;
    transition: transform 0.12s ease, background-color 0.12s ease;
}

.hw-fish-slot-filled:hover {
    background: #fdecea !important;
    border-color: #c9362b !important;
    transform: translateY(-1px);
}

.hw-slot-remove {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #c9362b;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 13px;
    text-align: center;
}

.hw-fish-res-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.hw-fish-res-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 8px;
    background: #ffffff;
    border: 1.5px solid #c9c0b1;
    color: #2c2523;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.14s ease;
}

.hw-fish-res-btn img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.hw-fish-res-btn.hw-active:hover {
    background: #f0f7fc;
    border-color: #2e6b9e;
    transform: translateY(-1px);
}

.hw-fish-res-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.hw-fish-res-count {
    padding: 2px 7px;
    border-radius: 999px;
    background: #f0ece1;
    font-size: 13.5px;
    font-weight: 800;
}

.hw-fish-auto-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 8px;
    border-radius: 7px;
    background: #f0ece1;
    border: 1px solid #d9d0be;
    min-height: 38px;
    justify-content: center;
}

.hw-fish-auto-tokens {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
}

.hw-fish-auto-chip img {
    width: 34px;
    height: 36px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.hw-fish-auto-text {
    font-size: 12px;
    font-weight: 700;
    color: #1f5f3b;
}

.hw-fish-auto-empty {
    font-size: 11.5px;
    color: #706259;
    font-style: italic;
}

.hw-fish-modal .hw-pay-footer {
    padding: 6px 10px;
    gap: 8px;
}

.hw-fish-modal .hw-pay-cancel,
.hw-fish-modal .hw-pay-confirm {
    min-height: 34px;
    padding: 3px 12px;
    font-size: 12.5px;
}

/* ==========================================================================
   Game Log Styling & Player-Colored Move Headers (Rules L-04, L-06, L-11)
   ========================================================================== */
#log {
    font-size: 13.5px;
    line-height: 1.55;
}

#log .move {
    font-size: 13.5px;
    font-weight: 700;
    padding: 4px var(--log-margin);
    margin-top: 6px;
    border-radius: 4px;
}

#log .move.color0 {
    background-color: #fce8e6;
    color: #5c130d;
}

/* Red */
#log .move.color1 {
    background-color: #e3f2fd;
    color: #0d3866;
}

/* Blue */
#log .move.color2 {
    background-color: #fffde7;
    color: #5d4a04;
}

/* Yellow */
#log .move.color3 {
    background-color: #eeeeee;
    color: #212121;
}

/* Black */
#log .move.color4 {
    background-color: #e8f5e9;
    color: #134717;
}

/* Green */

#log .action {
    padding: 3px var(--log-margin);
    line-height: 1.55;
}

#log .action:not(.actionfinishTurn)>.effect {
    display: block;
    padding-left: 11px;
    margin-top: 2px;
    line-height: 1.45;
}

#log .action:not(.actionfinishTurn)>.effect0::before {
    content: '\21d2\00a0';
    color: #593a22;
    font-weight: 700;
}

#log .action:not(.actionfinishTurn)>.effect:not(.effect0)::before {
    content: '\2022\00a0';
    color: #7d6347;
}

#log .action.actionfinishTurn {
    padding: 3px var(--log-margin) 5px;
}

#log .action.actionfinishTurn>.coreAction {
    display: block;
}

#log .action.actionfinishTurn>.effect,
#log .action.actionfinishTurn>.automatic {
    display: none;
}

.hw-finish-effects>.hw-finish-eff {
    display: block;
    padding-left: 11px;
    margin-top: 2px;
    line-height: 1.45;
}

.hw-log {
    display: inline;
    font-size: 13.5px;
}

#log .hw-log-tile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    padding: 1px 2px;
    margin: 0 3px;
    border: 1px solid rgba(90, 64, 34, 0.35);
    border-radius: 5px;
    background: #fdfaf2;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    line-height: 1;
}

#log .hw-log-tile-btn:hover,
#log .hw-log-tile-btn:focus-visible {
    border-color: #00bcd4;
    box-shadow: 0 0 0 2px rgba(0, 188, 212, 0.35);
    outline: none;
}

#log .hw-log-tile-btn img.hw-tile,
#log .hw-log img.hw-tile {
    height: 30px;
    width: auto;
    max-width: 64px;
    border-radius: 3px;
    vertical-align: middle;
    object-fit: contain;
}

#log .hw-log-loc-btn,
.hw-log button:not(.hw-log-tile-btn) {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    padding: 2px 7px;
    margin: 0 3px;
    border: 1px solid rgba(90, 64, 34, 0.35);
    border-radius: 4px;
    background: #fdf6e6;
    color: #24180b;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

#log .hw-log-loc-btn:hover,
#log .hw-log-loc-btn:focus-visible,
.hw-log button:not(.hw-log-tile-btn):hover,
.hw-log button:not(.hw-log-tile-btn):focus-visible {
    background: #fff8e1;
    border-color: #d48806;
    box-shadow: 0 0 0 2px rgba(212, 136, 6, 0.25);
    outline: none;
}

#log .hw-log .hw-resources,
#log .hw-round-summary .hw-resources {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    vertical-align: middle;
    margin: 0 0 0 2px;
    white-space: nowrap;
}

#log .hw-log .hw-res-pill,
#log .hw-round-summary .hw-res-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(90, 64, 34, 0.3);
    font-size: 12.5px;
    line-height: 1;
    vertical-align: middle;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

#log .hw-log .hw-res-pill img,
#log .hw-round-summary .hw-res-pill img {
    width: 17px;
    height: 17px;
    object-fit: contain;
    vertical-align: middle;
}

#log .hw-log .hw-res-pill b,
#log .hw-round-summary .hw-res-pill b {
    font-size: 13px;
    font-weight: 700;
    color: #24180b;
}

.hw-round-summary {
    margin: 3px 0 2px;
    background: linear-gradient(180deg, #fdf8ec 0%, #f3e8ce 100%);
    border: 1px solid #b89a64;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(36, 24, 11, 0.14);
    color: #24180b;
    font-size: 12.5px;
    line-height: 1.35;
}

.hw-rs-head,
.hw-rs-subhead,
.hw-rs-next {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 7px;
    font-weight: 700;
    font-size: 12.5px;
}

.hw-rs-head {
    background: #4a301b;
    color: #fff3d6;
    border-bottom: 1px solid #b89a64;
}

.hw-rs-subhead {
    background: #5c3d22;
    color: #fff3d6;
    border-top: 1px solid #b89a64;
    border-bottom: 1px solid #b89a64;
}

.hw-rs-next {
    background: #0e4a73;
    color: #f0f9ff;
    border-top: 1px solid #b89a64;
    border-bottom: 1px solid rgba(184, 154, 100, 0.55);
}

#log .hw-round-summary .hw-rs-round-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    flex: 0 0 auto;
    line-height: 0;
}

#log .hw-round-summary .hw-rs-round-btn:hover,
#log .hw-round-summary .hw-rs-round-btn:focus-visible {
    border-color: #ffd24c;
    box-shadow: 0 0 0 2px rgba(255, 210, 76, 0.35);
    outline: none;
}

#log .hw-round-summary .hw-rs-round-btn img {
    width: 30px;
    height: 20px;
    object-fit: fill;
    border-radius: 2px;
    display: block;
}

.hw-rs-section {
    padding: 5px 7px;
}

.hw-rs-empty {
    font-size: 12px;
    color: #6b5742;
    font-style: italic;
}

.hw-rs-final {
    display: flex;
    flex-direction: column;
}

.hw-rs-cat-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 5px 7px;
    border-bottom: 1px solid rgba(184, 154, 100, 0.32);
}

.hw-rs-cat-row:last-child {
    border-bottom: 0;
}

.hw-rs-cat-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #66492d;
}

.hw-rs-items {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 5px;
}

.hw-rs-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px 2px 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(154, 123, 72, 0.55);
    font-size: 12px;
    line-height: 1.25;
    max-width: 100%;
    white-space: nowrap;
}

.hw-rs-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.3);
    flex: 0 0 10px;
}

.hw-rs-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
}

.hw-rs-pts {
    color: #1b6e2d;
    font-weight: 800;
    flex: 0 0 auto;
}

.hw-rs-income {
    display: flex;
    flex-direction: column;
}

.hw-rs-income-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 6px;
    padding: 4px 7px;
    border-bottom: 1px solid rgba(184, 154, 100, 0.28);
}

.hw-rs-income-row:last-child {
    border-bottom: 0;
}

.hw-rs-who {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    flex: 1 1 70px;
}

.hw-rs-res {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
}

.hw-log img {
    height: 24px;
    width: auto;
    vertical-align: middle;
}

#log .hw-log img[src*="price"] {
    height: 28px;
    width: 28px;
    object-fit: contain;
    margin: 0 2px;
    vertical-align: middle;
}

#log .hw-log img[src*="fish"] {
    height: 24px;
    width: auto;
    object-fit: contain;
    margin: 0 2px;
    vertical-align: middle;
}

/* ==========================================================================
   Responsive Reflow (Narrow/Mobile <= 864px down to 320px)
   General Islands on top, Player Infos below (Own Player Info first)
   ========================================================================== */
@media (max-width: 864px) {
    #Hawaii2 {
        padding: 6px 6px 12px;
    }

    .hw-main-layout {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .hw-col-island {
        grid-column: 1;
        grid-row: 1;
        order: 1;
        width: 100%;
        align-items: center;
    }

    .hw-col-villages {
        grid-column: 1;
        grid-row: 2;
        order: 2;
        width: 100%;
    }

    .hw-own-village-card {
        order: 1;
    }

    .hw-opp-village-card {
        order: 2;
    }
}

@container (max-width: 840px) {
    .hw-main-layout {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .hw-col-island {
        grid-column: 1;
        grid-row: 1;
        order: 1;
        width: 100%;
        align-items: center;
    }

    .hw-col-villages {
        grid-column: 1;
        grid-row: 2;
        order: 2;
        width: 100%;
    }

    .hw-own-village-card {
        order: 1;
    }

    .hw-opp-village-card {
        order: 2;
    }
}

@supports not (container-type: inline-size) {
    .hw-main-layout:where([data-gcf-hawaii2-q0]) {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .hw-col-island:where([data-gcf-hawaii2-q1]) {
        grid-column: 1;
        grid-row: 1;
        order: 1;
        width: 100%;
        align-items: center;
    }
    .hw-col-villages:where([data-gcf-hawaii2-q2]) {
        grid-column: 1;
        grid-row: 2;
        order: 2;
        width: 100%;
    }
    .hw-own-village-card:where([data-gcf-hawaii2-q3]) {
        order: 1;
    }
    .hw-opp-village-card:where([data-gcf-hawaii2-q4]) {
        order: 2;
    }
}

@media (max-width: 520px) {
    #Hawaii2 .hw-tutorial-link {
        top: 4px;
        right: 4px;
        height: 36px;
        padding: 3px 2px;
        font-size: 8px;
    }

    #Hawaii2 .hw-tutorial-icon {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 420px) {
    #Hawaii2 {
        padding: 4px 4px 10px;
    }

    .hw-stat-chip {
        padding: 2px 3px;
        font-size: 11px;
    }

    .hw-stat-chip img {
        width: 13px;
        height: 13px;
    }

    .hw-inspect {
        width: 12px;
        height: 12px;
        font-size: 8px !important;
        line-height: 10px !important;
    }
}