@charset "UTF-8";
/* =========================
   Base (all screens)
========================= */
/* Global Styles */
:root {
  --primary-color: #3b82f6;
  --secondary-color: #ef4444;
  --accent-color: #c5aa22;
  --dark-bg: #050814;
  --light-bg: #ffffff;
  --text-dark: #050814;
  --text-light: #ffffff;
  --muted-dark: rgba(0, 0, 0, 0.72);
  --muted-light: rgba(255, 255, 255, 0.72);
  --line-dark: rgba(0, 0, 0, 0.14);
  --line-light: rgba(255, 255, 255, 0.14);
}

* :not(.btn) {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Roboto", sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--light-bg);
}

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

ul {
  list-style: none;
}

img {
  max-width: 100%;
}

.container {
  max-width: 1700px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Navigation */
header {
  background-color: var(--dark-bg);
  color: var(--text-light);
  padding: 0.1rem 0.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo img {
  height: 40px;
  width: auto;
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

nav ul {
  display: flex;
  gap: 20px;
}

nav a {
  padding: 8px 12px;
  border-radius: 4px;
  transition: background-color 0.3s;
}

nav a:hover, nav a.active {
  background-color: rgba(255, 255, 255, 0.1);
}

.login-btn {
  background-color: var(--primary-color);
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: 500;
}

.login-btn:hover {
  background-color: #2563eb;
}

/* Hero Section */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, #f6f8ff 0%, #e9f1ff 100%);
}

.hero-content {
  flex: 1;
  max-width: 600px;
}

.hero-content h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--dark-bg);
}

.hero-content p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: var(--muted-dark);
}

.hero-image {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.tennis-court {
  max-width: 400px;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
  100% {
    transform: translateY(0px);
  }
}
.cta-buttons {
  display: flex;
  gap: 15px;
}

/* Features Section */
.features {
  padding: 4rem 2rem;
  background-color: white;
}

.features h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 3rem;
  color: var(--dark-bg);
}

.feature-cards {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
}

.feature-card {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 30px;
  width: 300px;
  text-align: center;
  transition: transform 0.3s;
}

.feature-card:hover {
  transform: translateY(-10px);
}

.feature-card img {
  height: 60px;
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 1.3rem;
  margin-bottom: 15px;
  color: var(--dark-bg);
}

.feature-card p {
  color: var(--muted-dark);
}

/* Footer */
footer {
  background-color: var(--dark-bg);
  color: var(--text-light);
  padding: 0.3rem 0.2rem 0.1rem;
  bottom: 0;
  position: absolute;
  width: 100%;
}

.footer-content {
  height: 2vw;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 0.2rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.small-icon {
  height: 30px;
  width: auto;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-social {
  display: flex;
  gap: 15px;
}

.social-icon {
  opacity: 0.8;
  transition: opacity 0.3s;
}

.social-icon:hover {
  opacity: 1;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--line-light);
  font-size: 0.9rem;
  color: var(--muted-light);
}

/* Page Header */
.page-header {
  background: linear-gradient(135deg, #f6f8ff 0%, #e9f1ff 100%);
  padding: 3rem 2rem;
  text-align: center;
}

.page-header h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--dark-bg);
}

.page-header p {
  font-size: 1.2rem;
  color: var(--muted-dark);
  max-width: 700px;
  margin: 0 auto;
}

/* How It Works Page */
/* App Purpose Section */
.app-purpose {
  padding: 4rem 0;
  background-color: #f8fafc;
  margin-bottom: 2rem;
}

.app-purpose h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--dark-bg);
}

.app-purpose > p {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 3rem;
  font-size: 1.2rem;
  color: var(--muted-dark);
  line-height: 1.7;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 2rem;
}

.feature {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 25px;
  transition: transform 0.3s;
}

.feature:hover {
  transform: translateY(-5px);
}

.feature h3 {
  color: var(--primary-color);
  font-size: 1.4rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--line-dark);
  padding-bottom: 0.5rem;
}

.feature p {
  color: var(--muted-dark);
  margin-bottom: 1rem;
}

.feature ul {
  padding-left: 20px;
  margin-bottom: 1rem;
}

.feature li {
  margin-bottom: 0.5rem;
  color: var(--muted-dark);
}

.feature li::before {
  content: "✓";
  color: var(--primary-color);
  font-weight: bold;
  display: inline-block;
  width: 1em;
  margin-left: -1em;
}

/* How It Works Steps */
.how-it-works {
  padding: 4rem 0;
}

.step {
  display: flex;
  margin-bottom: 3rem;
  align-items: flex-start;
}

