/*! tailwindcss v3.4.10 | MIT License | https://tailwindcss.com */

/* Self-hosted fonts — eliminates external Google Fonts waterfall */

/* Inter (variable font — single file covers weights 400–700) */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Size-adjusted fallback for Inter to reduce layout shift */
@font-face {
  font-family: 'Inter Fallback';
  src: local('Helvetica Neue'), local('Arial'), local('sans-serif');
  size-adjust: 107%;
  ascent-override: 90%;
  descent-override: 25%;
  line-gap-override: 0%;
}

/* Barlow Condensed */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/barlow-condensed-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/barlow-condensed-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/fonts/barlow-condensed-800-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Size-adjusted fallback for Barlow Condensed to reduce layout shift */
@font-face {
  font-family: 'Barlow Condensed Fallback';
  src: local('Arial Narrow'), local('Helvetica Neue'), local('Arial');
  size-adjust: 90%;
  ascent-override: 105%;
  descent-override: 25%;
  line-gap-override: 0%;
}

/*
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
*/

*,
::before,
::after {
  box-sizing: border-box; /* 1 */
  border-width: 0; /* 2 */
  border-style: solid; /* 2 */
  border-color: var(--color-border); /* 2 */
}

::before,
::after {
  --tw-content: '';
}

/*
1. Use a consistent sensible line-height in all browsers.
2. Prevent adjustments of font size after orientation changes in iOS.
3. Use a more readable tab size.
4. Use the user's configured `sans` font-family by default.
5. Use the user's configured `sans` font-feature-settings by default.
6. Use the user's configured `sans` font-variation-settings by default.
7. Disable tap highlights on iOS
*/

html,
:host {
  line-height: 1.5; /* 1 */
  -webkit-text-size-adjust: 100%; /* 2 */
  -moz-tab-size: 4; /* 3 */
  tab-size: 4; /* 3 */
  font-family: 'Inter', 'Inter Fallback', ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */
  font-feature-settings: normal; /* 5 */
  font-variation-settings: normal; /* 6 */
  -webkit-tap-highlight-color: transparent; /* 7 */
}

/*
1. Remove the margin in all browsers.
2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.
*/

body {
  margin: 0; /* 1 */
  line-height: inherit; /* 2 */
}

/*
1. Add the correct height in Firefox.
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
3. Ensure horizontal rules are visible by default.
*/

hr {
  height: 0; /* 1 */
  color: inherit; /* 2 */
  border-top-width: 1px; /* 3 */
}

/*
Add the correct text decoration in Chrome, Edge, and Safari.
*/

abbr:where([title]) {
  text-decoration: underline dotted;
}

/*
Remove the default font size and weight for headings.
*/

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}

/*
Reset links to optimize for opt-in styling instead of opt-out.
*/

a {
  color: inherit;
  text-decoration: inherit;
}

/*
Add the correct font weight in Edge and Safari.
*/

b,
strong {
  font-weight: bolder;
}

/*
1. Use the user's configured `mono` font-family by default.
2. Use the user's configured `mono` font-feature-settings by default.
3. Use the user's configured `mono` font-variation-settings by default.
4. Correct the odd `em` font sizing in all browsers.
*/

code,
kbd,
samp,
pre {
  font-family: ui-monospace, SFMono-Regular, "Roboto Mono", "Cascadia Code", "Source Code Pro", "Fira Code", "Droid Sans Mono", "Courier New", monospace; /* 1 */
  font-feature-settings: normal; /* 2 */
  font-variation-settings: normal; /* 3 */
  font-size: 1em; /* 4 */
}

/*
Add the correct font size in all browsers.
*/

small {
  font-size: 80%;
}

/*
Prevent `sub` and `sup` elements from affecting the line height in all browsers.
*/

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/*
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
3. Remove gaps between table borders by default.
*/

table {
  text-indent: 0; /* 1 */
  border-color: inherit; /* 2 */
  border-collapse: collapse; /* 3 */
}

/*
1. Change the font styles in all browsers.
2. Remove the margin in Firefox and Safari.
3. Remove default padding in all browsers.
*/

button,
input,
optgroup,
select,
textarea {
  font-family: inherit; /* 1 */
  font-feature-settings: inherit; /* 1 */
  font-variation-settings: inherit; /* 1 */
  font-size: 100%; /* 1 */
  font-weight: inherit; /* 1 */
  line-height: inherit; /* 1 */
  letter-spacing: inherit; /* 1 */
  color: inherit; /* 1 */
  margin: 0; /* 2 */
  padding: 0; /* 3 */
}

/*
Remove the inheritance of text transform in Edge and Firefox.
*/

button,
select {
  text-transform: none;
}

/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Remove default button styles.
*/

button,
input:where([type='button']),
input:where([type='reset']),
input:where([type='submit']) {
  -webkit-appearance: button; /* 1 */
  background-color: transparent; /* 2 */
  background-image: none; /* 2 */
}

/*
Use the modern Firefox focus style for all focusable elements.
*/

:-moz-focusring {
  outline: auto;
}

/*
Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
*/

:-moz-ui-invalid {
  box-shadow: none;
}

/*
Add the correct vertical alignment in Chrome and Firefox.
*/

progress {
  vertical-align: baseline;
}

/*
Correct the cursor style of increment and decrement buttons in Safari.
*/

::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
  height: auto;
}

/*
1. Correct the odd appearance in Chrome and Safari.
2. Correct the outline style in Safari.
*/

[type='search'] {
  -webkit-appearance: textfield; /* 1 */
  outline-offset: -2px; /* 2 */
}

/*
Remove the inner padding in Chrome and Safari on macOS.
*/

::-webkit-search-decoration {
  -webkit-appearance: none;
}

/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Change font properties to `inherit` in Safari.
*/

::-webkit-file-upload-button {
  -webkit-appearance: button; /* 1 */
  font: inherit; /* 2 */
}

/*
Add the correct display in Chrome and Safari.
*/

summary {
  display: list-item;
}

/*
Removes the default spacing and border for appropriate elements.
*/

blockquote,
dl,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
figure,
p,
pre {
  margin: 0;
}

fieldset {
  margin: 0;
  padding: 0;
}

legend {
  padding: 0;
}

ol,
ul,
menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

/*
Reset default styling for dialogs.
*/
dialog {
  padding: 0;
}

/*
Prevent resizing textareas horizontally by default.
*/

textarea {
  resize: vertical;
}

/*
1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
2. Set the default placeholder color to the user's configured gray 400 color.
*/

input::placeholder,
textarea::placeholder {
  opacity: 1; /* 1 */
  color: var(--gray-300); /* 2 */
}

/*
Set the default cursor for buttons.
*/

button,
[role="button"] {
  cursor: pointer;
}

/*
Make sure disabled buttons don't get the pointer cursor.
*/
:disabled {
  cursor: default;
}

/*
1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
2. Add `vertical-align: top` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
   This can trigger a poorly considered lint error in some tools but is included by design.
*/

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block; /* 1 */
  vertical-align: middle; /* 2 */
}

/*
Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
*/

img,
video {
  max-width: 100%;
  height: auto;
}

/* Make elements with the HTML hidden attribute stay hidden by default */
[hidden] {
  display: none;
}

/* ============================================
   DESIGN SYSTEM - CSS Custom Properties
   Emerald Brand — Dark/Light Theme
   ============================================ */
:root {
  /* Brand */
  --brand: #10B981;
  --brand-hover: #059669;

  /* Feature accents */
  --sky: #38BDF8;
  --sky-strong: #2563EB;
  --sky-mid: #3B82F6;
  --sky-dark: #1D4ED8;
  --coral: #D4622B;
  --courtgreen: #2D6B4A;

  /* Accent palette (tournament/bracket display) */
  --orange: #f97316;
  --orange-hover: #ea580c;
  --purple-accent: #a855f7;
  --cyan-accent: #06b6d4;
  --pink-accent: #ec4899;
  --teal-accent: #14b8a6;
  --rose-accent: #f43f5e;

  /* Semantic */
  --color-success: #4ADE80;
  --color-success-strong: #10B981;
  --color-error: #F87171;
  --color-error-strong: #DC2626;
  --color-warning: #FBBF24;
  --color-warning-strong: #EAB308;
  --color-warning-hover: #CA8A04;
  --color-danger-hover: #b91c1c;
  --color-warning-text: #78350f;
  --color-on-accent: #FFFFFF;

  /* Overlays */
  --overlay: rgba(0, 0, 0, 0.5);
  --overlay-light: rgba(0, 0, 0, 0.3);

  /* Surfaces */
  --navy: #0B1120;
  --navy-light: #131B2E;
  --color-background: #0B1120;
  --color-surface: #1A2332;
  --color-text: #F1F5F9;
  --color-text-secondary: #94A3B8;
  --color-border: #1C2535;

  /* Gray scale */
  --gray-50: #1A2332;
  --gray-100: #172030;
  --gray-200: #1E2838;
  --gray-300: #64748B;
  --gray-400: #94A3B8;
  --gray-500: #CBD5E1;
  --gray-600: #E2E8F0;
  --gray-700: #F1F5F9;
  --gray-900: #F8FAFC;

  /* Tinted backgrounds */
  --gold-tint: #2A2215;
  --gold-tint-strong: #33280F;
  --sky-tint: #132231;
  --sky-tint-strong: #15263A;
  --green-tint: #0F2318;
  --green-tint-strong: #11291A;
  --red-tint: #2A1418;
  --red-tint-strong: #33141A;
  --yellow-tint: #2A2410;
  --yellow-tint-strong: #332C0D;
  --coral-tint: #2A1E14;
  --courtgreen-tint: #0F2318;
  --teal-tint: #0A2320;

  /* Tinted borders */
  --gold-border: #4D3A0A;
  --gold-border-strong: #6B510E;
  --sky-border: #1A3A52;
  --sky-border-strong: #1F4668;
  --coral-border: #4D3520;
  --courtgreen-border: #1A4028;
  --teal-border: #1A4D45;
  --green-border: #1A4028;
  --red-border: #4D1F24;
  --red-border-strong: #68252C;
  --yellow-border: #4D420A;

  /* Focus rings */
  --ring-gold: #5C4A14;
  --ring-gold-strong: #7A6218;

  color-scheme: dark;
}

/* ============================================
   Light mode — respect OS preference
   ============================================ */
