/* =========================
   BASE PAGE SETUP
   ========================= */

body {
    font-family: Arial, sans-serif;
    background: #0f0f0f;
    color: white;
    margin: 0;
    text-align: center;
}

#startScreen {
    margin-top: 80px;
}

#card {
    display: none;
    padding: 15px;
}


/* =========================
   HOME / START SCREEN
   ========================= */

.joinBox {
    background: #1c1c1c;
    padding: 25px;
    width: 320px;
    margin: auto;
    border-radius: 12px;
}

.homeHero {
    position: relative;
    max-width: 420px;
    margin: 70px auto 0;
    padding: 28px 20px 44px;
    text-align: center;
}

.logoCircle {
    width: 92px;
    height: 92px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: #d4af37;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logoCircle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.homeHero h1 {
    margin: 0 0 8px;
    font-size: 34px;
}

.homeHero p {
    color: #bbb;
    margin: 0 0 22px;
}

.homeFooter {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 20px;
    color: #777;
    font-size: 12px;
}

.homeFooter a {
    color: #d4af37;
    text-decoration: none;
}

.homeFooter span {
    color: #777;
}

.admin-link {
    position: fixed;
    right: 14px;
    bottom: 12px;
    width: auto;
    background: transparent;
    color: #777;
    padding: 8px;
    font-size: 12px;
    font-weight: normal;
}

.admin-link:hover {
    color: #d4af37;
}

.joinBox button {
    margin-top: 10px;
    border: 1px solid rgba(212, 175, 55, 0.35);
}

.joinBox button+button {
    margin-top: 12px;
}

.joinBox>button:last-child {
    background: transparent;
    color: #d4af37;
    border-color: rgba(212, 175, 55, 0.45);
}

.claim-review-card {
    background: #151515;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 10px;
    margin: 10px 0;
}

.claim-review-card.approved {
    border-color: #2ecc71;
}

.claim-review-card.rejected {
    border-color: #e74c3c;
    opacity: 0.75;
}

.claim-review-title {
    margin: 0 0 6px;
    color: #d4af37;
    font-weight: bold;
    font-size: 13px;
}

.claim-review-actions {
    margin-top: 8px;
}

.claim-valid-btn {
    background: #2f6f45;
    color: white;
}

.claim-valid-btn.active {
    background: #2ecc71;
    color: #07120b;
}

.player-reject-btn.active {
    background: #e74c3c;
    color: white;
}

.ticket-board .team-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-width: 0;
    min-height: 62px;
    padding: 7px 5px;
    font-size: 12px;
    line-height: 1.15;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
}

.ticket-board .row:nth-child(2) .team-btn {
    min-height: 68px;
}

/* =========================
   FORM CONTROLS
   ========================= */

input,
select,
textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border-radius: 6px;
    border: none;
}

textarea {
    font-family: Arial, sans-serif;
    resize: vertical;
}

