/* Shared page: keep navigation and sharing compact within its dark palette. */
.match-view .match-nav{justify-content:flex-start;flex-wrap:wrap;gap:8px}
.match-view .share-panel{background:#172e25;border:1px solid #315a46;color:#e8f5ee;padding:16px 18px;margin-bottom:20px;box-shadow:none;display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.match-view .share-panel label{flex:1 1 340px;color:#F3F6F5;min-width:0}
.match-view .share-panel input{background:#10241b;color:#f2fff7;border-color:#426651;margin-bottom:0;font-size:14px}
.match-view .share-panel #ownStatus{flex-basis:100%;margin:2px 0 0;color:#F3F6F5;font-size:13px}
.match-view .share-panel a{font-size:13px}.match-view .share-panel button{margin:0}
.confirmed-badge{display:inline-block;vertical-align:middle;font-size:10px;line-height:1.3;padding:3px 6px;border-radius:3px;background:var(--soft);color:var(--ink);border:1px solid var(--line);font-weight:500;white-space:nowrap}
/* Badge now lives in its own dedicated line below the position text (see
   share.js) rather than crammed against the player's name, and every
   card gets this line's height reserved whether or not that player is
   actually confirmed -- otherwise a confirmed player's card grows taller
   than its neighbours and the two team columns drift out of alignment
   with each other row by row. */
/* Small corner check icon on a confirmed player's card (see share.js) --
   absolutely positioned, so it never adds to the card's own layout
   height whether present or not. That's what actually keeps the two
   team columns from drifting out of alignment with each other, not
   reserved space for a badge line, which is what the previous version
   of this did. */
.confirmed-check{position:absolute;top:6px;right:6px;width:18px;height:18px;border-radius:3px;background:#1f9d55;color:#F2EEE8;font-size:11px;font-weight:800;display:flex;align-items:center;justify-content:center;line-height:1}
.attendance-badge{display:inline-flex;align-items:center;justify-content:center;background:var(--soft);color:var(--ink);border:1px solid var(--line);padding:9px 13px;border-radius:3px;font-size:14px;font-weight:700;white-space:nowrap}
#myGamesPage{position:relative}#myGamesPage>h1{padding-right:180px}#myGamesPage>#historyScore{position:absolute;right:24px;top:26px}
#matchlogRows button{margin-right:8px;margin-bottom:8px}.log-attendance p{padding:5px 0;margin:0;border-bottom:1px solid #dbe7df}
@media(min-width:701px){#manualPlayers{max-width:640px;gap:8px}#manualPlayers label{display:grid;grid-template-columns:minmax(180px,1fr) 220px;justify-content:initial;gap:20px;margin:0}#manualPlayers select{margin:0;width:220px;min-height:38px;padding:8px 10px}}
@media(max-width:480px){#myGamesPage>h1{padding-right:0}#myGamesPage>#historyScore{position:static;display:flex;width:max-content;margin:0 0 16px auto}.match-view .share-panel{padding:13px}.match-view .share-panel label{flex-basis:100%}}
.match-view button:disabled{background:#224638!important;border-color:#426a53!important;color:#d3eee0!important;opacity:1!important}
/* Profile / avatar (v10) */
.avatar-row{display:flex;align-items:center;gap:16px;margin:16px 0;flex-wrap:wrap}
.avatar{border-radius:50%;object-fit:cover;background:#e7efe9}
.avatar-lg{width:72px;height:72px}
.avatar-placeholder{width:72px;height:72px;border-radius:50%;background:var(--soft);color:var(--ink);border:1px solid var(--line);display:flex;align-items:center;justify-content:center;font-weight:700;font-size:22px;flex:0 0 auto}
.avatar-actions{display:flex;flex-direction:column;gap:6px;align-items:flex-start}
.file-btn{display:inline-block;padding:9px 16px;border-radius:3px;background:#e2ece5;color:#124732;font-weight:500;font-size:14px;cursor:pointer;border:1px solid #c3d2c7}
.file-btn:hover{background:#d4e2d8}
#playerProfilePage .attendance-badge{margin:10px 0}
.profile-header-bar{display:flex;justify-content:flex-end;margin-bottom:8px}

/* Profile view (v12.6): was a left-aligned two-column split with the
   avatar squeezed next to the name. Now a centred hero -- bigger avatar,
   name and facts stacked and centred beneath it -- with game history as
   its own full-width section below, not squeezed into a side column. */
.profile-hero{display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px;padding:4px 0 26px;border-bottom:1px solid var(--line);margin-bottom:26px}
.profile-hero .avatar-row{justify-content:center;margin:0 0 4px}
.avatar-xl{width:108px;height:108px}
.avatar-placeholder-xl{width:108px;height:108px;font-size:32px}

/* Account dropdown menu (v12.7): was a flat list of links with no
   identity or grouping. Now: a small avatar + name header (matching the
   avatar treatment on the profile page, just compact), then the account
   links, then Sign out set apart below a divider since it's a distinct
   kind of action from the rest. */
.account-menu-header{display:flex;align-items:center;gap:10px;padding:8px 10px 12px}
.account-menu-header strong{font-size:14px;overflow-wrap:anywhere}
.avatar-sm{width:36px;height:36px;flex:0 0 auto}
.avatar-placeholder-sm{width:36px;height:36px;font-size:14px}
.account-menu-divider{border-top:1px solid var(--line);margin:4px 6px}
.profile-hero h1{margin:2px 0 0;font-size:24px;font-style:italic;font-weight:800}
.profile-hero-facts{display:flex;gap:16px;flex-wrap:wrap;justify-content:center;font-size:13px;color:var(--muted);margin:6px 0 2px}
.profile-hero .attendance-badge{margin-top:8px}
.profile-history h2{margin-top:0}
/* "Available games" card on Home: each row shows date/time above location
   with a "Book your spot" button beside it -- reuses the same pill-button
   style as the existing "Confirm attendance" button since it's the same
   underlying action. "See all games" is deliberately a plain text-style
   link, not another pill button, so the two are visually distinct as
   requested rather than reading as two competing primary actions. */
.available-game-row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 0;border-bottom:1px solid var(--line)}
.available-game-row:last-child{border-bottom:0}
.available-game-info{min-width:0}
.available-game-when{margin:0;font-weight:700;font-size:14px;color:var(--ink)}
.available-game-where{margin:2px 0 0;font-size:12px;color:var(--muted)}
/* An <a> tag isn't covered by the global button rule above (which only
   targets specific selectors), so this needs its own full button styling
   -- without it, this rendered as a bare underlined link with padding,
   not an actual button. */
.book-spot-btn{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:3px;background:var(--j-surface);border:1px solid var(--line);color:var(--ink);box-shadow:none;min-height:0;padding:8px 16px;font-size:12px;line-height:1.25;font-weight:500;text-decoration:none;white-space:nowrap}
.book-spot-btn:hover{background:#f0f5f0;border-color:#adc1b1}
.see-all-games-wrap{display:flex;justify-content:flex-end;margin-top:10px}
.see-all-games-btn{font-size:12px;color:var(--muted);text-decoration:underline;padding:4px 0}

/* =========================================================================
   Platform Games -- the new, account-centric booking system. Kept in its
   own clearly-labelled block since it's a separate feature area from the
   existing playerbase styling above.
   ========================================================================= */

.platform-game-details-header{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;flex-wrap:wrap}
.platform-game-details-header h1{margin:0}
.platform-game-details-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px;margin-top:14px}
.platform-game-details-grid .label{display:block;font-size:11px;letter-spacing:.06em;color:var(--muted);text-transform:uppercase}
.platform-game-details-grid strong{display:block;font-size:15px;margin-top:2px}
.pg-host-link{text-decoration:none;color:inherit}
.pg-host-link:hover{text-decoration:underline}
@media(min-width:600px){.platform-game-details-grid{grid-template-columns:repeat(3,1fr)}}

.platform-teams{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:8px}
.platform-team h3{margin:0 0 8px;font-size:14px;font-style:italic;font-weight:800}
.platform-team-list{display:flex;flex-direction:column;gap:6px}
.platform-player-row{display:flex;align-items:center;gap:10px;padding:8px 10px;border:1px solid var(--line);border-radius:6px;background:var(--soft);text-decoration:none;color:inherit}
a.platform-player-row:hover{border-color:#adc1b1;background:#eef3ef}
.platform-player-row .avatar-placeholder-sm{width:28px;height:28px;font-size:12px}
.platform-player-row .avatar-sm{width:28px;height:28px}
.platform-empty-slot-avatar{opacity:.5}
.platform-empty-slot-text{color:var(--muted);font-style:normal}

/* Floating action buttons -- centred, fixed to the bottom of the screen,
   sitting above everything else (z-index matches the app's other overlay
   elements like the account dropdown). Only one of these two is ever
   visible at once: the game page's Join/Leave button replaces the global
   Host-a-game button while you're on that specific page (see
   syncHostGameFloatBtn in platform-games.js). */
.host-game-float-btn,.platform-float-wrap{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);z-index:45}
.host-game-float-btn{display:inline-flex;align-items:center;gap:6px;padding:14px 26px;border-radius:3px;background:var(--ink);color:#F2EEE8;font-weight:700;text-decoration:none;box-shadow:0 10px 30px #0003;border:1px solid var(--ink)}
.host-game-float-btn:hover{opacity:.92}
.platform-float-btn{padding:14px 32px;border-radius:3px;font-weight:700;background:var(--ink);color:#F2EEE8;border:1px solid var(--ink);box-shadow:0 10px 30px #0003;min-height:0}
.platform-float-btn:disabled{background:#cfd8d3;border-color:#cfd8d3;color:#6d7a73}
/* Leaves enough space at the bottom of the game page that the floating
   button never sits on top of the last team row. */
.platform-float-spacer{height:90px}

.price-field{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--ui-border);border-radius:6px;padding:0 10px;background:var(--j-surface)}
.price-field input{border:0!important;padding:10px 0!important;background:transparent!important}

@media(max-width:480px){
 .host-game-float-btn{padding:12px 20px;font-size:13px;bottom:16px}
 .platform-float-btn{padding:12px 24px;font-size:13px}
 .platform-teams{grid-template-columns:1fr}
}

/* Language switcher in the app's header-controls -- same neutral pill
   pattern as the marketing page's version, but that file isn't loaded
   here, so it needs its own copy rather than relying on landing-page.css. */
.header-controls .lang-switch{display:flex;border:1px solid rgba(255,255,255,.35);border-radius:3px;overflow:hidden;order:-1}
.header-controls .lang-switch button{background:transparent!important;border:0!important;color:#c9eed7!important;padding:6px 10px!important;font-size:11px!important;font-weight:700!important;cursor:pointer;min-height:0!important}
.header-controls .lang-switch button.lang-active{background:var(--j-surface)!important;color:var(--ink)!important}
/* Share page's nav (.match-nav) is a third distinct context -- dark
   background like the app's header, but not wrapped in .header-controls
   -- so it needs its own scoped copy too rather than silently rendering
   as unstyled default buttons there. */
.match-nav .lang-switch{display:flex;border:1px solid #537460;border-radius:3px;overflow:hidden;min-height:40px;align-items:center}
.match-nav .lang-switch button{background:transparent;border:0;color:#c9eed7;padding:8px 12px;font-size:12px;font-weight:700;cursor:pointer;min-height:0}
.match-nav .lang-switch button.lang-active{background:var(--j-surface);color:var(--ink)}

/* Reset-password page: light theme (design.css), so the dark
   .header-controls/.match-nav lang-switch variants above would look
   wrong here -- needs its own light-background version. */
.reset-nav{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}
.reset-nav .lang-switch{display:flex;border:1px solid var(--line);border-radius:3px;overflow:hidden;min-height:36px;align-items:center}
.reset-nav .lang-switch button{background:transparent;border:0;color:var(--ink);padding:7px 12px;font-size:12px;font-weight:700;cursor:pointer;min-height:0}
.reset-nav .lang-switch button.lang-active{background:var(--forest);color:#F2EEE8}
#mfaResetForm label{display:block;margin:12px 0 4px}

/* Waiting list, spot handoff, comments -- extends the platform games
   block above. */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
/* Two floating buttons side by side (Give spot + Leave game) rather
   than the single-button layout this was originally built for --
   secondary one is visually lighter so Leave/Join stays the clearer,
   more prominent action of the two. */
.platform-float-wrap{display:flex;gap:10px}
.platform-float-btn-secondary{background:var(--j-surface);color:var(--ink);border:1px solid var(--line)}
.platform-comments{display:flex;flex-direction:column;gap:12px;margin-bottom:14px}
.platform-comment{display:flex;gap:10px}
.platform-comment .avatar-placeholder-sm{flex-shrink:0}
.platform-comment-body{flex:1;background:var(--soft);border-radius:6px;padding:10px 12px}
.platform-comment-meta{display:flex;justify-content:space-between;gap:10px;margin-bottom:2px}
.platform-comment-author{font-weight:700;font-size:13px;text-decoration:none;color:inherit}
.platform-comment-author:hover{text-decoration:underline}
.platform-comment-avatar-link{flex-shrink:0;display:block}
.platform-comment-time{font-size:11px;color:var(--muted)}
.platform-comment-text{margin:0;font-size:14px;white-space:pre-wrap;word-break:break-word}
.platform-comment-delete{font-size:11px;color:var(--muted);background:none;border:0;padding:2px 0;text-decoration:underline;cursor:pointer;min-height:0}
#pgCommentForm{display:flex;flex-direction:column;gap:8px}
#pgCommentForm textarea{border:1px solid var(--ui-border);border-radius:0px;padding:10px;font:inherit;resize:vertical}
#pgCommentForm button{align-self:flex-end}

/* Messenger + Notifications icons, private messaging inbox/thread, and
   notifications list. */
.user-menu{display:flex;align-items:center;gap:8px}
/* The account dropdown panel had no z-index of its own -- it only ever
   inherited whatever its nearest positioned ancestor established, which
   wasn't reliably high enough to sit above in-page content like the
   message compose box on the conversation thread page. Setting it
   directly here guarantees the dropdown always renders on top of page
   content while open, regardless of what else is on the page. */
.account-menu-panel{z-index:200}
.icon-btn-badge{position:relative;display:inline-flex;align-items:center;justify-content:center;width:40px;min-height:40px;border-radius:3px;border:1px solid #F2EEE850;background:#F2EEE815;color:#F2EEE8;padding:0}
.icon-btn-badge:hover{background:#F2EEE825}
.notif-badge{position:absolute;top:-4px;right:-4px;min-width:16px;height:16px;padding:0 4px;border-radius:3px;background:#e5484d;color:#F2EEE8;font-size:10px;font-weight:800;display:flex;align-items:center;justify-content:center;line-height:1;border:2px solid var(--forest,#102f27)}
/* Height stays 40px at every width -- matches .header-controls .user-menu
   summary, which never shrinks its own height on mobile in this
   context (only its padding/font-size do). Only width narrows here to
   save horizontal space now that three items share the header row. */
@media(max-width:700px){.icon-btn-badge{width:34px}}

/* Chat pages (inbox, thread, notifications) -- narrow, centered content
   column like .account-page uses, instead of stretching to the page's
   full width on desktop; consistent back-button spacing (previously
   missing here entirely, unlike .account-page/.roster-page which both
   set their own margin-bottom on it -- the gap's absence was what let
   the back button sit flush against the page content below it). */
#messagesPage,#conversationPage,#notificationsPage{max-width:680px;margin:0 auto}
#messagesPage>.back-page,#conversationPage>.back-page,#notificationsPage>.back-page{margin-bottom:20px}

.conversation-list{display:flex;flex-direction:column;gap:8px}
.conversation-row{display:flex;align-items:center;gap:12px;padding:12px;border:1px solid var(--line);border-radius:6px;background:var(--j-surface);text-decoration:none;color:inherit;position:relative}
.conversation-row:hover{border-color:#adc1b1;background:var(--j-surface)}
.conversation-row.unread{background:#f2f8f3;border-color:#bcdcc4}
.conversation-row-info{flex:1;min-width:0}
.conversation-row-info strong{display:block;font-size:14px}
.conversation-row-info p{margin:2px 0 0;font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.conversation-row-time{font-size:11px;color:var(--muted);flex-shrink:0}
.unread-dot{position:absolute;top:10px;right:10px;width:9px;height:9px;border-radius:6px;background:var(--green)}

.conversation-header{display:flex;align-items:center;gap:10px;margin-bottom:14px;text-decoration:none;color:inherit;padding:6px;border-radius:6px;flex-shrink:0}
.conversation-header:hover{background:var(--soft)}
.conversation-header h1{font-size:22px;margin:0;font-style:italic;font-weight:800}
/* The compose form previously sat in normal document flow directly
   below a thread box that only had a max-height (not a fixed one) --
   so as messages arrived and the thread grew toward that cap,
   everything below it, including the form, kept getting pushed
   further down the page, off the bottom of short viewports.
   position:fixed (tried previously) turned out not to behave
   reliably in this app's desktop layout, so instead of depending on
   that, the whole page is now a height-bounded flex column: the
   thread is the only flexible child (flex:1, its own overflow-y:auto),
   and the form is simply the last item in that column, which keeps it
   pinned directly under the thread without ever being pushed off
   itself, and without position:fixed being involved at all. min-height:0
   on the thread overrides flexbox's default "don't shrink below content
   size" behaviour, which would otherwise silently break its own
   internal scrolling. */
#conversationPage{display:flex;flex-direction:column;max-height:calc(100vh - 280px)}
.conversation-thread{flex:1;min-height:0;display:flex;flex-direction:column;gap:8px;overflow-y:auto;padding:8px 2px}
.message-bubble{max-width:75%;padding:9px 13px;border-radius:6px;background:var(--soft)}
.message-bubble.mine{align-self:flex-end;background:var(--forest);color:#F2EEE8}
.message-bubble.mine .message-bubble-time{color:#F3F6F5}
.message-bubble p{margin:0;white-space:pre-wrap;word-break:break-word;font-size:14px}
.message-bubble-time{display:block;font-size:10px;color:var(--muted);margin-top:3px}
#sendMessageForm{flex-shrink:0;display:flex;gap:8px;align-items:flex-end;background:var(--j-surface);border-top:1px solid var(--line);padding:12px 0 calc(12px + env(safe-area-inset-bottom));margin-top:8px}
#sendMessageForm textarea{flex:1;border:1px solid var(--ui-border);border-radius:0px;padding:10px;font:inherit;resize:none;margin:0}
#sendMessageForm button{flex-shrink:0;margin:0}

.notifications-list{display:flex;flex-direction:column;gap:8px}
.notification-row{display:block;padding:12px;border:1px solid var(--line);border-radius:6px;background:var(--j-surface);text-decoration:none;color:inherit}
.notification-row.unread{background:#f2f8f3;border-color:#bcdcc4;font-weight:500}
.notification-row p{margin:0;font-size:13px}
.notification-row-time{display:block;margin-top:4px;font-size:11px;color:var(--muted);font-weight:400}

@media(max-width:700px){
 #conversationPage{max-height:calc(100vh - 190px)}
 .message-bubble{max-width:85%}
 .conversation-header h1{font-size:19px;font-style:italic;font-weight:800}
}
/* Temporary, on-screen diagnostic for the live-updates connection --
   deliberately plain and visible (not hidden in devtools) so the state
   can be read off at a glance while tracking down why realtime wasn't
   working. */
.realtime-status{font-size:11px;color:var(--muted);margin:-4px 0 12px}

.profile-game-stats{display:flex;gap:10px;margin:0 0 16px}
.profile-game-stat{flex:1;text-align:center;padding:12px 6px;background:var(--soft);border:1px solid var(--line);border-radius:6px}
.profile-game-stat strong{display:block;font-size:24px;color:var(--forest)}
.profile-game-stat span{font-size:11px;color:var(--muted)}

/* Home "Your next game": once there's a second joined upcoming game,
   the cards become a horizontally swipeable row (native scroll-snap --
   real touch-swipe on mobile, click-drag/wheel on desktop, no JS
   carousel needed) instead of only ever showing the single soonest
   game. A lone card stays a plain, non-scrolling block -- the swipe
   treatment only earns its place once there's a second card to swipe
   to. Cards are sized so the next one peeks in at the edge, the usual
   visual cue that there's more to scroll to. */
.upcoming-games-scroll.multi{display:flex;gap:12px;overflow-x:auto;scroll-snap-type:x mandatory;padding-bottom:4px;-webkit-overflow-scrolling:touch}
.upcoming-games-scroll.multi .game-card{flex:0 0 86%;scroll-snap-align:start}
@media(min-width:560px){.upcoming-games-scroll.multi .game-card{flex-basis:62%}}
.profile-game-stat.profile-game-stat-link{text-decoration:none;color:inherit;cursor:pointer}
.profile-game-stat.profile-game-stat-link:hover{border-color:#adc1b1;background:#eef3ef}