@media (prefers-color-scheme: light) {
  :root {
    --color-background: #F8FAFC;
    --color-surface: #FFFFFF;
    --color-text: #1E293B;
    --color-text-secondary: #64748B;
    --color-border: #E2E8F0;
    --navy: #F8FAFC;
    --navy-light: #F1F5F9;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-900: #0F172A;
    /* light pastels for tinted backgrounds */
    --gold-tint: #FFFBEB;
    --gold-tint-strong: #FEF3C7;
    --sky-tint: #F0F9FF;
    --sky-tint-strong: #E0F2FE;
    --green-tint: #F0FDF4;
    --green-tint-strong: #DCFCE7;
    --red-tint: #FEF2F2;
    --red-tint-strong: #FEE2E2;
    --yellow-tint: #FEFCE8;
    --yellow-tint-strong: #FEF9C3;
    --coral-tint: #FFF5EE;
    --teal-tint: #F0FDFA;
    /* light borders */
    --gold-border: #FDE68A;
    --gold-border-strong: #FCD34D;
    --sky-border: #BAE6FD;
    --sky-border-strong: #7DD3FC;
    --coral-border: #F5DED0;
    --teal-border: #99F6E4;
    --green-border: #BBF7D0;
    --red-border: #FECACA;
    --red-border-strong: #FCA5A5;
    --yellow-border: #FDE68A;
    /* semantic */
    --color-success: #22C55E;
    --color-success-strong: #16A34A;
    --color-error: #EF4444;
    --color-error-strong: #DC2626;
    --overlay: rgba(0, 0, 0, 0.3);
    --overlay-light: rgba(0, 0, 0, 0.15);
    color-scheme: light;
  }
  body.bg-gray-50 { background: #F8FAFC; }
  /* Softer shadows for light mode */
  .shadow-lg { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }
  .shadow-md { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06); }
}

/* ============================================
   Dark theme default overrides for Tailwind
   ============================================ */

body {
  background-color: var(--color-background);
  color: var(--color-text);
}

.bg-white {
  background-color: var(--color-surface);
}

.bg-gray-50 {
  background-color: var(--color-background);
}

.bg-gray-100 {
  background-color: var(--gray-100);
}

input,
select,
textarea {
  background-color: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

.border-gray-200,
.border-gray-300 {
  border-color: var(--color-border);
}

.text-gray-400 {
  color: var(--gray-400);
}

.text-gray-500,
.text-gray-600 {
  color: var(--color-text-secondary);
}

.text-gray-700,
.text-gray-800,
.text-gray-900 {
  color: var(--color-text);
}

.shadow-sm {
  box-shadow: none;
}
.shadow-lg {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Header */
header.bg-white {
  background-color: rgba(26, 35, 50, 0.85);
  backdrop-filter: blur(12px);
  border-color: var(--color-border);
}

/* Dropdowns — use theme-aware colors */
#profile-dropdown,
#notifications-dropdown {
  background-color: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}

.dropdown-item {
  color: var(--color-text);
}

.dropdown-item:hover {
  background-color: var(--gray-100);
}

.notification-item.unread {
  background-color: var(--sky-tint);
}

/* Modals */
.modal-content,
#login-modal > div {
  background-color: var(--color-surface);
}

/* Footer */
footer {
  border-color: transparent;
}