button {
    width: 100%;
    padding: 12px;
    background: #d4af37;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}


/* =========================
   PASSWORD FIELD
   ========================= */

.passwordField {
    position: relative;
    display: flex;
    align-items: center;
}

.passwordField input {
    padding-right: 82px;
    margin: 10px 0;
}

.passwordField button {
    position: absolute !important;
    right: 8px;
    top: 50% !important;
    transform: translateY(-50%);
    width: auto !important;
    height: 28px;
    margin: 0 !important;
    padding: 0 9px !important;
    font-size: 12px;
    line-height: 28px;
    background: #333;
    color: white;
    border: 1px solid #555;
    border-radius: 5px;
}

.passwordField .helpIcon {
    right: 58px;
    top: 50% !important;
    transform: translateY(-50%);
}


/* =========================
   HELP ICONS
   ========================= */

.fieldHelp {
    position: relative;
}

.helpIcon {
    position: absolute;
    right: 10px;
    top: 19px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #d4af37;
    color: #111;
    font-size: 13px;
    font-weight: bold;
    line-height: 20px;
    cursor: help;
}

.helpText {
    display: none;
    position: absolute;
    right: 0;
    top: 28px;
    width: 230px;
    background: #222;
    color: white;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #444;
    font-size: 12px;
    font-weight: normal;
    line-height: 1.4;
    z-index: 10;
}

.helpIcon:hover .helpText {
    display: block;
}


/* =========================
   GLOBAL MESSAGES
   ========================= */

.app-message {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 420px;
    padding: 12px;
    border-radius: 8px;
    background: #222;
    color: white;
    border: 1px solid #444;
    z-index: 1000;
    font-size: 14px;
    text-align: center;
}

.app-message.error {
    border-color: #e74c3c;
    background: #2a1414;
}

.app-message.success {
    border-color: #2ecc71;
    background: #102318;
}

.app-message.info {
    border-color: #d4af37;
}


/* =========================
   PLAYER TICKET SCREEN
   ========================= */

.event {
    background: #222;
    padding: 10px;
    margin: 10px auto;
    max-width: 420px;
    border-radius: 6px;
}

.stage {
    background: #181818;
    border: 1px solid #333;
    padding: 10px;
    margin: 10px auto;
    max-width: 420px;
    border-radius: 6px;
    font-weight: bold;
}

.ticket-wrap {
    max-width: 420px;
    margin: 0 auto;
}

.player-top-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.player-settings-cog {
    width: 36px;
    height: 36px;
    font-size: 17px;
}

.subscription-status {
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
    text-align: left;
}

.subscription-status strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

.subscription-status span {
    display: block;
    font-size: 13px;
    line-height: 1.4;
}

.subscription-status.active {
    background: #102318;
    border: 1px solid #2ecc71;
}

.subscription-status.active strong {
    color: #2ecc71;
}

.subscription-status.inactive {
    background: #2a1414;
    border: 1px solid #e74c3c;
}

.subscription-status.inactive strong {
    color: #e74c3c;
}

.player-card-header {
    background: #151515;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 12px;
    margin: 0 0 12px;
    text-align: center;
}

.player-card-header h3 {
    margin: 0;
    color: #d4af37;
    font-size: 22px;
    line-height: 1.2;
}

.player-card-header p {
    margin: 4px 0 0;
    color: #bbb;
    font-size: 14px;
}

.ticket-title {
    margin: 10px 0 4px;
    font-size: 24px;
}

.ticket-subtitle {
    color: #bbb;
    margin: 0 0 12px;
}

.ticket-board {
    background: #151515;
    border: 2px solid #d4af37;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.15);
}

.row {
    display: flex;
    gap: 6px;
    margin: 6px 0;
    justify-content: center;
}

.ticket-board .row {
    display: grid;
    gap: 6px;
    margin: 0;
}

.ticket-board .row+.row {
    margin-top: 8px;
}

.ticket-board .row:nth-child(1),
.ticket-board .row:nth-child(3) {
    grid-template-columns: repeat(3, 1fr);
}

.ticket-board .row:nth-child(2) {
    grid-template-columns: repeat(4, 1fr);
}

.team-btn {
    flex: 1;
    min-width: 0;
    padding: 10px;
    border-radius: 6px;
    border: none;
    background: #2a2a2a;
    color: white;
}

.ticket-board .team-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 66px;
    padding: 7px 5px;
    font-size: 12px;
    line-height: 1.15;
    text-align: center;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
}

.ticket-board .row:nth-child(2) .team-btn {
    min-height: 72px;
}

.marked {
    background: #2ecc71 !important;
    color: black;
    font-weight: bold;
}

.ticket-board .marked {
    background: #2ecc71 !important;
    color: #07120b;
}

.claim-btn {
    margin-top: 10px;
    background: orange;
}

.ticket-wrap .claim-btn {
    margin: 10px 0 0;
}

.four-corners-btn {
    background: #9b59b6;
    color: white;
}

.claim-pause-box {
    background: #2a1d10;
    border: 1px solid #d4af37;
    color: white;
    padding: 10px;
    margin: 10px auto;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
}

.private-host-tabs {
    margin: 12px 0;
}


/* =========================
   PLAYER PROGRESS / PRIZES
   ========================= */

.progress-panel {
    background: #181818;
    border: 1px solid #333;
    padding: 10px;
    margin: 10px auto;
    max-width: 420px;
    border-radius: 6px;
}