.step-number {
  background-color: var(--primary-color);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  margin-right: 2rem;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-content h2 {
  margin-bottom: 1rem;
  color: var(--dark-bg);
}

.step-content p {
  margin-bottom: 1.5rem;
  color: var(--muted-dark);
}

.step-image {
  max-width: 200px;
  margin-top: 1rem;
}

.instruction-list {
  list-style: none;
  padding: 0;
}

.instruction-list li {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.instruction-list .small-icon {
  width: 24px;
  height: 24px;
  margin-right: 10px;
}

/* Keyboard Shortcuts */
.keyboard-shortcuts {
  background-color: #f8fafc;
  padding: 4rem 2rem;
  margin-bottom: 4rem;
}

.keyboard-shortcuts h2 {
  text-align: center;
  margin-bottom: 2rem;
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.shortcut {
  display: flex;
  align-items: center;
  background-color: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.key {
  background-color: var(--dark-bg);
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-weight: bold;
  margin-right: 15px;
  min-width: 36px;
  text-align: center;
}

.description {
  color: var(--muted-dark);
}

/* CTA Section */
.cta-section {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  padding: 4rem 2rem;
  text-align: center;
}

.cta-section h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.cta-section p {
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cta-section .primary-btn {
  background-color: white;
  color: var(--primary-color);
}

.cta-section .primary-btn:hover {
  background-color: #f8fafc;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

/* About Page */
.about-content {
  display: flex;
  gap: 2rem;
  padding: 0.5rem 0.3rem;
}

.about-story {
  flex: 2;
}

.about-story h2 {
  margin: 2rem 0 1rem;
  color: var(--dark-bg);
}

.about-story h2:first-child {
  margin-top: 0;
}

.about-story p {
  margin-bottom: 1.5rem;
  color: var(--muted-dark);
  line-height: 1.7;
}

.about-story ul {
  padding-left: 20px;
  margin-bottom: 2rem;
}

.about-story li {
  margin-bottom: 0.5rem;
  color: var(--muted-dark);
}

.about-image {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 2rem;
}

.tennis-court-large {
  max-width: 100%;
  animation: float 6s ease-in-out infinite;
}

.team-section {
  padding: 4rem 2rem;
  background-color: #f8fafc;
}

.team-section h2 {
  text-align: center;
  margin-bottom: 3rem;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  max-width: 1000px;
  margin: 0 auto;
}

.team-member {
  text-align: center;
  background-color: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s;
}

.team-member:hover {
  transform: translateY(-10px);
}

.team-member img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
  border: 4px solid var(--primary-color);
}

.team-member h3 {
  margin-bottom: 0.5rem;
  color: var(--dark-bg);
}

.team-member p {
  color: var(--muted-dark);
  margin-bottom: 0.5rem;
}

/* Contact Page */
.contact-content {
  display: flex;
  gap: 0.3vw;
  padding: 0.5vw 0.2vw;
  flex-wrap: wrap;
}

.contact-info {
  flex: 1;
  min-width: 300px;
}

.contact-info h2 {
  margin-bottom: 1rem;
  color: var(--dark-bg);
}

.contact-info > p {
  margin-bottom: 2rem;
  color: var(--muted-dark);
  line-height: 1.7;
}

.contact-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.contact-method {
  margin-bottom: 1.5rem;
}

.contact-method h3 {
  margin-bottom: 0.5rem;
  color: var(--dark-bg);
  font-size: 1.1rem;
}

.contact-method p {
  color: var(--muted-dark);
}

.contact-method a {
  color: var(--primary-color);
  transition: color 0.3s;
}

.contact-method a:hover {
  color: #2563eb;
  text-decoration: underline;
}

.social-links {
  display: flex;
  gap: 10px;
}

.social-link {
  color: var(--primary-color);
  transition: color 0.3s;
}

.social-link:hover {
  color: #2563eb;
  text-decoration: underline;
}

.contact-form {
  flex: 1;
  min-width: 300px;
  background-color: white;
  padding: 0.4rem;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.contact-form h2 {
  margin-bottom: 1.5rem;
  color: var(--dark-bg);
}

.form-group {
  margin-bottom: 0.3rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--dark-bg);
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* FAQ Section */
.faq-section {
  padding: 4rem 2rem;
  background-color: #f8fafc;
  margin-bottom: 2rem;
}

.faq-section h2 {
  text-align: center;
  margin-bottom: 3rem;
  color: var(--dark-bg);
}

.faq-item {
  background-color: white;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.faq-item h3 {
  margin-bottom: 0.5rem;
  color: var(--dark-bg);
  font-size: 1.2rem;
}

.faq-item p {
  color: var(--muted-dark);
  line-height: 1.7;
}

/* Login Page */
.login-container {
  max-width: 500px;
  margin: 4rem auto;
  padding: 2rem;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.login-container h2 {
  margin-bottom: 2rem;
}

.login-container p {
  margin-bottom: 2rem;
  color: var(--muted-dark);
}

.g-signin2 {
  display: inline-block;
  margin-bottom: 2rem;
}

.login-divider {
  display: flex;
  align-items: center;
  margin: 2rem 0;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--line-dark);
}

.login-divider span {
  padding: 0 10px;
  color: var(--muted-dark);
}

.login-benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 2rem 0;
}

.benefit-item {
  text-align: left;
  padding: 1rem;
  border-radius: 8px;
  background-color: #f8fafc;
}

.benefit-item h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--dark-bg);
}

.benefit-item p {
  color: var(--muted-dark);
  font-size: 0.9rem;
}

.login-footer {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--muted-dark);
}

.login-footer a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s;
}

.login-footer a:hover {
  color: #2563eb;
  text-decoration: underline;
}

.google-signin-button {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

/* Responsive Design */
.message {
  background: #efe;
  padding: 10px;
  margin-bottom: 15px;
}

.friend-msg {
  background: #eef;
  padding: 8px;
  margin-bottom: 5px;
}

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

td, th {
  padding: 3px 6px;
  border: 1px solid #ccc;
}

main {
  max-width: 95vw;
  margin-left: 1vw;
  padding: 0.5vw 0.2vw;
}

.nav-links {
  display: flex;
  gap: 20px;
  margin-bottom: 0.5vw;
  margin-top: 0.5vw;
}

.nav-links a {
  text-decoration: none;
  padding: 8px 16px;
  background-color: #f0f0f0;
  border-radius: 4px;
  color: #333;
}

.nav-links a.active {
  background-color: #4CAF50;
  color: white;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  bottom: 3vw;
  position: absolute;
  flex-wrap: wrap;
}

.page-link {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  text-decoration: none;
  color: #333;
  background: #fff;
}

.page-link:hover {
  background: #f5f5f5;
}

.page-link.active {
  background: #2196F3;
  color: #fff;
  border-color: #2196F3;
}

.page-meta {
  text-align: center;
  margin-top: 10px;
  color: #666;
  font-size: 14px;
  position: absolute;
  bottom: 3vw;
  display: inline-flex;
}

.page-wrap {
  max-width: 98vw;
  margin: 0 0.5vw;
  padding: 0.2vw;
}

.grid {
  display: grid;
  grid-template-columns: 20vw 1fr;
  gap: 2vw;
  align-items: start;
}

.card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 7px;
}

.card h2 {
  margin: 0 0 7px 0;
  font-size: 18px;
}

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

label {
  font-size: 1vw;
  color: #333;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

input[type=text], input[type=date], input[type=time], select {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  min-width: 9vw;
}

input[type=number] {
  max-width: 120px;
}

.alert {
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #f9f9f9;
  margin-bottom: 4px;
}

.muted {
  color: #777;
  font-size: 13px;
}

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

.table th, .table td {
  padding: 4px 4px;
  border-bottom: 1px solid #eee;
  text-align: left;
  vertical-align: middle;
}

.table th {
  background: #f8f8f8;
  font-weight: 700;
}

.status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid #ddd;
  background: #fff;
}

.status.pending {
  background: #fff7e6;
  border-color: #ffe0a3;
}

.status.confirmed {
  background: #e8f5e9;
  border-color: #b7e1c1;
}

.status.refused {
  background: #ffebee;
  border-color: #f5b3b3;
}

.status.cancelled {
  background: #f2f2f2;
  border-color: #ddd;
  color: #666;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nowrap {
  white-space: nowrap;
}

.date-group-odd {
  background-color: #ccc4c5;
}

.date-group-even {
  background-color: #ffffff;
}

.flash-success {
  background-color: #e8f5e9;
  border-color: #b7e1c1;
  color: #2e7d32;
  padding: 4px 10px;
  border-radius: 5px;
  width: 99vw;
}

.flash-error {
  background-color: #fff3e0;
  border-color: #ffcc80;
  color: #ef6c00;
  padding: 4px 10px;
  border-radius: 5px;
}

.new-match {
  background-color: #c8e6c9 !important;
}

.match-center {
  margin: 0 1vw;
  padding: 0.2vw;
}

.match-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.2vw;
}

.match-table th, .match-table td {
  padding: 4px 8px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.match-table th {
  background-color: #f8f8f8;
  font-weight: bold;
}

.match-table tr:hover {
  background-color: #f5f5f5;
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: #666;
}

.alert {
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid transparent;
  border-radius: 4px;
}

.alert-danger {
  color: #721c24;
  background-color: #f8d7da;
  border-color: #f5c6cb;
}

.header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.pagination {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.page-link {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  text-decoration: none;
  color: #333;
  background: #fff;
}

.page-link:hover {
  background: #f5f5f5;
}

.page-link.active {
  background: #2196F3;
  color: #fff;
  border-color: #2196F3;
}

/* Mobile-friendly styles for Tennis Scoreboard */
/* Hide header, footer, and dashboard header on mobile */
/* Mobile Navigation */
.mobile-navigation {
  display: none;
  background-color: var(--dark-bg);
  color: var(--text-light);
  padding: 10px;
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.mobile-site-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-item {
  margin-bottom: 5px;
}

.mobile-nav-link {
  display: block;
  padding: 10px 15px;
  color: var(--text-light);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.mobile-nav-auth-link {
  display: block;
  padding: 12px 15px;
  margin-top: 10px;
  background-color: var(--primary-color);
  color: white;
  text-align: center;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
}

.mobile-nav-auth-link:hover {
  background-color: #2563eb;
}

/* Responsive tables */
/* Accordion styles */
.accordion {
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
}

.accordion-header {
  background-color: #f8f8f8;
  padding: 12px 15px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
}

.accordion-header:after {
  content: "+"; /* Plus sign */
  font-size: 20px;
  font-weight: bold;
}

.accordion-header.active:after {
  content: "−"; /* Minus sign */
}

.accordion-content {
  padding: 0 15px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease-out;
}

/* Form improvements for mobile */
/* Hero section improvements for mobile */
.date-group-odd {
  background-color: #ccc4c5;
}

.date-group-even {
  background-color: #ece2e4;
}

#mobile-menu > ul > li > a {
  font-size: 1.6rem;
}

/* =========================
   Mobile (<= 860px)
========================= */
/* =========================
   Desktop (861–1080px)
   (currently same as base)
========================= */
/* =========================
   Large screens (>=1081px)
   (currently same as base)
========================= */
/* =========================
   MOBILE (<= 860px)
========================= */
@media (max-width: 860px) {
  input[type=text], input[type=date], input[type=time], select {
    padding: 1vw;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 5vw;
    min-width: 19vw;
  }
  label {
    font-size: 4.5vw;
    color: #333;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  nav ul {
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  .hero {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }
  .hero-content {
    max-width: 100%;
  }
  .cta-buttons {
    justify-content: center;
  }
  .step {
    flex-direction: column;
  }
  .step-number {
    margin-bottom: 1rem;
  }
  .footer-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .footer-links, .footer-social {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  /* From styles.css @media (max-width: 768px) */
  header {
    flex-direction: column;
    padding: 1rem;
  }
  nav ul {
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  .hero {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }
  .hero-content {
    max-width: 100%;
  }
  .cta-buttons {
    justify-content: center;
  }
  .step {
    flex-direction: column;
  }
  .step-number {
    margin-bottom: 1rem;
  }
  .footer-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .footer-links, .footer-social {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  /* From styles.css @media (max-width: 980px) — aligned to mobile breakpoint */
  .grid {
    grid-template-columns: 1fr;
  }
  /* From mobile.css @media (max-width: 768px) */
  .mobile-hidden {
    display: none !important;
  }
  .mobile-navigation {
    display: block;
  }
  /* Convert tables to cards on mobile */
  table, .table, .match-table {
    display: block;
    width: 100%;
  }
  thead, tbody, th, td, tr {
    display: block;
  }
  /* Hide table headers */
  thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  tr {
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
  }
  td, th {
    position: relative;
    padding: 4px 4px 4px 50% !important;
    border: none !important;
    border-bottom: 1px solid #eee !important;
    text-align: left !important;
    min-height: 25px;
  }
  td:before {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 45%;
    padding-right: 10px;
    white-space: nowrap;
    font-weight: bold;
    content: attr(data-label);
  }
  /* Special styling for action buttons */
  td:last-child {
    border-bottom: none !important;
  }
  .actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
  .actions .btn {
    display: inline-flex;
    text-align: center;
    margin: 2px 0;
  }
  /* Adjust edit form on mobile */
  .edit-inline {
    flex-direction: column;
    width: 100%;
  }
  .edit-inline .edit-ctrl {
    width: 100% !important;
    max-width: 100% !important;
  }
  .row {
    flex-direction: column;
    align-items: stretch;
  }
  label {
    width: 100%;
  }
  input[type=text],
  input[type=date],
  input[type=time],
  input[type=number],
  select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .btn:hover {
    background-color: #45a049;
  }
  .btn {
    display: inline-block;
    background: #4c7eaf;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    width: 12vw !important;
    padding: 0.5vw !important;
    text-align: center !important;
  }
  .btn.schedule {
    width: 100% !important;
  }
  .btn:hover {
    background: #45a049;
  }
  .btn.btn-primary {
    background: #2196F3;
  }
  .btn.btn-secondary {
    background: #45a049;
  }
  .btn.btn-secondary:hover {
    background: #0b7dda;
  }
  .btn.btn-edit {
    background: #c067dd;
    text-align: center;
  }
  .btn.btn-edit:hover {
    background: #3b648c;
  }
  .btn.btn-cancel {
    background: #efaf3a;
    color: red;
  }
  .btn.btn-cancel:hover {
    background: #c62828;
  }
  .btn.btn-danger {
    background: #e53935;
  }
  .btn-danger:hover {
    background: #c62828;
  }
  .btn.btn-outline {
    background: yellow;
    color: #333;
    border: 1px solid #ddd;
    text-align: center;
  }
  .btn.btn-outline:hover {
    background: #f5f5f5;
  }
  /* Adjust grid layout */
  .grid {
    display: block;
  }
  .card {
    margin-bottom: 15px;
  }
  /* Adjust pagination */
  .pagination {
    position: absolute;
    margin-top: 20px;
    margin-bottom: 20px;
  }
  .hero {
    padding: 2rem 1rem;
  }
  .hero-content h2 {
    font-size: 2rem;
  }
  .hero-content p {
    font-size: 1rem;
  }
  .tennis-court {
    max-width: 100%;
  }
  /* Moved from header.php inline <style> */
  #mobile-menu > li, #mobile-menu > li > a {
    line-height: 2.6;
    background-color: #a1c1dc;
    font-size: 1.7rem;
  }
  /* from upcoming_schedule_mobile.php */
  .m-wrap {
    margin: 0;
    padding: 4px;
    background-color: #c5aa22;
  }
  .m-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin: 6px 0 10px;
  }
  .m-top h2 {
    margin: 0;
    font-size: 18px;
    line-height: 1.1;
  }
  .m-tabs {
    gap: 6px;
    width: 20vw;
    margin-right: 4vw;
  }
  .m-top .m-tabs {
    width: 90vw;
    margin-right: 4vw;
  }
  .grid_upcoming .m-tabs {
    width: 90vw;
    margin: 0;
  }
  .m-card {
    background: #fff;
    border-radius: 14px;
    width: 95vw;
    padding: 4px 4px 6px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
  }
  .m-time {
    font-size: 4.8vw;
  }
  .m-who {
    font-size: 4.8vw;
    margin-top: 1px;
  }
  .m-field {
    margin-top: 8px;
  }
  .m-label {
    display: block;
    font-weight: 700;
    margin-bottom: 4px;
  }
  .m-input, .m-select {
    width: 100%;
    height: 40px;
    border-radius: 12px;
    border: 1px solid #ddd;
    padding: 0 10px;
    font-size: 4vw;
  }
  .m-row2 {
    display: flex;
    gap: 8px;
  }
  .m-row2 > * {
    flex: 1;
  }
  .m-cta {
    margin-top: 10px;
    display: flex;
    gap: 8px;
  }
  .m-cta .btn {
    height: 40px;
    line-height: 40px;
    padding: 0 14px;
    border-radius: 12px;
  }
  .m-muted {
    opacity: 0.75;
    font-size: 1rem;
  }
  .flash-success, .flash-error {
    margin: 8px 0;
    padding: 10px 12px;
    border-radius: 12px;
  }
  .flash-success {
    background: #e7f7ea;
  }
  .flash-error {
    background: #fde8e8;
  }
  *, select {
    font-size: 1.5rem;
  }
  /* from past_matches_mobile.php */
  .wrap {
    max-width: 740px;
    margin: 0 auto;
    padding: 10px 10px 20px;
  }
  .tabs {
    display: flex;
    gap: 8px;
    margin: 10px 0;
  }
  .tabs a {
    flex: 1;
    text-align: center;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 900;
  }
  .tabs a.active {
    background: #2f8fe8;
    color: #fff;
  }
  .tabs a.inactive {
    background: #f3a40b;
    color: #000;
  }
  .card {
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 14px;
    padding: 12px;
    margin: 10px 0;
  }
  .flash {
    padding: 10px 12px;
    border-radius: 10px;
    margin: 10px 0;
    font-weight: 600;
  }
  .flash.ok {
    background: #e9ffe9;
    border: 1px solid #8bd48b;
  }
  .flash.err {
    background: #ffe9e9;
    border: 1px solid #e6a0a0;
  }
  .topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .pill {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #ffe6b7;
  }
  .meta {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 2px;
  }
  .score {
    font-weight: 800;
    margin-top: 6px;
  }
  .actions {
    margin-top: 10px;
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
  }
  .actions form {
    margin: 0;
    display: inline-block;
  }
  .actions .btn, .actions button, .actions a {
    height: 34px;
    line-height: 34px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 4.2vw;
    display: inline-block !important;
    min-width: 30vw;
    width: auto !important;
    flex: 0 0 auto;
  }
  .note {
    margin-left: auto;
    font-size: 12px;
    opacity: 0.75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 45%;
    text-align: right;
  }
  .pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 14px 0;
    flex-wrap: wrap;
  }
  .page-link {
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #ddd;
    text-decoration: none;
  }
  .page-link.active {
    background: #2f8fe8;
    color: #fff;
    border-color: #2f8fe8;
  }
  .muted {
    opacity: 0.75;
    font-size: 12px;
  }
  .page-wrap {
    height: 100vw;
    width: 100vw;
    position: relative;
    overflow: hidden;
  }
  .page-wrap.Mobile {
    height: 210vw;
    width: 100vw;
    z-index: 1000;
    position: relative;
    overflow: hidden;
  }
  .grid_upcoming, .card.upcoming-card {
    display: inline-block;
    width: 97vw;
    left: 1%;
    position: relative;
    height: 210%;
    top: 0;
    background-color: #c5aa22;
  }
  .card.upcoming-card {
    width: 97vw;
    left: 2%;
    position: relative;
    height: 210%;
    top: 0;
  }
  /* from past_register_mobile.php */
  .wrap {
    max-width: 740px;
    margin: 0 auto;
    padding: 10px 10px 20px;
  }
  .tabs {
    display: flex;
    gap: 8px;
    margin: 10px 0;
  }
  .tabs a {
    flex: 1;
    text-align: center;
    padding: 4px 6px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
  }
  .tabs a.active {
    background: #f3a40b;
    color: #000;
  }
  .tabs a.inactive {
    background: #2f8fe8;
    color: #fff;
  }
  .card {
    background: #ddd8d9;
    border: 1px solid #e6e6e6;
    border-radius: 14px;
    padding: 6px;
    margin: 4px 0;
    color: black;
  }
  .flash {
    padding: 4px 6px;
    border-radius: 10px;
    margin: 10px 0;
    font-weight: 600;
  }
  .flash.ok {
    background: #e9ffe9;
    border: 1px solid #8bd48b;
  }
  .flash.err {
    background: #ffe9e9;
    border: 1px solid #e6a0a0;
  }
  .row {
    margin: 4px 0;
    gap: 4px;
  }
  label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
  }
  input, select {
    width: 100%;
    padding: 10px;
    border: 1px solid #d8d8d8;
    border-radius: 10px;
  }
  .time-row {
    display: flex;
    gap: 8px;
    align-items: center;
  }
  .time-row select {
    width: auto;
    min-width: 74px;
  }
  .sets {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
  }
  .sets th, .sets td {
    border: 1px solid #eee;
    padding: 6px;
    text-align: center;
  }
  .sets input {
    padding: 8px;
    text-align: center;
  }
  .two {
    display: flex;
    gap: 10px;
  }
  .two > div {
    flex: 1;
  }
  .btn {
    padding: 11px 12px;
    border-radius: 12px;
    border: none;
    font-weight: 800;
  }
  .btn-primary {
    background: #f3a40b;
    color: #000;
  }
  .muted {
    opacity: 0.85;
    font-size: 15px;
    color: black;
  }
  /* from friend_search.php */
  .search-form {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
  }
  .search-input {
    width: 90%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 3vw;
  }
  .search-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 5.5vw;
    width: 20vw;
    margin-top: 1.1vw;
    margin-left: 10vw;
    display: inline-block;
  }
  .search-btn:hover {
    background: #45a049;
  }
  .filter-form {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 14px 20px;
    margin-bottom: 20px;
  }
  .filter-row {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
  }
  .filter-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
  }
  .filter-row input[type=text],
  .filter-row input[type=number],
  .filter-row select {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 4.5vw;
  }
  .filter-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
  }
  .reset-link {
    display: inline-block;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    background: #fff;
  }
  .reset-link:hover {
    background: #f5f5f5;
  }
  .results-table th {
    background: #f8f8f8;
    font-weight: bold;
  }
  .muted {
    color: #777;
    font-size: 13px;
  }
  .users-list {
    list-style: none;
    padding: 0;
  }
  .user-item {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .user-info {
    font-weight: bold;
  }
  .add-btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
  }
  .add-btn:hover {
    background: #0b7dda;
  }
  .add-guest-btn {
    background: #FF9800;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1.1vw;
    font-size: 1.2vw;
    display: inline-block;
  }
  .add-guest-btn:hover {
    background: #F57C00;
  }
  /* Layout: forms left, results right */
  .layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    width: 100%;
  }
  .sidebar {
    width: 360px;
  }
  .sidebar.Mobile {
    width: 480vw;
  }
  .content {
    flex: 1;
    min-width: 0;
  }
  /* --- Mobile-only fixes (keep bootstrap .row from breaking our form layout) --- */
  /* from past_schedule_mobile.php */
  /* from match_details_mobile.php */
  /* Layout tighter for mobile */
  /* --- Friends grid --- */
  /* --- Pagination --- */
  /* ===== Sets table (mobile) ===== */
  /* Game dots smaller */
  /* ===== Stats table (mobile) ===== */
  /* Graph */
  /* from profile_mobile.php */
  /* Profile page (local only) */
  /* Responsive form grid:
             - desktop: 4 cols
             - tablet: 3 cols
             - phone: 2 cols
             - tiny: 1 col
          */
  /* Top header block */
  /* Form controls */
  /* Intl prefix + number fields */
  /* Breakpoints */
  /* =========================
     Upcoming schedule form (mobile): right-aligned controls + keep time selects on one line
     Applies to the "Schedule a match" form (#createMatchForm)
  ========================= */
  /* Put label text on the left, controls aligned to the right */
  /* Controls share the same right edge */
  /* Court number should stay compact but still right-aligned */
  /* Keep hour + minute on a single row */
  /* Slightly favor hour width over minutes */
  /* Ultra-small phones: reduce label column by shrinking max width a bit */
  /* Mobile cards view (based on previous upcoming_matches_mobile.php) */
  /* Location + Court on a single line */
}
@media (max-width: 860px) and (max-width: 1000px) {
  .sets-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* ripristina la tabella vera SOLO per la tabella set */
  .sets-wrap table.sets-inline {
    display: table !important;
    width: 100% !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
  }
  .sets-wrap table.sets-inline thead {
    display: table-header-group !important;
  }
  .sets-wrap table.sets-inline tbody {
    display: table-row-group !important;
  }
  .sets-wrap table.sets-inline tr {
    display: table-row !important;
  }
  .sets-wrap table.sets-inline th,
  .sets-wrap table.sets-inline td {
    display: table-cell !important;
    float: none !important;
    position: static !important;
    padding: 4px !important;
    padding-left: 4px !important; /* annulla padding-left:50% */
    width: auto !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
  }
  /* CRITICO: spegne la modalità "card" */
  .sets-wrap table.sets-inline td::before,
  .sets-wrap table.sets-inline th::before {
    content: none !important;
    display: none !important;
  }
}
@media (max-width: 860px) and (max-width: 600px) {
  .wrap .row {
    display: block !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    --bs-gutter-x: 0 !important;
    --bs-gutter-y: 0 !important;
  }
  .wrap .row > * {
    max-width: 100% !important;
  }
  .wrap input[type=date] {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .wrap button.btn,
  .wrap .btn.btn-primary {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
}
@media (max-width: 860px) {
  .wrap {
    max-width: 740px;
    margin: 0 auto;
    padding: 10px 10px 20px;
  }
  .tabs {
    display: flex;
    gap: 8px;
    margin: 10px 0;
  }
  .tabs a {
    flex: 1;
    text-align: center;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
  }
  .tabs a.active {
    background: #f3a40b;
    color: #000;
  }
  .tabs a.inactive {
    background: #2f8fe8;
    color: #fff;
  }
  .card {
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 14px;
    padding: 4px;
    margin: 4px 0;
  }
  .flash {
    padding: 10px 12px;
    border-radius: 10px;
    margin: 10px 0;
    font-weight: 600;
  }
  .flash.ok {
    background: #e9ffe9;
    border: 1px solid #8bd48b;
  }
  .flash.err {
    background: #ffe9e9;
    border: 1px solid #e6a0a0;
  }
  .row {
    margin: 4px 0;
    gap: 4px;
  }
  label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
  }
  input, select {
    width: 100%;
    padding: 10px;
    border: 1px solid #d8d8d8;
    border-radius: 10px;
  }
  .time-row {
    display: flex;
    gap: 8px;
    align-items: center;
  }
  .time-row select {
    width: auto;
    min-width: 74px;
  }
  .sets {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
  }
  .sets th, .sets td {
    border: 1px solid #eee;
    padding: 6px;
    text-align: center;
  }
  .sets input {
    padding: 8px;
    text-align: center;
  }
  .two {
    display: flex;
    gap: 10px;
  }
  .two > div {
    flex: 1;
  }
  .btn {
    padding: 11px 12px;
    border-radius: 12px;
    border: none;
    font-weight: 800;
  }
  .btn-primary {
    background: #f3a40b;
    color: #000;
  }
  .muted {
    opacity: 0.75;
    font-size: 4.5vw !important;
  }
}
@media (max-width: 860px) and (max-width: 1000px) {
  .sets-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* ripristina la tabella vera SOLO per la tabella set */
  .sets-wrap table.sets-inline {
    display: table !important;
    width: 100% !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
  }
  .sets-wrap table.sets-inline thead {
    display: table-header-group !important;
  }
  .sets-wrap table.sets-inline tbody {
    display: table-row-group !important;
  }
  .sets-wrap table.sets-inline tr {
    display: table-row !important;
  }
  .sets-wrap table.sets-inline th,
  .sets-wrap table.sets-inline td {
    display: table-cell !important;
    float: none !important;
    position: static !important;
    padding: 4px !important;
    padding-left: 4px !important; /* annulla padding-left:50% */
    width: auto !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
  }
  /* CRITICO: spegne la modalità "card" */
  .sets-wrap table.sets-inline td::before,
  .sets-wrap table.sets-inline th::before {
    content: none !important;
    display: none !important;
  }
}
@media (max-width: 860px) {
  :root {
    --p0-color: var(--p0-color);
    --p1-color: var(--p1-color);
  }
  .player0 {
    color: var(--p0-color);
    font-weight: 800;
  }
  .player1 {
    color: var(--p1-color);
    font-weight: 800;
  }
  body {
    margin: 0;
  }
  .match-details {
    max-width: 100vw;
    margin: 0 auto;
    padding: 10px;
    overflow: visible;
  }
  .match-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
  }
  .match-header h2 {
    margin: 0;
    font-size: 16px;
    line-height: 1.15;
  }
  .header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 2px;
  }
  .toggle-btn {
    padding: 4px 7px;
    border-radius: 6px;
    border: 2px solid #111;
    background: #fff;
    color: #111;
    font-weight: 800;
    cursor: pointer;
    line-height: 1;
    font-size: 4.5vw;
  }
  .btn {
    display: inline-block;
    padding: 7px 10px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 5.5vw;
    text-decoration: none;
    color: #fff;
    background: #4CAF50;
    line-height: 1;
    font-weight: 800;
    width: 30vw;
  }
  .btn-secondary {
    background: #2196F3;
  }
  .alert {
    padding: 10px;
    margin: 10px 0;
    border: 1px solid transparent;
    border-radius: 6px;
  }
  .alert-danger {
    color: #721c24;
    background: #f8d7da;
    border-color: #f5c6cb;
  }
  .friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 12px;
    margin-top: 16px;
  }
  .friend-card {
    background: #fff;
    border: 1px solid #e7e7e7;
    border-radius: 14px;
    padding: 14px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    min-width: 0;
  }
  .avatar {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    object-fit: cover;
    background: #f0f0f0;
    border: 1px solid #eaeaea;
    flex: 0 0 auto;
  }
  .f-body {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 2.6vw;
  }
  .f-name {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 6px;
  }
  .name {
    font-weight: 700;
    font-size: 6vw;
  }
  .badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 5vw;
    padding: 2px 6px;
    border-radius: 999px;
    background: #f2f7ff;
    border: 1px solid #dbe9ff;
    color: #1b4ea3;
    white-space: nowrap;
  }
  .badge.blocked {
    background: #fff5f5;
    border-color: #f2c7c7;
    color: #9b1c1c;
  }
  .meta {
    margin: 0;
    color: #555;
    font-size: 5vw;
    line-height: 1.35;
  }
  .meta + .meta {
    margin-top: 4px;
  }
  .meta .label {
    color: #888;
  }
  .actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
  }
  .actions form {
    margin: 0;
  }
  .btn2 {
    appearance: none;
    border: 1px solid #cfcfcf;
    background: #fff;
    padding: 9px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
  }
  .btn2:hover {
    background: #f7f7f7;
  }
  .btn2.block {
    border-color: #f2c7c7;
    background: #fff5f5;
  }
  .btn2.unblock {
    border-color: #c9e7d0;
    background: #f4fff6;
  }
  .pagination {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: left;
    bottom: 18px;
    position: absolute;
    flex-wrap: wrap;
  }
  .page-btn, .page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #d8d8d8;
    border-radius: 10px;
    background: #fff;
    color: #222;
    text-decoration: none;
    font-size: 13px;
  }
  .page-btn:hover, .page-num:hover {
    background: #f6f6f6;
  }
  .page-num.active {
    background: #1e7e34;
    color: #fff;
    border-color: #1e7e34;
  }
  .page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  .dots {
    color: #888;
    padding: 0 2px;
  }
  .message {
    margin: 10px 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f4fff6;
    border: 1px solid #c9e7d0;
    font-size: 14px;
  }
  .sets-table-mobile {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin-top: 6px;
  }
  .sets-table-mobile th,
  .sets-table-mobile td {
    padding: 5px 6px;
    text-align: center;
    border: 1px solid #ddd;
    vertical-align: middle;
    font-size: 14px;
  }
  .sets-table-mobile th {
    background: #f2f2f2;
    font-weight: 900;
  }
  .winner {
    color: #4CAF50;
    font-weight: 900;
  }
  .sets-table-mobile .col-set {
    width: 12%;
  }
  .sets-table-mobile .col-dur {
    width: 18%;
  }
  .games-row td {
    padding: 6px;
    text-align: left;
  }
  .game-seq {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    line-height: 1;
  }
  .seq-arrow {
    color: #888;
    font-size: 14px;
    margin-right: 2px;
    user-select: none;
  }
  .game-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
  }
  .game-pts {
    font-size: 11px;
    color: #444;
    line-height: 1;
    user-select: none;
  }
  .game-dot {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    line-height: 1;
    font-weight: 900;
    color: #fff;
  }
  .game-dot.p0 {
    background: var(--p0-color);
  }
  .game-dot.p1 {
    background: var(--p1-color);
  }
  .game-dot.break {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.22) inset;
  }
  .stats-section {
    margin-top: 10px;
  }
  .stats-mobile {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
  }
  .stats-mobile th,
  .stats-mobile td {
    padding: 6px;
    border: 1px solid #ddd;
    vertical-align: top;
    font-size: 13px;
  }
  .stats-mobile th {
    background: #f2f2f2;
    font-weight: 900;
    text-align: center;
  }
  .stats-mobile .stat {
    width: 34%;
    font-weight: 900;
  }
  .stats-mobile .val {
    width: 33%;
    text-align: center;
    font-weight: 700;
  }
  .pt-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    line-height: 1.2;
  }
  .ptlbl {
    font-weight: 900;
    margin-right: 6px;
  }
  .ptval {
    font-weight: 800;
    margin-right: 10px;
  }
  .ptdot {
    opacity: 0.55;
    margin: 0 8px;
  }
  .diff-chart-wrap {
    width: 94vw;
    height: 44vw;
    margin: 10px auto 0;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 8px;
    background: #fff;
  }
  #diffChart {
    width: 100%;
    height: 100%;
    display: block;
  }
  .profile-main {
    width: min(1100px, 94vw);
    margin: 16px auto 60px !important;
    padding: 0 8px;
  }
  .profile-main .message {
    margin: 0 0 14px 0;
    padding: 6px 14px;
    border-radius: 6px;
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #135200;
  }
  .profile-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: 22px 24px;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.08);
  }
  .profile-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 16px;
    align-items: start;
  }
  .profile-form br {
    display: none;
  }
  .span-all {
    grid-column: 1/-1;
  }
  .span-2 {
    grid-column: span 2;
  }
  .profile-top {
    grid-column: 1/-1;
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 6px 16px;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 6px;
  }
  .profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 18px;
    object-fit: cover;
  }
  .profile-info h3 {
    margin: 0;
    line-height: 1.2;
  }
  .profile-info p {
    margin: 4px 0 0 0;
    opacity: 0.78;
  }
  .profile-badges {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
  }
  .profile-meta-box {
    padding: 10px 6px;
    background: #f7f7f8;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    min-width: 130px;
  }
  .profile-meta-box .label {
    opacity: 0.7;
    margin-bottom: 2px;
  }
  .profile-meta-box .value {
    font-weight: 700;
  }
  .profile-form label {
    font-size: 3.9vw;
  }
  .profile-toggle, .profile-meta-box {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #f7f7f8;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    font-size: 1.3vw;
    width: 42vw;
  }
  .profile-toggle input[type=checkbox] {
    width: 18px;
    height: 18px;
    margin: 0;
  }
  .profile-form label {
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 700;
  }
  .profile-form input[type=text],
  .profile-form input[type=tel],
  .profile-form input[type=number],
  .profile-form select {
    width: 100% !important;
    padding: 10px 6px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    background: #ece2e4;
    outline: none;
  }
  .profile-form input:focus,
  .profile-form select:focus {
    border-color: rgba(0, 0, 0, 0.45);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.06);
  }
  .intl-field {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }
  .intl-field select {
    flex: 1 1 220px;
    min-width: 130px;
  }
  .intl-field input.prefix-custom {
    flex: 0 0 110px;
  }
  .intl-field input.local-number {
    flex: 2 1 220px;
    min-width: 130px;
    width: auto !important;
  }
  .profile-form .intl-field select {
    width: auto !important;
    margin-left: 0 !important;
  }
  .profile-form .intl-field .prefix-custom {
    width: auto !important;
  }
  .profile-actions {
    grid-column: 1/-1;
    display: flex;
    justify-content: flex-start;
    padding-top: 6px;
  }
  .profile-form button[name=save_profile] {
    padding: 10px 14px;
    border-radius: 6px;
  }
}
@media (max-width: 860px) and (max-width: 1100px) {
  .profile-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .profile-top {
    grid-template-columns: 84px 1fr auto;
  }
  .profile-avatar {
    width: 84px;
    height: 84px;
  }
}
@media (max-width: 860px) and (max-width: 820px) {
  .profile-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-top {
    grid-template-columns: 72px 1fr;
    align-items: start;
  }
  .profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 16px;
  }
  .profile-badges {
    grid-column: 1/-1;
    justify-content: flex-start;
    margin-top: 6px;
  }
  .span-2 {
    grid-column: 1/-1;
  } /* make big fields full width on phone */
}
@media (max-width: 860px) and (max-width: 380px) {
  .profile-form {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 860px) {
  .min_age, .max_age, .gender, .skill, .filter-row label {
    width: 14vw;
    font-size: 4.5vw;
    display: inline-flex;
  }
  #createMatchForm .row {
    width: 100%;
  }
  #createMatchForm .row > label {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
  }
  #createMatchForm .row > label > input,
  #createMatchForm .row > label > select,
  #createMatchForm .row > label > .time-pair {
    width: 100% !important;
    max-width: 260px;
    min-width: 0;
    margin-left: auto;
  }
  #createMatchForm input[type=number] {
    max-width: 90px;
  }
  #createMatchForm .time-pair {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: nowrap;
  }
  #createMatchForm .time-pair select {
    width: auto !important; /* override mobile select{width:100%} */
    flex: 1 1 0;
    min-width: 0;
  }
  #createMatchForm .time-pair select[name$=_hour] {
    flex: 1.2 1 0;
  }
  #createMatchForm .time-pair select[name$=_min] {
    flex: 0.9 1 0;
  }
}
@media (max-width: 860px) and (max-width: 380px) {
  #createMatchForm .row > label > input,
  #createMatchForm .row > label > select,
  #createMatchForm .row > label > .time-pair {
    max-width: 220px;
  }
}
@media (max-width: 860px) {
  .m-day {
    margin: 4px 0 6px;
    font-weight: 900;
    font-size: 5vw;
    opacity: 0.9;
  }
  .m-card {
    width: 90vw;
    border-radius: 14px;
    padding: 4px 4px 4px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    margin-bottom: 4px;
    background: #fff;
  }
  .m-card.new {
    outline: 2px solid rgba(0, 120, 255, 0.35);
  }
  .m-row1 {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
  }
  .m-row1 .m-left {
    flex: 1;
    min-width: 0;
  }
  .m-where {
    margin-top: 2px;
    font-size: 4.2vw;
    line-height: 1.15;
    opacity: 0.85;
    display: flex;
    align-items: baseline;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
  }
  .m-where .m-loc {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .m-where .m-court {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .m-where .m-dot {
    flex: 0 0 auto;
    opacity: 0.6;
  }
  .m-when {
    font-weight: 900;
    font-size: 14px;
    line-height: 1.15;
  }
  .m-time {
    font-weight: 900;
    font-size: 5vw;
  }
  .m-status {
    font-size: 5vw;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eee;
    white-space: nowrap;
    align-self: flex-start;
  }
  .m-status.pending {
    background: #fff3cd;
  }
  .m-status.confirmed {
    background: #d1e7dd;
  }
  .m-status.refused, .m-status.cancelled {
    background: #f8d7da;
  }
  .m-who {
    margin-top: 2px;
    font-weight: 900;
    font-size: 5vw;
  }
  .m-actions {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
  }
  .m-actions form {
    margin: 0;
    display: inline;
    padding: 4px;
  }
  .m-actions .btn, .m-actions a {
    height: 34px;
    line-height: 34px;
    padding: 0 10px;
    border-radius: 12px;
    font-size: 5vw;
    display: inline-block !important;
    min-width: 84px;
    width: 25vw !important;
  }
  .m-editbox {
    margin-top: 10px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.03);
  }
  .m-editrow {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
  }
  .m-editrow .m-l {
    width: 70px;
    font-weight: 700;
    opacity: 0.85;
  }
  .m-inp {
    flex: 1;
    width: 100%;
    height: 38px;
    border-radius: 12px;
    border: 1px solid #ddd;
    padding: 0 10px;
    font-size: 14px;
  }
  .m-pagi {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin: 12px 0;
  }
  .m-pagi .btn {
    height: 64px;
    line-height: 64px;
    padding: 0 6px;
    border-radius: 12px;
    font-size: 40px;
    width: 30vw !important;
  }
  .m-pagi .cur {
    font-weight: 900;
    padding: 0 10px;
  }
}
/* =========================
   DESKTOP (861px–1080px)
========================= */
@media (min-width: 861px) and (max-width: 1080px) {
  input[type=text], input[type=date], input[type=time], select {
    padding: 0.3vw;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 2vw;
    min-width: 19vw;
  }
  /* from upcoming_matches.php */
  /* Active match blocker modal (mobile-first) */
  .active-block-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    padding-top: calc(16px + env(safe-area-inset-top));
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 9999;
  }
  .active-block-modal {
    background: #fff;
    border-radius: 16px;
    width: min(560px, 100%);
    max-height: min(760px, 100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 18px 18px 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  }
  .active-block-modal h2 {
    margin: 0 0 8px 0;
    font-size: 20px;
    line-height: 1.2;
  }
  .active-block-modal .muted {
    opacity: 0.85;
  }
  .active-block-modal .meta {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.4;
    background: #f6f7f9;
    border-radius: 12px;
    padding: 10px 12px;
  }
  .active-block-modal .meta-row {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
  }
  .active-block-modal .meta-row:last-child {
    border-bottom: none;
  }
  .active-block-modal .meta .k {
    opacity: 0.75;
    min-width: 96px;
  }
  .active-block-modal .meta .v {
    font-weight: 600;
    text-align: right;
    word-break: break-word;
  }
  .active-block-modal .hint {
    margin: 10px 0 0;
    font-size: 13px;
    opacity: 0.9;
  }
  .active-block-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    align-items: stretch;
    background: #f6f7f9;
    border-radius: 12px;
    padding: 10px;
  }
  .active-block-actions form {
    margin: 0;
  }
  .active-block-actions .btn,
  .active-block-actions a.btn {
    min-height: 44px;
    padding: 12px 14px;
    border-radius: 12px;
    white-space: nowrap;
  }
  /* Desktop / Mobile toggles */
  /* Compact + aligned edit controls (desktop table inline) */
  /* Mobile cards view (based on previous upcoming_matches_mobile.php) */
  /* from my_matches.php */
  /* Result coloring */
  /* green */
  /* red */
  /* yellow */
  /* from profile.php */
  /* Profile page (local only) */
  /* Responsive form grid:
             - desktop: 4 cols
             - tablet: 3 cols
             - phone: 2 cols
             - tiny: 1 col
          */
  /* Top header block */
  /* Form controls */
  /* Intl prefix + number fields */
  /* Breakpoints */
  /* from play.php */
  /* prevent toss flash before JS decides resume/normal */
  /* from friend_search.php */
  /* Layout: forms left, results right */
  /* -----------------------------
             Mobile-only overrides
             (do NOT change desktop)
          ----------------------------- */
  /* from my_friends.php */
  /* --- Layout --- */
  /* Bottom info row (no absolute positioning; avoids overlap on mobile) */
  /* --- Friends grid --- */
  /* --- Pagination --- */
  /* --- Small screens --- */
  /* --- Larger screens --- */
  /* from match_center.php */
  /* from match_details.php */
  /* Stats table: compact first column */
  /* Point Types rows */
  /* Graph */
  /* Game sequence dots */
  /* from past_matches.php */
  /* Insert form layout (keeps same look as upcoming_matches, but cleaner) */
  /* === Time selects (Select2) compact === */
  /* box del select */
  /* testo interno */
  /* freccia */
  /* dropdown */
  /* === Riga inline (label + controls) === */
  /* === Riduzione padding verticale delle righe === */
  /* inputs non-Select2 coerenti */
  /* from friend_requests.php */
  /* Schedule form alignment */
  /* Make the submit button align nicely */
  /* =========================
     Schedule match form layout (desktop + large)
     Forces 2-column grid, but single fields span full width
  ========================= */
  /* If the row only has ONE label (Opponent, Date, Create button), it spans both columns */
  /* Make labels stack: title above control */
  /* Controls fill their grid cell */
  /* Keep hour/min on one line within each label */
  /* Optional: make the create button not stretch too wide */
}
@media (min-width: 861px) and (max-width: 1080px) and (max-width: 680px) {
  .active-block-overlay {
    padding: 12px;
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .active-block-modal {
    border-radius: 14px;
    padding: 16px 14px 12px;
  }
  .active-block-modal h2 {
    font-size: 18px;
  }
  .active-block-modal .meta {
    padding: 10px 10px;
  }
  .active-block-modal .meta .k {
    min-width: 88px;
  }
  .active-block-actions {
    gap: 8px;
  }
  .active-block-actions .btn,
  .active-block-actions a.btn {
    min-width: 140px;
  }
}
@media (min-width: 861px) and (max-width: 1080px) {
  .only-mobile {
    display: none;
  }
  .only-desktop {
    display: block;
  }
}
@media (min-width: 861px) and (max-width: 1080px) and (max-width: 860px) {
  .only-desktop {
    display: none;
  }
  .only-mobile {
    display: block;
  }
  .page-wrap {
    padding: 10px;
  }
  .grid {
    display: block;
  }
  .grid > .card {
    margin-bottom: 12px;
  }
  .row {
    display: block;
  }
  .row label {
    display: block;
    margin-bottom: 10px;
  }
  .row select, .row input {
    width: 100%;
  }
}
@media (min-width: 861px) and (max-width: 1080px) {
  .edit-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }
  .edit-inline input {
    height: 32px;
    line-height: 32px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 14px;
    border: 1px solid #ddd;
  }
  .edit-inline .edit-time {
    width: 110px;
  }
  .edit-inline .edit-court {
    width: 80px;
    text-align: center;
  }
  .edit-inline .edit-loc {
    min-width: 180px;
    max-width: 360px;
  }
}
@media (min-width: 861px) and (max-width: 1080px) and (max-width: 860px) {
  .m-wrap {
    max-width: 680px;
    margin: 0 auto;
  }
  .m-day {
    margin: 10px 0 6px;
    font-weight: 900;
    font-size: 14px;
    opacity: 0.9;
  }
  .m-card {
    border-radius: 14px;
    padding: 10px 10px 10px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    margin-bottom: 8px;
    background: #fff;
  }
  .m-card.new {
    outline: 2px solid rgba(0, 120, 255, 0.35);
  }
  .m-row1 {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
  }
  .m-when {
    font-weight: 900;
    font-size: 14px;
    line-height: 1.15;
  }
  .m-time {
    font-weight: 900;
    font-size: 15px;
  }
  .m-where {
    margin-top: 2px;
    font-size: 13px;
    opacity: 0.85;
  }
  .m-status {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eee;
    white-space: nowrap;
    align-self: flex-start;
  }
  .m-status.pending {
    background: #fff3cd;
  }
  .m-status.confirmed {
    background: #d1e7dd;
  }
  .m-status.refused, .m-status.cancelled {
    background: #f8d7da;
  }
  .m-who {
    margin-top: 6px;
    font-weight: 900;
    font-size: 15px;
  }
  .m-actions {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
  }
  .m-actions form {
    margin: 0;
    display: inline;
  }
  .m-actions .btn, .m-actions a {
    height: 34px;
    line-height: 34px;
    padding: 0 10px;
    border-radius: 12px;
    font-size: 13px;
    display: inline-block !important;
    min-width: 84px;
  }
  .m-muted {
    opacity: 0.75;
    font-size: 13px;
  }
  .m-editbox {
    margin-top: 10px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.03);
  }
  .m-editrow {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
  }
  .m-editrow .m-l {
    width: 70px;
    font-weight: 700;
    opacity: 0.85;
  }
  .m-inp {
    flex: 1;
    width: 100%;
    height: 38px;
    border-radius: 12px;
    border: 1px solid #ddd;
    padding: 0 10px;
    font-size: 14px;
  }
  .m-pagi {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin: 12px 0;
  }
  .m-pagi .btn {
    height: 34px;
    line-height: 34px;
    padding: 0 10px;
    border-radius: 12px;
    font-size: 14px;
  }
  .m-pagi .cur {
    font-weight: 900;
    padding: 0 10px;
  }
}
@media (min-width: 861px) and (max-width: 1080px) {
  .row-win {
    background: #d4edda;
  }
  .row-loss {
    background: #f8d7da;
  }
  .row-draw {
    background: #f3d98d;
  }
  .row-win td, .row-loss td {
    border-color: rgba(0, 0, 0, 0.05);
  }
  .h2h-col {
    text-align: center;
    white-space: nowrap;
  }
  .bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 6px 0 14px;
    position: absolute;
    bottom: 2vw;
    right: 0;
    padding: 0 12px;
  }
  .bottom-row h2 {
    margin: 0;
    font-size: 20px;
  }
}
@media (min-width: 861px) and (max-width: 1080px) and (max-width: 1000px) {
  /* ripristina tabella vera */
  table.mobile-inline-table {
    display: table !important;
    width: 100% !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
  }
  table.mobile-inline-table thead {
    display: table-header-group !important;
  }
  table.mobile-inline-table tbody {
    display: table-row-group !important;
  }
  table.mobile-inline-table tr {
    display: table-row !important;
  }
  /* ripristina celle vere */
  table.mobile-inline-table th,
  table.mobile-inline-table td {
    display: table-cell !important;
    position: static !important; /* annulla position:relative */
    padding-left: 8px !important; /* annulla padding-left:50% */
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  /* spegne le label pseudo-element (questo è CRITICO) */
  table.mobile-inline-table td::before,
  table.mobile-inline-table td:before {
    content: none !important;
    display: none !important;
  }
}
@media (min-width: 861px) and (max-width: 1080px) {
  .profile-main {
    width: min(1100px, 94vw);
    margin: 16px auto 60px !important;
    padding: 0 8px;
  }
  .profile-main .message {
    margin: 0 0 14px 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #135200;
  }
  .profile-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: 22px 24px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  }
  .profile-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 16px;
    align-items: start;
  }
  .profile-form br {
    display: none;
  }
  .span-all {
    grid-column: 1/-1;
  }
  .span-2 {
    grid-column: span 2;
  }
  .profile-top {
    grid-column: 1/-1;
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 12px 16px;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 6px;
  }
  .profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 18px;
    object-fit: cover;
  }
  .profile-info h3 {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
  }
  .profile-info p {
    margin: 4px 0 0 0;
    opacity: 0.78;
  }
  .profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
  }
  .profile-meta-box {
    padding: 10px 12px;
    background: #f7f7f8;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    min-width: 170px;
  }
  .profile-meta-box .label {
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 2px;
  }
  .profile-meta-box .value {
    font-weight: 700;
    font-size: 13px;
  }
  .profile-meta-box.Mobile {
    padding: 4px 6px;
    background: #f7f7f8;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 4px;
    min-width: 25vw;
  }
  .profile-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f7f7f8;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
  }
  .profile-toggle input[type=checkbox] {
    width: 18px;
    height: 18px;
    margin: 0;
  }
  .profile-toggle.Mobile {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    background: #f7f7f8;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
  }
  .profile-form label {
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 700;
  }
  .profile-form input[type=text],
  .profile-form input[type=tel],
  .profile-form input[type=number],
  .profile-form select {
    width: 100% !important;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    background: #fff;
    outline: none;
  }
  .profile-form input:focus,
  .profile-form select:focus {
    border-color: rgba(0, 0, 0, 0.45);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.06);
  }
  .intl-field {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }
  .intl-field select {
    flex: 1 1 220px;
    min-width: 170px;
  }
  .intl-field input.prefix-custom {
    flex: 0 0 110px;
  }
  .intl-field input.local-number {
    flex: 2 1 220px;
    min-width: 170px;
    width: auto !important;
  }
  .profile-form .intl-field select {
    width: auto !important;
    margin-left: 0 !important;
  }
  .profile-form .intl-field .prefix-custom {
    width: auto !important;
  }
  .profile-form .intl-field select.Mobile#phone_prefix {
    width: 15vw !important;
    margin-left: 0 !important;
  }
  .profile-actions {
    grid-column: 1/-1;
    display: flex;
    justify-content: flex-start;
    padding-top: 6px;
  }
  .profile-form button[name=save_profile] {
    padding: 10px 14px;
    border-radius: 12px;
  }
}
@media (min-width: 861px) and (max-width: 1080px) and (max-width: 1100px) {
  .profile-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .profile-top {
    grid-template-columns: 84px 1fr auto;
  }
  .profile-avatar {
    width: 84px;
    height: 84px;
  }
}
@media (min-width: 861px) and (max-width: 1080px) and (max-width: 820px) {
  .profile-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-top {
    grid-template-columns: 72px 1fr;
    align-items: start;
  }
  .profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 16px;
  }
  .profile-badges {
    grid-column: 1/-1;
    justify-content: flex-start;
    margin-top: 6px;
  }
}
@media (min-width: 861px) and (max-width: 1080px) and (max-width: 380px) {
  .profile-form {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 861px) and (max-width: 1080px) {
  .tossGateHidden {
    visibility: hidden;
  }
  .search-form {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
  }
  .search-input {
    width: 90%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
  }
  .search-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 2.2vw;
    margin-top: 1.1vw;
    display: inline-block;
  }
  .search-btn:hover {
    background: #45a049;
  }
  .filter-form {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 14px 20px;
    margin-bottom: 20px;
  }
  .filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
  }
  .filter-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
  }
  .filter-row input[type=text],
  .filter-row input[type=number],
  .filter-row select {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
  }
  .filter-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
  }
  .reset-link {
    display: inline-block;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    background: #fff;
  }
  .reset-link:hover {
    background: #f5f5f5;
  }
  .results-table th {
    background: #f8f8f8;
    font-weight: bold;
  }
  .muted {
    color: #777;
    font-size: 13px;
  }
  .users-list {
    list-style: none;
    padding: 0;
  }
  .user-item {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .user-info {
    font-weight: bold;
  }
  .add-btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
  }
  .add-btn:hover {
    background: #0b7dda;
  }
  .add-guest-btn {
    background: #FF9800;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1.1vw;
    font-size: 1.2vw;
    display: inline-block;
  }
  .add-guest-btn:hover {
    background: #F57C00;
  }
  .layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    width: 100%;
  }
  .sidebar {
    flex: 0 0 360px;
    max-width: 360px;
    width: 50vw;
  }
  .sidebar.Mobile {
    width: 100vw;
  }
  .content {
    flex: 1;
    min-width: 0;
  }
}
@media (min-width: 861px) and (max-width: 1080px) and (max-width: 900px) {
  .layout {
    flex-direction: column;
  }
  .sidebar {
    flex: 1 1 auto;
    max-width: 100%;
  }
}
@media (min-width: 861px) and (max-width: 1080px) and (max-width: 600px) {
  /* i 4 filtri su una riga */
  .filter-row {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
  }
  /* il testo City/Country deve occupare tutta la riga */
  .filter-row > .muted {
    grid-column: 1/-1;
  }
  /* elimina i <br> che spezzano la riga */
  .filter-row br {
    display: none !important;
  }
  /* ogni filtro con label sopra e campo sotto */
  .filter-row label {
    width: auto !important;
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  /* campi a tutta larghezza dentro la colonna */
  .filter-row select,
  .filter-row input[type=number] {
    width: 100% !important;
    box-sizing: border-box;
  }
  /* il bottone Search (ultimo label) va sotto, a tutta riga */
  .filter-row label:last-of-type {
    grid-column: 1/-1;
  }
}
@media (min-width: 861px) and (max-width: 1080px) {
  .page-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px;
  }
  .bottom-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin: 12px 0 18px;
    padding: 0;
    position: static;
  }
  .bottom-row h2 {
    margin: 0;
    font-size: 18px;
  }
  .sub {
    color: #666;
    font-size: 13px;
  }
  .friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 16px;
  }
  .friend-card {
    background: #fff;
    border: 1px solid #e7e7e7;
    border-radius: 14px;
    padding: 14px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    min-width: 0;
  }
  .avatar {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    object-fit: cover;
    background: #f0f0f0;
    border: 1px solid #eaeaea;
    flex: 0 0 auto;
  }
  .f-body {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14px;
  }
  .f-name {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 6px;
  }
  .name {
    font-weight: 700;
    font-size: 15px;
  }
  .badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f2f7ff;
    border: 1px solid #dbe9ff;
    color: #1b4ea3;
    white-space: nowrap;
  }
  .badge.blocked {
    background: #fff5f5;
    border-color: #f2c7c7;
    color: #9b1c1c;
  }
  .meta {
    margin: 0;
    color: #555;
    font-size: 13px;
    line-height: 1.35;
  }
  .meta + .meta {
    margin-top: 4px;
  }
  .meta .label {
    color: #888;
  }
  .actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
  }
  .actions form {
    margin: 0;
  }
  .btn2 {
    appearance: none;
    border: 1px solid #cfcfcf;
    background: #fff;
    padding: 9px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
  }
  .btn2:hover {
    background: #f7f7f7;
  }
  .btn2.block {
    border-color: #f2c7c7;
    background: #fff5f5;
  }
  .btn2.unblock {
    border-color: #c9e7d0;
    background: #f4fff6;
  }
  .pagination {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin: 18px 0 6px;
    flex-wrap: wrap;
  }
  .page-btn, .page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #d8d8d8;
    border-radius: 10px;
    background: #fff;
    color: #222;
    text-decoration: none;
    font-size: 13px;
  }
  .page-btn:hover, .page-num:hover {
    background: #f6f6f6;
  }
  .page-num.active {
    background: #1e7e34;
    color: #fff;
    border-color: #1e7e34;
  }
  .page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  .dots {
    color: #888;
    padding: 0 2px;
  }
  .message {
    margin: 10px 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f4fff6;
    border: 1px solid #c9e7d0;
    font-size: 14px;
  }
}
@media (min-width: 861px) and (max-width: 1080px) and (max-width: 680px) {
  .page-wrap {
    padding: 10px;
  }
  .friends-grid {
    grid-template-columns: 1fr;
  }
  .friend-card {
    padding: 12px;
  }
  .avatar {
    width: 56px;
    height: 56px;
  }
  /* Buttons become easy to tap */
  .actions {
    gap: 10px;
  }
  .actions form {
    flex: 1 1 140px;
  }
  .btn2 {
    width: 100%;
    padding: 12px;
    font-size: 14px;
  }
  .sub {
    font-size: 12px;
  }
  .name {
    font-size: 16px;
  }
}
@media (min-width: 861px) and (max-width: 1080px) and (min-width: 900px) {
  .f-body {
    font-size: 15px;
  }
  .meta {
    font-size: 14px;
  }
  .btn2 {
    font-size: 14px;
  }
  .sub {
    font-size: 14px;
  }
}
@media (min-width: 861px) and (max-width: 1080px) {
  .bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 6px 0 14px;
    position: absolute;
    bottom: 2vw;
    right: 0;
    padding: 0 12px;
  }
  .bottom-row h2 {
    margin: 0;
    font-size: 20px;
  }
  :root {
    --p0-color: var(--p0-color);
    --p1-color: var(--p1-color);
  }
  .player0 {
    color: var(--p0-color);
  }
  .player1 {
    color: var(--p1-color);
  }
  .match-details {
    max-height: 80vw;
    max-width: 100vw;
    margin: 0 auto;
    padding: 20px;
    overflow-y: auto;
    min-height: calc(100vh - 20vw);
  }
  .match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.2vw;
    margin-bottom: 0.3vw;
    flex-wrap: wrap;
  }
  .header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .toggle-btn {
    padding: 10px 14px;
    border-radius: 6px;
    border: 2px solid #111;
    background: #fff;
    color: #111;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
  }
  .toggle-btn:hover {
    background: #f5f5f5;
  }
  .stats-table th:first-child,
  .stats-table td:first-child {
    white-space: nowrap;
  }
  .pt-line {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
  }
  .ptlbl {
    font-weight: 900;
    margin-right: 6px;
  }
  .ptval {
    font-weight: 800;
    margin-right: 10px;
  }
  .ptdot {
    opacity: 0.55;
    margin: 0 10px;
  }
  .diff-chart-wrap {
    width: 85vw;
    height: 35vw;
    margin: 0 auto;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 10px;
    background: #fff;
  }
  #diffChart {
    width: 100%;
    height: 100%;
    display: block;
  }
  .sets-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
  }
  .sets-table th, .sets-table td {
    padding: 7px;
    text-align: center;
    border: 1px solid #ddd;
    vertical-align: middle;
  }
  .sets-table th {
    background-color: #f2f2f2;
  }
  .winner {
    color: #4CAF50;
    font-weight: bold;
  }
  .game-seq {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    line-height: 1;
  }
  .game-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  .game-pts {
    font-size: 12px;
    color: #444;
    line-height: 1;
    user-select: none;
  }
  .seq-arrow {
    color: #888;
    font-size: 16px;
    margin-right: 4px;
    user-select: none;
  }
  .game-dot {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    line-height: 1;
    font-weight: 800;
    color: #fff;
  }
  .game-dot.p0 {
    background: var(--p0-color);
  }
  .game-dot.p1 {
    background: var(--p1-color);
  }
  .game-dot.break {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25) inset;
  }
  .stats-section {
    margin-top: 1vw;
  }
  .stats-table {
    width: 100%;
    border-collapse: collapse;
  }
  .stats-table th, .stats-table td {
    padding: 7px 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
  }
  .stats-table th {
    background-color: #f8f8f8;
    font-weight: bold;
  }
  .alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
  }
  .alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
  }
  .ptTypesLine {
    margin-top: 8px;
    font-size: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  .ptTag {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 999px;
  }
  .grid {
    display: grid;
    grid-template-columns: 28vw 65vw 1fr;
    gap: 8px;
    align-items: start;
  }
  .grid_upcoming {
    display: grid;
    grid-template-columns: 20vw 72vw 1fr;
    gap: 8px;
    align-items: start;
  }
  .card {
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    padding: 14px;
  }
  .row {
    margin-bottom: 12px;
  }
  label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
  }
  input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
  }
  .row label div select {
    width: 4vw;
    display: inline-block;
  }
  [name=court_number] {
    width: 4vw;
  }
  .flash {
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 12px;
  }
  .flash.ok {
    background: #e9f7ef;
    border: 1px solid #bfe8cd;
    color: #1e7a3a;
    width: 36vw;
  }
  .flash.err {
    background: #fdecea;
    border: 1px solid #f5c2c7;
    color: #a61b1b;
    width: 36vw;
  }
  .muted {
    color: #666;
    font-size: 0.95em;
    line-height: 1.35;
    text-align: justify;
  }
  .sets-grid {
    display: grid;
    grid-template-columns: 60px 1fr 1fr;
    gap: 8px;
    align-items: center;
  }
  .sets-grid .hdr {
    font-weight: 700;
  }
  .sets-grid .setno {
    font-weight: 700;
    text-align: center;
  }
  .time-row {
    display: block;
    gap: 10px;
    align-items: end;
  }
  .time-row .time-block {
    align-items: center;
  }
  .time-pair select {
    margin-right: 5px;
    min-width: 20px;
    max-width: 4vw;
    padding: 0.1vw;
  }
  .time-row > select {
    max-width: 1vw;
    padding: 0.1vw;
    display: inline-block;
  }
  .time-block > select {
    width: 1vw;
    display: inline-block;
  }
  [start_h] {
    width: 1.5vw;
  }
  .btn {
    display: inline-block;
    padding: 8px 16px;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
  }
  .btn:hover {
    background-color: #45a049;
  }
  .btn {
    display: inline-block;
    background: #4c7eaf;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    width: 6vw !important;
    padding: 0.5vw !important;
    text-align: center !important;
  }
  .up-actions form button {
    width: 5vw !important;
  }
  .btn.large {
    width: 12vw !important;
  }
  .btn:hover {
    background: #45a049;
  }
  .btn.btn-primary {
    background: #2196F3;
  }
  .btn.btn-primary.large {
    width: 12vw !important;
  }
  .btn.btn-secondary {
    background: #45a049;
  }
  .btn.btn-secondary.large {
    width: 12vw !important;
  }
  .btn.btn-secondary:hover {
    background: #0b7dda;
  }
  .btn.btn-edit {
    background: #c067dd;
    text-align: center;
  }
  .btn.btn-edit.large {
    width: 12vw !important;
  }
  .btn.btn-edit:hover {
    background: #3b648c;
  }
  .btn.btn-cancel {
    background: #efaf3a;
    color: red;
  }
  .btn.btn-cancel.large {
    width: 12vw !important;
  }
  .btn.btn-cancel:hover {
    background: #c62828;
  }
  .btn.btn-danger {
    background: #e53935;
  }
  .btn.btn-danger.large {
    width: 12vw !important;
  }
  .btn-danger:hover {
    background: #c62828;
  }
  .btn.btn-outline {
    background: yellow;
    color: #333;
    border: 1px solid #ddd;
    text-align: center;
  }
  .btn.btn-outline:hover {
    background: #f5f5f5;
  }
  .pending-matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15vw, 1fr));
    gap: 0.4vw;
    margin-bottom: 0.3vw;
    height: 14vw;
  }
  .pending-match-card {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.5vw;
  }
  .pending-title {
    font-weight: 800;
    margin-bottom: 5px;
  }
  .pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fff3cd;
    border: 1px solid #ffe69c;
    font-size: 12px;
    font-weight: 700;
  }
  .small {
    font-size: 14px;
    color: #444;
    margin-bottom: 5px;
  }
  .pending-actions {
    display: flex;
    gap: 0.3vw;
    margin-top: 0.3vw;
  }
  .btn-sm {
    padding: 5px 10px;
    font-size: 14px;
  }
  .pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 15px;
    flex-wrap: wrap;
  }
  .pagination .btn {
    padding: 6px 12px;
    margin: 0 2px;
  }
  .pagination .btn-current {
    background: #2b7fff;
    color: white;
  }
}
@media (min-width: 861px) and (max-width: 1080px) and (max-width: 1180px) {
  .grid {
    grid-template-columns: 2fr;
  }
}
@media (min-width: 861px) and (max-width: 1080px) {
  .match-insert-card h2 {
    margin: 0 0 10px 0;
  }
  .match-form-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .match-form-grid .row {
    margin: 0;
  }
  .match-form-grid .two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .match-form-grid .three-col {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 12px;
  }
  .match-form-grid .five-col {
    display: grid;
    grid-template-columns: 4fr 1fr;
    gap: 12px;
  }
  .match-form-grid .actions-row {
    display: flex;
    justify-content: flex-end;
  }
  .input-group {
    display: flex;
    flex-direction: column;
  }
  .input-group label {
    margin-bottom: 6px;
  }
  .select2-container {
    vertical-align: middle;
  }
  .select2-container--default .select2-selection--single {
    height: 32px;
    padding: 2px 2px;
    font-size: 14px;
  }
  .select2-container--default .select2-selection__rendered {
    line-height: 26px;
    padding-left: 0;
  }
  .select2-container--default .select2-selection__arrow {
    height: 26px;
  }
  .time-select {
    padding: 4vw;
  }
  .time-select + .select2-container {
    margin-right: 4px;
    vertical-align: middle;
  }
  .select2-container--default .select2-selection--single {
    height: 28px; /* più basso */
    padding: 0 2px;
    font-size: 14px; /* compatto ma leggibile */
    line-height: 26px;
  }
  .select2-container--default .select2-selection__rendered {
    line-height: 26px;
    padding-left: 0;
  }
  .select2-container--default .select2-selection__arrow {
    height: 26px;
  }
  .select2-dropdown {
    font-size: 14px;
  }
  .inline-row {
    display: flex;
    align-items: center;
    gap: 2px;
  }
  .inline-row label {
    margin: 0;
    font-weight: 600;
    font-size: 14px;
  }
  .match-insert-card .row {
    padding-top: 3px;
    padding-bottom: 3px;
  }
  .match-insert-card input[type=date],
  .match-insert-card input[type=text],
  .match-insert-card input[type=number] {
    height: 28px;
    padding: 3px 6px;
    font-size: 14px;
  }
  [name=location] {
    width: 13vw;
  }
  .pagination {
    bottom: 1.5vw;
  }
  .request-list {
    list-style: none;
    padding: 0;
  }
  .request-item {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .request-email {
    font-weight: bold;
  }
  .request-actions {
    display: flex;
    gap: 10px;
  }
  .accept-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
  }
  .delete-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
  }
  .accept-btn:hover {
    background: #45a049;
  }
  .delete-btn:hover {
    background: #d32f2f;
  }
  .min_age, .max_age, .gender, .skill {
    width: 5.5vw;
  }
  #createMatchForm.schedule-form {
    max-width: 520px; /* keeps it tidy in left card */
  }
  #createMatchForm.schedule-form .row {
    display: grid;
    grid-template-columns: 1fr; /* default one field per row */
    gap: 14px;
    align-items: end;
    margin-bottom: 14px;
  }
  #createMatchForm.schedule-form .row.row-2 {
    grid-template-columns: 1fr 1fr; /* two fields on one row */
    gap: 14px;
  }
  #createMatchForm.schedule-form label {
    display: grid;
    grid-template-rows: auto auto; /* label text then control */
    gap: 6px;
    font-weight: 600;
  }
  #createMatchForm.schedule-form input,
  #createMatchForm.schedule-form select {
    width: 100%;
    min-width: 0;
  }
  #createMatchForm.schedule-form .time-pair {
    display: grid;
    grid-template-columns: 1fr 1fr; /* hour + minute */
    gap: 8px;
    align-items: center;
  }
  #createMatchForm.schedule-form .time-pair select {
    width: 100%;
    min-width: 0;
  }
  #createMatchForm.schedule-form button.btn {
    width: 160px;
  }
  .upcoming-layout .schedule-card #createMatchForm .row {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: end;
  }
  .upcoming-layout .schedule-card #createMatchForm .row > label:only-child,
  .upcoming-layout .schedule-card #createMatchForm .row > button:only-child,
  .upcoming-layout .schedule-card #createMatchForm .row > .btn:only-child {
    grid-column: 1/-1;
  }
  .upcoming-layout .schedule-card #createMatchForm label {
    display: grid;
    grid-template-rows: auto auto;
    gap: 6px;
    width: 100%;
  }
  .upcoming-layout .schedule-card #createMatchForm input,
  .upcoming-layout .schedule-card #createMatchForm select {
    width: 100% !important;
    min-width: 0;
  }
  .upcoming-layout .schedule-card #createMatchForm .time-pair {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  .upcoming-layout .schedule-card #createMatchForm .time-pair select {
    width: 100% !important;
    min-width: 0;
  }
  .upcoming-layout .schedule-card #createMatchForm button.btn {
    width: 180px;
  }
}
/* =========================
   LARGE (>=1081px)
========================= */
@media (min-width: 1081px) {
  input[type=text], input[type=date], input[type=time], select {
    padding: 0.2vw;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1vw;
    min-width: 9vw;
  }
  .row label input, .row label select {
    font-size: 1vw;
  }
  /* from upcoming_matches.php */
  /* Active match blocker modal */
  .active-block-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 9999;
  }
  .active-block-modal {
    background: #fff;
    border-radius: 16px;
    width: min(560px, 100%);
    padding: 18px 18px 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  }
  .active-block-modal h2 {
    margin: 0 0 8px 0;
    font-size: 20px;
  }
  .active-block-modal .meta {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.4;
    background: #f6f7f9;
    border-radius: 12px;
    padding: 10px 12px;
  }
  .active-block-modal .meta-row {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
  }
  .active-block-modal .meta-row:last-child {
    border-bottom: none;
  }
  .active-block-modal .meta .k {
    opacity: 0.75;
  }
  .active-block-modal .meta .v {
    font-weight: 600;
    text-align: right;
  }
  .active-block-modal .hint {
    margin: 10px 0 0;
    font-size: 13px;
    opacity: 0.85;
  }
  .active-block-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    background: #f6f7f9;
    border-radius: 12px;
    padding: 10px;
  }
  /* Desktop / Mobile toggles */
  /* Compact + aligned edit controls (desktop table inline) */
  /* Mobile cards view (based on previous upcoming_matches_mobile.php) */
  /* from my_matches.php */
  /* Result coloring */
  /* green */
  /* red */
  /* yellow */
  /* from profile.php */
  /* Profile page (local only) */
  /* Responsive form grid:
             - desktop: 4 cols
             - tablet: 3 cols
             - phone: 2 cols
             - tiny: 1 col
          */
  /* Top header block */
  /* Form controls */
  /* Intl prefix + number fields */
  /* Breakpoints */
  /* from play.php */
  /* prevent toss flash before JS decides resume/normal */
  /* from friend_search.php */
  /* Layout: forms left, results right */
  /* -----------------------------
             Mobile-only overrides
             (do NOT change desktop)
          ----------------------------- */
  /* from my_friends.php */
  /* --- Layout --- */
  /* Bottom info row (no absolute positioning; avoids overlap on mobile) */
  /* --- Friends grid --- */
  /* --- Pagination --- */
  /* --- Small screens --- */
  /* --- Larger screens --- */
  /* from match_center.php */
  /* from match_details.php */
  /* Stats table: compact first column */
  /* Point Types rows */
  /* Graph */
  /* Game sequence dots */
  /* from past_matches.php */
  /* Insert form layout (keeps same look as upcoming_matches, but cleaner) */
  /* === Time selects (Select2) compact === */
  /* box del select */
  /* testo interno */
  /* freccia */
  /* dropdown */
  /* === Riga inline (label + controls) === */
  /* === Riduzione padding verticale delle righe === */
  /* inputs non-Select2 coerenti */
  /* from friend_requests.php */
  /* Schedule form alignment */
  /* Make the submit button align nicely */
  /* =========================
     Schedule match form layout (desktop + large)
     Forces 2-column grid, but single fields span full width
  ========================= */
  /* If the row only has ONE label (Opponent, Date, Create button), it spans both columns */
  /* Make labels stack: title above control */
  /* Controls fill their grid cell */
  /* Keep hour/min on one line within each label */
  /* Optional: make the create button not stretch too wide */
}
@media (min-width: 1081px) and (max-width: 680px) {
  .active-block-modal .meta {
    padding: 10px 10px;
  }
  .active-block-actions .btn,
  .active-block-actions a.btn {
    min-width: 140px;
    white-space: nowrap;
  }
}
@media (min-width: 1081px) {
  .only-mobile {
    display: none;
  }
  .only-desktop {
    display: block;
  }
}
@media (min-width: 1081px) and (max-width: 860px) {
  .only-desktop {
    display: none;
  }
  .only-mobile {
    display: block;
  }
  .page-wrap {
    padding: 10px;
  }
  .grid {
    display: block;
  }
  .grid > .card {
    margin-bottom: 12px;
  }
  .row {
    display: block;
  }
  .row label {
    display: block;
    margin-bottom: 10px;
  }
  .row select, .row input {
    width: 100%;
  }
}
@media (min-width: 1081px) {
  .edit-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }
  .edit-inline input {
    height: 32px;
    line-height: 32px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 14px;
    border: 1px solid #ddd;
  }
  .edit-inline .edit-time {
    width: 110px;
  }
  .edit-inline .edit-court {
    width: 80px;
    text-align: center;
  }
  .edit-inline .edit-loc {
    min-width: 180px;
    max-width: 360px;
  }
}
@media (min-width: 1081px) and (max-width: 860px) {
  .m-wrap {
    max-width: 680px;
    margin: 0 auto;
  }
  .m-day {
    margin: 10px 0 6px;
    font-weight: 900;
    font-size: 14px;
    opacity: 0.9;
  }
  .m-card {
    border-radius: 14px;
    padding: 10px 10px 10px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    margin-bottom: 8px;
    background: #fff;
  }
  .m-card.new {
    outline: 2px solid rgba(0, 120, 255, 0.35);
  }
  .m-row1 {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
  }
  .m-when {
    font-weight: 900;
    font-size: 14px;
    line-height: 1.15;
  }
  .m-time {
    font-weight: 900;
    font-size: 15px;
  }
  .m-where {
    margin-top: 2px;
    font-size: 13px;
    opacity: 0.85;
  }
  .m-status {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eee;
    white-space: nowrap;
    align-self: flex-start;
  }
  .m-status.pending {
    background: #fff3cd;
  }
  .m-status.confirmed {
    background: #d1e7dd;
  }
  .m-status.refused, .m-status.cancelled {
    background: #f8d7da;
  }
  .m-who {
    margin-top: 6px;
    font-weight: 900;
    font-size: 15px;
  }
  .m-actions {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
  }
  .m-actions form {
    margin: 0;
    display: inline;
  }
  .m-actions .btn, .m-actions a {
    height: 34px;
    line-height: 34px;
    padding: 0 10px;
    border-radius: 12px;
    font-size: 13px;
    display: inline-block !important;
    min-width: 84px;
  }
  .m-muted {
    opacity: 0.75;
    font-size: 13px;
  }
  .m-editbox {
    margin-top: 10px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.03);
  }
  .m-editrow {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
  }
  .m-editrow .m-l {
    width: 70px;
    font-weight: 700;
    opacity: 0.85;
  }
  .m-inp {
    flex: 1;
    width: 100%;
    height: 38px;
    border-radius: 12px;
    border: 1px solid #ddd;
    padding: 0 10px;
    font-size: 14px;
  }
  .m-pagi {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin: 12px 0;
  }
  .m-pagi .btn {
    height: 34px;
    line-height: 34px;
    padding: 0 10px;
    border-radius: 12px;
    font-size: 14px;
  }
  .m-pagi .cur {
    font-weight: 900;
    padding: 0 10px;
  }
}
@media (min-width: 1081px) {
  .row-win {
    background: #d4edda;
  }
  .row-loss {
    background: #f8d7da;
  }
  .row-draw {
    background: #f3d98d;
  }
  .row-win td, .row-loss td {
    border-color: rgba(0, 0, 0, 0.05);
  }
  .h2h-col {
    text-align: center;
    white-space: nowrap;
  }
  .bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 6px 0 14px;
    position: absolute;
    bottom: 2vw;
    right: 0;
    padding: 0 12px;
  }
  .bottom-row h2 {
    margin: 0;
    font-size: 20px;
  }
}
@media (min-width: 1081px) and (max-width: 1000px) {
  /* ripristina tabella vera */
  table.mobile-inline-table {
    display: table !important;
    width: 100% !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
  }
  table.mobile-inline-table thead {
    display: table-header-group !important;
  }
  table.mobile-inline-table tbody {
    display: table-row-group !important;
  }
  table.mobile-inline-table tr {
    display: table-row !important;
  }
  /* ripristina celle vere */
  table.mobile-inline-table th,
  table.mobile-inline-table td {
    display: table-cell !important;
    position: static !important; /* annulla position:relative */
    padding-left: 8px !important; /* annulla padding-left:50% */
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  /* spegne le label pseudo-element (questo è CRITICO) */
  table.mobile-inline-table td::before,
  table.mobile-inline-table td:before {
    content: none !important;
    display: none !important;
  }
}
@media (min-width: 1081px) {
  .profile-main {
    width: min(1100px, 94vw);
    margin: 16px auto 60px !important;
    padding: 0 8px;
  }
  .profile-main .message {
    margin: 0 0 14px 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #135200;
  }
  .profile-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    padding: 11px 12px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
  }
  .profile-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 16px;
    align-items: start;
  }
  .profile-form br {
    display: none;
  }
  .span-all {
    grid-column: 1/-1;
  }
  .span-2 {
    grid-column: span 2;
  }
  .profile-top {
    grid-column: 1/-1;
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 12px 16px;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 6px;
  }
  .profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 18px;
    object-fit: cover;
  }
  .profile-info h3 {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
  }
  .profile-info p {
    margin: 4px 0 0 0;
    opacity: 0.78;
  }
  .profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
  }
  .profile-meta-box {
    padding: 10px 12px;
    background: #f7f7f8;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    min-width: 170px;
  }
  .profile-meta-box .label {
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 2px;
  }
  .profile-meta-box .value {
    font-weight: 700;
    font-size: 13px;
  }
  .profile-meta-box.Mobile {
    padding: 4px 6px;
    background: #f7f7f8;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 4px;
    min-width: 25vw;
  }
  .profile-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f7f7f8;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
  }
  .profile-toggle input[type=checkbox] {
    width: 18px;
    height: 18px;
    margin: 0;
  }
  .profile-toggle.Mobile {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    background: #f7f7f8;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
  }
  .profile-form label {
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 700;
  }
  .profile-form input[type=text],
  .profile-form input[type=tel],
  .profile-form input[type=number],
  .profile-form select {
    width: 100% !important;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    background: #fff;
    outline: none;
  }
  .profile-form input:focus,
  .profile-form select:focus {
    border-color: rgba(0, 0, 0, 0.45);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.06);
  }
  .intl-field {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }
  .intl-field select {
    flex: 1 1 220px;
    min-width: 170px;
  }
  .intl-field input.prefix-custom {
    flex: 0 0 110px;
  }
  .intl-field input.local-number {
    flex: 2 1 220px;
    min-width: 170px;
    width: auto !important;
  }
  .profile-form .intl-field select {
    width: auto !important;
    margin-left: 0 !important;
  }
  .profile-form .intl-field .prefix-custom {
    width: auto !important;
  }
  .profile-form .intl-field select.Mobile#phone_prefix {
    width: 15vw !important;
    margin-left: 0 !important;
  }
  .profile-actions {
    grid-column: 1/-1;
    display: flex;
    justify-content: flex-start;
    padding-top: 6px;
  }
  .profile-form button[name=save_profile] {
    padding: 10px 14px;
    border-radius: 12px;
  }
}
@media (min-width: 1081px) and (max-width: 1100px) {
  .profile-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .profile-top {
    grid-template-columns: 84px 1fr auto;
  }
  .profile-avatar {
    width: 84px;
    height: 84px;
  }
}
@media (min-width: 1081px) and (max-width: 820px) {
  .profile-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-top {
    grid-template-columns: 72px 1fr;
    align-items: start;
  }
  .profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 16px;
  }
  .profile-badges {
    grid-column: 1/-1;
    justify-content: flex-start;
    margin-top: 6px;
  }
}
@media (min-width: 1081px) and (max-width: 380px) {
  .profile-form {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 1081px) {
  .tossGateHidden {
    visibility: hidden;
  }
  .search-form {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
  }
  .search-input {
    width: 90%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
  }
  .search-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.8vw;
    margin-top: 1.1vw;
    display: inline-block;
  }
  .search-btn:hover {
    background: #45a049;
  }
  .filter-form {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 14px 20px;
    margin-bottom: 20px;
  }
  .filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
  }
  .filter-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
  }
  .filter-row input[type=text],
  .filter-row input[type=number],
  .filter-row select {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
  }
  .filter-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
  }
  .reset-link {
    display: inline-block;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    background: #fff;
  }
  .reset-link:hover {
    background: #f5f5f5;
  }
  .results-table th {
    background: #f8f8f8;
    font-weight: bold;
  }
  .muted {
    color: #777;
    font-size: 13px;
  }
  .users-list {
    list-style: none;
    padding: 0;
  }
  .user-item {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .user-info {
    font-weight: bold;
  }
  .add-btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
  }
  .add-btn:hover {
    background: #0b7dda;
  }
  .add-guest-btn {
    background: #FF9800;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1.1vw;
    font-size: 1.2vw;
    display: inline-block;
  }
  .add-guest-btn:hover {
    background: #F57C00;
  }
  .layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    width: 100%;
  }
  .sidebar {
    flex: 0 0 360px;
    max-width: 360px;
    width: 50vw;
  }
  .sidebar.Mobile {
    width: 100vw;
  }
  .content {
    flex: 1;
    min-width: 0;
  }
}
@media (min-width: 1081px) and (max-width: 900px) {
  .layout {
    flex-direction: column;
  }
  .sidebar {
    flex: 1 1 auto;
    max-width: 100%;
  }
}
@media (min-width: 1081px) and (max-width: 600px) {
  /* i 4 filtri su una riga */
  .filter-row {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
  }
  /* il testo City/Country deve occupare tutta la riga */
  .filter-row > .muted {
    grid-column: 1/-1;
  }
  /* elimina i <br> che spezzano la riga */
  .filter-row br {
    display: none !important;
  }
  /* ogni filtro con label sopra e campo sotto */
  .filter-row label {
    width: auto !important;
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  /* campi a tutta larghezza dentro la colonna */
  .filter-row select,
  .filter-row input[type=number] {
    width: 100% !important;
    box-sizing: border-box;
  }
  /* il bottone Search (ultimo label) va sotto, a tutta riga */
  .filter-row label:last-of-type {
    grid-column: 1/-1;
  }
}
@media (min-width: 1081px) {
  .page-wrap {
    max-width: 1200px;
    margin: 0;
    padding: 12px;
  }
  .bottom-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin: 12px 0 18px;
    padding: 0;
    position: static;
  }
  .bottom-row h2 {
    margin: 0;
    font-size: 18px;
  }
  .sub {
    color: #666;
    font-size: 13px;
  }
  .friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 12px;
    margin-top: 16px;
  }
  .friend-card {
    background: #fff;
    border: 1px solid #e7e7e7;
    border-radius: 14px;
    padding: 14px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    min-width: 0;
  }
  .avatar {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    object-fit: cover;
    background: #f0f0f0;
    border: 1px solid #eaeaea;
    flex: 0 0 auto;
  }
  .f-body {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14px;
  }
  .f-name {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 6px;
  }
  .name {
    font-weight: 700;
    font-size: 1.8vw;
  }
  .badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 1.6vw;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f2f7ff;
    border: 1px solid #dbe9ff;
    color: #1b4ea3;
    white-space: nowrap;
  }
  .badge.blocked {
    background: #fff5f5;
    border-color: #f2c7c7;
    color: #9b1c1c;
  }
  .meta {
    margin: 0;
    color: #555;
    font-size: 13px;
    line-height: 1.35;
  }
  .meta + .meta {
    margin-top: 4px;
  }
  .meta .label {
    color: #888;
  }
  .actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
  }
  .actions form {
    margin: 0;
  }
  .btn2 {
    appearance: none;
    border: 1px solid #cfcfcf;
    background: #fff;
    padding: 9px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
  }
  .btn2:hover {
    background: #f7f7f7;
  }
  .btn2.block {
    border-color: #f2c7c7;
    background: #fff5f5;
  }
  .btn2.unblock {
    border-color: #c9e7d0;
    background: #f4fff6;
  }
  .pagination {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin: 18px 0 6px;
    flex-wrap: wrap;
  }
  .page-btn, .page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #d8d8d8;
    border-radius: 10px;
    background: #fff;
    color: #222;
    text-decoration: none;
    font-size: 13px;
  }
  .page-btn:hover, .page-num:hover {
    background: #f6f6f6;
  }
  .page-num.active {
    background: #1e7e34;
    color: #fff;
    border-color: #1e7e34;
  }
  .page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  .dots {
    color: #888;
    padding: 0 2px;
  }
  .message {
    margin: 10px 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f4fff6;
    border: 1px solid #c9e7d0;
    font-size: 14px;
  }
}
@media (min-width: 1081px) and (max-width: 680px) {
  .page-wrap {
    padding: 10px;
  }
  .friends-grid {
    grid-template-columns: 1fr;
  }
  .friend-card {
    padding: 12px;
  }
  .avatar {
    width: 56px;
    height: 56px;
  }
  /* Buttons become easy to tap */
  .actions {
    gap: 10px;
  }
  .actions form {
    flex: 1 1 140px;
  }
  .btn2 {
    width: 100%;
    padding: 12px;
    font-size: 14px;
  }
  .sub {
    font-size: 12px;
  }
  .name {
    font-size: 16px;
  }
}
@media (min-width: 1081px) and (min-width: 900px) {
  .f-body {
    font-size: 15px;
  }
  .meta {
    font-size: 1.6vw;
  }
  .btn2 {
    font-size: 14px;
  }
  .sub {
    font-size: 14px;
  }
}
@media (min-width: 1081px) {
  .bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 6px 0 14px;
    position: absolute;
    bottom: 2vw;
    right: 0;
    padding: 0 12px;
  }
  .bottom-row h2 {
    margin: 0;
    font-size: 20px;
  }
  :root {
    --p0-color: var(--p0-color);
    --p1-color: var(--p1-color);
  }
  .player0 {
    color: var(--p0-color);
  }
  .player1 {
    color: var(--p1-color);
  }
  .match-details {
    max-height: 80vw;
    max-width: 100vw;
    margin: 0 auto;
    padding: 20px;
    overflow-y: auto;
    min-height: calc(100vh - 20vw);
  }
  .match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.2vw;
    margin-bottom: 0.3vw;
    flex-wrap: wrap;
  }
  .header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .toggle-btn {
    padding: 10px 14px;
    border-radius: 6px;
    border: 2px solid #111;
    background: #fff;
    color: #111;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
  }
  .toggle-btn:hover {
    background: #f5f5f5;
  }
  .stats-table th:first-child,
  .stats-table td:first-child {
    white-space: nowrap;
  }
  .pt-line {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
  }
  .ptlbl {
    font-weight: 900;
    margin-right: 6px;
  }
  .ptval {
    font-weight: 800;
    margin-right: 10px;
  }
  .ptdot {
    opacity: 0.55;
    margin: 0 10px;
  }
  .diff-chart-wrap {
    width: 85vw;
    height: 35vw;
    margin: 0 auto;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 10px;
    background: #fff;
  }
  #diffChart {
    width: 100%;
    height: 100%;
    display: block;
  }
  .sets-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
  }
  .sets-table th, .sets-table td {
    padding: 7px;
    text-align: center;
    border: 1px solid #ddd;
    vertical-align: middle;
  }
  .sets-table th {
    background-color: #f2f2f2;
  }
  .winner {
    color: #4CAF50;
    font-weight: bold;
  }
  .game-seq {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    line-height: 1;
  }
  .game-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  .game-pts {
    font-size: 12px;
    color: #444;
    line-height: 1;
    user-select: none;
  }
  .seq-arrow {
    color: #888;
    font-size: 16px;
    margin-right: 4px;
    user-select: none;
  }
  .game-dot {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    line-height: 1;
    font-weight: 800;
    color: #fff;
  }
  .game-dot.p0 {
    background: var(--p0-color);
  }
  .game-dot.p1 {
    background: var(--p1-color);
  }
  .game-dot.break {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25) inset;
  }
  .stats-section {
    margin-top: 1vw;
  }
  .stats-table {
    width: 100%;
    border-collapse: collapse;
  }
  .stats-table th, .stats-table td {
    padding: 7px 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
  }
  .stats-table th {
    background-color: #f8f8f8;
    font-weight: bold;
  }
  .alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
  }
  .alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
  }
  .ptTypesLine {
    margin-top: 8px;
    font-size: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  .ptTag {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 999px;
  }
  .grid {
    display: grid;
    grid-template-columns: 16vw 27vw 42vw 1fr;
    gap: 8px;
    align-items: start;
  }
  .grid_upcoming {
    display: grid;
    grid-template-columns: 20vw 79vw 1fr;
    gap: 8px;
    align-items: start;
  }
  .card {
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    padding: 14px;
  }
  .row {
    margin-bottom: 6px;
  }
  label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
  }
  input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
  }
  .row label div select {
    width: 4vw;
    display: inline-block;
  }
  [name=court_number] {
    width: 10vw;
  }
  .flash {
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 12px;
  }
  .flash.ok {
    background: #e9f7ef;
    border: 1px solid #bfe8cd;
    color: #1e7a3a;
    width: 36vw;
  }
  .flash.err {
    background: #fdecea;
    border: 1px solid #f5c2c7;
    color: #a61b1b;
    width: 36vw;
  }
  .muted {
    color: #666;
    font-size: 0.95em;
    line-height: 1.35;
    text-align: justify;
  }
  .sets-grid {
    display: grid;
    grid-template-columns: 60px 1fr 1fr;
    gap: 8px;
    align-items: center;
  }
  .sets-grid .hdr {
    font-weight: 700;
  }
  .sets-grid .setno {
    font-weight: 700;
    text-align: center;
  }
  .time-row {
    display: block;
    gap: 10px;
    align-items: end;
  }
  .time-row .time-block {
    align-items: center;
  }
  .time-pair select {
    margin-right: 5px;
    min-width: 20px;
    max-width: 4vw;
    padding: 0.1vw;
  }
  .time-row > select {
    max-width: 1vw;
    padding: 0.1vw;
    display: inline-block;
  }
  .time-block > select {
    width: 1vw;
    display: inline-block;
  }
  [start_h] {
    width: 1.5vw;
  }
  .btn-secondary {
    background-color: #2196F3;
  }
  .btn-secondary:hover {
    background-color: #0b7dda;
  }
  .btn:hover {
    background-color: #45a049;
  }
  .btn {
    display: inline-block;
    background: #4c7eaf;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    width: 6vw !important;
    padding: 0.2vw !important;
    text-align: center !important;
  }
  .up-actions form button {
    width: 6vw !important;
  }
  .btn.large {
    width: 12vw !important;
  }
  .btn:hover {
    background: #45a049;
  }
  .btn.btn-primary {
    background: #2196F3;
  }
  .btn.btn-primary.large {
    width: 12vw !important;
  }
  .btn.btn-secondary {
    background: #45a049;
  }
  .btn.btn-secondary.large {
    width: 12vw !important;
  }
  .btn.btn-secondary:hover {
    background: #0b7dda;
  }
  .btn.btn-edit {
    background: #c067dd;
    text-align: center;
    width: 6vw !important;
  }
  .btn.btn-edit.large {
    width: 12vw !important;
  }
  .btn.btn-edit:hover {
    background: #3b648c;
  }
  .btn.btn-cancel {
    background: #efaf3a;
    color: red;
  }
  .btn.btn-cancel.large {
    width: 12vw !important;
  }
  .btn.btn-cancel:hover {
    background: #c62828;
  }
  .btn.btn-danger {
    background: #e53935;
  }
  .btn.btn-danger.large {
    width: 12vw !important;
  }
  .btn-danger:hover {
    background: #c62828;
  }
  .btn.btn-outline {
    background: yellow;
    color: #333;
    border: 1px solid #ddd;
    text-align: center;
  }
  .btn.btn-outline:hover {
    background: #f5f5f5;
  }
  .pending-matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15vw, 1fr));
    gap: 0.4vw;
    margin-bottom: 0.3vw;
    height: 14vw;
  }
  .pending-match-card {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.5vw;
  }
  .pending-title {
    font-weight: 800;
    margin-bottom: 5px;
  }
  .pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fff3cd;
    border: 1px solid #ffe69c;
    font-size: 12px;
    font-weight: 700;
  }
  .small {
    font-size: 14px;
    color: #444;
    margin-bottom: 5px;
  }
  .pending-actions {
    display: flex;
    gap: 0.3vw;
    margin-top: 0.3vw;
  }
  .btn-sm {
    padding: 5px 10px;
    font-size: 14px;
  }
  .pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 15px;
    flex-wrap: wrap;
  }
  .pagination .btn {
    padding: 6px 12px;
    margin: 0 2px;
  }
  .pagination .btn-current {
    background: #2b7fff;
    color: white;
  }
}
@media (min-width: 1081px) and (max-width: 1180px) {
  .grid {
    grid-template-columns: 2fr;
  }
}
@media (min-width: 1081px) {
  .match-insert-card h2 {
    margin: 0 0 10px 0;
  }
  .match-form-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .match-form-grid .row {
    margin: 0;
  }
  .match-form-grid .two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .match-form-grid .three-col {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 12px;
  }
  .match-form-grid .five-col {
    display: grid;
    grid-template-columns: 4fr 1fr;
    gap: 12px;
  }
  .match-form-grid .actions-row {
    display: flex;
    justify-content: flex-end;
  }
  .input-group {
    display: flex;
    flex-direction: column;
  }
  .input-group label {
    margin-bottom: 6px;
  }
  .select2-container {
    vertical-align: middle;
  }
  .select2-container--default .select2-selection--single {
    height: 32px;
    padding: 2px 2px;
    font-size: 14px;
  }
  .select2-container--default .select2-selection__rendered {
    line-height: 26px;
    padding-left: 0;
  }
  .select2-container--default .select2-selection__arrow {
    height: 26px;
  }
  .time-select {
    padding: 4vw;
  }
  .time-select + .select2-container {
    margin-right: 4px;
    vertical-align: middle;
  }
  .select2-container--default .select2-selection--single {
    height: 28px; /* più basso */
    padding: 0 2px;
    font-size: 14px; /* compatto ma leggibile */
    line-height: 26px;
  }
  .select2-container--default .select2-selection__rendered {
    line-height: 26px;
    padding-left: 0;
  }
  .select2-container--default .select2-selection__arrow {
    height: 26px;
  }
  .select2-dropdown {
    font-size: 14px;
  }
  .inline-row {
    display: flex;
    align-items: center;
    gap: 2px;
  }
  .inline-row label {
    margin: 0;
    font-weight: 600;
    font-size: 14px;
  }
  .match-insert-card .row {
    padding-top: 3px;
    padding-bottom: 3px;
  }
  .match-insert-card input[type=date],
  .match-insert-card input[type=text],
  .match-insert-card input[type=number] {
    height: 28px;
    padding: 3px 6px;
    font-size: 14px;
  }
  [name=location] {
    width: 13vw;
  }
  .pagination {
    bottom: 2vw;
  }
  .request-list {
    list-style: none;
    padding: 0;
  }
  .request-item {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .request-email {
    font-weight: bold;
  }
  .request-actions {
    display: flex;
    gap: 10px;
  }
  .accept-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
  }
  .delete-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
  }
  .accept-btn:hover {
    background: #45a049;
  }
  .delete-btn:hover {
    background: #d32f2f;
  }
  .min_age, .max_age, .gender, .skill {
    width: 9vw;
  }
  #createMatchForm.schedule-form {
    max-width: 520px; /* keeps it tidy in left card */
  }
  #createMatchForm.schedule-form .row {
    display: grid;
    grid-template-columns: 1fr; /* default one field per row */
    gap: 14px;
    align-items: end;
    margin-bottom: 14px;
  }
  #createMatchForm.schedule-form .row.row-2 {
    grid-template-columns: 1fr 1fr; /* two fields on one row */
    gap: 14px;
  }
  #createMatchForm.schedule-form label {
    display: grid;
    grid-template-rows: auto auto; /* label text then control */
    gap: 6px;
    font-weight: 600;
  }
  #createMatchForm.schedule-form input,
  #createMatchForm.schedule-form select {
    width: 100%;
    min-width: 0;
  }
  #createMatchForm.schedule-form .time-pair {
    display: grid;
    grid-template-columns: 1fr 1fr; /* hour + minute */
    gap: 8px;
    align-items: center;
  }
  #createMatchForm.schedule-form .time-pair select {
    width: 100%;
    min-width: 0;
  }
  #createMatchForm.schedule-form button.btn {
    width: 160px;
  }
  .upcoming-layout .schedule-card #createMatchForm .row {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: end;
  }
  .upcoming-layout .schedule-card #createMatchForm .row > label:only-child,
  .upcoming-layout .schedule-card #createMatchForm .row > button:only-child,
  .upcoming-layout .schedule-card #createMatchForm .row > .btn:only-child {
    grid-column: 1/-1;
  }
  .upcoming-layout .schedule-card #createMatchForm label {
    display: grid;
    grid-template-rows: auto auto;
    gap: 6px;
    width: 100%;
  }
  .upcoming-layout .schedule-card #createMatchForm input,
  .upcoming-layout .schedule-card #createMatchForm select {
    width: 100% !important;
    min-width: 0;
  }
  .upcoming-layout .schedule-card #createMatchForm .time-pair {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  .upcoming-layout .schedule-card #createMatchForm .time-pair select {
    width: 100% !important;
    min-width: 0;
  }
  .upcoming-layout .schedule-card #createMatchForm button.btn {
    width: 180px;
  }
}

/*# sourceMappingURL=styles.css.map */
