* { box-sizing: border-box; }

body {
    background: #0a0a0a;
    color: #f2c94c;
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    padding: 0;
}

.app-shell {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: #0a0a0a;
    position: relative;
    overflow: hidden;
}

.app-shell::before {
    content: "";
    position: absolute;
    top: 240px;
    left: 50%;
    width: 85%;
    max-width: 420px;
    aspect-ratio: 1 / 1;
    background-image: url('logo.webp');   /* replaced by the H5 logo in _Layout.vbhtml */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transform: translateX(-50%);
    opacity: 0.14;
    z-index: 0;
    pointer-events: none;
}

.app-header, .app-content {
    position: relative;
    z-index: 1;
}

.app-header {
    padding: 16px;
    border-bottom: 1px solid #333;
}

.header-top {
    display: flex;
    align-items: center;
}

.header-brand {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    padding: 0 8px;   /* air between the title and the back arrow / language links */
}

.title-logo {
    height: 52px;
    width: 52px;
    border-radius: 50%;
    flex-shrink: 0;
}

.app-header h1 {
    font-size: 18px;
    margin: 0;
    text-align: center;
    color: #f2c94c;
}

.back-link, .back-link-spacer {
    width: 40px;   /* just the arrow - the room goes to the title, the language links have their own 78px */
    flex-shrink: 0;
}

.back-link {
    color: #f2c94c;
    text-decoration: none;
    font-size: 20px;
}

.account-bar {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    line-height: 1;
    color: #ccc;
}

/* same height + centred, so the name and the (CJK-capable) balance label share one visual line */
.account-bar span {
    display: inline-flex;
    align-items: center;
    height: 20px;
}

.account-balance {
    color: #f2c94c;
    font-weight: 600;
}

.header-nav {
    width: 100%;
    display: flex;
    gap: 6px;
    margin-top: 12px;
    background: #161616;
    border-radius: 10px;
    padding: 4px;
}

.header-nav a {
    flex: 1;
    text-align: center;
    color: #999;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    padding: 9px 4px;
    border-radius: 8px;
    white-space: nowrap;
}

.header-nav a.active {
    background: linear-gradient(180deg, #f7d774, #c9971f);
    color: #1a1200;
}

.app-content {
    padding: 16px;
}

label {
    display: block;
    margin-top: 14px;
    margin-bottom: 4px;
    color: #f2c94c;
}

.simulator-note {
    background: #2a1a00;
    border: 1px dashed #f2c94c;
    border-radius: 8px;
    color: #f7d774;
    font-size: 12px;
    line-height: 1.5;
    padding: 10px 12px;
}

.simulator-note code {
    color: #fff;
}

select, input[type=text], input[type=number], input[type=date], input[type=password] {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: none;
    background: #fff;
    color: #111;
    font-size: 15px;
}

.field-row {
    display: flex;
    gap: 12px;
}

.field-row > div {
    flex: 1;
    min-width: 0;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #222;
}

.checkbox-row input {
    width: 22px;
    height: 22px;
}

/* the counter logo next to each counter on the Order page (39 x 18) */
.counter-icon {
    width: 39px;
    height: 18px;
    flex: 0 0 auto;
    object-fit: contain;   /* the eagle (HEL3 / HEL9) is square: shown whole, centred */
}

/* HEL3 / HEL9: the eagle as a small round badge, centred in the same 39 px column */
.counter-icon-eagle {
    width: 26px;
    height: 26px;
    margin: -4px 6.5px;
    border-radius: 50%;
    border: 1px solid #c9971f;
    background: #000;
}

.btn {
    display: inline-block;
    background: linear-gradient(180deg, #f7d774, #c9971f);
    color: #1a1200;
    border: none;
    border-radius: 20px;
    padding: 12px 28px;
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
}

.btn-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
}

.error {
    color: #ff6b6b;
    margin-top: 10px;
}

.success {
    color: #6bff89;
    margin-top: 10px;
}

table.grid {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 13px;
    table-layout: fixed;
}

table.grid th, table.grid td {
    border: 1px solid #333;
    padding: 4px;
    text-align: center;
    overflow: hidden;
}

table.grid .amount-col {
    width: 11%;
}

table.grid th {
    color: #f2c94c;
    font-weight: normal;
}

table.grid input {
    width: 100%;
    padding: 6px 2px;
    text-align: center;
}

table.prize-table {
    margin-bottom: 14px;
}

table.prize-table th, table.prize-table td {
    border-color: #ddd;
}

table.prize-table th {
    background: linear-gradient(#f2c94c, #b8860b);
    color: #fff;
    font-weight: bold;
    padding: 10px 4px;
    border-color: #b8860b;
}

table.prize-table td {
    background: #fff;
    color: #000;
    padding: 10px 4px;
}

.total-row {
    text-align: right;
    font-size: 18px;
    margin-top: 14px;
    color: #f2c94c;
}

table.betlist {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 13px;
    color: #eee;
}

table.betlist th, table.betlist td {
    border: 1px solid #333;
    padding: 6px;
}

.receipt-box {
    background: #111;
    border: 1px solid #f2c94c;
    border-radius: 6px;
    padding: 12px;
    margin-top: 12px;
    white-space: pre-wrap;
    color: #eee;
    font-size: 13px;
}

.confirm-box {
    background: #111;
    border: 1px solid #f2c94c;
    border-radius: 6px;
    padding: 12px;
    margin-top: 12px;
}

.confirm-meta {
    color: #eee;
    font-size: 14px;
    margin-bottom: 8px;
}

.bet-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.bet-receipt {
    flex: 1;
    margin-top: 0;
    min-width: 0;
}

.bet-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
    flex-shrink: 0;
}

.bet-actions .btn {
    white-space: nowrap;
}

.center {
    text-align: center;
}

.right {
    text-align: right;
}

.payout-summary {
    background: #161616;
    border-radius: 10px;
    padding: 4px 16px;
    margin-top: 16px;
}

.payout-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #262626;
}