/* Utility classes */
.block { display: block; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.grid { display: grid; }
.hidden { display: none !important; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }

/* Overflow utilities */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

/* Text wrapping */
.break-words { word-wrap: break-word; overflow-wrap: break-word; word-break: break-word; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fixed { position: fixed; }
.absolute { position: absolute; }
.relative { position: relative; }
.sticky { position: sticky; }

.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.top-4 { top: 1rem; }
.-top-2 { top: -0.5rem; }
.right-0 { right: 0; }
.right-2 { right: 0.5rem; }
.right-4 { right: 1rem; }
.-right-2 { right: -0.5rem; }
.left-4 { left: 1rem; }
.bottom-2 { bottom: 0.5rem; }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }


/* Transform utilities */
.-translate-y-full { transform: translateY(-100%); }
.translate-y-0 { transform: translateY(0); }

/* Opacity utilities */
.opacity-0 { opacity: 0; }
.opacity-70 { opacity: 0.7; }
.opacity-100 { opacity: 1; }

/* Transition utilities */
.transition-toast {
  transition: opacity 0.3s, transform 0.3s;
}

/* Badge Components */
.badge-warning {
  background-color: var(--color-warning);
  color: var(--color-warning-text);
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.badge-open {
  background-color: var(--green-tint-strong);
  color: var(--color-success);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.badge-full {
  background-color: var(--gray-100);
  color: var(--gray-400);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.badge-ended {
  background-color: var(--gray-100);
  color: var(--gray-400);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Input clear button positioning */
.input-clear-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
}

/* Color utilities */
.text-red-500 { color: var(--color-error); }
.text-red-600 { color: var(--color-error-strong); }

/* Pointer events */
.pointer-events-none { pointer-events: none; }

/* Double elimination note */
.bracket-note {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-top: 0.5rem;
}

/* Max width utilities */
.max-w-sm { max-width: 24rem; }

.col-span-full { grid-column: 1 / -1; }

.mx-auto { margin-left: auto; margin-right: auto; }
.mx-1 { margin-left: 0.25rem; margin-right: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1\.5 { margin-top: 0.375rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mb-12 { margin-bottom: 3rem; }
.mt-12 { margin-top: 3rem; }
.mt-14 { margin-top: 3.5rem; }
.mt-16 { margin-top: 4rem; }
.mt-24 { margin-top: 6rem; }

.max-w-md { max-width: 28rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-7xl { max-width: 80rem; }

.w-full { width: 100%; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-11 { width: 2.75rem; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-16 { height: 4rem; }
.min-h-screen { min-height: 100vh; }
.max-h-full { max-height: 100%; }
.max-h-screen { max-height: 100vh; }
.overflow-y-auto { overflow-y: auto; }
.my-auto { margin-top: auto; margin-bottom: auto; }
.mt-auto { margin-top: auto; }

.space-x-1 > :not([hidden]) ~ :not([hidden]) { margin-left: 0.25rem; }
.space-x-2 > :not([hidden]) ~ :not([hidden]) { margin-left: 0.5rem; }
.space-x-3 > :not([hidden]) ~ :not([hidden]) { margin-left: 0.75rem; }
.space-x-4 > :not([hidden]) ~ :not([hidden]) { margin-left: 1rem; }
.space-x-8 > :not([hidden]) ~ :not([hidden]) { margin-left: 2rem; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }
.space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.75rem; }
.space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }
.space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: 1.5rem; }
.space-y-8 > :not([hidden]) ~ :not([hidden]) { margin-top: 2rem; }
.space-y-12 > :not([hidden]) ~ :not([hidden]) { margin-top: 3rem; }

.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

.border { border-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-t { border-top-width: 1px; }
.border-gray-200 { border-color: var(--gray-200); }
.border-gray-300 { border-color: var(--gray-300); }
.border-gray-100 { border-color: var(--gray-100); }
.border-transparent { border-color: transparent; }

/* Tab hover styles */
.hover\:border-gray-300:hover { border-color: var(--gray-300); }

.bg-white { background-color: var(--color-surface); }
.bg-gray-50 { background-color: var(--color-background); }
.bg-gray-100 { background-color: var(--gray-100); }
.bg-gray-300 { background-color: var(--gray-300); }
.bg-gray-400 { background-color: var(--gray-400); }
.bg-gray-500 { background-color: var(--gray-500); }
.bg-gray-600 { background-color: var(--gray-600); }
.bg-gray-700 { background-color: var(--gray-700); }
.bg-black { background-color: var(--navy); }
.bg-opacity-50 { background-color: rgba(0, 0, 0, 0.5); }

.bg-brand { background-color: var(--brand); }
.bg-sky { background-color: var(--sky); }
.text-brand { color: var(--brand); }
.text-sky { color: var(--sky); }
.bg-accent { background-color: var(--brand); }
.bg-accent-light { background-color: var(--color-warning); }
.text-accent { color: var(--brand); }
.hover\:bg-brand-hover:hover { background-color: var(--brand-hover); }
.hover\:text-brand-hover:hover { color: var(--brand-hover); }
.focus\:ring-brand:focus { --tw-ring-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.focus\:ring-red-400:focus { box-shadow: 0 0 0 2px #F87171; }
.focus\:border-red-400:focus { border-color: #F87171; }
.hover\:bg-accent-dark:hover { background-color: var(--brand-hover); }
.hover\:text-green-700:hover { color: var(--color-success); }
.hover\:text-green-600:hover { color: var(--color-success); }

/* Semantic background colors (dark-friendly) */
.bg-green-50 { background-color: var(--green-tint); }
.bg-yellow-50 { background-color: var(--yellow-tint); }
.bg-green-500 { background-color: var(--color-success-strong); }
.bg-red-500 { background-color: var(--color-error); }
.bg-red-600 { background-color: var(--color-error-strong); }
.bg-red-700 { background-color: #B91C1C; }
.bg-blue-500 { background-color: var(--sky-mid); }
.bg-yellow-500 { background-color: var(--color-warning-strong); }

/* Semantic text colors (dark-friendly) */
.text-green-500 { color: var(--color-success); }
.text-green-700 { color: var(--color-success); }
.text-yellow-800 { color: var(--color-warning); }

/* Semantic border colors (dark-friendly) */
.border-green-200 { border-color: var(--green-border); }
.border-yellow-200 { border-color: var(--yellow-border); }
.border-red-300 { border-color: var(--red-border-strong); }
.border-blue-300 { border-color: var(--sky-border-strong); }

/* Semantic hover states (dark-friendly) */
.hover\:bg-red-50:hover { background-color: var(--red-tint); }

/* Button hover states */
.hover\:bg-red-600:hover { background-color: var(--color-error-strong); }
.hover\:bg-red-700:hover { background-color: #B91C1C; }
.hover\:bg-blue-600:hover { background-color: var(--sky-strong); }
.hover\:bg-yellow-600:hover { background-color: var(--color-warning-hover); }

/* Badge colors (dark-friendly) */
.bg-green-100 { background-color: var(--green-tint-strong); }
.bg-red-100 { background-color: var(--red-tint-strong); }
.bg-yellow-100 { background-color: var(--yellow-tint-strong); }
.bg-amber-50 { background-color: var(--gold-tint); }
.bg-blue-50 { background-color: var(--sky-tint); }
.bg-blue-100 { background-color: var(--sky-tint-strong); }
.bg-blue-600 { background-color: var(--sky-strong); }
.text-green-800 { color: var(--color-success); }
.text-red-800 { color: var(--color-error); }
.text-yellow-500 { color: var(--color-warning); }
.text-yellow-600 { color: var(--color-warning); }
.text-amber-400 { color: var(--color-warning); }
.text-amber-700 { color: var(--color-warning); }
.text-amber-800 { color: var(--color-warning-text); }
.text-blue-600 { color: var(--sky); }
.text-blue-700 { color: var(--sky); }
.text-blue-800 { color: var(--sky); }
.text-blue-900 { color: var(--sky); }
.text-gray-800 { color: var(--color-text); }
.border-amber-200 { border-color: var(--gold-border); }
.border-blue-200 { border-color: var(--sky-border); }
.hover\:text-amber-600:hover { color: var(--color-warning-hover); }
.hover\:text-blue-700:hover { color: var(--sky); }
.hover\:text-blue-900:hover { color: var(--sky); }
.hover\:bg-blue-700:hover { background-color: var(--sky-dark); }

.hover\:bg-green-50:hover { background-color: var(--green-tint); }
.hover\:bg-green-600:hover { background-color: var(--color-success-strong); }
.hover\:bg-blue-50:hover { background-color: var(--sky-tint); }
.hover\:bg-gray-700:hover { background-color: var(--gray-100); }
.hover\:bg-gray-50:hover { background-color: var(--gray-50); }
.hover\:bg-gray-100:hover { background-color: var(--gray-100); }
.hover\:text-brand:hover { color: var(--brand); }
.hover\:underline:hover { text-decoration-line: underline; }

/* Header stays dark in both modes */
@media (prefers-color-scheme: light) {
  header.bg-white {
    background-color: #0B1120;
    border-color: #1C2535;
    --color-text: #F1F5F9;
    --color-text-secondary: #94A3B8;
    --gray-50: #1A2332;
    --gray-100: #172030;
    --gray-200: #1E2838;
    --gray-500: #CBD5E1;
    --gray-900: #F8FAFC;
  }

  /* Reset dropdowns to light mode colors (don't inherit dark header variables) */
  header #profile-dropdown,
  header #notifications-dropdown {
    --color-text: #1E293B;
    --color-text-secondary: #64748B;
    --color-surface: #ffffff;
    --color-border: #E2E8F0;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-500: #64748B;
    --gray-900: #0F172A;
  }
}

.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.pl-6 { padding-left: 1.5rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-24 { padding-top: 6rem; padding-bottom: 6rem; }
.pt-4 { padding-top: 1rem; }
.pt-6 { padding-top: 1.5rem; }
.pt-8 { padding-top: 2rem; }
.pb-4 { padding-bottom: 1rem; }
.pb-8 { padding-bottom: 2rem; }
.pb-12 { padding-bottom: 3rem; }
.pb-16 { padding-bottom: 4rem; }
.pb-24 { padding-bottom: 6rem; }
.pb-32 { padding-bottom: 8rem; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-hero { font-size: clamp(2.5rem, 6vw, 4.5rem); }
.text-hero-sub { font-size: clamp(1rem, 2.5vw, 1.375rem); }

/* Responsive hero text - compact on mobile, full size on tablet+ */
@media (min-width: 640px) {
  .sm\:text-hero { font-size: 2.75rem; }
  .sm\:text-hero-sub { font-size: 1.75rem; }
  .sm\:text-lg { font-size: 1.125rem; }
  .sm\:text-3xl { font-size: 1.875rem; }
  .sm\:text-5xl { font-size: 3rem; }
  .sm\:p-10 { padding: 2.5rem; }
  .sm\:mb-4 { margin-bottom: 1rem; }
  .sm\:mb-6 { margin-bottom: 1.5rem; }
  .sm\:mb-8 { margin-bottom: 2rem; }
  .sm\:mb-10 { margin-bottom: 2.5rem; }
  .sm\:mt-6 { margin-top: 1.5rem; }
  .sm\:space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.75rem; }
  .sm\:w-5 { width: 1.25rem; }
  .sm\:h-5 { height: 1.25rem; }
  .sm\:px-8 { padding-left: 2rem; padding-right: 2rem; }
  .sm\:py-4 { padding-top: 1rem; padding-bottom: 1rem; }
}
.text-5xl { font-size: 3rem; }
.text-6xl { font-size: 3.75rem; }

.font-light { font-weight: 300; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.leading-relaxed { line-height: 1.625; }
.cursor-pointer { cursor: pointer; }

.text-white { color: var(--color-on-accent); }
.text-gray-500 { color: var(--gray-500); }
.text-gray-600 { color: var(--gray-600); }
.text-gray-800 { color: var(--color-text); }
.text-gray-700 { color: var(--gray-700); }
.text-gray-900 { color: var(--gray-900); }
.text-gray-400 { color: var(--gray-400); }

.hover\:text-gray-600:hover { color: var(--gray-600); }
.hover\:text-gray-700:hover { color: var(--gray-700); }
.hover\:text-gray-800:hover { color: var(--color-text); }
.hover\:text-gray-900:hover { color: var(--gray-900); }

.text-center { text-align: center; }
.whitespace-nowrap { white-space: nowrap; }

.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.hover\:shadow-md:hover { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }

.transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-shadow { transition-property: box-shadow; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-transform { transition-property: transform; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }

.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.self-start { align-self: flex-start; }
.flex-wrap { flex-wrap: wrap; }

.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.animate-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.border-b-2 { border-bottom-width: 2px; }

/* Responsive design */
@media (min-width: 640px) {
  .sm\:inline { display: inline !important; }
  .sm\:block { display: block !important; }
  .sm\:flex { display: flex !important; }
  .sm\:hidden { display: none !important; }
  .sm\:px-4 { padding-left: 1rem; padding-right: 1rem; }
  .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
  .sm\:p-8 { padding: 2rem; }
  .sm\:py-12 { padding-top: 3rem; padding-bottom: 3rem; }
  .sm\:py-16 { padding-top: 4rem; padding-bottom: 4rem; }
  .sm\:py-24 { padding-top: 6rem; padding-bottom: 6rem; }
  .sm\:pb-16 { padding-bottom: 4rem; }
  .sm\:pb-32 { padding-bottom: 8rem; }
  .sm\:pt-6 { padding-top: 1.5rem; }
  .sm\:mt-0 { margin-top: 0; }
  .sm\:mt-6 { margin-top: 1.5rem; }
  .sm\:ml-2 { margin-left: 0.5rem; }
  .sm\:mt-14 { margin-top: 3.5rem; }
  .sm\:mt-16 { margin-top: 4rem; }
  .sm\:mt-20 { margin-top: 5rem; }
  .sm\:mt-24 { margin-top: 6rem; }
  .sm\:mb-0 { margin-bottom: 0; }
  .sm\:mb-6 { margin-bottom: 1.5rem; }
  .sm\:mb-8 { margin-bottom: 2rem; }
  .sm\:mb-12 { margin-bottom: 3rem; }
  .sm\:gap-4 { gap: 1rem; }
  .sm\:gap-6 { gap: 1.5rem; }
  .sm\:gap-8 { gap: 2rem; }
  .sm\:space-x-2 > :not([hidden]) ~ :not([hidden]) { margin-left: 0.5rem; }
  .sm\:space-x-4 > :not([hidden]) ~ :not([hidden]) { margin-left: 1rem; }
  .sm\:space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: 1.5rem; }
  .sm\:flex-row { flex-direction: row; }
  .sm\:justify-between { justify-content: space-between; }
  .sm\:justify-end { justify-content: flex-end; }
  .sm\:items-start { align-items: flex-start; }
  .sm\:text-center { text-align: center; }
  .sm\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
  .sm\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
  .sm\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
}

@media (min-width: 768px) {
  .md\:flex { display: flex; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Dropdown menu item - works for both links and buttons */
.dropdown-item {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-text);
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.dropdown-item:hover {
  background-color: var(--gray-100);
}

/* Profile menu button - remove focus/active styling */
#profile-menu-btn:focus,
#profile-menu-btn:active {
  outline: none;
  box-shadow: none;
  background: transparent;
}

/* Profile dropdown positioning - below header, aligned with trigger */
#profile-dropdown {
  top: calc(100% + 1.5rem);
  margin-top: 0 !important;
}


/* Custom styles */
.tab-button.active {
  color: var(--brand) !important;
  border-color: var(--brand) !important;
  border-bottom-width: 2px !important;
}

.filter-chip {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 9999px;
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
  color: var(--color-text);
  transition: all 0.2s;
  min-height: 36px;
  touch-action: manipulation;
  cursor: pointer;
}

.filter-chip:hover {
  background-color: var(--gray-100);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
}

.filter-chip:focus {
  outline: none;
  ring: 2px solid var(--brand);
  border-color: var(--brand);
}

/* Missing notification utility classes */
.translate-x-full { transform: translateX(100%); }
.ml-4 { margin-left: 1rem; }

.filter-chip.active {
  background-color: var(--brand) !important;
  border-color: var(--brand) !important;
  color: var(--navy) !important;
}

.filter-chip.active:hover {
  background-color: var(--brand-hover) !important;
}

/* Make chips more touch-friendly on mobile */
@media (max-width: 640px) {
  .filter-chip {
    min-height: 36px;
    padding: 0.5rem 0.75rem;
  }
}

/* Filter toggle button - keep compact on mobile */
#filter-toggle {
  min-height: auto;
  padding: 0.5rem 0;
}

/* Ensure consistent icon sizing on all devices */
svg.w-4.h-4 {
  width: 1rem !important;
  height: 1rem !important;
  flex-shrink: 0;
}

svg.w-5.h-5 {
  width: 1.25rem !important;
  height: 1.25rem !important;
  flex-shrink: 0;
}

/* Specific fix for mobile devices */
@media (max-width: 640px) {
  svg.w-4.h-4 {
    width: 1rem !important;
    height: 1rem !important;
    flex-shrink: 0;
  }

  svg.w-5.h-5 {
    width: 1.25rem !important;
    height: 1.25rem !important;
    flex-shrink: 0;
  }
}

/* Dropdown arrow styling */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M2.5 4.5L6 8L9.5 4.5" stroke="%236B7280" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>');
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px 12px;
  padding-right: 2.5rem !important;
}

select:disabled {
  background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M2.5 4.5L6 8L9.5 4.5" stroke="%23D1D5DB" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>');
}

/* City filter styling */
#city-filter {
  width: 100% !important;
  max-width: 24rem; /* 384px */
  padding-right: 2.25rem !important; /* Room for the X button */
}

#city-filter:focus {
  outline: none !important;
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent) !important;
}

#clear-city-filter {
  display: flex;
  align-items: center;
  justify-content: center;
}

#clear-city-filter.hidden {
  display: none !important;
}

/* Google Places Autocomplete dropdown styling */
.pac-container {
  border-radius: 0.375rem !important;
  border: 1px solid var(--color-border) !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2) !important;
  font-family: inherit !important;
  background-color: var(--color-surface) !important;
}

.pac-item {
  padding: 0.75rem !important;
  border-bottom: 1px solid var(--gray-100) !important;
  font-size: 0.875rem !important;
  line-height: 1.25rem !important;
  color: var(--color-text) !important;
}

.pac-item:hover {
  background-color: var(--gray-100) !important;
}

.pac-item-selected {
  background-color: var(--brand) !important;
  color: white !important;
}

.pac-matched {
  font-weight: 600 !important;
}

/* Bracket format tabs */
.format-tab:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* Button System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.2s;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0.5rem;
  transition: all 0.2s;
  cursor: pointer;
  background-color: var(--brand);
  color: #fff;
  border: 1px solid var(--brand);
}

.btn-primary:hover {
  background-color: var(--brand-hover);
  border-color: var(--brand-hover);
}

.btn-confirmed {
  background-color: var(--color-success-strong) !important;
  border-color: var(--color-success-strong) !important;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.2s;
  cursor: pointer;
}

.btn-secondary:hover {
  background-color: var(--navy-light);
  border-color: var(--color-text-secondary);
  color: var(--color-text);
}

.btn-warning {
  background-color: var(--color-warning-strong);
  color: var(--color-on-accent);
  border-color: var(--color-warning-strong);
}

.btn-warning:hover {
  background-color: var(--color-warning-hover);
  border-color: var(--color-warning-hover);
}

.btn-danger-outline {
  background-color: var(--color-surface);
  color: var(--color-error);
  border-color: var(--red-border);
}

.btn-danger-outline:hover {
  background-color: var(--red-tint);
}

.btn-danger {
  background-color: var(--color-error-strong);
  color: var(--color-on-accent);
  border-color: var(--color-error-strong);
}

.btn-danger:hover {
  background-color: var(--color-danger-hover);
  border-color: var(--color-danger-hover);
}

.btn-orange {
  background-color: var(--orange);
  color: var(--color-on-accent);
  border-color: var(--orange);
}

.btn-orange:hover {
  background-color: var(--orange-hover);
  border-color: var(--orange-hover);
}

.btn-info {
  background-color: var(--sky-strong);
  color: var(--color-on-accent);
  border-color: var(--sky-strong);
}

.btn-info:hover {
  background-color: var(--sky-dark);
  border-color: var(--sky-dark);
}

.btn-muted {
  background-color: var(--gray-200);
  color: var(--gray-700);
  border-color: var(--gray-200);
}

.btn-muted:hover {
  background-color: var(--gray-300);
  border-color: var(--gray-300);
}

/* Outline button style for brackets page */
.btn-outline {
  background: var(--color-surface);
  color: var(--gray-400);
  border: 1px solid var(--gray-300);
}

.btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn-outline:focus {
  outline: none;
}

.btn-outline:focus-visible {
  outline: 2px solid var(--brand-hover);
  outline-offset: 2px;
}

.btn-outline:active {
  background: var(--brand);
  border-color: var(--brand) !important;
  color: var(--navy);
  outline: none;
}

/* Screen Reader Only - visually hidden but accessible */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Toggle Switch Component */
.toggle-switch {
  width: 2.75rem;
  height: 1.5rem;
  background-color: var(--gray-200);
  border-radius: 9999px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.2s;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.25rem;
  height: 1.25rem;
  background-color: var(--gray-500);
  border: 1px solid var(--gray-300);
  border-radius: 9999px;
  transition: transform 0.2s;
}

.peer:checked ~ .toggle-switch {
  background-color: var(--brand);
}

.peer:checked ~ .toggle-switch::after {
  transform: translateX(100%);
  border-color: var(--color-on-accent);
}

.peer:focus ~ .toggle-switch {
  outline: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 25%, transparent);
}

/* Notifications Inbox Styles */
#notifications-container {
  position: relative;
  display: flex;
  align-items: center;
  margin-right: 0.75rem; /* mr-3 */
}

#notifications-container.hidden {
  display: none;
}

#notifications-bell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  color: var(--color-text-secondary);
  transition: color 0.15s;
  cursor: pointer;
  background: transparent;
  border: none;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

#notifications-bell:hover,
#notifications-bell:focus {
  color: var(--color-text);
}

