/* ============================================================
   BRAND FOUNDATION - tixs.ca brand guidelines
   ------------------------------------------------------------
   Color palette and typography are applied globally (every page shares
   this stylesheet), since a brand identity should be consistent site-wide,
   not just on the homepage. The one deliberate exception: game-specific
   functional colors (Qwixx's red/yellow/green/blue rows, Cribbage peg
   colors, win/skunk badges, etc.) are left alone - those colors carry
   actual meaning in the game itself, not just decoration, so overriding
   them with the brand palette would make those games harder to read
   rather than more on-brand.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600;700&family=Roboto:wght@400;500&display=swap');

:root {
    --color-teal: #00BCD4;
    --color-teal-dark: #0097A7;
    --color-dark: #212121;
    --color-orange: #FF9800;
    --color-orange-dark: #E68900;
    --font-heading: 'Poppins', Arial, sans-serif;
    --font-body: 'Roboto', Arial, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-dark);
}

/* ============================================================
   MOBILE-FIRST FOUNDATION
   ------------------------------------------------------------
   Everything below this block assumes border-box sizing (so padding
   never silently pushes an element wider than intended - a common
   cause of horizontal overflow/scrolling on narrow screens) and that
   the page itself never scrolls sideways. Individual scrollable
   tables opt back into horizontal scrolling deliberately via their
   own overflow-x:auto wrappers, so this doesn't hide anything.
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%; /* stop iOS auto-enlarging text on rotate */
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Every text input/select/textarea needs to be at least 16px on mobile,
   or iOS Safari will zoom in automatically when it's focused - a well-known
   and easily-avoided mobile annoyance. */
input, select, textarea, button {
    font-size: 16px;
    font-family: inherit;
}

body {
    font-family: var(--font-body);
    font-size: 16px; /* Base font size */
    margin: 0;
    background: #f7f7f7;
    color: var(--color-dark);
}

@media screen and (max-width: 600px) {
    body {
        font-size: 14px; /* Smaller font size for mobile devices */
    }
}

.container {
    margin: 20px auto;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: 80%; /* Use percentage for width */
    max-width: 960px; /* Maximum width */
    background: #fff;
}

/* Tablet: a bit more breathing room used, less wasted margin */
@media screen and (max-width: 900px) {
    .container {
        width: 92%;
    }
}

/* Phone: full-bleed edge to edge with a small gutter, since 80% of a
   360px phone only leaves ~290px to work with otherwise */
@media screen and (max-width: 600px) {
    .container {
        width: 100%;
        margin: 0 auto;
        padding: 14px;
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
}

.title-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.title-logo {
    width: 150px;
    height: 150px;
    margin-right: 10px;
}

@media screen and (max-width: 600px) {
    .title-logo {
        width: 100px;
        height: 100px;
    }
}

.player-input h2 {
    margin: 0;
}

/* ---------- Dashboard game picker / featured games carousel ---------- */
.game-picker {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 24px;
}

.game-card {
    display: block;
    width: 220px;
    padding: 24px 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    background: #fafafa;
    transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}

.game-card:hover {
    box-shadow: 0 6px 16px rgba(0,188,212,0.25);
    transform: translateY(-2px);
    background: #fff;
    border-color: var(--color-teal);
}

/* ---------- Game availability (admin on/off switch) ---------- */
.coming-soon-banner {
    background: var(--color-orange);
    color: #fff;
    text-align: center;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 600;
}

.game-card-disabled {
    opacity: 0.7;
    border-style: dashed;
    border-color: var(--color-orange);
    position: relative;
}

.game-card-disabled:hover {
    border-color: var(--color-orange-dark);
}

.coming-soon-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--color-orange);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 10px;
    letter-spacing: 0.02em;
}

.game-enabled-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.solitaire-coming-soon {
    opacity: 0.6;
    cursor: default;
}
.solitaire-coming-soon:hover {
    box-shadow: none;
    transform: none;
    background: #fafafa;
    border-color: #ccc;
}

.game-card-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-teal-dark);
    margin-bottom: 8px;
}

.game-card-desc {
    font-size: 0.9rem;
    color: #666;
}

.brand-cta-btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--color-orange);
    color: #fff;
    text-decoration: none;
    border-radius: 24px;
    font-family: var(--font-heading);
    font-weight: 600;
    box-shadow: 0 3px 8px rgba(255,152,0,0.35);
    transition: background-color 0.15s, transform 0.15s;
    margin: 4px;
}

.brand-cta-btn:hover {
    background: var(--color-orange-dark);
    transform: translateY(-1px);
}

.brand-cta-btn-secondary {
    background: var(--color-teal);
    box-shadow: 0 3px 8px rgba(0,188,212,0.35);
}

.brand-cta-btn-secondary:hover {
    background: var(--color-teal-dark);
}

.carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.carousel-track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 6px 4px 14px;
    flex: 1;
    /* Hide the scrollbar since the arrows/dots are the intended controls -
       native swipe still works perfectly, this just tidies the look. */
    scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-slide {
    flex: 0 0 auto;
    width: 240px;
    scroll-snap-align: center;
}

.carousel-arrow {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--color-teal);
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: background-color 0.15s;
}

.carousel-arrow:hover {
    background: var(--color-teal-dark);
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.carousel-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: none;
    background: #ddd;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.15s, transform 0.15s;
}

.carousel-dot.active {
    background: var(--color-orange);
    transform: scale(1.3);
}

@media screen and (max-width: 600px) {
    .carousel-arrow {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }
    .carousel-slide {
        width: 200px;
    }
}

/* Top navigation bar shown on every page once logged in */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    background: var(--color-teal);
    color: #fff;
    padding: 12px 20px;
    gap: 14px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    order: 0;
}

.navbar-logo {
    height: 34px;
    width: 34px;
    border-radius: 6px;
    object-fit: cover;
    display: block;
}

.navbar .nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar .nav-links a {
    background: var(--color-orange);
    color: #fff;
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    padding: 8px 14px;
    border-radius: 18px;
    transition: background-color 0.15s;
}

.navbar .nav-links a:hover {
    background: var(--color-orange-dark);
}

.navbar .nav-links a.active {
    background: var(--color-dark);
}

.navbar .nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    order: 2;
}

.nav-profile-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-decoration: none;
}

.nav-profile-link:hover span {
    text-decoration: underline;
}

.nav-dropdown {
    position: relative;
}

.nav-hamburger-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 1.2rem;
    line-height: 1;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
}

.nav-hamburger-btn:hover {
    background: rgba(255,255,255,0.3);
}

.nav-dropdown-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    color: var(--color-dark);
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
    min-width: 190px;
    overflow: hidden;
    z-index: 100;
}

.nav-dropdown-menu.open {
    display: flex;
}

.nav-dropdown-menu a,
.nav-dropdown-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    background: none;
    border: none;
    border-bottom: 1px solid #eee;
    color: var(--color-dark);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
}

.nav-dropdown-menu a:last-child,
.nav-dropdown-menu button:last-child {
    border-bottom: none;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu button:hover {
    background: #f5f5f5;
}

.nav-dropdown-menu a.active {
    font-weight: bold;
    color: var(--color-teal-dark);
}

.nav-dropdown-logout {
    color: #c0392b !important;
}

/* Tablet/phone: user info becomes its own full-width row, and the nav
   links become a horizontally-scrollable pill strip underneath - a
   thumb-friendly pattern instead of cramming 7 buttons into one line or
   letting them clip off-screen. The brand logo stays pinned top-left
   (order: 0) regardless of how the other two rows stack. */
@media screen and (max-width: 780px) {
    .navbar {
        padding: 10px 14px;
    }

    .navbar .nav-user {
        order: 1;
        width: 100%;
        justify-content: space-between;
    }

    .navbar .nav-links {
        order: 2;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }

    .navbar .nav-links a {
        flex-shrink: 0;
    }

    .navbar .nav-user span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 45vw;
    }
}

.avatar-img {
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
    vertical-align: middle;
    border: 1px solid rgba(255,255,255,0.4);
}

.avatar-fallback {
    border-radius: 50%;
    background: #5d7a99;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    vertical-align: middle;
}

.navbar button {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
}

.navbar button:hover {
    background: #c0392b;
}

#scoreTable {
    overflow-x: auto; /* Allows horizontal scrolling on small screens */
}

#scoreTable table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

th:first-child, td:first-child {
    text-align: left;
    font-weight: bold;
}

th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

td input[type="number"] {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 4px;
}

tr.winner-row td {
    background: #fff8dc;
}

.info-container {
    display: flex;
    justify-content: space-between;
}

@media screen and (max-width: 600px) {
    .info-container {
        flex-direction: column;
    }
}

#scoreLegend, #rules {
    border: 1px solid #ccc;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 5px;
}

#scoreLegend {
    max-width: 200px;
    margin-right: 20px;
}

#rules {
    text-align: left;
    flex-grow: 1;
}

.in-game-scoring-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.72rem;
}

.in-game-scoring-table th, .in-game-scoring-table td {
    border: 1px solid #ddd;
    padding: 3px 5px;
    text-align: left;
}

.in-game-scoring-table th:last-child, .in-game-scoring-table td:last-child {
    text-align: right;
}

@media screen and (max-width: 600px) {
    #scoreLegend, #rules {
        max-width: 100%;
        margin-right: 0;
    }
}

img {
    max-width: 100%; /* Ensures image is not larger than its container */
    height: auto; /* Keeps the aspect ratio intact */
}

