/* Redoublet Play — Base Styles
   Matches mobile app styling: Poppins/Merriweather, #0808D9 primary, #F89554 accent */

:root {
  --header-h: 90px;
  --avail: calc(100vh - var(--header-h));
  --avail: calc(100dvh - var(--header-h));
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: #f5f5f5;
  color: #000;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ============================================
   Header — matches mobile CommonHeader
   ============================================ */

header {
  background-color: #0808D9;
  padding: 10px 0 15px;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Row 1: Centered logo */
.header-logo-row {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 10px;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-text {
  font-size: 24px;
  font-family: 'Merriweather', serif;
  font-weight: 700;
  display: flex;
}

.logo-redoublet {
  color: #fff;
}

.logo-com {
  color: #F89554;
}

.play-badge {
  background: #F89554;
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 10px;
}

/* Row 2: Navigation links */
.header-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 10px;
}

.header-nav-link {
  color: #fff;
  font-size: 16px;
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  text-decoration: underline;
  text-align: center;
  cursor: pointer;
  transition: opacity 0.2s ease;
  background: transparent;
  border: none;
  padding: 0;
}

.header-nav-link:hover {
  opacity: 0.75;
}

/* Language dropdown toggle (flag-based, matches app LanguageToggle) */
.login-lang-wrapper {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 100;
}

.lang-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #E0E0E0;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: box-shadow 0.2s;
}

.lang-dropdown-btn:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.lang-dropdown-arrow {
  font-size: 10px;
  color: #666;
}

.lang-flag {
  display: inline-flex;
  align-items: center;
}

/* Dutch flag (horizontal stripes) */
.flag-nl {
  display: flex;
  flex-direction: column;
  width: 28px;
  height: 20px;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid #E0E0E0;
}

.flag-nl > span {
  flex: 1;
  display: block;
}

/* UK flag — SVG data URI for pixel-perfect rendering */
.flag-uk {
  display: block;
  width: 28px;
  height: 20px;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid #E0E0E0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3Crect fill='%23012169' width='60' height='30'/%3E%3Cpath d='M0,0 L60,30 M60,0 L0,30' stroke='%23fff' stroke-width='6'/%3E%3Cpath d='M0,0 L60,30 M60,0 L0,30' stroke='%23C8102E' stroke-width='2'/%3E%3Cpath d='M30,0 V30 M0,15 H60' stroke='%23fff' stroke-width='10'/%3E%3Cpath d='M30,0 V30 M0,15 H60' stroke='%23C8102E' stroke-width='6'/%3E%3C/svg%3E") center/cover no-repeat;
}

.lang-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #fff;
  border-radius: 8px;
  padding: 8px 0;
  min-width: 160px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  z-index: 200;
}

.lang-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  width: 100%;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 15px;
  font-family: 'Poppins', sans-serif;
  color: #333;
  transition: background 0.15s;
}

.lang-dropdown-item:hover {
  background: #f5f5f5;
}

.lang-dropdown-divider {
  height: 1px;
  background: #E0E0E0;
  margin: 0 12px;
}

/* Header-right for non-login headers */
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ============================================
   Main Content
   ============================================ */

main {
  margin-top: 90px;
  padding: 30px 20px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* Green felt background for game screens */
body.green-felt {
  background-color: #2C7148;
}

body.green-felt main {
  max-width: 1400px;
  padding: 4px 20px;
  height: var(--avail);
  overflow: hidden;
}

/* ============================================
   Login / Signup Page
   ============================================ */

/* Login screen — app-matching centered layout */
.login-screen-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f5f5f5;
  padding: 20px;
  position: relative;
}

.login-content {
  max-width: 400px;
  width: 100%;
  padding: 0 20px;
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-logo-text {
  font-family: 'Merriweather', serif;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 10px;
}

.login-logo-redoublet {
  color: #0808D9;
}

.login-logo-com {
  color: #F89554;
}

.login-welcome {
  font-family: 'Poppins', sans-serif;
  font-size: 18px;
  color: #666;
}

/* Inputs — app-matching borderless style */
.login-input {
  width: 100%;
  padding: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  font-size: 16px;
  font-family: 'Poppins', sans-serif;
  background: #fff;
  transition: border-color 0.3s;
}

.login-input:focus {
  outline: none;
  border-color: #0808D9;
}

.login-input::placeholder {
  color: #999;
}

.login-password-group {
  position: relative;
}

.login-eye-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  padding: 0;
  line-height: 1;
}

.login-submit-btn {
  margin-top: 5px;
  padding: 15px;
  font-size: 18px;
  font-weight: 700;
  border-radius: 10px;
}

.login-forgot-btn {
  color: #000;
  text-decoration: underline;
  font-size: 16px;
}

.login-forgot-btn:hover {
  color: #333;
}

/* Footer — "Don't have an account?" / "Create Account" */
.login-footer {
  text-align: center;
  margin-top: 24px;
}

.login-footer-text {
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  color: #666;
  margin-bottom: 10px;
}

.login-footer-link {
  background: none;
  border: none;
  font-family: 'Poppins', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #000;
  text-decoration: underline;
  cursor: pointer;
}

.login-footer-link:hover {
  color: #333;
}

/* Legacy compat */
.login-subtitle {
  color: #666;
  text-align: center;
  margin-bottom: 24px;
  font-size: 14px;
}

/* Auth Tabs */
.auth-tabs {
  display: flex;
  margin-bottom: 24px;
  background: #f0f4f8;
  border-radius: 10px;
  padding: 4px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: #666;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-family: 'Poppins', sans-serif;
}

.auth-tab.active {
  background: #0808D9;
  color: #fff;
}