#notifications-badge {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  background-color: var(--color-error);
  color: var(--color-on-accent);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
  height: 1.25rem;
  min-width: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.25rem;
}

#notifications-badge.hidden {
  display: none;
}

#notifications-dropdown {
  position: fixed;
  right: 1rem;
  left: 1rem;
  top: 4.5rem; /* Below header */
  max-height: calc(100vh - 5.5rem); /* Viewport minus top and bottom margin */
  width: auto;
  max-width: none;
  background-color: var(--color-surface);
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  z-index: 50;
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
}

@media (min-width: 640px) {
  #notifications-dropdown {
    position: absolute;
    right: 0;
    left: auto;
    top: calc(100% + 1.5rem);
    max-height: 28rem; /* Fixed max height for desktop */
    width: 24rem;
    /* Keep flex layout for scrolling to work */
  }
}

/* Notifications header/footer - don't shrink */
#notifications-dropdown > div:first-child,
#notifications-footer {
  flex-shrink: 0;
}

/* Notifications list scroll fix for mobile */
#notifications-list {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  flex: 1;
  min-height: 0; /* Allow flex shrinking */
  overflow-y: auto;
}

/* On mobile, remove max-height and let flex handle it */
@media (max-width: 639px) {
  #notifications-list {
    max-height: none;
  }
}

/* Notification item styling */
.notification-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background-color 0.15s;
}

.notification-item:hover {
  background-color: var(--gray-50);
}

.notification-item.unread {
  background-color: var(--sky-tint);
}

/* Blue dot indicator for unread */
.notification-unread-dot {
  width: 0.5rem;
  height: 0.5rem;
  background-color: var(--sky-mid);
  border-radius: 9999px;
  flex-shrink: 0;
}

/* Line clamp utilities */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Form Input Focus Styles */
/* Ensure consistent input focus styles across all browsers */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select,
textarea {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

/* Hide Safari's broken auto-fill icons on email/contact fields */
input::-webkit-contacts-auto-fill-button,
input::-webkit-credentials-auto-fill-button {
  visibility: hidden;
  position: absolute;
  right: 0;
}

/* Override any browser default focus styles */
input:focus,
select:focus,
textarea:focus,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent);
  border-color: var(--brand);
}

/* Prevent webkit blue glow on focus */
input:focus,
select:focus,
textarea:focus {
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: text;
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

/* Focus visible for all interactive elements */
button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Modal close button - minimum touch target */
.modal-close-btn {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  transition: background-color 0.15s;
}

.modal-close-btn:hover {
  background-color: var(--gray-100);
}

.modal-close-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Footer social icon buttons - minimum touch target, mirrors .modal-close-btn pattern */
.footer-social-link {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  transition: background-color 0.15s, color 0.15s;
}

.footer-social-link:hover {
  background-color: var(--gray-100);
}

/* Modal backdrop - ensure proper stacking */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: var(--overlay);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* Modal content box */
.modal-content {
  background-color: var(--color-surface);
  border-radius: 0.5rem;
  max-width: 28rem;
  width: 100%;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

/* Minimum touch target for primary action buttons */
.btn,
.btn-primary,
.btn-secondary,
.btn-outline {
  min-height: 44px;
}

/* Small buttons can override but need larger touch area */
.btn-sm {
  min-height: 36px;
  padding: 0.5rem 1rem;
}

/* Icon buttons - ensure adequate touch target */
.icon-btn {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: 0.375rem;
}

/* Skip to main content link (for keyboard users) */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--brand);
  color: var(--color-on-accent);
  padding: 0.5rem 1rem;
  z-index: 100;
  border-radius: 0 0 0.375rem 0;
}

.skip-link:focus {
  top: 0;
}

/* Focus trap indicator for modals */
[aria-modal="true"]:focus {
  outline: none;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode improvements */
@media (prefers-contrast: high) {
  .btn-primary,
  .bg-brand {
    border: 2px solid currentColor;
  }

  input,
  select,
  textarea {
    border-width: 2px;
  }
}

/* Navigation */
.nav-link {
  color: var(--color-text-secondary);
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s;
}

.nav-link:hover {
  color: var(--color-text);
}

.nav-link-active {
  color: var(--brand);
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.main-nav {
  display: flex;
  gap: 0.5rem;
}

/* ============================================
   BRACKET PAGE STYLES
   ============================================ */

/* Format tabs */
.format-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.format-tab {
  padding: 0.5rem 1rem;
  border: 2px solid var(--gray-300);
  background: var(--gray-50);
  color: var(--gray-700);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  min-height: 44px;
  touch-action: manipulation;
}

.format-tab:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.format-tab:active {
  transform: scale(0.98);
}

.format-tab.active,
.format-tab[aria-selected="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--color-on-accent);
}

/* Page title (brackets page) */
.max-w-7xl > h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

/* Input section */
.input-section {
  background: var(--gray-50);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
}


/* Form elements */
.help-text {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

.format-description {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin: 0.75rem 0 1.5rem 0;
  padding: 0.75rem 1rem;
  background: var(--gray-100);
  border-radius: 6px;
  border-left: 3px solid var(--brand);
}

.format-limit {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand);
  background: var(--color-surface);
  border: 1px solid var(--brand);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  margin-left: 0.25rem;
  vertical-align: baseline;
}

/* Textarea with line numbers */
.textarea-wrapper {
  display: flex;
  border: 2px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
}

.textarea-wrapper:focus-within {
  border-color: var(--brand);
}

.line-numbers {
  background: var(--gray-100);
  padding: 0.75rem 0.5rem;
  text-align: right;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--gray-400);
  user-select: none;
  border-right: 1px solid var(--gray-200);
  min-width: 2.5rem;
  height: 200px;
  overflow-y: scroll;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.line-numbers::-webkit-scrollbar {
  display: none;
}

.line-numbers span {
  display: block;
  height: 1.5rem;
}

.textarea-wrapper textarea {
  flex: 1;
  border: none;
  border-radius: 0;
  resize: none;
  height: 200px;
  padding: 0.75rem;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  background: var(--color-background);
  color: var(--gray-900);
}

.textarea-wrapper textarea::placeholder {
  font-style: italic;
  opacity: 0.5;
}

.textarea-wrapper textarea:focus {
  outline: none;
}

/* Player count */
.player-count {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-top: 0.5rem;
}

.player-count.over-limit {
  color: var(--color-error);
  font-weight: 500;
}

.player-limit-warning {
  display: none;
  font-size: 0.85rem;
  color: var(--color-error);
  background: var(--red-tint);
  border: 1px solid var(--red-border);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
}

.player-limit-warning.visible {
  display: block;
}

/* Error message */
.error {
  background: var(--red-tint);
  border: 1px solid var(--red-border);
  color: var(--color-error);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-top: 1rem;
  display: none;
}

.error.visible {
  display: block;
}

/* Button row */
.button-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  justify-content: center;
}

@media (min-width: 640px) {
  .button-row {
    justify-content: flex-end;
  }
}

.input-section button,
.button-row button {
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
  touch-action: manipulation;
}

/* Focus styles for keyboard navigation */
.input-section button:focus-visible,
.button-row button:focus-visible,
.output-actions button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Remove default browser focus outline, but keep for focus-visible */
.input-section button:focus:not(:focus-visible),
.button-row button:focus:not(:focus-visible),
.output-actions button:focus:not(:focus-visible) {
  outline: none;
}

/* Output section */
.output-section {
  display: none;
}

.output-section.visible {
  display: block;
}

.output-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.output-header h2 {
  font-size: 1.25rem;
}

.title-edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--gray-400);
  margin-left: 0.5rem;
  padding: 0.1rem 0.3rem;
  vertical-align: middle;
  opacity: 0;
  transition: opacity 0.15s;
}

h2:hover .title-edit-btn,
.title-edit-btn:focus {
  opacity: 1;
}

.title-edit-input {
  font-size: 1.25rem;
  font-weight: 600;
  border: 1px solid var(--brand);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  width: 100%;
  max-width: 500px;
  background: var(--gray-50);
  color: var(--gray-900);
}

.title-edit-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent);
}

.output-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  justify-content: center;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  min-height: 44px;
  border-radius: 6px;
}

.output-actions .btn-small {
  min-width: 80px;
}

.save-hint {
  text-align: center;
  color: var(--gray-500);
  font-size: 0.8125rem;
  margin-top: 0.5rem;
}

/* Bracket container */
.bracket-container {
  background: var(--gray-50);
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  overflow-x: auto;
}


/* ============================================
   BRACKET HERO BANNER
   ============================================ */