/* ---------- Auth pages (login / register) ---------- */
.auth-container {
    margin: 60px auto;
    padding: 30px;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: 90%;
    max-width: 380px;
    background: #fff;
    text-align: center;
}

.auth-container label {
    display: block;
    text-align: left;
    margin-top: 12px;
    margin-bottom: 4px;
    font-weight: bold;
}

.auth-container input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.auth-container button {
    margin-top: 20px;
    width: 100%;
    padding: 10px;
    background: #2c3e50;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.auth-container button:hover {
    background: #1a252f;
}

.auth-switch {
    margin-top: 16px;
    font-size: 0.9rem;
}

.error-message {
    color: #c0392b;
    margin-top: 12px;
    font-size: 0.9rem;
    min-height: 1.2em;
}

.success-message {
    color: #27ae60;
    margin-top: 12px;
    font-size: 0.9rem;
    min-height: 1.2em;
}

.warning-message {
    color: #8a6d1f;
    background: #fff8dc;
    border: 1px solid #e6d17a;
    border-radius: 4px;
    padding: 8px 10px;
    margin-top: 12px;
    font-size: 0.9rem;
}

.warning-message:empty {
    display: none;
}

/* ---------- Add player row ---------- */
.add-player-row {
    display: flex;
    gap: 8px;
    align-items: center;
    position: relative;
    flex-wrap: wrap;
}

.add-player-row input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 90px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    z-index: 10;
    max-height: 150px;
    overflow-y: auto;
}

.autocomplete-list div {
    padding: 8px;
    cursor: pointer;
    text-align: left;
}

.autocomplete-list div:hover {
    background: #f0f0f0;
}

/* ---------- Game code banner ---------- */
.game-code-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    background: #eef6ff;
    border: 1px solid #b8d9f7;
    border-radius: 5px;
    padding: 12px 16px;
    margin-top: 12px;
}

.game-code-banner .code {
    font-size: 1.6rem;
    font-weight: bold;
    letter-spacing: 3px;
    color: #2c3e50;
}

.game-code-banner .label {
    font-size: 0.85rem;
    color: #555;
}

.viewer-note {
    background: #fff8dc;
    border: 1px solid #e6d17a;
    border-radius: 5px;
    padding: 10px 16px;
    margin-top: 12px;
}

/* ---------- Buttons ---------- */
button {
    padding: 10px 16px;
    border-radius: 4px;
    border: 1px solid #ccc;
    cursor: pointer;
    background: #fff;
    margin: 2px 0;
}

button:hover {
    background: #f0f0f0;
}

#finishGameBtn {
    background: #e67e22;
    color: #fff;
    border: none;
}

#finishGameBtn:hover {
    background: #d35400;
}

.danger-btn {
    background: #fff;
    color: #c0392b;
    border: 1px solid #c0392b;
}

.danger-btn:hover {
    background: #c0392b;
    color: #fff;
}