.progress-title {
    font-weight: bold;
    margin: 0 0 4px;
}

.progress-detail {
    color: #bbb;
    margin: 0;
}

.prize-tracker {
    background: #181818;
    border: 1px solid #333;
    padding: 10px;
    margin: 10px auto;
    max-width: 420px;
    border-radius: 6px;
    text-align: left;
}

.prize-tracker h4 {
    margin: 0 0 8px;
    color: #d4af37;
    text-align: center;
}

.prize-tracker p {
    margin: 6px 0;
    color: white;
}

.prize-tracker .prize-won {
    color: #777;
    text-decoration: line-through;
}

.game-complete-box {
    background: #151515;
    border: 1px solid #d4af37;
    border-radius: 10px;
    padding: 12px;
    margin: 12px 0 0;
    text-align: center;
}

.game-complete-box strong {
    display: block;
    color: #d4af37;
    font-size: 18px;
    margin-bottom: 4px;
}

.game-complete-box span {
    display: block;
    color: #bbb;
    font-size: 13px;
}


/* =========================
   ADMIN MAIN LAYOUT
   ========================= */

.admin {
    background: #1c1c1c;
    max-width: 420px;
    margin: 15px auto;
    padding: 18px;
    border-radius: 12px;
    border: none;
}

.admin button {
    margin-top: 8px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.admin-header h3 {
    margin: 0;
    flex: 1;
    text-align: left;
}

.admin-header-centered {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
}

.admin-header-side {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.admin-header-title {
    margin: 0;
    text-align: center !important;
    color: white;
    font-size: 18px;
    line-height: 1.2;
}

.admin-header-back {
    margin: 0 !important;
}

.admin-title-block {
    flex: 1;
    text-align: left;
}

.admin-title-block h3 {
    margin: 0;
    color: white;
    font-size: 18px;
    line-height: 1.2;
}

.admin-title-block p {
    margin: 3px 0 0;
    color: #d4af37;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0;
    text-transform: uppercase;
}

.settings-cog {
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    background: #2a2a2a;
    color: white;
    border: 1px solid #444;
    border-radius: 50%;
    font-size: 18px;
}

.claim-focus-header {
    background: #2a1d10;
    border: 1px solid #d4af37;
    border-radius: 10px;
    padding: 12px;
    margin: 12px 0;
    text-align: left;
}

.claim-focus-header strong {
    display: block;
    color: #d4af37;
    font-size: 18px;
    margin-bottom: 4px;
}

.claim-focus-header span {
    display: block;
    color: white;
    font-size: 13px;
}


/* =========================
   OLD ADMIN TABS
   Keep this only while ticket switching still uses the tab style.
   ========================= */

.admin-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.admin-tabs button {
    position: relative;
    background: #2a2a2a;
    color: white;
}

.admin-tabs .active-tab {
    background: #d4af37;
    color: black;
}

.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    border-radius: 50%;
    background: #e74c3c;
    color: white;
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
}


/* =========================
   ADMIN SETUP WIZARD
   ========================= */

.setup-progress {
    background: #181818;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px;
    color: #d4af37;
    font-weight: bold;
}

.setup-section {
    background: #181818;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
    text-align: left;
}

.setup-section h3 {
    margin: 0 0 4px;
    color: #d4af37;
}

.setup-help {
    color: #bbb;
    font-size: 13px;
    line-height: 1.4;
    margin: 0 0 10px;
}

.setup-warning {
    color: #f39c12;
    font-size: 13px;
}

.setup-nav {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.setup-nav button {
    margin-top: 0;
}

.setup-nav .setup-back-btn {
    background: #333;
    color: white;
}

.setup-nav .setup-next-btn {
    background: #d4af37;
    color: #111;
}

.empty-state-box {
    background: #151515;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 14px;
    margin: 10px 0;
    text-align: left;
}

.empty-state-box strong {
    display: block;
    color: #d4af37;
    font-size: 15px;
    margin-bottom: 4px;
}

.empty-state-box span {
    display: block;
    color: #bbb;
    font-size: 13px;
    line-height: 1.4;
}

/* =========================
   LIVE ADMIN DASHBOARD
   ========================= */

.live-admin-dashboard {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.live-admin-card {
    background: #181818;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 12px;
    text-align: left;
}

.live-admin-card-main {
    border-color: rgba(212, 175, 55, 0.65);
}

.live-admin-card span {
    display: block;
    color: #bbb;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.live-admin-card strong {
    display: block;
    color: #d4af37;
    font-size: 24px;
    line-height: 1.1;
}

.live-admin-card p {
    margin: 4px 0 0;
    color: white;
    font-size: 13px;
}

.live-admin-card-won {
    opacity: 0.55;
}

.live-admin-card-won strong,
.live-admin-card-won p {
    color: #777;
    text-decoration: line-through;
}

/* =========================
   ADMIN TICKET PREVIEW
   ========================= */

.admin-ticket {
    background: #151515;
    border: 1px solid #d4af37;
    border-radius: 8px;
    padding: 10px;
    margin: 10px 0;
}

.admin-ticket .team-btn {
    pointer-events: none;
}


/* =========================
   PLAYER APPROVAL ROWS
   ========================= */

.player-admin-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 10px 0 12px;
}

.player-admin-stat {
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}

.player-admin-stat strong {
    display: block;
    color: #d4af37;
    font-size: 24px;
    line-height: 1;
}

.player-admin-stat span {
    display: block;
    color: #bbb;
    font-size: 12px;
    margin-top: 4px;
    text-transform: uppercase;
}

.section-label {
    color: #d4af37;
    font-size: 12px;
    font-weight: bold;
    margin: 14px 0 6px;
    text-transform: uppercase;
}

.player-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #1c1c1c;
    padding: 10px;
    margin: 6px 0;
    border-radius: 6px;
    text-align: left;
}

.player-row strong {
    display: block;
    color: white;
    font-size: 14px;
}

.player-row span {
    display: block;
    color: #bbb;
    font-size: 12px;
    margin-top: 2px;
}

.compact-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.compact-player-header .section-label {
    margin-bottom: 6px;
}

.compact-player-header span {
    color: #bbb;
    font-size: 12px;
}

.compact-bulk-actions {
    display: grid;
    grid-template-columns: 1fr 86px 64px;
    gap: 6px;
    margin: 6px 0 10px;
}

.compact-bulk-actions button {
    margin: 0;
    padding: 9px 6px;
    font-size: 11px;
}

.compact-player-row {
    background: #1c1c1c;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 9px;
    margin: 7px 0;
    text-align: left;
}

.compact-player-row.selected {
    border-color: #d4af37;
    background: #221d10;
}

.compact-player-top {
    display: flex;
    align-items: center;
    gap: 9px;
}

.compact-check {
    width: 30px;
    height: 30px;
    min-width: 30px;
    margin: 0;
    padding: 0;
    border-radius: 6px;
    background: #111;
    color: #111;
    border: 1px solid #555;
    font-size: 16px;
    line-height: 1;
}

.compact-check.active {
    background: #d4af37;
    color: #111;
    border-color: #d4af37;
}

.compact-player-info {
    flex: 1;
    min-width: 0;
}

.compact-player-info strong {
    display: block;
    color: white;
    font-size: 15px;
    line-height: 1.2;
}

.compact-player-info span {
    display: block;
    color: #bbb;
    font-size: 12px;
    margin-top: 2px;
}

.compact-player-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 8px;
}