.bracket-hero {
  text-align: center;
  padding: 1.25rem 1.5rem 1rem;
  margin-bottom: 1rem;
  background: var(--gray-50);
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.bracket-hero-title {
  font-family: 'Barlow Condensed', 'Barlow Condensed Fallback', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 0.5rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.bracket-hero-edit {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  padding: 0.35rem 1rem;
  min-height: 36px;
  color: var(--brand);
  border-color: var(--brand);
}

.bracket-hero-location {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.bracket-hero-pin {
  font-size: 1rem;
}

.bracket-hero-address {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
}

.bracket-hero-meta-row {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
}

.bracket-hero-rules {
  max-width: 600px;
  margin: 0.5rem auto 0.5rem;
}

.bracket-hero-rules summary {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.bracket-hero-rules summary:hover {
  color: var(--color-text);
}

.bracket-hero-description {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--color-surface);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
  text-align: left;
}

.bracket-hero-chips {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.bracket-hero-chip {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--green-tint);
  color: var(--brand);
  border: 1px solid var(--green-border);
}

.match-score {
  font-size: 0.7rem;
  color: var(--color-text-secondary);
  margin-left: auto;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.bracket-slot.winner {
  background: var(--green-tint);
}

/* Round Robin Table */
.round-robin-output {
  width: 100%;
}

.round-group {
  margin-bottom: 1.5rem;
}

.round-group:first-child .round-header {
  margin-top: 0;
}

.round-header {
  font-family: 'Barlow Condensed', 'Barlow Condensed Fallback', sans-serif;
  font-weight: 600;
  font-size: 0.8125rem;
  margin: 0 0 0.5rem 0;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.match-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.75rem;
}

.match-card {
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--gray-50);
}


.match-number {
  background: var(--green-tint);
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.match-players {
  flex: 1;
}

.player-name {
  font-weight: 500;
}

.vs {
  color: var(--gray-400);
  font-size: 0.8rem;
  margin: 0 0.25rem;
}

/* Doubles Mixer */
.doubles-mixer-output {
  width: 100%;
}

.mixer-info {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--gray-100);
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.mixer-info span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.mixer-warning {
  background: var(--yellow-tint);
  border: 1px solid var(--yellow-border);
  color: var(--color-warning);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.mixer-round {
  margin-bottom: 1.5rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
}

.mixer-round-header {
  font-family: 'Barlow Condensed', 'Barlow Condensed Fallback', sans-serif;
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.5rem 1rem;
  background: var(--gray-50);
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mixer-matches {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mixer-match {
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--gray-50);
}


.court-label {
  background: var(--brand);
  color: var(--color-on-accent);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
}

.mixer-teams {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.mixer-team {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.team-player {
  font-weight: 500;
}

.team-separator {
  color: var(--gray-400);
  font-size: 0.875rem;
}

.mixer-vs {
  color: var(--gray-400);
  font-size: 0.875rem;
  font-weight: 500;
}

.mixer-sitout {
  padding: 0.5rem 1rem;
  background: var(--gray-50);
  color: var(--gray-500);
  font-size: 0.875rem;
  border-top: 1px solid var(--gray-200);
}

/* Single/Double Elimination Bracket */
.elimination-bracket {
  display: flex;
  gap: 2rem;
  padding: 1rem 0;
  min-width: max-content;
}

.bracket-round {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  min-width: 200px;
}

.round-title {
  font-family: 'Barlow Condensed', 'Barlow Condensed Fallback', sans-serif;
  font-weight: 600;
  font-size: 0.8125rem;
  text-align: left;
  margin-bottom: 0.75rem;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.bracket-matches {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  flex: 1;
  gap: 1rem;
}

.bracket-match {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
  background: var(--gray-50);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}


.bracket-slot {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
}

.bracket-slot:last-child {
  border-bottom: none;
}

/* Loser slot dims when match is decided */
.bracket-slot.loser .slot-name {
  opacity: 0.5;
}

.bracket-slot.loser .seed {
  opacity: 0.5;
}

.bracket-slot.bye {
  color: var(--gray-400);
  font-style: italic;
  background: var(--gray-100);
}

.bracket-slot.tbd {
  color: var(--gray-400);
}

.bracket-slot.play-in-winner {
  color: var(--sky);
  font-style: italic;
  background: var(--sky-tint);
}

.play-in-section {
  margin-bottom: 1rem;
}

/* Match Status Indicators */
.match-status-pending {
  border-left: 4px solid var(--gray-400);
}

.match-status-in-progress {
  border-left: 4px solid var(--brand);
  background: linear-gradient(90deg, var(--gold-tint) 0%, var(--gray-50) 20%);
}


.match-status-completed {
  border-left: 4px solid var(--color-success);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.status-pending {
  background: var(--gray-100);
  color: var(--gray-500);
}

.status-in-progress {
  background: var(--gold-tint-strong);
  color: var(--color-warning);
}

.status-completed {
  background: var(--green-tint-strong);
  color: var(--color-success);
}

/* Metadata Section */
.metadata-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--color-background);
  border-radius: 6px;
}

.metadata-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.metadata-field label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gray-600);
  margin-bottom: 0;
}

.metadata-field input {
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 0.9rem;
  background: var(--color-background);
  color: var(--gray-900);
  min-height: 2.5rem;
}


.metadata-field input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent);
}

.metadata-field-full {
  grid-column: 1 / -1;
}

@media (max-width: 600px) {
  .metadata-section {
    grid-template-columns: 1fr;
  }
}

/* Consolation Toggle */
.consolation-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--gray-100);
  border-radius: 6px;
}

.consolation-toggle.visible {
  display: flex;
}

.consolation-toggle input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
}

.consolation-toggle label {
  font-size: 0.9rem;
  margin-bottom: 0;
  cursor: pointer;
}

/* Round Robin Standings Table */
.standings-table {
  margin-top: 1.5rem;
  background: var(--gray-50);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--gray-200);
}


.standings-table h3 {
  padding: 0.75rem 1rem;
  background: var(--brand);
  color: var(--color-on-accent);
  font-size: 1rem;
  margin: 0;
}

.standings-table table {
  width: 100%;
  border-collapse: collapse;
}

.standings-table th,
.standings-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-100);
}

.standings-table th {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
}

.standings-table tr:last-child td {
  border-bottom: none;
}

.standings-table .rank {
  font-weight: 600;
  color: var(--gray-600);
}

.bracket-info {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--gray-100);
  border-radius: 6px;
}

.bracket-info strong {
  color: var(--gray-900);
}


.seed {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--brand);
  min-width: 1.25rem;
  text-align: center;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  border-radius: 3px;
  padding: 1px 4px;
  line-height: 1.3;
}

.seed:empty {
  display: none;
}

.slot-name {
  flex: 1;
}

.score-box {
  width: 2rem;
  height: 1.5rem;
  border: 1px solid var(--gray-300);
  border-radius: 3px;
  text-align: center;
  font-size: 0.85rem;
}

