/* ========================================
   RESET & BASE
   ======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: "Georgia", "Times New Roman", serif;
  color: #f4e7d5;
  background-color: #1e140a;
  background-image: url("https://www.berlinnhdarts.com/images/core/pub_bg.jpg");
  background-position: center center;
  background-size: cover;
  background-attachment: fixed;
  background-repeat: no-repeat;
  min-height: 100vh;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }

a { color: #f4e7d5; text-decoration: none; }
a:hover { color: #d2a676; }

button {
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

input {
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}

/* ========================================
   OVERLAY & PAGE WRAPPER (from existing site)
   ======================================== */
.overlay {
  background: rgba(30, 20, 10, 0.85);
  min-height: 100vh;
  padding: 20px 10px 40px;
}

.page-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  border: 2px solid rgba(139, 92, 51, 0.6);
  background: rgba(40, 26, 16, 0.95);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
}

/* ========================================
   HEADER (from existing site)
   ======================================== */
header {
  padding: 20px;
  border-bottom: 2px solid rgba(139, 92, 51, 0.7);
  background: linear-gradient(135deg, rgba(79, 46, 23, 0.9), rgba(61, 35, 18, 0.9));
}

.club-header-inner {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  -webkit-align-items: center;
  align-items: center;
  gap: 15px;
}

.club-logo {
  width: 80px;
  height: 80px;
  background: #3a2a1b;
  border-radius: 50%;
  border: 3px solid #d2a676;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  overflow: hidden;
}

.club-title-area { -webkit-flex: 1 1 200px; flex: 1 1 200px; }
.club-title-area h1 { margin: 0; font-size: 26px; letter-spacing: 1px; }
.club-title-area p { margin: 4px 0 0; font-size: 14px; color: #e5c9a2; }

/* ========================================
   NAV (from existing site, with -webkit-sticky)
   ======================================== */
.rustic-nav {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(135deg, rgba(79, 46, 23, 0.95), rgba(53, 32, 18, 0.95));
  border-bottom: 2px solid rgba(139, 92, 51, 0.8);
}

.rustic-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 16px;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: space-between;
  justify-content: space-between;
}

.nav-links-desktop {
  list-style: none;
  margin: 0;
  padding: 0;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-links-desktop li a {
  display: block;
  padding: 6px 10px;
  font-size: 14px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #f4e7d5;
  background: rgba(52, 32, 18, 0.9);
  border-radius: 3px;
  border: 1px solid rgba(210, 166, 118, 0.5);
  -webkit-transition: background 0.2s ease, -webkit-transform 0.1s ease;
  transition: background 0.2s ease, transform 0.1s ease;
}

.nav-links-desktop li a:hover,
.nav-links-desktop li a:focus,
.nav-links-desktop li a.nav-active {
  background: #d2a676;
  color: #2b1a10;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.7);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(210, 166, 118, 0.7);
  border-radius: 3px;
  padding: 6px 5px;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  margin: 3px 0;
  background-color: #f4e7d5;
}

/* Mobile fullscreen overlay */
.rustic-nav-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 2000;
  background: rgba(20, 12, 6, 0.96);
  display: none;
}

.rustic-nav-overlay.active { display: block; }

.overlay-inner-menu {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 60px 24px 24px;
  background: radial-gradient(circle at top, rgba(120, 84, 43, 0.35), transparent 60%);
}

.overlay-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: transparent;
  border: 1px solid rgba(210, 166, 118, 0.8);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  color: #f4e7d5;
  font-size: 22px;
  line-height: 1;
}