.compact-player-actions button {
    margin: 0;
    padding: 9px 6px;
    font-size: 11px;
}


.pub-update-compose textarea {
    box-sizing: border-box;
    width: 100%;
    min-height: 96px;
    padding: 12px;
    margin: 10px 0;
    border: none;
    border-radius: 6px;
    font-family: Arial, sans-serif;
    resize: vertical;
}

.pub-update-card {
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px;
    margin: 8px 0;
    text-align: left;
}

.pub-update-card strong {
    display: block;
    color: white;
    font-size: 14px;
}

.pub-update-card p {
    margin: 6px 0;
    color: #ddd;
    font-size: 13px;
    line-height: 1.4;
}

.pub-update-card span {
    display: block;
    color: #777;
    font-size: 11px;
}

.pub-update-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.pub-update-actions button {
    width: auto;
    margin: 0;
    padding: 8px 10px;
    font-size: 11px;
}

.player-row-actions {
    display: flex;
    gap: 6px;
}

.player-row-actions button,
.player-row>button {
    width: auto;
    margin: 0;
    padding: 8px 10px;
    font-size: 11px;
}

.player-reject-btn {
    background: #333;
    color: white;
}

.player-row button {
    width: auto;
    min-width: 92px;
    margin: 0;
}

.admin-back-btn {
    margin: 12px 0 4px !important;
}