/* Double Elimination specific */
.double-elim-container {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.bracket-section-title {
  font-family: 'Barlow Condensed', 'Barlow Condensed Fallback', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.losers-bracket .bracket-section-title {
  border-bottom-color: var(--orange);
}

.grand-final-section .bracket-section-title {
  border-bottom-color: var(--color-warning-strong);
}

.consolation-section {
  margin-top: 2rem;
}

.consolation-section .bracket-section-title {
  border-bottom-color: var(--purple-accent);
}

.consolation-title {
  margin-top: 2rem;
  border-bottom-color: var(--purple-accent);
}

/* Compass Draw */
.compass-draw-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.compass-direction {
  border-radius: 8px;
  padding: 0.5rem 0;
}

.compass-title-east { border-bottom-color: var(--brand); }
.compass-title-west { border-bottom-color: var(--orange); }
.compass-title-south { border-bottom-color: var(--brand); }
.compass-title-north { border-bottom-color: var(--cyan-accent); }
.compass-title-southeast { border-bottom-color: var(--pink-accent); }
.compass-title-northeast { border-bottom-color: var(--color-warning-strong); }
.compass-title-southwest { border-bottom-color: var(--teal-accent); }
.compass-title-northwest { border-bottom-color: var(--rose-accent); }

/* Connector lines between elimination rounds */
.bracket-round:not(:last-child) .bracket-match {
  position: relative;
}

.bracket-round:not(:last-child) .bracket-match::after {
  content: '';
  position: absolute;
  right: -1rem;
  top: 50%;
  width: 1rem;
  height: 0;
  border-top: 2px solid var(--gray-300);
}

/* Vertical connector: joins two match outputs into one input */
.bracket-round:not(:last-child) .bracket-match:nth-child(odd)::before {
  content: '';
  position: absolute;
  right: -1rem;
  top: 50%;
  height: calc(50% + 0.5rem);
  border-right: 2px solid var(--gray-300);
}

.bracket-round:not(:last-child) .bracket-match:nth-child(even)::before {
  content: '';
  position: absolute;
  right: -1rem;
  bottom: 50%;
  height: calc(50% + 0.5rem);
  border-right: 2px solid var(--gray-300);
}

/* Toast notification */
.toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  z-index: 100;
  text-align: center;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Match labels and TBD sources - hidden by default on desktop */
.match-label {
  display: none;
  font-size: 0.7rem;
  color: var(--gray-500);
  margin-bottom: 0.25rem;
  padding: 0.25rem 0 0 0.5rem;
  font-weight: 500;
}

.tbd-source {
  display: none;
  font-size: 0.65rem;
  color: var(--brand);
  font-weight: 600;
  margin-right: 0.25rem;
}

/* ===========================
   Bottom Sheet (mobile)
   =========================== */

.scroll-locked {
  overflow: hidden !important;
}

.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 60;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.bottom-sheet-overlay.visible {
  opacity: 1;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 85vh;
  background: var(--color-surface);
  border-radius: 16px 16px 0 0;
  z-index: 70;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
}

.bottom-sheet.visible {
  transform: translateY(0);
}

.bottom-sheet-handle {
  display: flex;
  justify-content: center;
  padding: 12px 0 4px;
  cursor: grab;
  flex-shrink: 0;
  touch-action: none;
}

.bottom-sheet-pill {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--gray-300);
}

.bottom-sheet-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ============================================
   EXPORT DROPDOWN
   ============================================ */
.export-dropdown {
  position: relative;
  display: inline-block;
}

.export-dropdown-menu {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 4px;
  min-width: 180px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  overflow: hidden;
}

.export-dropdown.open .export-dropdown-menu {
  display: block;
}

.export-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  background: none;
  color: var(--color-text);
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.export-dropdown-item:hover {
  background: var(--gray-100);
}

.export-dropdown-item + .export-dropdown-item {
  border-top: 1px solid var(--color-border);
}

/* ============================================
   BRACKET PAGE PRINT STYLES
   ============================================ */
@media print {
  @page {
    margin: 0.4in;
    size: landscape;
  }

  /* Force light-on-white for print readability */
  :root {
    --color-background: #ffffff;
    --color-surface: #ffffff;
    --color-text: #111827;
    --color-text-secondary: #6b7280;
    --color-border: #e5e7eb;
    --brand: #059669;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
  }

  /* --- Page layout: hide UI, reset spacing --- */

  html, body {
    height: auto;
    min-height: 0;
    overflow: visible;
    background: white;
    padding: 0;
  }

  header, footer,
  .input-section, .output-actions, .save-hint, .upgrade-prompt, .bracket-cta, .anon-save-nudge, .bracket-limit-nudge,
  .toast, .mixer-warning, .consolation-toggle,
  h1:not(.bracket-hero-title), .subtitle, .format-description,
  #settings-btn {
    display: none !important;
  }

  .container,
  .max-w-7xl {
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  .output-section {
    display: block !important;
    margin: 0;
    padding: 0;
  }

  .output-header {
    margin-bottom: 0.5rem;
  }

  .output-header h1,
  .output-header h2 {
    font-size: 1.1rem;
  }

  .bracket-container {
    box-shadow: none;
    padding: 0;
    overflow: visible;
    width: 100%;
    max-width: 100%;
    background: white;
  }

  .bracket-info {
    background: var(--gray-100) !important;
    border: 1px solid var(--gray-300);
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    padding: 0.35rem 0.5rem;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  /* --- Elimination brackets (single, double, compass) --- */

  .elimination-bracket {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0.25rem 0;
    font-size: 0.7rem;
    min-width: 0 !important;
    max-width: 100%;
    width: 100%;
  }

  .bracket-round {
    min-width: 0 !important;
    flex: 1 1 0;
    justify-content: flex-start;
    break-inside: avoid;
  }

  .bracket-matches {
    gap: 0.15rem;
    justify-content: flex-start;
  }

  .bracket-match {
    break-inside: avoid;
    background: white;
  }

  .bracket-round:not(:last-child) .bracket-match::after,
  .bracket-round:not(:last-child) .bracket-match::before {
    display: none;
  }

  .bracket-slot {
    padding: 0.1rem 0.3rem;
    min-height: 1rem;
    font-size: 0.65rem;
    border: 1px solid var(--gray-300);
  }

  .bracket-slot.winner {
    background: #ecfdf5 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .bracket-slot .match-score {
    font-size: 0.55rem;
    color: #6b7280;
  }

  .bracket-slot.tbd {
    border-color: var(--gray-400);
    min-height: 1.1rem;
    font-size: 0.6rem;
    background: white;
  }

  .bracket-slot.tbd .slot-name {
    visibility: hidden;
  }

  .bracket-slot.bye {
    font-size: 0.6rem;
  }

  .seed {
    font-size: 0.55rem;
    min-width: 1.1rem;
  }

  .round-title {
    font-size: 0.65rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    padding: 0.15rem 0.35rem;
    text-align: center;
    background: var(--brand) !important;
    color: white !important;
    border-radius: 4px;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .match-label {
    display: none;
  }

  .tbd-source {
    display: inline;
    font-size: 0.55rem;
    color: var(--brand) !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  /* --- Double elimination specific --- */

  .double-elim-container {
    gap: 0.75rem;
  }

  .bracket-section-title {
    break-inside: avoid;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    padding-bottom: 0.15rem;
    border-bottom: 2px solid var(--brand) !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .losers-bracket .bracket-section-title {
    border-bottom-color: #f97316 !important;
  }

  .grand-final-section .bracket-section-title {
    border-bottom-color: #eab308 !important;
  }

  .consolation-section .bracket-section-title {
    border-bottom-color: #a855f7 !important;
  }

  .grand-final-section {
    break-inside: avoid;
    break-after: avoid;
  }

  /* --- Round Robin --- */

  .round-group {
    break-inside: avoid;
    margin-bottom: 0.75rem;
  }

  .round-group:last-of-type {
    break-after: avoid;
  }

  .round-header {
    margin: 0 0 0.35rem 0;
    font-size: 0.8rem;
  }

  .round-robin-output .match-list {
    margin-bottom: 0;
    gap: 0.35rem;
  }

  .match-card {
    break-inside: avoid;
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
    background: white;
  }

  .match-number {
    font-size: 0.7rem;
    padding: 0.15rem 0.35rem;
    background: var(--gray-100) !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .player-name {
    font-size: 0.8rem;
  }

  .vs {
    font-size: 0.75rem;
  }

  /* --- Doubles Mixer --- */

  .mixer-info {
    background: var(--gray-100) !important;
    border: 1px solid var(--gray-300);
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    padding: 0.5rem;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .mixer-round {
    break-inside: avoid;
    margin-bottom: 0.75rem;
  }

  .mixer-round:last-of-type {
    break-after: avoid;
  }

  .mixer-round-header {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    break-after: avoid;
  }

  .mixer-matches {
    padding: 0.5rem;
    gap: 0.35rem;
    break-before: avoid;
  }

  .mixer-match {
    break-inside: avoid;
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
    background: white;
  }

  .court-label {
    background: var(--brand) !important;
    color: white !important;
    font-size: 0.7rem;
    padding: 0.15rem 0.35rem;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .team-player {
    font-size: 0.8rem;
  }

  .team-separator,
  .mixer-vs {
    font-size: 0.75rem;
  }

  .mixer-sitout {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }

  /* Hero banner: compact for print */
  .bracket-hero {
    text-align: left;
    padding: 0 0 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
  }

  .bracket-hero-title {
    font-size: 1.3rem;
  }

  .bracket-hero-location {
    font-size: 0.9rem;
    justify-content: flex-start;
  }

  .bracket-hero-address {
    font-size: 0.75rem;
  }

  .bracket-hero-meta-row {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
  }

  .bracket-hero-rules {
    display: none;
  }

  .bracket-hero-chips {
    display: none;
  }

  .title-edit-btn {
    display: none !important;
  }

  /* Share URL footer */
  .output-section::after {
    content: "nextrally.app";
    display: block;
    text-align: center;
    font-size: 0.7rem;
    color: #6b7280;
    margin-top: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e5e7eb;
  }

  .bracket-match,
  .match-card,
  .bracket-hero-chip {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  /* Score panel & sidebar (moved from second print block) */
  .score-entry-panel {
    display: none;
  }

  .standings-table {
    page-break-inside: avoid;
  }

  .standings-table .alt-row {
    background: #f3f4f6 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .match-clickable:hover {
    box-shadow: none;
    border-color: inherit;
  }

  .settings-sidebar,
  .sidebar-overlay,
  #settings-btn {
    display: none !important;
  }

  .sidebar-theme-grid {
    display: none !important;
  }
}

/* ============================================
   BRACKET PAGE MOBILE STYLES (screen only)
   ============================================ */
@media screen and (max-width: 600px) {
  .format-tabs {
    flex-direction: column;
    gap: 0.375rem;
  }

  .format-tab {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    width: 100%;
    text-align: center;
  }

  .output-actions {
    justify-content: center;
  }

  .bracket-container {
    padding: 0.75rem;
    overflow-x: hidden;
  }

  .elimination-bracket {
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
    max-width: 100%;
  }

  /* Hide connector lines in stacked mobile layout */
  .bracket-round:not(:last-child) .bracket-match::after,
  .bracket-round:not(:last-child) .bracket-match::before {
    display: none;
  }

  .bracket-round {
    min-width: 0;
    max-width: 100%;
  }

  .bracket-match {
    max-width: 100%;
    overflow: hidden;
    min-height: 56px;
  }

  .match-clickable {
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  }

  .bracket-slot {
    overflow: hidden;
    min-height: 26px;
    padding: 4px 0.5rem;
  }

  .slot-name {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .match-label {
    display: block;
  }

  .tbd-source {
    display: inline;
  }

  .format-limit {
    display: block;
    margin-top: 0.5rem;
  }

  .format-description + p {
    margin-bottom: 1rem;
  }

  .match-score {
    font-size: 0.7rem;
  }

  .match-updated-by {
    font-size: 0.7rem;
    padding: 2px 0.75rem 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .score-entry-panel {
    min-width: 0;
    width: calc(100vw - 16px);
    max-width: 360px;
    left: 8px !important;
    right: 8px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
  }

  .score-panel-header {
    padding: 0.5rem 0.75rem;
  }

  .score-panel-body {
    padding: 0.5rem 0.75rem;
  }

  .score-panel-actions {
    padding: 0.5rem 0.75rem;
  }

  .score-player-label {
    min-width: 3rem;
    font-size: 0.75rem;
  }

  .score-set-input {
    width: 2.5rem;
    padding: 0.25rem 0.15rem;
    font-size: 0.8rem;
  }

  .score-tb-input {
    width: 2rem;
    padding: 0.25rem 0.15rem;
    font-size: 0.75rem;
  }

  .score-set-row {
    gap: 0.25rem;
  }

  .winner-selection {
    gap: 0.5rem;
  }

  .match-tb-toggle {
    font-size: 0.75rem;
  }

  /* Doubles mixer mobile layout */
  .mixer-match {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
  }

  .mixer-teams {
    flex-basis: calc(100% - 4.5rem);
    font-size: 0.9rem;
  }

  .mixer-match .match-score {
    margin-left: auto;
  }

  .mixer-match .match-updated-by {
    display: none;
  }

  /* Sidebar mobile fixes */
  .settings-sidebar {
    width: 100vw;
    max-width: 100vw;
  }

  .sidebar-field input[type="date"],
  .sidebar-field input[type="time"] {
    min-height: 44px;
    font-size: 1rem;
  }

  .sidebar-field input[type="text"],
  .sidebar-field input[type="number"],
  .sidebar-field textarea {
    font-size: 1rem;
  }

  .sidebar-add-player input,
  .sidebar-add-cohost input {
    font-size: 1rem;
    min-height: 44px;
  }

  .sidebar-player-item {
    padding: 0.625rem 0.5rem;
  }

  .sidebar-player-drag {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    touch-action: none;
  }

  /* Toast at bottom on mobile */
  .toast {
    top: auto;
    bottom: 1rem;
  }

  /* Larger confirm dialog buttons on mobile */
  .confirm-modal-cancel,
  .confirm-modal-confirm {
    min-height: 44px;
    font-size: 1rem;
  }

}

/* ============================================
   BILLING PAGE
   ============================================ */

/* Subscription status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 500;
}

.status-badge.active {
  background: var(--green-tint-strong);
  color: var(--color-success);
}

.status-badge.past_due {
  background: var(--gold-tint-strong);
  color: var(--color-warning);
}

.status-badge.canceled,
.status-badge.free {
  background: var(--gray-100);
  color: var(--color-text-secondary);
}

/* Usage progress bars */
.usage-bar {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}

.usage-bar-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 4px;
  transition: width 0.3s;
}

.usage-bar-fill.warning {
  background: var(--brand);
}

.usage-bar-fill.danger {
  background: var(--color-error);
}

/* ============================================
   PRICING PAGE
   ============================================ */

/* Pricing cards */
.pricing-card {
  transition: transform 0.2s, box-shadow 0.2s;
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.pricing-card.featured {
  border: 2px solid var(--brand);
  position: relative;
}

.pricing-card.featured::before {
  content: 'Best Value';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand);
  color: var(--color-on-accent);
  padding: 4px 16px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

/* Feature checklist */
.feature-list li {
  display: flex;
  align-items: start;
  gap: 8px;
  padding: 8px 0;
}

.feature-list li svg {
  flex-shrink: 0;
  margin-top: 2px;
}

/* Billing interval toggle */
.toggle-billing {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-bottom: 32px;
}

.toggle-billing button {
  padding: 8px 24px;
  border-radius: 24px;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-billing button.active {
  background: var(--brand);
  color: var(--color-on-accent);
  border-color: var(--brand);
}

/* Savings badge */
.savings-badge {
  display: inline-block;
  background: var(--gold-tint-strong);
  color: var(--color-warning);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 8px;
}

@media (prefers-color-scheme: light) {
  .savings-badge {
    color: var(--color-warning-text);
  }
}

/* ============================================
   UPGRADE PROMPT
   ============================================ */

.upgrade-prompt {
  margin-top: 1rem;
  padding: 1.25rem;
  background: var(--sky-tint);
  border: 1px solid var(--sky-border);
  border-radius: 8px;
  text-align: center;
}

.upgrade-prompt p {
  margin: 0 0 0.75rem;
  color: var(--sky);
  font-size: 0.9375rem;
}

.upgrade-prompt .btn {
  display: inline-block;
}

/* ============================================
   STANDINGS TABLE (Round Robin)
   ============================================ */

.standings-section {
  margin-top: 2rem;
}

.standings-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.standings-table {
  width: 100%;
  max-width: 600px;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.standings-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  color: var(--color-text);
  border-bottom: 2px solid var(--gray-300);
  white-space: nowrap;
}

.standings-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--gray-200);
  color: var(--color-text);
}

.standings-table .alt-row {
  background: var(--gray-50);
}

.standings-table .rank-col {
  font-weight: 600;
  color: var(--gray-500);
  width: 2rem;
}

.standings-table .diff-positive {
  color: var(--color-success);
  font-weight: 600;
}

.standings-table .diff-negative {
  color: var(--color-error);
  font-weight: 600;
}

/* ============================================
   SCORE ENTRY PANEL
   ============================================ */

.match-clickable {
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.match-clickable:hover {
  box-shadow: 0 0 0 2px var(--brand);
  border-color: var(--brand);
}

.match-updated-by {
  font-size: 0.7rem;
  color: var(--gray-500);
  padding: 2px 0.75rem 4px;
}

.score-entry-panel {
  z-index: 100;
  background: var(--color-surface);
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  min-width: 320px;
}

.score-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.score-panel-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text);
}

.score-panel-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--gray-500);
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
}

.score-panel-close:hover {
  color: var(--color-text);
}

.score-panel-body {
  padding: 0.75rem 1rem;
}

.score-sets {
  margin-bottom: 0.75rem;
}

.score-set-group {
  margin-bottom: 0.5rem;
}

.score-set-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.score-set-clear {
  background: none;
  border: 1px solid var(--gray-300);
  color: var(--gray-500);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1;
  padding: 1px 6px;
  border-radius: 4px;
}

.score-set-clear:hover {
  color: var(--red-500, #ef4444);
  border-color: var(--red-300, #fca5a5);
  background: var(--red-50, #fef2f2);
}

.score-set-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}

.score-player-label {
  font-size: 0.8rem;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 4rem;
  flex: 1;
}

.score-set-input {
  width: 3rem;
  padding: 0.3rem 0.2rem;
  text-align: center;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  font-size: 0.875rem;
  background: var(--color-surface);
  color: var(--color-text);
}

.score-set-input:focus,
.score-set-input:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent);
}

.score-tb-group {
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-size: 0.8rem;
  color: var(--gray-500);
}

.score-tb-input {
  width: 2.5rem;
  padding: 0.3rem 0.2rem;
  text-align: center;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  font-size: 0.8rem;
  background: var(--color-surface);
  color: var(--color-text);
}

.score-tb-input:focus,
.score-tb-input:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent);
}

.match-tb-toggle {
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  color: var(--color-text);
}

.match-tb-toggle label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.match-tb-toggle input[type="checkbox"] {
  accent-color: var(--brand);
}

.winner-selection {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.winner-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text);
}

.winner-radio {
  font-size: 0.8rem;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
}

.winner-radio input[type="radio"] {
  accent-color: var(--brand);
}

.score-panel-attribution {
  font-size: 0.7rem;
  color: var(--gray-500);
  margin-top: 0.5rem;
}

.score-panel-error {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  color: var(--color-error);
  background: var(--red-tint);
  border-top: 1px solid var(--red-border);
}

.score-panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--gray-200);
}

/* Sidebar inside bottom sheet (mobile) */
.bottom-sheet-content .settings-sidebar {
  position: static;
  transform: none;
  width: 100%;
  max-width: 100%;
  box-shadow: none;
  height: auto;
}

.bottom-sheet-content .sidebar-body {
  flex: none;
  overflow-y: visible;
}


/* Score panel inside bottom sheet (mobile) */
.score-panel-in-sheet {
  position: static !important;
  width: 100% !important;
  max-width: 100% !important;
  box-shadow: none !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.score-panel-in-sheet .score-panel-header { padding: 0.75rem 1rem; }
.score-panel-in-sheet .score-panel-body { padding: 0.75rem 1rem; }
.score-panel-in-sheet .score-set-input {
  width: 3.5rem; height: 48px; font-size: 1rem; text-align: center;
}
.score-panel-in-sheet .score-tb-input {
  width: 2.5rem; height: 40px; font-size: 1rem; text-align: center;
}
.score-panel-in-sheet .score-player-label { font-size: 0.9rem; min-width: 4rem; }
.score-panel-in-sheet .score-panel-actions { padding: 0.75rem 1rem 1.5rem; }
.score-panel-in-sheet .score-panel-actions button { min-height: 44px; font-size: 1rem; }
.score-panel-in-sheet .winner-radio { min-height: 44px; display: inline-flex; align-items: center; }

.quick-score-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  margin-bottom: 8px;
}

.quick-score-btn {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--color-text);
  transition: background 0.15s;
}