.overlay-links {
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-justify-content: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

.overlay-links li a {
  display: inline-block;
  padding: 10px 16px;
  font-size: 18px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #f4e7d5;
  background: rgba(60, 37, 21, 0.9);
  border-radius: 4px;
  border: 1px solid rgba(210, 166, 118, 0.8);
}

.overlay-links li a:hover,
.overlay-links li a:focus {
  background: #d2a676;
  color: #2b1a10;
}

@media (max-width: 768px) {
  .nav-links-desktop { display: none; }
  .nav-toggle { display: block; }
}

/* ========================================
   CONTENT (from existing site)
   ======================================== */
.content { padding: 20px; }

.section-title {
  margin-top: 20px;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-bottom: 1px solid rgba(210, 166, 118, 0.6);
  padding-bottom: 6px;
  font-size: 22px;
  color: #d2a676;
}

/* ========================================
   APP: GENERAL SCREEN
   ======================================== */
.app-screen {
  max-width: 800px;
  margin: 0 auto;
}

.app-screen .section-title {
  text-align: center;
  margin-top: 0;
}

/* ========================================
   APP: RUNNING SCORE
   ======================================== */
.running-score {
  font-size: 20px;
  font-weight: bold;
  text-align: center;
  color: #f4e7d5;
  background: rgba(91, 58, 35, 0.9);
  padding: 8px 15px;
  border-radius: 4px;
  border: 1px solid rgba(210, 166, 118, 0.5);
  margin-bottom: 8px;
}

.running-score .score-value {
  color: #d2a676;
  font-size: 26px;
}

.progress-indicator {
  font-size: 12px;
  text-align: center;
  color: #e5c9a2;
  margin-bottom: 8px;
}

/* ========================================
   APP: INSTRUCTIONS (smaller font)
   ======================================== */
.instructions {
  font-size: 12px;
  color: #e5c9a2;
  background: rgba(42, 26, 16, 0.8);
  padding: 8px 10px;
  border-radius: 4px;
  border: 1px solid rgba(210, 166, 118, 0.3);
  margin-bottom: 10px;
  line-height: 1.4;
}

.instructions p { margin: 4px 0; }

/* ========================================
   APP: TARGET DISPLAY (large, readable from distance)
   ======================================== */
.target-display {
  font-size: 38px;
  font-weight: bold;
  text-align: center;
  color: #d2a676;
  margin: 10px 0;
  padding: 10px;
  background: rgba(52, 32, 18, 0.7);
  border: 2px solid rgba(210, 166, 118, 0.6);
  border-radius: 4px;
  line-height: 1.2;
}

/* ========================================
   APP: PROMPT TEXT
   ======================================== */
.prompt {
  font-size: 18px;
  text-align: center;
  color: #f4e7d5;
  margin: 8px 0;
}

/* ========================================
   APP: SCORE BUTTONS (large, error-proof)
   ======================================== */
.btn-grid {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  -webkit-justify-content: center;
  justify-content: center;
  margin: 10px 0;
}

.score-btn {
  height: 62px;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 24px;
  font-weight: bold;
  color: #f4e7d5;
  background: rgba(52, 32, 18, 0.9);
  border: 2px solid rgba(210, 166, 118, 0.5);
  border-radius: 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-transition: background 0.15s ease, -webkit-transform 0.1s ease;
  transition: background 0.15s ease, transform 0.1s ease;
  text-align: center;
  line-height: 70px;
  padding: 0;
  margin-bottom: 8px;
}

/* 4-column layout (sections 1, 3) */
.btn-grid-4 .score-btn {
  width: 23%;
  margin-left: 1%;
  margin-right: 1%;
}

/* 5-column layout (section 2: 0-9) */
.btn-grid-5 .score-btn {
  width: 18%;
  margin-left: 1%;
  margin-right: 1%;
}

/* 2-column layout (yes/no) */
.btn-grid-2 .score-btn {
  width: 48%;
  margin-left: 1%;
  margin-right: 1%;
}

.score-btn.selected {
  background: #d2a676;
  color: #2b1a10;
  border-color: #d2a676;
  box-shadow: 0 0 10px rgba(210, 166, 118, 0.4);
}

.score-btn:not(.selected):active {
  background: rgba(210, 166, 118, 0.3);
  -webkit-transform: scale(0.96);
  transform: scale(0.96);
}

.score-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* ========================================
   APP: POINTS DISPLAY
   ======================================== */
.points-display {
  font-size: 22px;
  font-weight: bold;
  text-align: center;
  color: #d2a676;
  margin: 10px 0;
  padding: 8px;
  background: rgba(52, 32, 18, 0.5);
  border-radius: 4px;
}

.points-display.negative { color: #c9784e; }

/* ========================================
   APP: TARGET TOTAL (section 2)
   ======================================== */
.target-total {
  font-size: 20px;
  font-weight: bold;
  text-align: center;
  color: #d2a676;
  background: rgba(52, 32, 18, 0.7);
  padding: 8px;
  border-radius: 4px;
  border: 1px solid rgba(210, 166, 118, 0.5);
  margin: 10px 0;
}

/* ========================================
   APP: CALCULATOR (section 4)
   ======================================== */
.calc-display {
  font-size: 26px;
  font-weight: bold;
  text-align: center;
  color: #f4e7d5;
  background: rgba(30, 20, 10, 0.9);
  border: 2px solid rgba(210, 166, 118, 0.6);
  border-radius: 4px;
  padding: 12px;
  margin: 8px 0;
  min-height: 30px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.calc-display.placeholder { color: rgba(244, 231, 213, 0.4); font-weight: normal; font-size: 20px; }

.calc-keypad {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  -webkit-justify-content: center;
  justify-content: center;
  margin: 8px 0;
}

.calc-btn {
  width: 31%;
  height: 58px;
  margin-left: 1%;
  margin-right: 1%;
  margin-bottom: 8px;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 28px;
  font-weight: bold;
  color: #f4e7d5;
  background: rgba(52, 32, 18, 0.9);
  border: 2px solid rgba(210, 166, 118, 0.5);
  border-radius: 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

.calc-btn:active {
  background: rgba(210, 166, 118, 0.3);
  -webkit-transform: scale(0.96);
  transform: scale(0.96);
}

.calc-btn.enter-btn {
  background: rgba(91, 58, 35, 0.9);
  border-color: rgba(210, 166, 118, 0.7);
  color: #d2a676;
  font-size: 22px;
}

.calc-btn.enter-btn:active {
  background: #d2a676;
  color: #2b1a10;
}

.calc-result {
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  color: #f4e7d5;
  margin: 8px 0;
  padding: 10px;
  background: rgba(52, 32, 18, 0.7);
  border-radius: 4px;
  border: 1px solid rgba(210, 166, 118, 0.5);
}

.calc-result .calc-num { color: #d2a676; }

/* ========================================
   APP: ACTION BUTTONS
   ======================================== */
.action-btn {
  display: block;
  width: 100%;
  height: 55px;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 18px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  margin: 6px 0;
  -webkit-transition: background 0.15s ease, -webkit-transform 0.1s ease;
  transition: background 0.15s ease, transform 0.1s ease;
}

.action-btn.primary {
  background: #d2a676;
  color: #2b1a10;
}

.action-btn.primary:active {
  -webkit-transform: scale(0.97);
  transform: scale(0.97);
  background: #c4965c;
}

.action-btn.secondary {
  background: rgba(52, 32, 18, 0.9);
  color: #f4e7d5;
  border: 2px solid rgba(210, 166, 118, 0.5);
}

.action-btn.secondary:active {
  -webkit-transform: scale(0.97);
  transform: scale(0.97);
  background: rgba(210, 166, 118, 0.2);
}

.action-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.action-row {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  margin: 8px 0;
}

.action-row .action-btn {
  -webkit-flex: 1;
  flex: 1;
  margin-left: 5px;
  margin-right: 5px;
  min-width: 200px;
}

.action-row .action-btn:only-child {
  margin-left: 0;
  margin-right: 0;
}

/* ========================================
   APP: RECAP SCREEN
   ======================================== */
.recap-score {
  font-size: 30px;
  font-weight: bold;
  text-align: center;
  color: #d2a676;
  margin: 25px 0;
  padding: 20px;
  background: rgba(52, 32, 18, 0.7);
  border-radius: 4px;
  border: 1px solid rgba(210, 166, 118, 0.5);
}

/* ========================================
   APP: INTRO SCREEN
   ======================================== */
.intro-content { margin: 20px 0; }

.intro-text {
  font-size: 16px;
  color: #e5c9a2;
  margin: 12px 0;
  line-height: 1.6;
}

.intro-sections {
  background: rgba(42, 26, 16, 0.8);
  padding: 15px;
  border-radius: 4px;
  border: 1px solid rgba(210, 166, 118, 0.3);
  margin: 15px 0;
}

.intro-section-item {
  font-size: 16px;
  color: #f4e7d5;
  padding: 8px 0;
  border-bottom: 1px solid rgba(210, 166, 118, 0.2);
}

.intro-section-item:last-child { border-bottom: none; }

/* ========================================
   APP: SCORECARD
   ======================================== */
.scorecard { text-align: center; }

.scorecard-rows { margin: 20px 0; }

.scorecard-row {
  display: -webkit-flex;
  display: flex;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  -webkit-align-items: center;
  align-items: center;
  font-size: 20px;
  padding: 12px 15px;
  border-bottom: 1px solid rgba(210, 166, 118, 0.3);
}

.scorecard-row .scorecard-label { color: #e5c9a2; text-align: left; }
.scorecard-row .scorecard-score { color: #d2a676; font-weight: bold; font-size: 24px; }

.scorecard-total {
  display: -webkit-flex;
  display: flex;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  -webkit-align-items: center;
  align-items: center;
  font-size: 26px;
  font-weight: bold;
  padding: 15px;
  margin-top: 15px;
  background: rgba(91, 58, 35, 0.9);
  border-radius: 4px;
  border: 2px solid rgba(210, 166, 118, 0.6);
}

.scorecard-total .score-value { color: #d2a676; font-size: 32px; }

.scorecard-actions {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  margin-top: 20px;
}

.scorecard-actions .action-btn {
  -webkit-flex: 1;
  flex: 1;
  margin-left: 5px;
  margin-right: 5px;
  min-width: 200px;
}