.auth-tab:hover:not(.active) {
  color: #0808D9;
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

/* Forms */
.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: #000;
  font-weight: 600;
  font-size: 14px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s ease;
  font-family: 'Poppins', sans-serif;
  background: #fff;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #0808D9;
}

.error-message {
  color: #DC3545;
  font-size: 14px;
  margin-top: 8px;
  display: none;
}

.error-message.show {
  display: block;
}

.success-message {
  color: #2C7148;
  font-size: 14px;
  margin-top: 8px;
  display: none;
}

.success-message.show {
  display: block;
}

.inline-error {
  color: #DC3545;
  font-size: 13px;
  margin-top: 6px;
}

/* Buttons */
.btn {
  padding: 14px 30px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Poppins', sans-serif;
}

.btn-primary {
  background: #0808D9;
  color: white;
  width: 100%;
}

.btn-primary:hover {
  background: #0606b3;
  box-shadow: 0 4px 12px rgba(8, 8, 217, 0.3);
}

.btn-primary:disabled {
  background: #999;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: #f0f4f8;
  color: #0808D9;
  border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
  background: #e0e5ea;
  border-color: #0808D9;
}

.btn-small {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-danger {
  background: #DC3545;
  color: white;
  width: 100%;
}

.btn-danger:hover {
  background: #c82333;
}

.btn-danger:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.link-btn {
  background: none;
  border: none;
  color: #0808D9;
  font-size: 14px;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  text-decoration: underline;
  padding: 0;
}

.link-btn:hover {
  color: #0606b3;
}

.auth-links {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  color: #666;
}

.auth-links .link-btn {
  margin-left: 4px;
}

/* Verification screen */
.verify-screen {
  text-align: center;
  padding: 30px 0;
}

.verify-screen .verify-icon {
  font-size: 48px;
  margin-bottom: 20px;
}

.verify-screen p {
  color: #666;
  margin-bottom: 20px;
  line-height: 1.6;
}

/* ============================================
   Home Screen — Play Mode Buttons
   Matches mobile PlayOnlineScreen layout
   ============================================ */

.home-screen {
  padding: 40px 0;
}

/* Trial Banner */
.trial-banner {
  background: #FEF3C7;
  border: 2px solid #0808D9;
  border-radius: 12px;
  padding: 12px 20px;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  color: #000;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.trial-banner-icon {
  font-size: 20px;
}

/* Mode Buttons — responsive grid, solid color tiles */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, min(200px, 25vw));
  gap: min(60px, 6vw) min(80px, 8vw);
  justify-content: center;
}

@media (max-width: 768px) {
  .mode-grid {
    grid-template-columns: repeat(2, min(200px, 38vw));
    gap: min(40px, 5vw);
  }
}

.mode-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  text-align: center;
  padding: 20px;
}

.mode-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.mode-tile:active {
  transform: translateY(0);
}

.mode-tile.competition {
  background: #2C7148;
}

.mode-tile.robot {
  background: #0808D9;
}

.mode-tile.learning {
  background: #F89554;
}

.mode-tile.locked {
  opacity: 0.7;
}

.mode-tile-name {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: clamp(16px, 3.2vw, 26px);
  color: #fff;
  line-height: 1.3;
}

.mode-tile.custom-competition {
  background: #00213A;
}

.mode-tile.create-competition {
  background: #fff;
  border: 3px solid #0808D9;
  flex-direction: column;
}

.mode-tile.create-competition .mode-tile-name {
  color: #0808D9;
  font-size: clamp(14px, 2.2vw, 18px);
}

.mode-tile.create-competition .mode-tile-plus {
  font-size: clamp(50px, 10vw, 80px);
  font-weight: 300;
  color: #0808D9;
  line-height: 1;
  margin-bottom: 4px;
}

.mode-tile.learning .mode-tile-name {
  color: #000;
}

.mode-tile-desc {
  color: #666;
  font-size: 13px;
  line-height: 1.4;
  margin-top: 10px;
  max-width: 200px;
  text-align: center;
}

/* Lock badge */
.lock-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #FEF3C7;
  border: 2px solid #0808D9;
  border-radius: 12px;
  padding: 4px 8px;
  font-size: 13px;
  line-height: 1;
}

/* ============================================
   Learning Mode Screens
   ============================================ */

.learning-screen,
.learning-comp-screen {
  max-width: 600px;
  margin: 0 auto;
  padding: 30px 20px;
}

.learning-screen-title,
.learning-comp-title {
  font-family: 'Poppins', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #2C7148;
  text-align: center;
  margin-bottom: 5px;
}

.learning-screen-subtitle,
.learning-comp-subtitle {
  font-size: 14px;
  color: #666;
  text-align: center;
  margin-bottom: 24px;
}

.learning-section-title {
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #0808D9;
  margin-bottom: 12px;
}

.learning-loading {
  text-align: center;
  padding: 40px 0;
  color: #666;
}

.learning-empty {
  text-align: center;
  padding: 60px 20px;
  color: #666;
  font-size: 16px;
}

.learning-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.learning-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  border-left: 4px solid #2C7148;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.learning-card.completed {
  opacity: 0.8;
}

.learning-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.learning-card-name {
  font-size: 18px;
  font-weight: 700;
  color: #00213a;
}