.quick-score-btn:hover, .quick-score-btn:active {
  background: var(--gray-200);
}

/* ===========================
   Settings Sidebar
   =========================== */

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-light);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sidebar-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.settings-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 360px;
  max-width: 90vw;
  background: var(--color-surface);
  z-index: 50;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.3);
}

.settings-sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.sidebar-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.sidebar-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-500);
  padding: 8px;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.sidebar-close:hover {
  color: var(--gray-800);
}

.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.sidebar-section {
  border-bottom: 1px solid var(--gray-200);
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  min-height: 44px;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gray-700);
}

.sidebar-section-header:hover {
  background: var(--gray-50);
}

.sidebar-section-header:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.sidebar-section-toggle {
  font-size: 0.75rem;
  color: var(--gray-500);
  transition: transform 0.2s ease;
}

.sidebar-section.collapsed .sidebar-section-toggle {
  transform: rotate(-90deg);
}

.sidebar-section-content {
  padding: 8px 20px 16px;
}

.sidebar-section.collapsed .sidebar-section-content {
  display: none;
}

.sidebar-field {
  margin-bottom: 12px;
}

.sidebar-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-600);
  margin-bottom: 4px;
}

.sidebar-field input[type="text"],
.sidebar-field input[type="date"],
.sidebar-field input[type="time"],
.sidebar-field input[type="number"],
.sidebar-field textarea {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 0.9rem;
  background: var(--color-background);
  color: var(--gray-900);
}

.sidebar-field textarea {
  resize: vertical;
  font-family: inherit;
}

.sidebar-field input:focus,
.sidebar-field textarea:focus,
.sidebar-field input:focus-visible,
.sidebar-field textarea:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent);
}

.sidebar-btn-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.sidebar-btn-row button {
  width: 100%;
}

/* Player list in sidebar */
.sidebar-player-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-player-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.5rem;
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.9rem;
  transition: background 0.15s;
}

.sidebar-player-list.drag-active > .sidebar-player-item {
  transition: background 0.15s, transform 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.sidebar-player-item[draggable="true"]:hover {
  background: var(--gray-50);
}

.sidebar-player-item.dragging {
  opacity: 0;
  height: 0;
  padding: 0 0.5rem;
  border-bottom: none;
  overflow: hidden;
  transition: none;
}

.sidebar-player-item.drag-clone {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
  background: var(--color-surface);
  border: 1px solid var(--brand);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2), 0 2px 6px rgba(0,0,0,0.1);
  border-radius: 6px;
  opacity: 0;
  padding: 6px 8px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: scale(1.03);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.sidebar-player-item.drag-clone.clone-active {
  opacity: 1;
}

.sidebar-player-item.drag-gap {
  transform: translateY(var(--drag-gap-height, 44px));
}

.sidebar-player-item.drop-above {
  box-shadow: 0 -2px 0 0 var(--brand);
}

.sidebar-player-item.drop-below {
  box-shadow: 0 2px 0 0 var(--brand);
}

.sidebar-player-list > .sidebar-player-item:last-child {
  border-bottom: none;
}

.sidebar-player-seed {
  color: var(--gray-500);
  font-size: 0.8rem;
  margin-right: 6px;
  min-width: 24px;
}

.sidebar-player-name {
  flex: 1;
}

.sidebar-player-remove {
  background: none;
  border: none;
  color: var(--gray-500);
  cursor: pointer;
  padding: 6px 8px;
  min-height: 36px;
  min-width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  border-radius: 4px;
}

.sidebar-player-remove:hover {
  color: var(--color-error);
  background: var(--red-tint);
}

.sidebar-add-player {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.sidebar-add-player input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 0.9rem;
}

.sidebar-add-player input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent);
}

/* Drag handle */
.sidebar-player-drag {
  cursor: grab;
  color: var(--gray-500);
  font-size: 1.1rem;
  user-select: none;
  touch-action: none;
  padding: 4px 6px;
  min-width: 28px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.sidebar-player-seed {
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Inline rename input */
.sidebar-rename-input {
  flex: 1;
  font-size: 0.9rem;
  padding: 2px 6px;
  border: 1px solid var(--brand);
  border-radius: 3px;
  outline: none;
  min-width: 0;
}

/* Auto-save status */
#sidebar-description {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  background: var(--color-background);
  color: var(--color-text);
  font-size: 0.85rem;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

#sidebar-description:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent);
}

.sidebar-save-status {
  display: block;
  font-size: 0.8rem;
  min-height: 1.2em;
  margin-top: 4px;
  opacity: 0;
  transition: opacity 0.3s;
  color: var(--green-600, #16a34a);
}

.sidebar-save-status.visible {
  opacity: 1;
}

.sidebar-save-status.error {
  color: var(--red-600, #dc2626);
}

/* Pro feature badge */
.sidebar-pro-badge {
  padding: 0.75rem;
  background: var(--gray-100);
  border: 1px dashed var(--gray-300);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  text-align: center;
}

.sidebar-pro-link {
  color: var(--brand);
  text-decoration: underline;
}

.sidebar-pro-link:hover {
  color: var(--brand-hover);
}

/* Bulk add */
.sidebar-bulk-add-link,
.sidebar-bulk-add-link:visited,
.sidebar-bulk-add-link:active {
  display: block;
  font-size: 0.8rem;
  color: var(--brand);
  margin-top: 4px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-align: right;
}

.sidebar-bulk-add-link:hover {
  color: var(--brand-hover);
}

.sidebar-bulk-add-link:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 2px;
}

.sidebar-bulk-add {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.sidebar-bulk-add textarea {
  width: 100%;
  font-size: 0.875rem;
  padding: 8px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  resize: vertical;
  font-family: inherit;
  background: var(--color-background);
  color: var(--gray-900);
}

.sidebar-bulk-status {
  font-size: 0.8rem;
  color: var(--gray-500);
}

/* Regenerate hint */
.sidebar-seed-banner {
  font-size: 0.8rem;
  color: var(--amber-800, #92400e);
  background: var(--amber-50, #fffbeb);
  border: 1px solid var(--amber-200, #fde68a);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 10px;
  line-height: 1.4;
}

.sidebar-regen-hint {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin: 12px 0 8px;
  font-style: italic;
  text-align: center;
}

/* Co-hosts section */
.sidebar-cohost-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem 0;
}

.sidebar-cohost-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--gray-200);
}

.sidebar-cohost-handle {
  font-size: 0.9rem;
  color: var(--color-text);
}

.sidebar-cohost-item:last-child {
  border-bottom: none;
}

.sidebar-cohost-remove {
  background: none;
  border: none;
  color: var(--gray-500);
  cursor: pointer;
  font-size: 1.1rem;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.sidebar-cohost-remove:hover {
  color: var(--color-error);
  background: rgba(239, 68, 68, 0.1);
}

.sidebar-add-cohost {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.sidebar-add-cohost input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 0.9rem;
  background: var(--color-background);
  color: var(--gray-900);
}

.sidebar-add-cohost input:focus,
.sidebar-add-cohost input:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent);
}

.sidebar-cohost-add-wrapper {
  position: relative;
}

.sidebar-cohost-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  list-style: none;
  padding: 4px 0;
  margin: 2px 0 0;
  background: var(--color-surface);
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10;
  max-height: 180px;
  overflow-y: auto;
}

.sidebar-cohost-dropdown-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--color-text);
}