.payout-summary-row:last-child {
    border-bottom: none;
}

.payout-summary-value {
    background: #e8e8e8;
    color: #111;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 15px;
}

.payout-summary-value.win {
    color: #1a7a1a;
    font-weight: bold;
}

.payout-group {
    padding: 0;
    overflow: hidden;
}

.payout-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid #333;
}

.payout-game-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.payout-game-name {
    flex: 1;
    color: #f2c94c;
    font-weight: bold;
}

.payout-game-total {
    color: #6bff89;
    font-weight: bold;
}

.payout-line {
    padding: 10px 12px;
    border-bottom: 1px solid #222;
}

.payout-line:last-child {
    border-bottom: none;
}

.payout-empty {
    text-align: center;
    color: #fff;
    font-size: 17px;
    padding: 22px 0;
}

.payout-section-title {
    text-align: center;
    color: #f7d774;
    font-weight: bold;
    margin-top: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f2c94c;
}

.payout-jp-game {
    color: #f2c94c;
    font-size: 12px;
    font-weight: normal;
}

.payout-jp-amount {
    color: #6bff89;
    font-weight: bold;
}

.payout-number {
    color: #fff;
    font-size: 16px;
    font-weight: bold;
}

.payout-detail {
    color: #ccc;
    font-size: 13px;
    margin-top: 2px;
}

.jackpot-banner {
    background: linear-gradient(135deg, #3a2a00, #1a1200);
    border: 1px solid #f2c94c;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
    text-align: center;
}

.jackpot-label {
    color: #f2c94c;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.jackpot-amount {
    color: #fff;
    font-size: 26px;
    font-weight: bold;
    margin-top: 4px;
    text-shadow: 0 0 8px rgba(242, 201, 76, 0.6);
}

.launch-error {
    display: flex;
    justify-content: center;
    margin-top: 60px;
    padding: 0 16px;
}

.launch-error-card {
    background: #111;
    border: 1px solid #f2c94c;
    border-radius: 10px;
    padding: 32px 24px;
    max-width: 320px;
    text-align: center;
}

.launch-error-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(180deg, #f7d774, #c9971f);
    color: #1a1200;
    font-size: 28px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.launch-error-card p {
    color: #ccc;
    font-size: 15px;
    line-height: 1.5;
    margin: 0;
}

/* Language switch (EN / 中文 / ID): top-right of the header row, same width as the back arrow's side so the title stays centred */
.lang-switch {
    width: 78px;
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.lang-switch a {
    display: inline-flex;
    align-items: center;
    height: 22px;
    line-height: 1;
    padding: 0 1px;
    color: #9a9a9a;
    font-size: 13px;
    font-weight: normal;
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}

.lang-switch a.active {
    color: #f2c94c;
    border-bottom-color: #f2c94c;
}

/* "Watch on YouTube" card on the Results page */
.yt-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #161616;
    border: 1px solid #3a3a3a;
    border-left: 3px solid #ff0000;
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 14px;
    text-decoration: none;
    color: #f5f5f5;
}

.yt-card:hover, .yt-card:active {
    background: #202020;
    border-color: #555;
    border-left-color: #ff0000;
}

.yt-icon {
    display: flex;
    flex-shrink: 0;
}

.yt-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.yt-title {
    font-weight: bold;
    font-size: 15px;
    color: #f5f5f5;
}

.yt-sub {
    font-size: 12px;
    color: #9a9a9a;
}

.yt-arrow {
    color: #f2c94c;
    font-size: 22px;
    line-height: 1;
}

/* ---- Lucky Pick campaign: gift icon, confirm popup, result card ---- */
.gift-btn {
    position: fixed;
    bottom: 20px;
    /* bottom-right corner of the 480px app column, or of the screen when it is narrower */
    right: max(16px, calc(50vw - 240px + 16px));
    z-index: 40;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid #555;
    background: #1b1b1b;
    color: #8a8a8a;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
}

.gift-btn .lp-gift { width: 28px; height: 28px; color: inherit; }

.gift-btn--open {
    border-color: #f2c94c;
    color: #f2c94c;
    animation: giftPulse 1.8s ease-in-out infinite;
}

@keyframes giftPulse {
    0%, 100% { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55), 0 0 0 0 rgba(242, 201, 76, 0.55); }
    50%      { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55), 0 0 0 10px rgba(242, 201, 76, 0); }
}

