/* World Cup Guesser - Saudi Themed Styles */
:root {
  --saudi-green: #006C35;
  --saudi-green-dark: #004D26;
  --saudi-gold: #C5A572;
  --saudi-gold-light: #E8D5A3;
  --white: #ffffff;
  --light-bg: #F8F9F5;
  --text: #222222;
  --card-shadow: 0 4px 20px rgba(0, 108, 53, 0.12);
}

.wc-saudi-theme {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 1100px;
  margin: 0 auto;
  color: var(--text);
}

/* Header - Saudi Green */
.wc-header {
  background: linear-gradient(135deg, var(--saudi-green) 0%, var(--saudi-green-dark) 100%);
  color: white;
  padding: 28px 24px;
  border-radius: 16px 16px 0 0;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}

.wc-header::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 220px;
  height: 220px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}

.wc-header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  flex-wrap: wrap;
}

.wc-flag-accent {
  width: 8px;
  height: 52px;
  background: var(--saudi-gold);
  border-radius: 4px;
}

.wc-header h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.wc-subtitle {
  margin: 4px 0 0;
  font-size: 15px;
  opacity: 0.95;
  font-weight: 500;
}

/* Date Controls */
.wc-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  padding: 14px 20px;
  border: 1px solid #e5e7e3;
  border-top: none;
  border-radius: 0 0 16px 16px;
  margin-bottom: 24px;
  box-shadow: var(--card-shadow);
}

.wc-current-date {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 18px;
  color: var(--saudi-green);
}

.wc-btn {
  background: var(--saudi-green);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wc-btn:hover {
  background: var(--saudi-green-dark);
  transform: translateY(-1px);
}

.wc-today-btn {
  background: var(--saudi-gold);
  color: #222;
  font-size: 13px;
  padding: 8px 14px;
}

.wc-today-btn:hover {
  background: var(--saudi-gold-light);
}

/* Matches Grid */
.wc-matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.wc-match-card {
  background: var(--white);
  border: 1px solid #e5e7e3;
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden; /* prevent steppers or content from going outside */
  box-sizing: border-box;
}

.wc-match-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 108, 53, 0.15);
}

.wc-match-card.finished {
  border-color: #d1e7d1;
}

.wc-match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.wc-group {
  background: var(--saudi-green);
  color: white;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.wc-time {
  font-size: 13px;
  color: var(--saudi-green);
  font-weight: 700;
  background: #f0f5f0;
  padding: 3px 9px;
  border-radius: 6px;
}

/* Teams */
.wc-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0;
  text-align: center;
}

.wc-team {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.wc-team-name {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
}

.wc-vs {
  font-size: 13px;
  font-weight: 800;
  color: #888;
  padding: 0 12px;
  letter-spacing: 1px;
}

/* Score */
.wc-score {
  text-align: center;
  margin: 12px 0 6px;
  padding: 12px;
  background: #f8f9f5;
  border-radius: 10px;
}

.wc-score .score {
  font-size: 32px;
  font-weight: 800;
  color: var(--saudi-green);
  letter-spacing: -1px;
}

.wc-finished-label {
  display: block;
  font-size: 11px;
  color: #666;
  margin-top: 2px;
  font-weight: 600;
}

/* Guess Form */
.wc-guess-form {
  margin: 14px 0;
  max-width: 100%;
  overflow: hidden;
}

.wc-guess-form-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wc-guess-form-inner input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e5e7e3;
  border-radius: 10px;
  font-size: 17px;
  outline: none;
  min-height: 52px;
}

.wc-guess-form-inner input[type="text"]:focus {
  border-color: var(--saudi-green);
}

.wc-score-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.wc-score-inputs input[type="number"] {
  width: 68px;
  padding: 12px 8px;
  border: 2px solid #e5e7e3;
  border-radius: 10px;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  min-height: 52px;
}

.wc-score-inputs input:focus {
  border-color: var(--saudi-gold);
  outline: none;
}

.wc-score-inputs .dash {
  font-size: 26px;
  font-weight: 900;
  color: #aaa;
  margin: 0 4px;
}