.solitaire-win-btn {
    background: #27ae60;
    color: #fff;
    border: none;
    font-weight: bold;
}
.solitaire-win-btn:hover { background: #1e8449; }

.solitaire-loss-btn {
    background: #fff;
    color: #c0392b;
    border: 1px solid #c0392b;
    font-weight: bold;
}
.solitaire-loss-btn:hover { background: #fdecea; }

.solitaire-result-win { color: #1e8449; font-weight: bold; }
.solitaire-result-loss { color: #c0392b; }

/* ---------- Feature requests ---------- */
.feature-card {
    display: flex;
    gap: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 14px;
    background: #fafafa;
}

.feature-vote-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    width: 44px;
}

.feature-vote-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 32px;
    height: 28px;
    cursor: pointer;
    color: #888;
    font-size: 0.9rem;
}

.feature-vote-btn.voted {
    background: var(--color-teal);
    color: #fff;
    border-color: var(--color-teal);
}

.feature-vote-score {
    font-weight: bold;
    font-size: 1rem;
}

.feature-body {
    flex: 1;
    min-width: 0;
}

.feature-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.feature-status-badge {
    font-size: 0.75rem;
    background: #eef2f5;
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.feature-desc {
    margin: 8px 0;
    color: #444;
    white-space: pre-wrap;
}

.feature-meta {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 8px;
}

.feature-comments-toggle {
    background: none;
    border: none;
    color: var(--color-teal-dark);
    cursor: pointer;
    padding: 4px 0;
    font-size: 0.85rem;
}

.feature-comments-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.feature-comment {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.feature-comment p {
    margin: 4px 0 0;
}

.feature-comment-date {
    font-size: 0.75rem;
    color: #999;
    margin-left: 8px;
}

.feature-admin-tag {
    font-size: 0.7rem;
    background: var(--color-orange);
    color: #fff;
    padding: 1px 6px;
    border-radius: 8px;
}

.feature-comments-locked-note {
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
}

.feature-admin-controls {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #ccc;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* ---------- Support tickets ---------- */
.support-thread {
    margin-top: 16px;
}

.support-message {
    padding: 10px 14px;
    border-radius: 8px;
    background: #f5f5f5;
    margin-bottom: 10px;
}

.support-message-admin {
    background: #eaf6f8;
    border-left: 3px solid var(--color-teal);
}

.support-message p {
    margin: 6px 0 0;
    white-space: pre-wrap;
}

/* ---------- Leaderboard / Stats tables ---------- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.data-table th, .data-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}

@media screen and (max-width: 600px) {
    .data-table th, .data-table td {
        padding: 6px 8px;
        font-size: 0.8rem;
    }
}

.data-table th {
    background: #2c3e50;
    color: #fff;
}

.data-table tr:nth-child(even) {
    background: #f7f7f7;
}

.stat-cards {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.stat-card {
    flex: 1;
    min-width: 100px;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 16px;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2c3e50;
}

.stat-card .stat-label {
    color: #666;
    font-size: 0.85rem;
    margin-top: 4px;
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 100;
}

.toast.show {
    opacity: 1;
}

/* ---------- Cribbage board ---------- */
.cribbage-board {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
}

.cribbage-player-card {
    flex: 1;
    min-width: 220px;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 16px;
    background: #fafafa;
}

.cribbage-player-card.is-winner {
    background: #fff8dc;
    border-color: #e6d17a;
}

.cribbage-player-name {
    font-weight: bold;
    font-size: 1.05rem;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cribbage-score-value {
    font-size: 2.2rem;
    font-weight: bold;
    color: #2c3e50;
    text-align: center;
    margin: 8px 0;
}

.cribbage-progress-track {
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 12px;
}

.cribbage-progress-fill {
    height: 100%;
    background: #2c7a4b;
    transition: width 0.2s;
}

.cribbage-quick-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.cribbage-quick-buttons button {
    flex: 1;
    min-width: 38px;
    padding: 8px 4px;
    font-weight: bold;
}

.cribbage-custom-row {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.cribbage-custom-row input {
    width: 60px;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
}

.cribbage-final-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    text-align: center;
    font-size: 1.2rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin: 8px 0;
}

.skunk-badge, .double-skunk-badge, .winner-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

.winner-badge {
    background: #f1c40f;
    color: #7a5c00;
}

.skunk-badge {
    background: #f5cba7;
    color: #935116;
}

.double-skunk-badge {
    background: #f1948a;
    color: #78281f;
}

.cribbage-setup-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.cribbage-setup-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
}

.cribbage-events-log {
    margin-top: 16px;
    font-size: 0.85rem;
    color: #555;
    max-height: 140px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 8px 10px;
}

/* ---------- Clue detective sheet ---------- */
.clue-sheet {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 16px;
}

.clue-categories {
    flex: 2;
    min-width: 280px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.clue-category {
    flex: 1;
    min-width: 160px;
}

.clue-category h3 {
    background: #2c3e50;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.clue-category ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.clue-category li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-weight: bold;
    color: #2c3e50;
}

.clue-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border: 3px solid #7a8a99;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
    background: #eef2f5;
    user-select: none;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.08);
    transition: background-color 0.15s, border-color 0.15s;
}

.clue-marker:hover {
    background: #dfe8ee;
    border-color: #4a6a85;
}

.clue-marker.crossed {
    border-color: #c0392b;
    color: #c0392b;
    background: #fdecea;
    box-shadow: none;
}
.clue-marker.crossed::after { content: "✕"; }

.clue-marker.questioned {
    border-color: #e67e22;
    color: #e67e22;
    background: #fdf2e3;
    box-shadow: none;
}
.clue-marker.questioned::after { content: "?"; }

.clue-marker.checked {
    border-color: #27ae60;
    color: #27ae60;
    background: #eafaf1;
    box-shadow: none;
}
.clue-marker.checked::after { content: "✓"; }

.clue-rules-section {
    flex: 1;
    min-width: 220px;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 12px 16px;
    background: #fafafa;
}

.clue-rules-section h3 {
    margin-top: 0;
}

.clue-rules-section ul {
    padding-left: 20px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.clue-rules-section li {
    margin-bottom: 4px;
}

.clue-players-list {
    font-size: 0.9rem;
    color: #555;
    margin-top: 6px;
}

/* ---------- Frustration Rummy trick grid ---------- */
#frustrationTable {
    overflow-x: auto;
    margin-top: 16px;
}

#frustrationTable table {
    width: 100%;
    border-collapse: collapse;
}

#frustrationTable th, #frustrationTable td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

#frustrationTable th {
    background: #2c3e50;
    color: #fff;
}

.trick-name-cell {
    text-align: left !important;
    font-size: 0.85rem;
    background: #f7f7f7;
    min-width: 160px;
}

.trick-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid #7a8a99;
    background: #eef2f5;
    cursor: pointer;
    font-weight: bold;
    color: transparent;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.08);
    transition: background-color 0.15s, border-color 0.15s;
}