.learning-completed-badge {
  background: #2C7148;
  color: #fff;
  border-radius: 12px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

.learning-card-details {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.learning-detail-label {
  font-size: 12px;
  color: #666;
}

.learning-detail-value {
  font-size: 12px;
  font-weight: 600;
  color: #333;
}

.learning-progress {
  margin-top: 12px;
}

.learning-progress-bar {
  height: 8px;
  background: #E0E0E0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.learning-progress-fill {
  height: 100%;
  background: #2C7148;
  border-radius: 4px;
  transition: width 0.3s;
}

.learning-progress-text {
  font-size: 12px;
  color: #666;
  text-align: right;
  display: block;
}

/* Learning Competition Screen — deal list */
.learning-comp-progress {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.learning-comp-progress-title {
  font-size: 16px;
  font-weight: 700;
  color: #2C7148;
  margin-bottom: 12px;
}

.learning-play-next-btn {
  margin-top: 16px;
  background: #2C7148;
}

.learning-play-next-btn:hover {
  background: #245c3b;
}

.learning-comp-completed-msg {
  text-align: center;
  padding: 16px 0 0;
}

.learning-comp-completed-msg h3 {
  color: #2C7148;
  font-size: 18px;
  margin-bottom: 8px;
}

.learning-comp-completed-msg p {
  color: #666;
  font-size: 14px;
}

.learning-deal-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.learning-deal-card {
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: transform 0.2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.learning-deal-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}

.learning-deal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.learning-deal-name {
  font-weight: 700;
  font-size: 16px;
  color: #00213a;
}

.learning-deal-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
}

.learning-deal-badge.done {
  background: #e8f5e9;
  color: #2C7148;
}

.learning-deal-badge.pending {
  background: #f5f5f5;
  color: #999;
}

.learning-deal-info {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #666;
}

.learning-notes-indicator {
  color: #F89554;
  font-weight: 600;
}

.learning-back-btn {
  margin-top: 8px;
}

/* ============================================
   Robot Challenge Screen
   ============================================ */

.robot-screen {
  max-width: 600px;
  margin: 0 auto;
  padding: 30px 20px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.robot-loading {
  text-align: center;
  color: #666;
}

.robot-screen-title {
  font-family: 'Merriweather', serif;
  font-size: 1.6rem;
  color: #1B4332;
  text-align: center;
  margin-bottom: 30px;
}

.robot-mode-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.robot-mode-card {
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.robot-mode-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.robot-mode-card.unlimited-card {
  background: #2C7148;
  border-color: #2C7148;
  color: #fff;
}

.robot-mode-card.practice-card {
  background: #0808D9;
  border-color: #0808D9;
  color: #fff;
}

.robot-mode-icon {
  font-size: 2.4rem;
  margin-bottom: 8px;
}

.robot-mode-name {
  font-size: 1.4rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.robot-mode-desc {
  font-size: 0.9rem;
  opacity: 0.85;
}

.practice-selector {
  animation: modalFadeIn 0.2s ease-out;
}

.practice-selector-title {
  font-family: 'Merriweather', serif;
  font-size: 1.3rem;
  color: #1B4332;
  text-align: center;
  margin-bottom: 20px;
}

.practice-board-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.practice-board-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}

.practice-board-btn:hover {
  border-color: #2C7148;
  background: #f0faf4;
  transform: translateX(4px);
}

.practice-board-num {
  font-weight: 700;
  font-size: 1rem;
  color: #1B4332;
}

.practice-board-info {
  font-size: 0.8rem;
  color: #666;
}

.practice-back-btn {
  display: block;
  margin: 0 auto;
}


/* ============================================
   Profile Screen
   ============================================ */

.profile-screen {
  max-width: 700px;
  margin: 0 auto;
}

.back-btn {
  background: none;
  border: none;
  color: #0808D9;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  margin-bottom: 20px;
  padding: 0;
}

.back-btn:hover {
  text-decoration: underline;
}

.page-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 28px;
  color: #000;
  margin-bottom: 24px;
}

/* Profile Tab Bar — matches mobile tab bar (underline style) */
.profile-tab-bar {
  display: flex;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 24px;
}

.profile-tab {
  flex: 1;
  padding: 12px 8px;
  border: none;
  background: transparent;
  color: #666;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
  font-family: 'Poppins', sans-serif;
  text-align: center;
}

.profile-tab.active {
  color: #0808D9;
  font-weight: 700;
  border-bottom-color: #0808D9;
}

.profile-tab:hover:not(.active) {
  color: #0808D9;
}

/* Tab Content */
.profile-tab-content {
  min-height: 300px;
}

/* Profile Sections (within tabs) — matching mobile */
.profile-section {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.section-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: #000;
  margin-bottom: 16px;
}

/* Competitions section separator — matching mobile */
#competitionsSection {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

/* Settings Rows — stacked layout matching mobile */
.settings-row {
  margin-bottom: 16px;
}

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

.settings-label {
  display: block;
  font-size: 14px;
  font-weight: 400;
  color: #666;
  margin-bottom: 4px;
}

.settings-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 16px;
  color: #000;
}

.edit-link {
  background: none;
  border: none;
  color: #0808D9;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  text-decoration: none;
}

.edit-link:hover {
  text-decoration: underline;
}

.username-edit-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.username-edit-form input {
  padding: 8px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  width: 160px;
}

.username-edit-form input:focus {
  outline: none;
  border-color: #0808D9;
}

.filter-select {
  padding: 10px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  background: white;
  cursor: pointer;
  min-width: 150px;
}

.filter-select:focus {
  outline: none;
  border-color: #0808D9;
}

/* Subscription Card — matching mobile */
.subscription-card {
  background: #f0f4ff;
  border-radius: 8px;
  padding: 16px 20px;
}

.subscription-header {
  margin-bottom: 4px;
}

.subscription-status-text {
  font-size: 20px;
  font-weight: 700;
  color: #0808D9;
}

.subscription-description {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
}

.subscription-manage-hint {
  font-size: 12px;
  color: #999;
  margin-top: 8px;
}

/* Subscribe Screen — matches mobile SubscriptionScreen */
.subscribe-screen {
  max-width: 480px;
  margin: 0 auto;
}

.subscribe-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.subscribe-card-title {
  font-size: 18px;
  font-weight: 700;
  color: #000;
  margin-bottom: 12px;
}

.subscribe-pro-title {
  color: #0808D9;
}

.plan-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.badge-pro {
  background: #D1FAE5;
  color: #10B981;
}

.badge-trial {
  background: #FEF3C7;
  color: #F59E0B;
}

.badge-free {
  background: #F3F4F6;
  color: #6B7280;
}

.plan-status-description {
  font-size: 14px;
  color: #666;
}

.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 16px;
}

.pricing-amount {
  font-size: 28px;
  font-weight: 800;
  color: #000;
}

.pricing-interval {
  font-size: 14px;
  color: #666;
}

.subscribe-features {
  margin-bottom: 20px;
}

.subscribe-features-title {
  font-size: 14px;
  font-weight: 700;
  color: #000;
  margin-bottom: 12px;
}

.subscribe-feature-item {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.feature-check {
  font-size: 16px;
  color: #10B981;
  font-weight: 700;
  margin-right: 8px;
}

.feature-text {
  font-size: 14px;
  color: #000;
}

.feature-note {
  font-size: 12px;
  color: #666;
  margin-left: 4px;
}

/* Subscription detail rows */
.subscription-detail-card {
  margin: 16px 0;
}

.subscription-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.subscription-detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 14px;
  color: #666;
}

.detail-value {
  font-size: 14px;
  font-weight: 600;
  color: #000;
}

.subscription-cancel-section {
  text-align: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.subscription-notice {
  text-align: center;
  margin-top: 16px;
  padding: 16px;
  background: #FEF3C7;
  border-radius: 8px;
}

.subscription-notice p {
  font-size: 14px;
  color: #92400E;
  margin-bottom: 16px;
}

/* Legal links */
.subscribe-legal-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.subscribe-legal-links a {
  font-size: 12px;
  color: #666;
  text-decoration: underline;
}

.subscribe-legal-links span {
  font-size: 12px;
  color: #666;
}

.subscribe-info {
  font-size: 11px;
  color: #999;
  text-align: center;
  line-height: 1.5;
  padding: 0 16px;
  margin-bottom: 20px;
}

/* Voucher input section */
.voucher-section {
  margin: 16px 0 20px;
}

.voucher-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.voucher-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  text-transform: uppercase;
}

.voucher-input::placeholder {
  text-transform: none;
}

.voucher-result {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
}

.voucher-success {
  background: #e8f5e9;
  color: #2e7d32;
  display: flex;
  align-items: center;
  gap: 6px;
}

.voucher-error {
  background: #fce4ec;
  color: #c62828;
}

.voucher-check {
  font-weight: bold;
}

.voucher-desc {
  margin-left: 4px;
  font-style: italic;
}

/* Referral card on profile */
.referral-card {
  background: #f0f4f8;
  border-radius: 12px;
  padding: 16px;
}

.referral-description {
  font-size: 13px;
  color: #555;
  margin-bottom: 12px;
  line-height: 1.5;
}

.referral-code-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.referral-code {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #0808D9;
  font-family: monospace;
}

.referral-status {
  margin-top: 8px;
  font-size: 12px;
  color: #666;
}

/* Subscription result screen */
.subscription-result {
  text-align: center;
  padding: 60px 20px;
}

.result-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e0e0e0;
  border-top-color: #0808D9;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 24px;
}

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