/* Touch friendly steppers - compact to avoid overflow */
.score-stepper {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.score-step-btn {
  width: 32px;
  height: 32px;
  border: 2px solid #e5e7e3;
  background: #f8f9f5;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  color: var(--saudi-green);
  user-select: none;
  padding: 0;
}

.score-step-btn:active {
  background: var(--saudi-green);
  color: white;
  transform: scale(0.95);
}

.score-step-btn:hover {
  border-color: var(--saudi-green);
}

.wc-score-inputs input[type="number"] {
  width: 48px;
  padding: 8px 4px;
  font-size: 18px;
}

.wc-submit-guess {
  background: var(--saudi-gold);
  color: #222;
  border: none;
  padding: 16px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 17px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 56px;
}

.wc-submit-guess:hover {
  background: #b38e55;
}

/* Venue */
.wc-venue {
  font-size: 12px;
  color: #666;
  text-align: center;
  margin-top: 4px;
  font-style: italic;
}

/* Guesses List */
.wc-guesses {
  margin-top: 16px;
  border-top: 1px solid #eee;
  padding-top: 12px;
}

.wc-guesses-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--saudi-green);
  margin-bottom: 8px;
}

.wc-guesses-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.wc-guesses-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8f9f5;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 14px;
}

.wc-guesses-list li.winner {
  background: #e6f4e6;
  border: 1px solid #a8d3a8;
  font-weight: 600;
}

.wc-guesses-list .name {
  flex: 1;
}

.wc-guesses-list .guess {
  font-family: monospace;
  font-size: 15px;
  font-weight: 700;
  background: white;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 8px;
}

.winner-badge {
  background: var(--saudi-green);
  color: white;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 700;
}

.wc-no-guesses {
  font-size: 13px;
  color: #888;
  font-style: italic;
}

/* No matches */
.wc-no-matches {
  background: #fff;
  padding: 40px 20px;
  border-radius: 12px;
  text-align: center;
  color: #555;
  border: 1px dashed #ccc;
}

/* Footer */
.wc-footer {
  margin-top: 32px;
  text-align: center;
  font-size: 13px;
  color: #666;
}

.wc-footer .small {
  font-size: 12px;
  margin-top: 4px;
}

/* Loading state */
.wc-loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Responsive */
@media (max-width: 640px) {
  .wc-matches-grid {
    grid-template-columns: 1fr;
  }
  
  .wc-controls {
    flex-direction: column;
    gap: 10px;
  }
  
  .wc-current-date {
    order: -1;
  }
}

/* RTL / Arabic support */
.wc-rtl {
  direction: rtl;
  text-align: right;
}

.wc-rtl .wc-controls,
.wc-rtl .wc-header-inner {
  flex-direction: row-reverse;
}

.wc-rtl .wc-teams {
  flex-direction: row-reverse;
}

.wc-rtl .wc-score-inputs {
  flex-direction: row-reverse;
}

.wc-rtl .wc-guesses-list li {
  flex-direction: row-reverse;
  text-align: right;
}

/* Flags */
.wc-match-card .flag {
  font-size: 1.65em;
  line-height: 1;
  margin-right: 8px;
  vertical-align: middle;
}

.wc-rtl .wc-match-card .flag {
  margin-right: 0;
  margin-left: 8px;
}

/* Stadium / Referee details */
.wc-details {
  margin: 8px 0 4px;
  font-size: 13px;
  background: #f8f9f5;
  padding: 8px 10px;
  border-radius: 8px;
  color: #444;
}

.wc-details .label {
  font-weight: 700;
  color: var(--saudi-green);
}

.wc-detail-item {
  margin: 2px 0;
}

/* Lang toggle button */
.wc-lang-toggle {
  margin-left: auto;
  font-size: 12px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.2);
  color: white;
  border: 1px solid rgba(255,255,255,0.4);
}

.wc-lang-toggle:hover {
  background: rgba(255,255,255,0.35);
}

.wc-rtl .wc-lang-toggle {
  margin-left: 0;
  margin-right: auto;
}