.trick-marker:not(.locked):hover {
    background: #dfe8ee;
    border-color: #4a6a85;
}

.trick-marker.completed {
    background: #2c7a4b;
    border-color: #1e5c37;
    color: #fff;
    box-shadow: none;
}

.trick-marker.completed::after {
    content: "✓";
}

.trick-marker.locked {
    cursor: default;
    opacity: 0.6;
}

.trick-total-row td {
    font-weight: bold;
    background: #eef6ff;
}

/* ---------- Dutch Blitz round table ---------- */
#dutchBlitzTable {
    overflow-x: auto;
    margin-top: 16px;
}

#dutchBlitzTable table {
    width: 100%;
    border-collapse: collapse;
}

#dutchBlitzTable th, #dutchBlitzTable td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    font-size: 0.9rem;
}

#dutchBlitzTable th {
    background: #2c3e50;
    color: #fff;
}

.dutchblitz-total-row td {
    font-weight: bold;
    background: #eef6ff;
}

.round-detail {
    font-size: 0.8rem;
    color: #666;
}

.add-round-panel {
    margin-top: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 14px;
    background: #fafafa;
}

.add-round-panel h3 {
    margin-top: 0;
}

.add-round-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.add-round-row .player-name {
    width: 140px;
    font-weight: bold;
}

.add-round-row label {
    font-size: 0.85rem;
    color: #555;
}

.add-round-row input {
    width: 60px;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
}

/* ---------- Cover Your Assets round table ---------- */
#coverAssetsTable {
    overflow-x: auto;
    margin-top: 16px;
}

#coverAssetsTable table {
    width: 100%;
    border-collapse: collapse;
}

#coverAssetsTable th, #coverAssetsTable td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    font-size: 0.9rem;
}

#coverAssetsTable th {
    background: #2c3e50;
    color: #fff;
}

.coverassets-total-row td {
    font-weight: bold;
    background: #eef6ff;
}

.target-reached-banner {
    background: #fff8dc;
    border: 1px solid #e6d17a;
    border-radius: 5px;
    padding: 10px 16px;
    margin-top: 12px;
    font-weight: bold;
    color: #7a5c00;
}

/* ---------- Flip 7 round table ---------- */
#flip7Table {
    overflow-x: auto;
    margin-top: 16px;
}

#flip7Table table {
    width: 100%;
    border-collapse: collapse;
}

#flip7Table th, #flip7Table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    font-size: 0.9rem;
}

#flip7Table th {
    background: #2c3e50;
    color: #fff;
}

.flip7-total-row td {
    font-weight: bold;
    background: #eef6ff;
}

.flip7-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    background: #d5f5e3;
    color: #1e8449;
    margin-left: 4px;
}

.add-round-row .flip7-checkbox-label {
    font-size: 0.85rem;
    color: #555;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ---------- Farkle round table ---------- */
#farkleTable {
    overflow-x: auto;
    margin-top: 16px;
}

#farkleTable table {
    width: 100%;
    border-collapse: collapse;
}

#farkleTable th, #farkleTable td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    font-size: 0.9rem;
}

#farkleTable th {
    background: #2c3e50;
    color: #fff;
}

.farkle-total-row td {
    font-weight: bold;
    background: #eef6ff;
}

.farkle-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    background: #f5cba7;
    color: #935116;
    margin-left: 4px;
}

/* ---------- Rules pages ---------- */
.rules-page h2 {
    color: #2c3e50;
    margin-top: 28px;
    border-bottom: 2px solid #eee;
    padding-bottom: 6px;
}

.rules-page h2:first-of-type {
    margin-top: 0;
}

.rules-page ul, .rules-page ol {
    line-height: 1.7;
}

.rules-page table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.rules-page th, .rules-page td {
    border: 1px solid #ddd;
    padding: 8px 10px;
    text-align: left;
}

.rules-page th {
    background: #2c3e50;
    color: #fff;
}

.rules-page .app-note {
    background: #eef6ff;
    border: 1px solid #b8d9f7;
    border-radius: 6px;
    padding: 14px 18px;
    margin: 20px 0;
}

.rules-page .app-note h3 {
    margin-top: 0;
    color: #2c3e50;
}

.instructions-btn {
    background: #fff;
    border: 1px solid #2c3e50;
    color: #2c3e50;
    font-weight: bold;
}

.instructions-btn:hover {
    background: #2c3e50;
    color: #fff;
}

/* ---------- Minesweeper ---------- */
.ms-difficulty-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.ms-difficulty-row select {
    padding: 8px;
}

#flagModeToggle.active {
    background: var(--color-orange);
    color: #fff;
    border-color: var(--color-orange);
}