.subscription-result h2 {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 8px;
}

.subscription-result p {
  font-size: 15px;
  color: #666;
  margin-bottom: 24px;
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 30px 20px;
}

.empty-state-text {
  color: #666;
  font-size: 15px;
  margin-bottom: 8px;
}

.empty-state-hint {
  color: #999;
  font-size: 13px;
}

.hint-text {
  color: #666;
  font-size: 14px;
  font-style: italic;
  margin-top: 12px;
}

/* Help hint has bottom border matching mobile helpHintRow */
.profile-section > .hint-text {
  padding-bottom: 16px;
  border-bottom: 1px solid #e0e0e0;
  margin-top: 0;
}

/* Help Rows — matching mobile */
.help-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid #e0e0e0;
}

.help-row:last-child {
  border-bottom: none;
}

.help-row-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  margin-right: 12px;
}

.help-row-title {
  font-size: 16px;
  font-weight: 700;
  color: #000;
}

.help-row-desc {
  font-size: 12px;
  color: #666;
}

.danger-warning {
  color: #666;
  font-size: 13px;
  margin-bottom: 15px;
}

/* Games Table — blue header matching mobile */
.games-table {
  width: 100%;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.games-table-header {
  display: grid;
  grid-template-columns: 1.2fr 1.5fr 0.8fr 0.8fr;
  gap: 8px;
  padding: 10px 8px;
  background: #0808D9;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.games-table-row {
  display: grid;
  grid-template-columns: 1.2fr 1.5fr 0.8fr 0.8fr;
  gap: 8px;
  padding: 12px 8px;
  border-bottom: 1px solid #e0e0e0;
  font-size: 14px;
  align-items: center;
}

.games-table-row:last-child {
  border-bottom: none;
}

.col-date .date-main {
  display: block;
  font-weight: 500;
}

.col-date .date-time {
  display: block;
  font-size: 12px;
  color: #999;
}

.col-score {
  font-weight: 600;
}

.col-mp {
  font-weight: 500;
  color: #0808D9;
}

/* Invitation Cards — amber card style matching mobile */
.invitation-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  margin-bottom: 8px;
  background: #fff8e1;
  border-radius: 8px;
  border: 1px solid #ffc107;
}