.sidebar-cohost-dropdown-item:hover {
  background: var(--gray-50);
}

.sidebar-cohost-dropdown-empty {
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--gray-500);
  font-style: italic;
}

.sidebar-cohost-status {
  font-size: 0.8rem;
  min-height: 1.2em;
}

.sidebar-cohost-status.error {
  color: var(--color-error);
}

.sidebar-cohost-empty {
  color: var(--gray-500);
  font-style: italic;
  font-size: 0.85rem;
  padding: 0.3rem 0;
}

/* Danger zone */
.sidebar-section.danger-zone .sidebar-section-header {
  color: var(--color-error);
}

.sidebar-section.danger-zone .btn-danger-outline {
  background: none;
  border: none;
  padding: 0;
  min-height: 0;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sidebar-warning {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-bottom: 12px;
}

/* ============================================
   LANDING PAGE
   ============================================ */

.landing-hero {
  padding: 3rem 1.5rem 2rem;
  text-align: center;
}

@media (min-width: 640px) {
  .landing-hero {
    padding: 5rem 1.5rem 3rem;
  }
}

.landing-hero h1 {
  font-family: 'Barlow Condensed', 'Barlow Condensed Fallback', sans-serif;
  font-weight: 800;
  font-size: clamp(3rem, 8vw, 5rem);
  line-height: 0.95;
  letter-spacing: -1px;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  color: var(--color-text);
}

.landing-hero h1 .accent {
  color: var(--brand);
}

.landing-hero p {
  font-size: clamp(1rem, 2.5vw, 1.375rem);
  color: var(--color-text-secondary);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Product cards */
.landing-products {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .landing-products {
    grid-template-columns: repeat(3, 1fr);
  }
}

.landing-product-card {
  background: var(--color-surface);
  border: 1px solid var(--gray-200);
  border-radius: 1rem;
  padding: 2.5rem;
  transition: all 0.3s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.landing-product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.card-brackets:hover { border-color: var(--brand); }
.card-stringlog:hover { border-color: var(--cyan-accent); }
.card-courtsnap:hover { border-color: var(--coral); }
.card-courtlens:hover { border-color: var(--teal-accent); }

.landing-product-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.landing-product-header h2 {
  font-family: 'Barlow Condensed', 'Barlow Condensed Fallback', sans-serif;
  font-weight: 700;
  font-size: 1.75rem;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  color: var(--color-text);
  margin: 0;
}

.landing-product-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.625rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.badge-free {
  background: var(--green-tint-strong);
  color: var(--color-success);
  border: 1px solid var(--green-border);
}

.badge-new-cyan {
  background: #ECFEFF;
  color: #0891B2;
  border: 1px solid #A5F3FC;
}

.badge-soon {
  background: var(--sky-tint);
  color: var(--sky);
  border: 1px solid var(--sky-border);
}
.card-courtsnap .badge-soon {
  background: var(--coral-tint);
  color: var(--coral);
  border: 1px solid var(--coral-border);
}
.card-courtlens .badge-soon {
  background: var(--teal-tint);
  color: var(--teal-accent);
  border: 1px solid var(--teal-border);
}

.landing-product-card h3 {
  font-weight: 500;
  font-size: 1rem;
  color: var(--color-text-secondary);
  margin: 0;
}

.landing-product-card p {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 0;
}

.landing-product-cta {
  display: inline-block;
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--brand);
}

.landing-product-cta.cyan {
  color: var(--cyan-accent);
}
.landing-product-cta.coral {
  color: var(--coral);
}
.landing-product-cta.teal {
  color: var(--teal-accent);
}
.card-brackets .landing-product-cta {
  color: var(--brand);
}

/* Icon backgrounds (shared) */
.icon-gold { background: var(--gold-tint-strong); }
.icon-sky { background: var(--sky-tint-strong); }
.icon-coral { background: var(--coral-tint); }
.icon-green { background: var(--green-tint-strong); }
.icon-coral-bg { background: var(--coral-tint); }

/* ============================================
   COURTSNAP PAGE — CourtSnap brand palette
   ============================================ */

.courtsnap-page {
  --cs-primary: #D4622B;
  --cs-primary-dark: #B8511F;
  --cs-accent: #10B981;
  --cs-accent-dark: #059669;
  --cs-secondary: #C9963A;
  --cs-bg: #FFF8F0;
  --cs-text: #3B2314;
  --cs-text-secondary: #8C7060;
  --cs-border: #E8D5C4;
  --cs-tint: #FFF0E6;
  --cs-green-tint: #E8F5EF;

  background: var(--cs-bg);
  color: var(--cs-text);
  min-height: 100%;
}

@media (prefers-color-scheme: dark) {
  .courtsnap-page {
    --cs-bg: #1a1a1a;
    --cs-text: #f5f5f5;
    --cs-text-secondary: #9ca3af;
    --cs-border: #374151;
    --cs-tint: #2A1E14;
    --cs-green-tint: #0F2318;
    --cs-primary: #E07A45;
    --cs-primary-dark: #D4622B;
    --cs-secondary: #D4A94E;
  }
}

.courtsnap-hero {
  position: relative;
  overflow: hidden;
  padding: 4rem 1.5rem 3rem;
  text-align: center;
  isolation: isolate;
  background: #fff;
}

.courtsnap-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 140%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 20%, var(--cs-tint) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, var(--cs-green-tint) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

@media (min-width: 640px) {
  .courtsnap-hero {
    padding: 6rem 1.5rem 4rem;
  }
}

.courtsnap-icon {
  display: block;
  margin: 0 auto 1.5rem;
  border-radius: 1.25rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.courtsnap-title {
  font-family: 'Barlow Condensed', 'Barlow Condensed Fallback', sans-serif;
  font-weight: 700;
  font-size: clamp(3.5rem, 10vw, 6rem);
  line-height: 0.95;
  letter-spacing: -1px;
  margin-bottom: 1.5rem;
  color: var(--cs-primary);
}

.courtsnap-tagline {
  font-family: 'Barlow Condensed', 'Barlow Condensed Fallback', sans-serif;
  font-weight: 600;
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--cs-secondary);
  margin-bottom: 2rem;
}

.courtsnap-description {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--cs-text-secondary);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Download section */
.courtsnap-download {
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: #D4622B;
  color: #fff;
}

.courtsnap-download h2 {
  font-family: 'Barlow Condensed', 'Barlow Condensed Fallback', sans-serif;
  font-weight: 700;
  font-size: 1.75rem;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
  color: #fff;
}

.courtsnap-ios-note {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 2rem;
}

.courtsnap-store-badges {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.courtsnap-store-badge {
  opacity: 0.4;
  filter: grayscale(100%);
  transition: opacity 0.2s;
}

.courtsnap-store-badge:hover {
  opacity: 0.6;
}

a.courtsnap-store-badge {
  opacity: 1;
  filter: none;
}

a.courtsnap-store-badge:hover {
  opacity: 0.85;
}

/* ============================================
   ANONYMOUS SAVE NUDGE
   ============================================ */
.anon-save-nudge {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--gold-tint);
  border: 1px solid var(--gold-border);
  border-radius: 0.5rem;
  text-align: center;
}

.anon-save-nudge p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

.anon-save-nudge a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
}

/* ============================================
   SHARED BRACKET CTA
   ============================================ */
.bracket-cta {
  margin-top: 1.5rem;
  padding: 1rem 1.5rem;
  background: var(--sky-tint, #f0f9ff);
  border: 1px solid var(--sky-light, #bae6fd);
  border-radius: 0.5rem;
  text-align: center;
}

.bracket-cta p {
  margin: 0 0 0.5rem;
  color: var(--gray-600, #4b5563);
  font-size: 0.9375rem;
}

/* ============================================
   ROUND NAVIGATION TABS (mobile)
   ============================================ */
.round-tabs { display: none; }

@media screen and (max-width: 600px) {
  .round-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 0.75rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--color-background);
    border-bottom: 1px solid var(--gray-200);
  }

  .round-tab {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--gray-200);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
  }

  .round-tab.active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
  }

  .round-tab:active { transform: scale(0.95); }
}

/* ============================================
   BRACKET LIMIT NUDGE
   ============================================ */
.bracket-limit-nudge {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--sky-tint, #f0f9ff);
  border: 1px solid var(--sky-light, #bae6fd);
  border-radius: 0.5rem;
  text-align: center;
}

.bracket-limit-nudge p {
  margin: 0;
  color: var(--gray-600, #4b5563);
  font-size: 0.875rem;
}

.bracket-limit-nudge a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
}

/* ── Legal pages (privacy, terms, support) ── */

.list-disc { list-style-type: disc; }
.pl-5 { padding-left: 1.25rem; }
.space-y-1 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.25rem; }

.legal-link { color: var(--color-text-secondary); text-decoration: underline; text-decoration-color: var(--gray-300); text-underline-offset: 2px; }
.legal-link:hover { color: var(--color-text); text-decoration-color: var(--gray-400); }

.legal-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.legal-section-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--color-text);
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 1.25rem;
}

/* Disabled state utilities */
.disabled\:opacity-50:disabled { opacity: 0.5; }
.disabled\:cursor-not-allowed:disabled { cursor: not-allowed; }

/* Underline utility */
.underline { text-decoration-line: underline; }

/* Danger zone card - subtle red tint for destructive actions */
.danger-zone-card {
    background-color: #FEF2F2;
    border: 1px solid #FECACA;
}

.legal-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 1.5rem;
  margin-bottom: 0.375rem;
}
.legal-label:first-child { margin-top: 0; }

.legal-nav-active { color: var(--color-text); font-weight: 600; }