.ms-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: #bdbdbd;
    border: 3px solid #7a7a7a;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 4px;
}

.ms-counter {
    background: #000;
    color: #e74c3c;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.4rem;
    letter-spacing: 2px;
    padding: 4px 8px;
    border-radius: 3px;
    min-width: 56px;
    text-align: center;
}

.ms-face-btn {
    font-size: 1.4rem;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 6px;
    line-height: 1;
}

.ms-grid-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #9e9e9e;
    border: 3px solid #7a7a7a;
    border-radius: 6px;
    padding: 8px;
}

.ms-grid {
    display: grid;
    gap: 1px;
    width: max-content;
    margin: 0 auto;
}

.ms-cell {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid #888;
    background: #c8c8c8;
    font-size: 0.85rem;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.ms-cell.ms-revealed {
    background: #e0e0e0;
    border: 1px solid #bbb;
    cursor: default;
}

.ms-cell.ms-flagged {
    background: #c8c8c8;
}

.ms-cell.ms-mine {
    background: #e0e0e0;
}

.ms-cell.ms-mine-hit {
    background: #e74c3c;
}

.ms-num-1 { color: #2874a6; }
.ms-num-2 { color: #1e8449; }
.ms-num-3 { color: #c0392b; }
.ms-num-4 { color: #17235e; }
.ms-num-5 { color: #78281f; }
.ms-num-6 { color: #0e6655; }
.ms-num-7 { color: #1c1c1c; }
.ms-num-8 { color: #707070; }

@media screen and (max-width: 600px) {
    .ms-cell {
        width: 22px;
        height: 22px;
        font-size: 0.75rem;
    }
    .ms-counter {
        font-size: 1.1rem;
        min-width: 46px;
    }
}

/* ---------- SkiFree ---------- */
.sf-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.sf-speed-label {
    text-align: center;
    font-weight: bold;
    font-size: 0.85rem;
    min-height: 1.2em;
    margin: 0 0 6px;
}

.sf-counter {
    font-weight: bold;
    background: #eaf4fb;
    border: 1px solid #b8d9f7;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 0.95rem;
}

.sf-canvas-wrapper {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
    border: 3px solid #7a7a7a;
    border-radius: 6px;
    overflow: hidden;
    line-height: 0;
}

.sf-canvas-wrapper canvas {
    width: 100%;
    height: auto;
    display: block;
}

.sf-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    gap: 14px;
}

.sf-overlay p {
    font-weight: bold;
    color: #212121;
    font-size: 1rem;
}

.sf-touch-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    max-width: 400px;
    margin: 14px auto 0;
}

.sf-touch-btn {
    flex: 1;
    padding: 16px;
    font-size: 1rem;
    font-weight: bold;
    background: var(--color-teal);
    color: #fff;
    border: none;
    border-radius: 8px;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.sf-touch-btn:active {
    background: var(--color-teal-dark);
}

.sf-speed-controls {
    margin-top: 8px;
}

.sf-boost-btn {
    background: var(--color-orange);
}
.sf-boost-btn:active {
    background: var(--color-orange-dark);
}

.sf-slow-btn {
    background: #7a7a7a;
}
.sf-slow-btn:active {
    background: #5a5a5a;
}

@media screen and (min-width: 900px) {
    .sf-touch-controls {
        display: none; /* keyboard controls are enough on desktop */
    }
}

/* ---------- Klondike Solitaire ---------- */
.kl-container {
    max-width: 900px;
}

.kl-toolbar {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.kl-hint {
    text-align: center;
    color: #666;
    font-size: 0.85rem;
    min-height: 1.2em;
    margin: 4px 0 14px;
}

.kl-board {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
}

.kl-top-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    min-width: 520px;
    margin-bottom: 16px;
}

.kl-pile-group {
    display: flex;
    gap: 8px;
}

.kl-pile {
    width: 60px;
    height: 84px;
    position: relative;
}

.kl-empty-pile {
    border: 2px dashed #bbb;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 1.4rem;
    cursor: pointer;
}

.kl-tableau {
    display: flex;
    gap: 10px;
    min-width: 520px;
}

.kl-column {
    position: relative;
    width: 60px;
    min-height: 260px;
    cursor: pointer;
}

.kl-empty-column {
    border: 2px dashed #bbb;
    border-radius: 6px;
}

.kl-card {
    position: absolute;
    left: 0;
    width: 58px;
    height: 82px;
    background: #fff;
    border: 1px solid #333;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #1c1c1c;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.kl-card.kl-red {
    color: #c0392b;
}

.kl-card-back {
    background: repeating-linear-gradient(45deg, var(--color-teal), var(--color-teal) 6px, var(--color-teal-dark) 6px, var(--color-teal-dark) 12px);
    border: 1px solid #333;
    cursor: default;
}

.kl-card-corner {
    position: absolute;
    font-size: 0.85rem;
    line-height: 1;
}
.kl-card-corner-tl { top: 4px; left: 4px; }
.kl-card-corner-br { bottom: 4px; right: 4px; transform: rotate(180deg); }

.kl-card-suit-big {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.4rem;
}

.kl-card.kl-selected {
    outline: 3px solid var(--color-orange);
    outline-offset: -2px;
    box-shadow: 0 3px 8px rgba(255,152,0,0.5);
}

.kl-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 200;
    text-align: center;
    padding: 20px;
}

.kl-overlay p {
    color: #fff;
    font-size: 1.2rem;
    font-weight: bold;
    max-width: 320px;
}

@media screen and (max-width: 600px) {
    .kl-pile, .kl-column, .kl-card {
        width: 46px;
    }
    .kl-card {
        height: 66px;
    }
    .kl-card-suit-big {
        font-size: 1.1rem;
    }
    .kl-card-corner {
        font-size: 0.7rem;
    }
}

/* ---------- Battleship ---------- */
.bs-container {
    max-width: 700px;
}

.bs-board-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 10px 0;
}

.bs-grid {
    display: grid;
    gap: 2px;
    width: max-content;
    margin: 0 auto;
    background: #b8d9f7;
    padding: 4px;
    border-radius: 6px;
}

.bs-grid-small {
    opacity: 0.95;
}

.bs-cell {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid #7fa8d0;
    background: #eaf4fb;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
}

.bs-cell:disabled {
    cursor: default;
}

.bs-cell-ship {
    background: #7a7a7a;
}

.bs-cell-hit {
    background: #f7c948;
}

.bs-cell-sunk {
    background: #e74c3c;
    color: #fff;
}

.bs-cell-miss {
    background: #cfe8fa;
    color: #7fa8d0;
}

@media screen and (max-width: 480px) {
    .bs-cell {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }
}

.bs-ship-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 10px;
}

.bs-ship-btn {
    background: #eee;
    border: 1px solid #ccc;
}

.bs-ship-btn.bs-ship-selected {
    background: var(--color-orange);
    color: #fff;
    border-color: var(--color-orange);
}

.bs-ship-btn.bs-ship-placed {
    background: #d6ecd9;
    border-color: #7fbf8a;
}

.bs-place-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 6px;
}

.bs-turn-indicator {
    text-align: center;
    font-weight: bold;
    padding: 10px;
    border-radius: 6px;
    background: #eee;
}

.bs-turn-indicator.bs-my-turn {
    background: var(--color-orange);
    color: #fff;
}

.bs-players-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 12px;
}

.bs-player-btn {
    background: #eee;
    border: 1px solid #ccc;
    padding: 8px 12px;
    text-align: center;
}

.bs-player-btn.bs-player-selected {
    background: var(--color-teal);
    color: #fff;
    border-color: var(--color-teal);
}

.bs-player-btn.bs-player-eliminated {
    opacity: 0.5;
    text-decoration: line-through;
}

/* ---------- Spider Solitaire (reuses .kl-card etc. from Klondike) ---------- */
.sp-sticky-bar {
    position: sticky;
    top: 0;
    z-index: 60;
    background: #f7f7f7;
    padding-top: 6px;
    padding-bottom: 4px;
    margin-bottom: 6px;
    border-bottom: 1px solid #e0e0e0;
}

.sp-progress {
    text-align: center;
    font-weight: bold;
    color: var(--color-teal-dark);
    margin: 0 0 8px;
}

.sp-stock-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.sp-stock-label {
    font-size: 0.85rem;
    color: #666;
}

.sp-tableau {
    display: flex;
    gap: 8px;
    min-width: 640px;
}

.sp-column {
    width: 56px;
}

@media screen and (max-width: 700px) {
    .sp-tableau {
        min-width: 560px;
    }
    .sp-column {
        width: 48px;
    }
}

/* ---------- Qwixx bubble scoresheet ---------- */
.qwixx-viewer-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0 10px;
}

#summaryTable {
    overflow-x: auto;
    margin-top: 12px;
}

#summaryTable table {
    width: 100%;
    border-collapse: collapse;
}