.invitation-card:last-child {
  margin-bottom: 0;
}

.invitation-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.invitation-group-name {
  font-size: 15px;
  font-weight: 600;
  color: #000;
}

.invitation-from {
  font-size: 13px;
  color: #666;
}

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

/* Group Cards — card style matching mobile */
.group-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  margin-bottom: 8px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.group-card:last-child {
  margin-bottom: 0;
}

.group-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.group-name {
  font-size: 15px;
  font-weight: 600;
  color: #000;
}

.group-member-count {
  font-size: 13px;
  color: #666;
}

.owner-badge {
  display: inline-block;
  background: #E3F2FD;
  color: #0808D9;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  width: fit-content;
  margin-top: 4px;
}

/* Favorites — card style matching mobile */
.favorites-list {
  margin-top: 8px;
}

.favorite-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  margin-bottom: 8px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.favorite-item:last-child {
  margin-bottom: 0;
}

.favorite-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.favorite-name {
  font-size: 15px;
  font-weight: 500;
  color: #000;
}

.favorite-email {
  font-size: 13px;
  color: #666;
}

.star-filled {
  color: #FFD700;
  font-size: 24px;
}

/* Competitions Section — matching mobile */
.competition-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
}

.competition-label {
  font-size: 14px;
  font-weight: 400;
  color: #666;
  flex: 1;
}

.competition-value {
  font-size: 14px;
  font-weight: 600;
  color: #0808D9;
}

.clickable-value {
  color: #0808D9;
  text-decoration: underline;
  cursor: pointer;
}

.clickable-value:hover {
  opacity: 0.8;
}

.competition-wins-row {
  padding: 10px 4px;
}

.competition-wins-row:last-child {
  border-bottom: none;
}

.competition-win-label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
  display: block;
}

.wins-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: 8px;
  margin-top: 4px;
}

.win-period {
  font-size: 13px;
  color: #666;
  padding: 2px 0;
}

.custom-comp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px;
  border-bottom: 1px solid #eee;
}

.custom-comp-row:last-child {
  border-bottom: none;
}

.custom-comp-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.custom-comp-name {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-comp-group {
  font-size: 12px;
  color: #888;
}

.custom-comp-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.custom-comp-progress {
  font-size: 12px;
  color: #888;
}

.no-wins-text {
  font-size: 13px;
  color: #999;
  font-style: italic;
  display: block;
  margin-left: 8px;
  margin-top: 4px;
}

/* Suit symbols — 50% larger than surrounding text */
.suit-symbol {
  font-size: 1.5em;
  line-height: 0;
  vertical-align: -0.05em;
}

/* Clickable MP% in games table */
.clickable-mp {
  cursor: pointer;
  text-decoration: underline;
}

.clickable-mp:hover {
  opacity: 0.7;
}

/* Profile Modals */
.profile-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  animation: modalFadeIn 0.2s ease-out;
}

.profile-modal {
  background: #fff;
  border-radius: 16px;
  width: 90%;
  max-width: 520px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.2s ease-out;
}

.profile-modal-medium {
  max-height: 55vh;
}

.profile-modal-large {
  max-height: 75vh;
  max-width: 580px;
}

.profile-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 10px;
  border-bottom: 2px solid #0808D9;
  margin-bottom: 0;
}

.profile-modal-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: #0808D9;
  margin: 0;
}

.profile-modal-subtitle {
  font-size: 13px;
  color: #666;
}

.profile-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #0808D9;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  font-weight: 700;
}

.profile-modal-close:hover {
  color: #0606b3;
}

.profile-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 24px;
}

/* Group Filter Tabs in Modals — matching mobile */
.profile-group-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e0e0e0;
  flex-wrap: wrap;
}

.profile-group-tab {
  padding: 6px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 16px;
  background: #f5f5f5;
  font-size: 12px;
  font-weight: 400;
  color: #666;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: all 0.2s;
}

.profile-group-tab:hover {
  border-color: #0808D9;
  color: #0808D9;
}

.profile-group-tab.active {
  background: #0808D9;
  border-color: #0808D9;
  color: #fff;
  font-weight: 700;
}

/* Comparison Table — blue header, card rows matching mobile */
.comparison-table {
  width: 100%;
}

.comparison-table-header {
  display: grid;
  grid-template-columns: 1.5fr 1.5fr 0.8fr 0.7fr;
  gap: 8px;
  padding: 10px 10px;
  background: #0808D9;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.comparison-table-row {
  display: grid;
  grid-template-columns: 1.5fr 1.5fr 0.8fr 0.7fr;
  gap: 8px;
  padding: 10px 10px;
  margin-bottom: 6px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  background: #fff;
  font-size: 14px;
  align-items: center;
}

.comparison-table-row:last-child {
  margin-bottom: 0;
}

.comparison-table-row.current-user-row {
  background: #E3F2FD;
  border: 2px solid #2196F3;
  font-weight: 700;
}

.comparison-table-row.robot-row {
  color: #0808D9;
}

.ct-score,
.ct-mp {
  text-align: right;
}

/* Overall Results Table — blue header matching mobile */
.overall-results-table {
  width: 100%;
}

.overall-results-header {
  display: grid;
  grid-template-columns: 0.5fr 2fr 1fr;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 2px solid #0808D9;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 700;
  color: #0808D9;
}

.overall-results-row {
  display: grid;
  grid-template-columns: 0.5fr 2fr 1fr;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
  font-size: 13px;
  align-items: center;
}

.overall-results-row:last-child {
  border-bottom: none;
}

.overall-results-row.current-user-row {
  background: #E3F2FD;
  border-radius: 6px;
  padding: 8px 10px;
}