.admin-game-tools {
    display: flex;
    justify-content: flex-end;
    margin: 8px 0;
}

.admin-live-actions {
    margin: 12px 0;
}

.admin-live-actions button {
    margin-top: 0;
}



/* =========================
   TEAM / LEAGUE SELECTOR
   ========================= */

.team-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1c1c1c;
    padding: 10px;
    margin: 6px 0;
    border-radius: 6px;
    text-align: left;
}

.team-toggle input {
    width: auto;
    margin: 0;
}

.team-toggle span {
    flex: 1;
}

.league-box {
    background: #181818;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px;
    margin: 12px 0;
}

.league-actions {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.league-actions button {
    background: #333;
    color: white;
    font-size: 12px;
    padding: 8px;
}

.league-header {
    background: #222;
    color: white;
    text-align: left;
    margin-bottom: 8px;
}

.league-header:hover {
    background: #2f2f2f;
}

.league-title {
    margin: 0 0 8px;
    color: #d4af37;
    font-weight: bold;
    text-align: center;
}

.league-picker-button {
    background: #252525;
    color: white;
    border: 1px solid #444;
    text-align: left;
}

.league-picker-modal {
    text-align: left;
}

.league-picker-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.league-picker-option {
    background: #1c1c1c;
    color: white;
    border: 1px solid #333;
    text-align: left;
    margin: 0;
}

.league-picker-option.active {
    background: #d4af37;
    color: #111;
    border-color: #d4af37;
}

/* =========================
   LEAGUE EDITOR MODAL
   ========================= */

.league-editor-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 10px 10px;
    z-index: 1900;
}

.league-editor-modal {
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 34px);
    overflow-y: auto;
    background: #111;
    border: 1px solid #d4af37;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}

.league-editor-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.league-editor-header h3 {
    margin: 0 0 2px;
    color: #d4af37;
    text-align: left;
}

.league-editor-header .setup-help {
    margin: 0;
    text-align: left;
}

.modal-x-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    background: #2a2a2a;
    color: white;
    border: 1px solid #444;
    font-size: 22px;
    line-height: 1;
}

.team-chip-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 12px 0;
    padding-bottom: 72px;
}

.team-chip {
    min-height: 42px;
    padding: 8px;
    font-size: 12px;
    line-height: 1.2;
    background: #252525;
    color: white;
    border: 1px solid #444;
}

.team-chip.active {
    background: #d4af37;
    color: #111;
    border-color: #d4af37;
}

.league-editor-footer {
    position: sticky;
    bottom: 0;
    background: #111;
    border-top: 1px solid #333;
    padding: 10px 0 0;
}


/* =========================
   PRIZE INPUTS
   ========================= */

.prize-field {
    display: block;
    text-align: left;
    margin: 10px 0;
}

.prize-field span {
    display: block;
    color: #bbb;
    font-size: 13px;
    margin-bottom: 4px;
}

.money-input {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 6px;
}

.money-input span {
    color: #111;
    padding-left: 12px;
    padding-right: 3px;
    font-weight: bold;
    line-height: 1;
}

.money-input input {
    margin: 0;
    border-radius: 0;
    padding-left: 4px;
    padding-top: 10px;
    padding-bottom: 14px;
    line-height: 1;
}


/* =========================
   SETTINGS MODAL
   ========================= */

.settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 120px 18px 18px;
    z-index: 1800;
}

.settings-modal {
    width: 100%;
    max-width: 320px;
    background: #111;
    border: 1px solid #d4af37;
    border-radius: 12px;
    padding: 18px;
    text-align: center;
}