#summaryTable th, #summaryTable td {
    border: 1px solid #ddd;
    padding: 6px 8px;
    text-align: center;
    font-size: 0.85rem;
}

#summaryTable th {
    background: #2c3e50;
    color: #fff;
}

.qwixx-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.qwixx-row-label {
    width: 62px;
    flex-shrink: 0;
    font-weight: bold;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 8px 4px;
    font-size: 0.8rem;
}

.qwixx-row-red { background: #c0392b; }
.qwixx-row-yellow { background: #b8960c; }
.qwixx-row-green { background: #1e8449; }
.qwixx-row-blue { background: #2874a6; }

.qwixx-row-bubbles {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 2px;
}

.qwixx-bubble {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    border: 2px solid #999;
    background: #fff;
    font-weight: bold;
    font-size: 0.85rem;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

/* Unmarked bubbles are already tinted with their row's color, so the row
   reads as a color group before you've selected anything. */
.qwixx-bubble.color-red { background: #fbe3e1; border-color: #e74c3c; color: #922b21; }
.qwixx-bubble.color-yellow { background: #faf1cf; border-color: #cda70d; color: #7d6608; }
.qwixx-bubble.color-green { background: #dff3e7; border-color: #27ae60; color: #145a32; }
.qwixx-bubble.color-blue { background: #dcebf9; border-color: #2874a6; color: #1b4f72; }

/* Selecting a bubble switches it to a solid, distinctly darker shade of
   that same color, with white text for contrast. */
.qwixx-bubble.filled {
    color: #fff;
    border-color: transparent;
}
.qwixx-bubble.filled.color-red { background: #922b21; }
.qwixx-bubble.filled.color-yellow { background: #7d6608; }
.qwixx-bubble.filled.color-green { background: #145a32; }
.qwixx-bubble.filled.color-blue { background: #1b4f72; }

.qwixx-bubble.crossed {
    color: #c0392b;
    border-color: #c0392b;
    background: #fdecea;
    text-decoration: line-through;
}

.qwixx-bubble.disabled-cell {
    opacity: 0.4;
    cursor: not-allowed;
}

.qwixx-bubble.qwixx-lock {
    border-radius: 6px;
    font-size: 1rem;
}

.qwixx-bubble.qwixx-lock.available {
    border-color: #f1c40f;
    box-shadow: 0 0 0 2px rgba(241,196,15,0.4);
}

.qwixx-bubble.qwixx-lock.locked {
    background: #2c3e50;
    color: #fff;
    border-color: #2c3e50;
    cursor: default;
}

.qwixx-row-locked-note {
    font-size: 0.75rem;
    color: #666;
    margin-left: 62px;
    margin-top: -4px;
    margin-bottom: 8px;
}

.qwixx-penalty-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 10px 14px;
    background: #f7f7f7;
    border-radius: 6px;
}

.qwixx-penalty-boxes {
    display: flex;
    gap: 6px;
}

.qwixx-penalty-box {
    width: 30px;
    height: 30px;
    border: 2px solid #999;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-weight: bold;
}

.qwixx-penalty-box.filled {
    background: #555;
    color: #fff;
    border-color: #555;
}

/* ---------- Cribbage peg progress bars ---------- */
#pegBoardContainer {
    background: #f7f2ea;
    border: 1px solid #d9cbb0;
    border-radius: 8px;
    padding: 14px 16px;
}

.peg-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.peg-bar-row:last-child {
    margin-bottom: 0;
}

.peg-bar-label {
    width: 130px;
    flex-shrink: 0;
    font-weight: bold;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.peg-bar-track {
    position: relative;
    flex: 1;
    height: 14px;
    background: #e0e0e0;
    border-radius: 7px;
}

.peg-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    border-radius: 7px;
    opacity: 0.35;
    transition: width 0.6s ease;
}

.peg-bar-marker {
    position: absolute;
    top: 50%;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.3);
    transform: translate(-50%, -50%);
    transition: left 0.6s ease;
}

.peg-bar-marker.front {
    width: 16px;
    height: 16px;
    z-index: 2;
}

.peg-bar-marker.back {
    width: 11px;
    height: 11px;
    opacity: 0.55;
}

.peg-bar-score {
    width: 64px;
    flex-shrink: 0;
    text-align: right;
    font-weight: bold;
    font-size: 0.85rem;
}

@media screen and (max-width: 480px) {
    .peg-bar-label {
        width: 82px;
        font-size: 0.75rem;
    }
    .peg-bar-score {
        width: 46px;
        font-size: 0.75rem;
    }
    .peg-bar-row {
        gap: 6px;
    }
}

.peg-legend-swatch {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.3);
    display: inline-block;
    flex-shrink: 0;
}

/* ---------- Peg color picker ---------- */
.color-picker-section {
    margin-top: 16px;
    text-align: center;
}

.color-swatches {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

.color-swatch-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}

.color-swatch-btn.taken {
    cursor: not-allowed;
    opacity: 0.3;
}

.color-swatch-btn.selected {
    border-color: #2c3e50;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2c3e50;
}

/* ---------- Team setup ---------- */
.team-setup-section {
    margin-top: 20px;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 14px 18px;
    background: #fafafa;
}

.team-setup-columns {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin: 12px 0;
}

.team-setup-column {
    flex: 1;
    min-width: 200px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px 14px;
}

.team-setup-column h4 {
    margin: 0 0 8px 0;
}

.team-setup-column label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.team-color-select {
    margin-top: 8px;
}

.add-round-row .farkle-checkbox-label {
    font-size: 0.85rem;
    color: #555;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