.clickable-user-row {
  cursor: pointer;
}

.clickable-user-row:hover {
  background: #dcdcff;
}

.or-rank {
  text-align: center;
}

.or-avg {
  text-align: center;
}

.bold-text {
  font-weight: 700;
}

.underlined-text {
  text-decoration: underline;
  color: #0808D9;
}

/* Breakdown Tables — blue header matching mobile */
.breakdown-table {
  width: 100%;
}

.breakdown-table-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px 10px;
  background: #0808D9;
  border-radius: 5px;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.breakdown-table-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 10px;
  border-bottom: 1px solid #e0e0e0;
  font-size: 14px;
  align-items: center;
}

.breakdown-table-row:last-child {
  border-bottom: none;
}

.clickable-breakdown {
  cursor: pointer;
}

.clickable-breakdown:hover {
  background: #f5f5ff;
}

.link-text {
  color: #0808D9;
  text-decoration: underline;
}

.muted-text {
  color: #999;
}

.bt-value {
  text-align: center;
}

.breakdown-average-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 10px;
  margin-top: 10px;
  border-top: 2px solid #0808D9;
  font-weight: 700;
  font-size: 15px;
}

.breakdown-avg-label {
  color: #333;
}

.breakdown-avg-value {
  color: #0808D9;
  font-size: 16px;
}

/* MP Breakdown (4-column game breakdown table) */
.breakdown-table-4col .breakdown-table-header,
.breakdown-table-4col .breakdown-table-row {
  grid-template-columns: 0.6fr 1.5fr 0.8fr 0.7fr;
}

.breakdown-table-4col .breakdown-table-header {
  background: #0808D9;
  color: #fff;
}

.bd-score,
.bd-mp {
  text-align: right;
}

/* Inline Loading Spinner */
.loading-inline {
  display: flex;
  justify-content: center;
  padding: 40px 0;
}

.loading-spinner-small {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(8, 8, 217, 0.2);
  border-top: 3px solid #0808D9;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-active {
  background: #e8f5e9;
  color: #2C7148;
}

.status-trial {
  background: #e3f2fd;
  color: #1976d2;
}

.status-free {
  background: #f5f5f5;
  color: #666;
}

.status-expired {
  background: #ffebee;
  color: #DC3545;
}

.status-cancelled {
  background: #fff3e0;
  color: #f57c00;
}

/* ============================================
   Loading Overlay
   ============================================ */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #0808D9;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ============================================
   Error Screen
   ============================================ */

.error-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: #666;
  font-size: 16px;
}

/* ============================================
   Mobile Warning
   ============================================ */

.mobile-warning {
  display: none;
  text-align: center;
  padding: 60px 20px;
}

.mobile-warning .mobile-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.mobile-warning h2 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 28px;
  color: #000;
  margin-bottom: 16px;
}

.mobile-warning p {
  color: #666;
  font-size: 16px;
  max-width: 500px;
  margin: 0 auto 30px;
  line-height: 1.6;
}

.mobile-warning .download-links {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.mobile-warning .download-links a {
  display: inline-block;
}

.mobile-warning .download-links img {
  height: 50px;
}

/* ============================================
   Game Modals (Bid Confirm, Contract, System Card, Tricks, Menu)
   ============================================ */

.game-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.game-modal {
  background: #fff;
  border-radius: 16px;
  padding: 28px 32px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.2s ease-out;
  text-align: center;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.game-modal-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: #000;
  margin-bottom: 12px;
}

.game-modal-body {
  font-size: 15px;
  color: #333;
  margin-bottom: 20px;
  line-height: 1.5;
}

.game-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.game-modal-actions .btn {
  min-width: 100px;
  padding: 10px 24px;
  font-size: 15px;
}

/* Bid confirmation modal — bid preview */
.bid-confirm-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f0f4f8;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 1.8rem;
  font-weight: 700;
  margin: 10px 0;
}