/* room under the content so the floating button never sits on the last row / button */
.has-fab .app-content { padding-bottom: 88px; }

.lp-gift { color: #f2c94c; }
.lp-gift--big { width: 52px; height: 52px; }

.lp-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.72);
}

.lp-modal[hidden] { display: none; }

.lp-card, .lp-result-card {
    width: 100%;
    max-width: 340px;
    box-sizing: border-box;
    padding: 24px 20px;
    text-align: center;
    background: #141414;
    border: 1px solid #3a3a3a;
    border-top: 3px solid #f2c94c;
    border-radius: 16px;
    color: #eee;
}

.lp-card h2, .lp-result-card h2 { margin: 10px 0 8px; font-size: 20px; color: #f2c94c; }
.lp-card p { margin: 6px 0; font-size: 14px; line-height: 1.45; color: #ccc; }
.lp-countdown b { color: #f2c94c; font-variant-numeric: tabular-nums; }

.lp-actions { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
.lp-actions--end { margin-top: 16px; }
.lp-actions .btn { flex: 1; text-align: center; }

.btn-ghost { background: transparent; color: #f2c94c; border: 1px solid #f2c94c; }

.lp-result { display: flex; flex-direction: column; align-items: center; padding-top: 6px; }
.lp-result-card { max-width: 380px; }
.lp-result-card--fail { border-top-color: #ff6b6b; }
.lp-result-sub { margin: 4px 0 14px; font-size: 14px; color: #ccc; }

.lp-label { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: #9a9a9a; }
.lp-numbers { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 8px 0 16px; }
.lp-number {
    padding: 8px 16px;
    font-size: 30px;
    font-weight: bold;
    letter-spacing: 0.18em;
    color: #1a1200;
    background: linear-gradient(180deg, #f7d774, #c9971f);
    border-radius: 12px;
}

.lp-facts { border-top: 1px solid #2c2c2c; }
.lp-facts div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #2c2c2c; font-size: 14px; }
.lp-facts span { color: #9a9a9a; }
.lp-facts b { color: #f5f5f5; text-align: right; }

/* "Lucky Pick" tag on a free campaign bet in Bet History (replaces Re-Buy / Void) */
.lp-tag {
    display: inline-block;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: bold;
    color: #f2c94c;
    border: 1px solid #f2c94c;
    border-radius: 12px;
    white-space: nowrap;
}

.counter-group-title { margin: 12px 0 4px; font-size: 13px; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: .04em; }

/* the icon dropdown of the Results page (the counter picker) */
.icon-select {
    position: relative;
}

.icon-select-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 10px;
    border-radius: 6px;
    border: none;
    background: #fff;
    color: #111;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
}

.icon-select-text {
    flex: 1;
}

.icon-select-caret {
    color: #555;
    font-size: 12px;
}

.icon-select-list {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 20;
    margin: 4px 0 0;
    padding: 4px 0;
    list-style: none;
    background: #141414;
    border: 1px solid #c9971f;
    border-radius: 8px;
    max-height: 340px;
    overflow-y: auto;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

.icon-select-list[hidden] {
    display: none;
}

.icon-select-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: #f2c94c;
    cursor: pointer;
}

.icon-select-list li:hover,
.icon-select-list li[aria-selected="true"] {
    background: #2a2210;
}

/* the eagle sits taller than the 18 px logos: keep the row height steady */
.icon-select .counter-icon-eagle {
    margin-top: 0;
    margin-bottom: 0;
}