.settings-modal h3 {
    margin: 0 0 14px;
}

.settings-modal button {
    margin-top: 10px;
}

.settings-modal button:first-of-type {
    background: #333;
    color: white;
}

.settings-close-btn {
    background: transparent;
    color: #d4af37;
    border: 1px solid rgba(212, 175, 55, 0.45);
}

.settings-danger-btn {
    background: #8e2a2a;
    color: white;
    border: 1px solid #e74c3c;
}

.settings-box {
    background: #181818;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px;
    margin: 10px 0;
}

.logout-btn {
    margin-top: 22px !important;
    background: #333;
    color: white;
}

.app-settings-section button {
    background: #d4af37;
    color: #111;
}

.app-settings-section .logout-btn {
    background: #333;
    color: white;
}

.marker-colour-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin: 10px 0 14px;
}

.marker-colour {
    height: 42px;
    margin: 0;
    border: 2px solid #333;
    border-radius: 8px;
}

.marker-colour.active {
    border-color: white;
    box-shadow: 0 0 0 2px #d4af37;
}

.hub-back-arrow {
    width: 38px;
    height: 38px;
    padding: 0;
    margin: 10px 0;
    border-radius: 50%;
    background: #2a2a2a;
    color: #d4af37;
    border: 1px solid #444;
    font-size: 28px;
    line-height: 1;
}

.player-join-header {
    max-width: 320px;
    margin: 0 auto 12px;
}

.player-join-back {
    display: block;
    margin: 0 0 10px 0 !important;
}

.player-board-panel {
    background: #151515;
    border: 1px solid #d4af37;
    border-radius: 10px;
    padding: 12px;
    margin-top: 10px;
    text-align: left;
}

/* =========================
   ADMIN / PLAYER HUB TILES
   ========================= */

.admin:has(.admin-hub-grid) {
    width: 320px;
    max-width: 320px;
    padding: 25px;
}

.admin-hub-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 12px 0;
}

.admin-hub-tile {
    position: relative;
    box-sizing: border-box;
    min-height: 72px;
    height: 72px;
    margin: 0;
    padding: 12px;
    background: #151515;
    color: #d4af37;
    border: 1px solid rgba(212, 175, 55, 0.45);
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    line-height: 1.2;
    text-align: center;
}

.admin-hub-tile span {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}

.admin-hub-tile.active {
    background: #d4af37;
    color: #111;
    border-color: #d4af37;
}

.admin-hub-tile:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.hub-tile-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #e74c3c;
    color: white;
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
}

/* =========================
   CONTINUE ADMIN BOX
   ========================= */

.continue-admin {
    background: #181818;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px;
    margin-top: 18px;
}

.continue-admin p {
    color: #bbb;
    margin: 0 0 8px;
}

.continue-admin button {
    margin-top: 6px;
}


/* =========================
   WIN / CHECKING POPUPS
   ========================= */

.win-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    z-index: 2000;
}

.win-popup {
    width: 100%;
    max-width: 360px;
    background: #111;
    border: 2px solid #d4af37;
    border-radius: 12px;
    padding: 22px;
    text-align: center;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.25);
}

.win-popup h2 {
    margin: 0 0 8px;
    color: #d4af37;
    font-size: 28px;
}

.win-popup p {
    color: white;
    font-size: 17px;
    line-height: 1.4;
    margin: 0 0 18px;
}

.win-popup button {
    background: #d4af37;
    color: #111;
}

.checking-ticket-popup h2 {
    color: #f39c12;
}

/* =========================
   MOBILE LAYOUT
   ========================= */

@media (max-width: 420px) {
    #card {
        padding: 8px;
    }

    .ticket-title {
        font-size: 20px;
    }

    .stage,
    .progress-panel,
    .prize-tracker {
        margin: 8px auto;
        padding: 8px;
    }

    .ticket-board {
        padding: 7px;
    }

    .ticket-board .team-btn {
        min-height: 60px;
        font-size: 11px;
        padding: 6px 4px;
    }

    .ticket-board .row:nth-child(2) .team-btn {
        min-height: 66px;
    }

    .row,
    .ticket-board .row {
        gap: 5px;
    }


}