.bid-confirm-preview .red-suit { color: #FF2222; }
.bid-confirm-preview .nt-color { color: #6135E1; }
.bid-confirm-preview.pass-preview { color: #2C7148; font-size: 1.4rem; }
.bid-confirm-preview.dbl-preview { background: #FF4444; color: #fff; border-color: #FF4444; }
.bid-confirm-preview.rdbl-preview { background: #6135E1; color: #fff; border-color: #6135E1; }

/* Contract modal — large contract display */
.contract-modal-display {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0f4f8;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  padding: 12px 28px;
  font-size: 2.2rem;
  font-weight: 700;
  margin: 10px 0;
}

.contract-modal-display .red-suit { color: #FF2222; }
.contract-modal-display .nt-color { color: #6135E1; }

.contract-modal-declarer {
  font-size: 15px;
  color: #666;
  margin-top: 4px;
}

/* System card modal — image display */
.system-card-modal .game-modal {
  max-width: 600px;
  padding: 20px;
}

.system-card-img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* System card button in info bar */
.system-card-btn {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.4);
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
}

.system-card-btn:hover {
  background: rgba(255,255,255,0.35);
}

/* ============================================
   Green Modals (matches mobile app style)
   ============================================ */

.green-modal {
  background: #2C7148;
  border-radius: 15px;
  padding: 30px;
  max-width: 400px;
  width: 85%;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: modalSlideIn 0.25s ease-out;
}

.green-modal-wide {
  max-width: 1100px;
  width: 96%;
  max-height: 85vh;
  padding: 24px;
}

.green-modal-title {
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 24px;
  margin-bottom: 20px;
}

.green-modal-scroll {
  width: 100%;
  max-height: 60vh;
  overflow-y: auto;
  padding: 0 10px;
}

.green-modal-btn {
  background: #0808D9;
  color: #fff;
  border: none;
  padding: 12px 40px;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  margin-top: 20px;
}

.green-modal-btn:hover {
  background: #0606B0;
}

/* ---- Trick cross layout (N/S/E/W card positions) ---- */
.trick-cross {
  position: relative;
  margin: 10px auto;
}

.trick-cross-n {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.trick-cross-s {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

.trick-cross-w {
  position: absolute;
  left: 15%;
  top: 50%;
  transform: translateY(-50%);
}

.trick-cross-e {
  position: absolute;
  right: 15%;
  top: 50%;
  transform: translateY(-50%);
}

.trick-cross-card {
  border-radius: 5px;
  width: auto;
}

/* ---- All tricks grid (4 per row) ---- */
.tricks-grid-row {
  display: flex;
  justify-content: flex-start;
  gap: 17px;
  margin-bottom: 21px;
}

.tricks-grid-item {
  text-align: center;
}

.tricks-grid-number {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
}

/* ---- Bidding modal table ---- */
.bidding-modal-table {
  width: 100%;
  border-collapse: collapse;
  background: #1a4c2e;
  border-radius: 8px;
  padding: 10px;
}

.bidding-modal-table thead tr {
  border-bottom: 2px solid #fff;
}

.bidding-modal-table th {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  padding: 8px 8px 10px;
  text-align: center;
}

.bidding-modal-table td {
  padding: 4px 8px;
  text-align: center;
  vertical-align: middle;
}

.bid-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  min-width: 50px;
  height: 32px;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  color: #000;
}

.bid-box-pass {
  color: #2C7148;
}

.bid-box-dbl {
  background: #FF4444;
  color: #fff;
  font-weight: 700;
}

.bid-box-rdbl {
  background: #0808D9;
  color: #fff;
  font-weight: 700;
}

/* ============================================
   Claim Button & Modal
   ============================================ */

.claim-btn {
  background: #0808D9;
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: all 0.2s;
}

.claim-btn:hover {
  background: #0606B0;
  transform: translateY(-1px);
}

.claim-btn:disabled {
  background: #999;
  cursor: not-allowed;
  transform: none;
}

.claim-bar {
  display: flex;
  justify-content: center;
  padding: 6px 0;
}

/* ============================================
   Play Phase Menu Button
   ============================================ */

.menu-btn {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.4);
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
}

.menu-btn:hover {
  background: rgba(255,255,255,0.35);
}

.game-menu-modal .game-modal {
  max-width: 300px;
  padding: 20px;
}

.menu-option {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: #f8f9fa;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  text-align: center;
  margin-bottom: 8px;
  transition: background 0.15s;
  color: #000;
}

.menu-option:hover {
  background: #e8e8ff;
}

.menu-option:last-child {
  margin-bottom: 0;
}

/* ============================================
   Suit Zoom (click suit to expand on touch,
   hover to fan out on desktop)
   ============================================ */

.suit-group.zoomable {
  cursor: pointer;
  border-radius: 4px;
}

/* Desktop: hover over suit group fans cards out for easy picking */
@media (hover: hover) and (pointer: fine) {
  .suit-group.zoomable {
    transition: gap 0.2s;
  }

  .suit-group.zoomable .card-img {
    transition: margin-left 0.2s, transform 0.15s, filter 0.15s;
  }

  .suit-group.zoomable:hover .card-img {
    margin-left: 2px;
  }

  .suit-group.zoomable:hover .card-img:first-child {
    margin-left: 0;
  }

  .suit-group.zoomable:hover {
    z-index: 50;
    background: rgba(255, 255, 255, 0.05);
  }
}

/* Touch: zoom overlay (replaces old inline zoom) */
.zoom-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.4);
}

.zoom-panel {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #2C7148;
  border: 2px solid #fff;
  padding: 20px;
  z-index: 3000;
}

.zoom-panel-south {
  bottom: 0;
  border-radius: 12px 12px 0 0;
}

.zoom-panel-north {
  top: var(--header-h, 90px);
  border-radius: 0 0 12px 12px;
}

.zoom-hint {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.zoom-cards-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.zoom-card-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: min(12px, 2vw);
}

.zoom-card-img {
  height: min(160px, 20vh, 18vw);
  width: auto;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  opacity: 0.4;
  transition: transform 0.15s;
}

.zoom-card-img.zoom-playable {
  opacity: 1;
  cursor: pointer;
}

.zoom-card-img.zoom-playable:active {
  transform: scale(0.95);
  filter: brightness(1.1);
}


/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .login-content {
    padding: 0 10px;
  }

  .profile-tab {
    font-size: 12px;
    padding: 10px 4px;
  }

  .settings-row {
    margin-bottom: 14px;
  }

  .header-nav-link {
    font-size: 14px;
  }

  .home-screen {
    padding: 20px 0;
  }

  .trial-banner {
    margin: 0 10px 20px;
    font-size: 13px;
  }

  .page-title {
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .logo-text {
    font-size: 18px;
  }

  .play-badge {
    font-size: 10px;
    padding: 3px 8px;
  }

  .header-username {
    display: none;
  }

  .header-nav-link {
    font-size: 12px;
  }
}

/* ============================================
   Mobile phone-specific styles (profile/subscribe access)
   ============================================ */
.is-mobile-phone .profile-screen > .back-btn {
  display: none;
}

@media (max-width: 480px) {
  .profile-screen {
    padding: 0 10px;
  }

  .subscribe-screen {
    padding: 0 10px;
  }

  .settings-value {
    flex-wrap: wrap;
  }

  .username-edit-form {
    width: 100%;
  }

  .username-edit-form input {
    flex: 1;
    min-width: 0;
  }

  .voucher-input-row {
    flex-direction: column;
    align-items: stretch;
  }

  .subscription-card {
    padding: 14px;
  }
}

@media (max-width: 400px) {
  .profile-tab {
    font-size: 10px;
    padding: 10px 2px;
  }
}

/* ============================================
   Create Competition Screen
   ============================================ */

.create-comp-screen {
  max-width: 700px;
  margin: 0 auto;
  padding: 30px 20px;
}

.create-comp-title {
  font-family: 'Poppins', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #0808D9;
  margin-bottom: 30px;
}

.create-comp-form .form-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  margin-bottom: 20px;
}

.create-comp-form .form-card h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #0808D9;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
}

.create-comp-form .form-group {
  margin-bottom: 16px;
}

.create-comp-form .form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 6px;
}

.create-comp-form .form-group input,
.create-comp-form .form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  box-sizing: border-box;
}

.create-comp-form .form-group input:focus,
.create-comp-form .form-group select:focus {
  outline: none;
  border-color: #0808D9;
  box-shadow: 0 0 0 2px rgba(8, 8, 217, 0.1);
}

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

.toggle-btn {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.toggle-btn:hover {
  border-color: #0808D9;
}

.toggle-btn.active {
  background: #0808D9;
  color: #fff;
  border-color: #0808D9;
}

.pbn-upload-area {
  border: 2px dashed #ddd;
  border-radius: 12px;
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  color: #999;
  font-size: 14px;
}

.pbn-upload-area:hover,
.pbn-upload-area.dragover {
  border-color: #0808D9;
  background: rgba(8, 8, 217, 0.03);
  color: #0808D9;
}

.pbn-upload-area input[type="file"] {
  display: none;
}

.pbn-deals-preview {
  margin-top: 12px;
}

.pbn-deal-item {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pbn-deal-item .deal-info-text {
  color: #333;
}

.pbn-deal-item .remove-deal-btn {
  color: #dc3545;
  cursor: pointer;
  font-size: 12px;
  background: none;
  border: none;
  font-family: 'Poppins', sans-serif;
}

/* Members section */
.members-section .member-list {
  margin-bottom: 12px;
}

.members-section .member-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 14px;
}

.members-section .member-item .member-info {
  display: flex;
  flex-direction: column;
}

.members-section .member-item .member-name {
  font-weight: 500;
  color: #333;
}

.members-section .member-item .member-email {
  font-size: 12px;
  color: #999;
}

.members-section .member-item .owner-badge {
  font-size: 11px;
  color: #0808D9;
  font-weight: 500;
}

.members-section .member-remove-btn {
  color: #dc3545;
  cursor: pointer;
  font-size: 12px;
  background: none;
  border: none;
  font-family: 'Poppins', sans-serif;
}

.add-member-form {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 16px;
  margin-top: 12px;
}

.add-member-form .email-check-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.add-member-form .email-check-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
}

.add-member-form .email-check-row button {
  padding: 8px 16px;
  background: #0808D9;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  cursor: pointer;
}

.add-member-form .email-result {
  font-size: 13px;
  padding: 8px 0;
  color: #666;
}

.add-member-form .email-result.existing {
  color: #2C7148;
}

.add-member-form .email-result.new-user {
  color: #F89554;
}

.add-member-form .new-user-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.add-member-form .new-user-fields input {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
}

.create-comp-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
}

.btn-create-comp {
  padding: 12px 32px;
  background: #0808D9;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-create-comp:hover {
  background: #0606b0;
  transform: translateY(-1px);
}

.btn-create-comp:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-back {
  padding: 10px 20px;
  background: #f0f0f0;
  color: #333;
  border: none;
  border-radius: 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.btn-add-member {
  padding: 8px 16px;
  background: #2C7148;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

/* Toggle switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
}

.switch .slider.round {
  border-radius: 24px;
}

.switch .slider.round:before {
  border-radius: 50%;
}

.switch .slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: #2C7148;
}

.switch input:checked + .slider:before {
  transform: translateX(20px);
}

.form-error {
  color: #dc3545;
  font-size: 13px;
  margin-top: 6px;
}

.form-success {
  color: #2C7148;
  font-size: 14px;
  text-align: center;
  padding: 16px;
  background: #d4edda;
  border-radius: 10px;
  margin-top: 16px;
}

/* ============================================
   My Competitions (Profile Tab)
   ============================================ */

.my-comps-container {
  padding: 20px 0;
}

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

.my-comps-list .comp-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 12px;
}

.my-comps-list .comp-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.my-comps-list .comp-card-name {
  font-weight: 600;
  font-size: 16px;
  color: #333;
}

.my-comps-list .comp-status-badge {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.comp-status-badge.active { background: #d4edda; color: #155724; }
.comp-status-badge.scheduled { background: #d1ecf1; color: #0c5460; }
.comp-status-badge.completed { background: #e2e3e5; color: #383d41; }
.comp-status-badge.paused { background: #fff3cd; color: #856404; }

.my-comps-list .comp-card-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #666;
  margin-bottom: 10px;
}

.my-comps-list .comp-card-actions {
  display: flex;
  gap: 8px;
}

.my-comps-list .comp-card-actions button {
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  cursor: pointer;
}

.my-comps-list .comp-card-actions button:hover {
  border-color: #0808D9;
  color: #0808D9;
}

.my-comps-list .comp-card-actions button.btn-danger {
  color: #dc3545;
}

.my-comps-list .comp-card-actions button.btn-danger:hover {
  border-color: #dc3545;
}

.my-comps-empty {
  text-align: center;
  color: #999;
  padding: 40px 20px;
  font-size: 14px;
}
