/* NewTon DC - Chalker App Tablet-optimized scoring interface Portrait orientation, high contrast for visibility */ /* Fonts - reuse from main app */ @font-face { font-family: 'Manrope'; src: url('../fonts/Manrope-VariableFont_wght.ttf') format('truetype'); font-weight: 100 900; font-style: normal; font-display: swap; } @font-face { font-family: 'Cascadia Code'; src: url('../fonts/CascadiaCode-VariableFont_wght.ttf') format('truetype'); font-weight: 100 900; font-style: normal; font-display: swap; } /* CSS Variables */ :root { --font-body: 'Manrope', sans-serif; --font-mono: 'Cascadia Code', 'SF Mono', 'Monaco', 'Consolas', monospace; --font-scores: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; /* NewTon colors with enhanced contrast */ --bg-primary: #f1f5f5; --bg-secondary: #ffffff; --bg-dark: #2a2a2a; --text-primary: #2a2a2a; --text-secondary: #666666; --text-light: #ffffff; --border-color: #666666; --border-light: #c0c0c0; /* Accent colors */ --accent-primary: #2563eb; --accent-primary-hover: #1d4ed8; --accent-success: #16a34a; --accent-danger: #dc2626; --accent-warning: #f59e0b; /* Player colors */ --player1-bg: #dbeafe; --player1-active: #2563eb; --player2-bg: #fef3c7; --player2-active: #d97706; /* Spacing */ --spacing-xs: 4px; --spacing-sm: 8px; --spacing-md: 16px; --spacing-lg: 24px; --spacing-xl: 32px; } /* Reset */ * { margin: 0; padding: 0; box-sizing: border-box; } /* Disable double-tap zoom on iOS */ html { touch-action: manipulation; } /* Portrait lock via CSS - uncomment for tablet deployment @media screen and (orientation: landscape) { html { transform: rotate(-90deg); transform-origin: left top; width: 100vh; height: 100vw; overflow-x: hidden; position: absolute; top: 100%; left: 0; } } */ /* Base */ html, body { height: 100%; overflow: hidden; } body { font-family: var(--font-body); background: var(--bg-primary); color: var(--text-primary); -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; } /* Screen management */ .screen { display: none; height: 100%; flex-direction: column; } .screen.active { display: flex; } /* ==================== */ /* Configuration Screen */ /* ==================== */ .config-header { background: var(--bg-secondary); border-bottom: 1px solid var(--border-color); padding: var(--spacing-lg); text-align: center; } .config-header h1 { font-size: 1.75rem; font-weight: 600; color: var(--text-primary); } .config-form { flex: 1; padding: var(--spacing-lg); overflow-y: auto; display: flex; flex-direction: column; gap: var(--spacing-md); } .form-group { display: flex; flex-direction: column; gap: var(--spacing-xs); } .form-group label { font-size: 0.875rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; } .form-group input, .form-group select { font-family: var(--font-body); font-size: 1.125rem; padding: var(--spacing-md); border: 1px solid var(--border-light); border-radius: 4px; background: var(--bg-secondary); color: var(--text-primary); } .form-group input:focus, .form-group select:focus { outline: none; border-color: var(--accent-primary); box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2); } /* Toggle switch */ .toggle-group { flex-direction: row; align-items: center; justify-content: space-between; } .toggle { position: relative; display: inline-block; width: 56px; height: 32px; } .toggle input { opacity: 0; width: 0; height: 0; } .toggle-slider { position: absolute; cursor: pointer; inset: 0; background: var(--border-light); border-radius: 32px; transition: 0.2s; } .toggle-slider::before { position: absolute; content: ""; height: 24px; width: 24px; left: 4px; bottom: 4px; background: var(--bg-secondary); border-radius: 50%; transition: 0.2s; } .toggle input:checked + .toggle-slider { background: var(--accent-primary); } .toggle input:checked + .toggle-slider::before { transform: translateX(24px); } /* Buttons */ .btn { font-family: var(--font-body); font-size: 1rem; font-weight: 600; padding: var(--spacing-md) var(--spacing-lg); border: none; border-radius: 4px; cursor: pointer; transition: background 0.2s, transform 0.1s; } .btn:active { transform: scale(0.98); } .btn-primary { background: var(--accent-primary); color: var(--text-light); } .btn-primary:hover { background: var(--accent-primary-hover); } .btn-secondary { background: var(--bg-secondary); color: var(--text-primary); border: 1px solid var(--border-color); } .btn-secondary:hover { background: var(--bg-primary); } .btn-tertiary { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-light); } .btn-tertiary:hover { background: var(--bg-secondary); color: var(--text-primary); } .btn-cancel { background: transparent; color: var(--text-secondary); } .btn-danger { background: var(--accent-danger); color: var(--text-light); } .btn-danger:hover { background: #b91c1c; } .confirm-buttons { display: flex; flex-direction: column; gap: var(--spacing-sm); margin-top: var(--spacing-md); } .btn-large { font-size: 1.25rem; padding: var(--spacing-lg); margin-top: var(--spacing-lg); } .btn-icon { background: transparent; border: none; font-size: 1.5rem; padding: var(--spacing-sm); cursor: pointer; color: var(--text-primary); } /* ============== */ /* Scoring Screen */ /* ============== */ .scoring-header { background: var(--bg-dark); color: var(--text-light); padding: var(--spacing-md) var(--spacing-lg); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--spacing-sm); } .scoring-header.network-mode { background: #1e3a5f; } .header-player { font-size: 1rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; } .header-player.leg-starter { color: var(--accent-success); } .header-player:first-child { text-align: left; } .header-player:nth-child(3) { text-align: right; } .lane-name { font-size: 0.875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; } .leg-score { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700; text-align: center; } /* Score anchors */ .score-anchors { display: flex; background: var(--bg-secondary); border-bottom: 2px solid var(--border-color); } .score-anchor { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 8px; position: relative; } .score-anchor:first-child { border-right: 1px solid var(--border-light); } .score-anchor.active { background: rgba(22, 163, 74, 0.15); } .anchor-score { font-family: var(--font-scores); font-variant-numeric: tabular-nums; font-size: 4.5rem; font-weight: 700; color: var(--text-primary); line-height: 1; } /* Match info bar */ .match-info-bar { text-align: center; padding: 2px 8px; background: var(--bg-primary); border-bottom: 1px solid var(--border-color); font-family: var(--font-body); font-size: 1.125rem; font-weight: 600; color: var(--text-secondary); } /* Chalkboard ledger */ .chalkboard { flex: 1; display: flex; flex-direction: column; background: var(--bg-secondary); overflow: hidden; min-height: 0; } .chalkboard-body { flex: 1; overflow-y: auto; min-height: 0; } /* Chalk table */ .chalk-table { width: 100%; border-collapse: separate; border-spacing: 0; font-family: var(--font-scores); font-variant-numeric: tabular-nums; table-layout: fixed; } .chalk-table thead th { background: var(--bg-primary); font-family: var(--font-body); font-size: 0.625rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; padding: var(--spacing-xs) var(--spacing-sm); border-top: 1px solid var(--border-color); border-left: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 1; } .chalk-table thead th:last-child { border-right: 1px solid var(--border-color); } .chalk-table thead th:nth-child(3) { width: 40px; font-size: 1rem; line-height: 1; } .chalk-table td { border-bottom: 1px solid var(--border-color); border-left: 1px solid var(--border-color); text-align: center; padding: 0; font-size: 1.9rem; height: 6vh; line-height: 6vh; overflow: hidden; white-space: nowrap; } .chalk-table td:last-child { border-right: 1px solid var(--border-color); } .chalk-table .col-scored { font-weight: 500; color: var(--text-secondary); } .chalk-table .col-togo { font-weight: 700; color: var(--text-primary); } .chalk-table .col-darts { font-size: 1.25rem; color: var(--text-secondary); background: var(--bg-primary); } /* Tappable cells (recorded scores) */ .chalk-table .col-scored[data-visit] { cursor: pointer; transition: background 0.1s; } .chalk-table .col-scored[data-visit]:hover { background: var(--bg-primary); } .chalk-table .col-scored[data-visit]:active { background: var(--border-light); } /* Highlight tons */ .chalk-table .col-scored.ton { color: var(--accent-primary); font-weight: 700; } .chalk-table .col-scored.ton span, .chalk-table .col-scored.ton80 span { display: inline-block; border: 2px solid #000; border-radius: 0.7em; padding: 0 0.25em; line-height: 1.1; } .chalk-table .col-scored.ton80 { color: var(--accent-success); font-weight: 700; } /* Empty future rows */ .chalk-table tr.chalk-row-empty td { opacity: 0.4; } .chalk-table tr.chalk-row-empty .col-darts { opacity: 1; } /* Tiebreak warning gradient - last 3 rows before tiebreak */ .chalk-table tr.tiebreak-warning-3 td { background: rgba(255, 193, 7, 0.1); } .chalk-table tr.tiebreak-warning-3 .col-darts { font-weight: 500; } .chalk-table tr.tiebreak-warning-2 td { background: rgba(255, 193, 7, 0.2); } .chalk-table tr.tiebreak-warning-2 .col-darts { font-weight: 600; } .chalk-table tr.tiebreak-warning-1 td { background: rgba(255, 193, 7, 0.3); } .chalk-table tr.tiebreak-warning-1 .col-darts { font-weight: 700; } /* Input section */ .input-section { background: var(--bg-secondary); border-top: 1px solid var(--border-color); padding: var(--spacing-sm); display: flex; flex-direction: column; gap: var(--spacing-sm); } /* Active input cell in chalkboard */ .chalk-table .col-scored.input-active { background: var(--bg-primary); color: var(--text-primary); font-weight: 700; } .chalk-table .col-scored.input-active::after { content: ''; display: inline-block; width: 2px; height: 1em; background: var(--text-primary); margin-left: 2px; vertical-align: middle; animation: blink 1s step-end infinite; } @keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } } /* Keypad */ .keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--spacing-xs); } .key { font-family: var(--font-mono); font-size: 1.125rem; font-weight: 600; padding: 10px var(--spacing-md); background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: 4px; cursor: pointer; transition: background 0.1s, transform 0.1s; } .key:active { background: var(--bg-primary); transform: scale(0.95); } .key-delete { background: var(--bg-primary); color: var(--accent-danger); font-size: 1rem; font-weight: 700; } .key-enter { background: var(--accent-primary); color: var(--text-light); border-color: var(--accent-primary); } .key-enter:active { background: var(--accent-primary-hover); } /* Action row (NEW, HISTORY, settings) */ .keypad-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--spacing-xs); margin-top: -2px; margin-bottom: var(--spacing-xs); border-bottom: 1px solid var(--border-light); padding-bottom: var(--spacing-xs); } .key-action { font-family: var(--font-body); font-size: 0.875rem; font-weight: 600; background: var(--bg-primary); color: var(--text-secondary); } .key-action:active { background: var(--border-light); } /* Disabled keys (idle state) */ .key:disabled { opacity: 0.4; cursor: not-allowed; } .key:disabled:active { transform: none; background: var(--bg-secondary); } /* Idle state scores */ .anchor-score.idle { color: var(--text-secondary); opacity: 0.5; } #undo-btn { margin-top: var(--spacing-sm); } /* ====== */ /* Modals */ /* ====== */ .modal { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); align-items: center; justify-content: center; z-index: 1000; } .modal.active { display: flex; } .modal-content { background: var(--bg-secondary); border-radius: 8px; padding: var(--spacing-xl); width: 90%; max-width: 320px; display: flex; flex-direction: column; gap: var(--spacing-md); text-align: center; } .modal-content h2 { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); } .modal-content p { color: var(--text-secondary); } .modal-content .network-notice { background: rgba(255, 193, 7, 0.15); border: 1px solid rgba(255, 193, 7, 0.4); border-radius: 6px; padding: var(--spacing-sm) var(--spacing-md); margin-bottom: var(--spacing-md); color: var(--text-primary); font-size: 0.9rem; } /* QR scan modal */ .qr-scan-modal-content { max-width: 380px; } .qr-video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: #000; } .qr-scan-hint { font-size: 0.85rem; color: var(--text-secondary); margin: 0; } .qr-scan-error { font-size: 0.9rem; color: #f87171; background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.3); border-radius: 6px; padding: var(--spacing-sm) var(--spacing-md); margin: 0; } /* QR confirm modal */ .qr-confirm-details { background: var(--bg-primary); border-radius: 6px; padding: var(--spacing-md); text-align: left; } .qr-confirm-details p { margin: 0; padding: 3px 0; color: var(--text-primary); font-size: 0.95rem; } /* Leg average highlight (first thrower) */ .leg-avg-first { color: var(--accent-success); } /* Result QR modal */ .match-complete-banner { background: var(--accent-success); color: #fff; text-align: center; padding: 10px 16px; font-size: 0.95rem; font-weight: 600; border-radius: 6px; margin: 6px 12px; } .result-qr-code { display: flex; justify-content: center; margin: 12px 0; } .result-qr-code svg { width: 220px; height: 220px; } /* Config modal (larger, scrollable) */ .config-modal-content { max-width: 400px; max-height: 90vh; display: flex; flex-direction: column; } .config-form-modal { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: var(--spacing-sm); margin-bottom: var(--spacing-md); padding-right: var(--spacing-xs); } .config-form-modal .form-group { flex-shrink: 0; } .config-form-modal .form-group label { font-size: 0.75rem; } .config-form-modal .form-group input, .config-form-modal .form-group select { font-size: 1rem; padding: var(--spacing-sm); } .config-form-modal .toggle { width: 48px; height: 28px; } .config-form-modal .toggle-slider::before { height: 20px; width: 20px; } .config-form-modal .toggle input:checked + .toggle-slider::before { transform: translateX(20px); } .dart-buttons { display: flex; gap: var(--spacing-md); justify-content: center; } .btn-dart { flex: 1; font-family: var(--font-mono); font-size: 2rem; padding: var(--spacing-lg); background: var(--accent-success); color: var(--text-light); border: none; border-radius: 8px; } /* Tie-break modal */ .tiebreak-buttons { display: flex; flex-direction: column; gap: var(--spacing-sm); margin-top: var(--spacing-md); } .btn-tiebreak { padding: var(--spacing-md); font-size: 1.25rem; } .btn-dart:active { background: #15803d; } /* =============== */ /* End-Match Screen */ /* =============== */ .end-header { background: var(--accent-success); color: var(--text-light); padding: var(--spacing-lg); text-align: center; } .end-header h1 { font-size: 1.5rem; font-weight: 700; } .stats-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; } .stats-table th, .stats-table td { padding: var(--spacing-sm) var(--spacing-xs); text-align: center; } .stats-table th { background: var(--bg-primary); font-weight: 600; color: var(--text-secondary); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.5px; } .stats-table .stat-label { font-weight: 500; color: var(--text-secondary); text-align: center; font-size: 0.75rem; } .stats-table td:not(.stat-label) { font-family: var(--font-mono); font-weight: 600; font-size: 1rem; } .stats-table td.leg-avgs { font-size: 0.875rem; } .stats-table tbody tr { border-bottom: 1px solid var(--border-light); } .leg-averages { margin-top: var(--spacing-lg); } .leg-averages h3 { font-size: 0.875rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: var(--spacing-sm); } #leg-averages-container { display: flex; flex-direction: column; gap: var(--spacing-xs); font-size: 0.875rem; } /* Leg stats table */ .leg-stats { margin-top: var(--spacing-md); } .leg-stats h3 { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: var(--spacing-sm); text-align: center; } .leg-stats-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 0.875rem; table-layout: fixed; } .leg-stats-table th { font-family: var(--font-body); font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; padding: var(--spacing-xs); border-bottom: 1px solid var(--border-light); } .leg-stats-table th:first-child { text-align: left; width: 35%; } .leg-stats-table th:nth-child(2) { text-align: center; width: 30%; } .leg-stats-table th:last-child { text-align: right; width: 35%; } .leg-stats-table td { padding: var(--spacing-xs); vertical-align: top; } .leg-stats-table td:first-child { text-align: left; } .leg-stats-table td:nth-child(2) { text-align: center; font-family: var(--font-body); color: var(--text-secondary); } .leg-stats-table td:last-child { text-align: right; } .leg-stats-table .leg-separator { border-top: 1px solid var(--border-light); } .leg-stat-avg, .leg-stat-detail { display: block; line-height: 1.4; } .leg-stat-avg { font-weight: 600; } .leg-stat-detail { font-size: 0.75rem; color: var(--text-secondary); } .leg-stat-detail.highlight { color: var(--accent-success); } /* End buttons */ .btn-full { width: 100%; } .end-buttons { padding: var(--spacing-md); display: flex; flex-direction: column; gap: var(--spacing-sm); background: var(--bg-secondary); border-top: 1px solid var(--border-light); } /* Utility */ .hidden { display: none !important; } /* History Screen */ .history-header { display: flex; align-items: center; gap: var(--spacing-sm); padding: var(--spacing-md); background: var(--bg-dark); color: white; } .history-header h1 { font-size: 1.25rem; font-weight: 600; margin: 0; flex: 1; } .history-header .btn-icon { color: white; } .history-list { flex: 1; overflow-y: auto; padding: var(--spacing-sm); } .history-item { display: grid; grid-template-columns: 1fr auto; gap: var(--spacing-xs); padding: var(--spacing-md); background: var(--bg-secondary); border-radius: 8px; margin-bottom: var(--spacing-sm); border: 1px solid var(--border-light); cursor: pointer; transition: background-color 0.15s ease; } .history-item:active { background: var(--border-light); } .history-players { font-weight: 600; color: var(--text-primary); } .qr-badge { display: inline-block; font-size: 0.65rem; font-weight: 700; color: #fff; background: var(--accent-primary); border-radius: 4px; padding: 1px 5px; margin-left: 6px; vertical-align: middle; letter-spacing: 0.03em; } .history-score { font-size: 1.25rem; font-weight: 700; color: var(--accent-primary); } .history-date { grid-column: 1 / -1; font-size: 0.75rem; color: var(--text-secondary); } .history-empty { text-align: center; padding: var(--spacing-xl); color: var(--text-secondary); } /* History Detail Screen */ .history-detail-content { flex: 1; overflow-y: auto; padding: var(--spacing-md); } .history-detail-header { text-align: center; margin-bottom: var(--spacing-lg); } .history-detail-players { display: flex; justify-content: center; align-items: center; gap: var(--spacing-sm); margin-bottom: var(--spacing-xs); } .detail-player { font-size: 1.125rem; font-weight: 600; color: var(--text-primary); } .detail-vs { font-size: 0.875rem; color: var(--text-secondary); } .detail-score { font-size: 2rem; font-weight: 700; color: var(--accent-primary); } .detail-date { font-size: 0.875rem; color: var(--text-secondary); } .history-detail-stats { margin-bottom: var(--spacing-lg); } .history-detail-stats h3 { font-size: 1rem; font-weight: 600; margin-bottom: var(--spacing-sm); color: var(--text-primary); } .history-detail-legs h3 { font-size: 1rem; font-weight: 600; margin-bottom: var(--spacing-sm); color: var(--text-primary); } /* Leg scoresheet tables */ .leg-scoresheet { margin-bottom: var(--spacing-lg); background: var(--bg-secondary); border-radius: 8px; overflow: hidden; border: 1px solid var(--border-light); } .leg-scoresheet-header { display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm) var(--spacing-md); background: var(--bg-dark); color: white; } .leg-scoresheet-title { font-weight: 600; } .leg-scoresheet-score { font-size: 1rem; font-weight: 700; color: rgba(255, 255, 255, 0.7); } .leg-scoresheet-winner { font-size: 0.75rem; color: var(--accent-success); } .leg-scoresheet-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 0.875rem; } .leg-scoresheet-table th, .leg-scoresheet-table td { padding: var(--spacing-xs) var(--spacing-sm); border-bottom: 1px solid var(--border-light); } .leg-scoresheet-table th { background: var(--bg-primary); font-weight: 600; font-size: 0.75rem; color: var(--text-secondary); } .leg-scoresheet-table td { text-align: center; } .leg-scoresheet-table .col-darts { width: 2.5rem; color: var(--text-secondary); } .leg-scoresheet-table .col-scored { width: 3.5rem; } .leg-scoresheet-table .col-remaining { width: 3.5rem; color: var(--text-secondary); } .leg-scoresheet-table .checkout-score { color: var(--accent-success); font-weight: 600; } .leg-scoresheet-table .high-out-score { color: var(--accent-success); font-weight: 700; text-decoration: underline; } .leg-scoresheet-table .ton-180-score { color: #ffc107; font-weight: 700; border: 2px solid #000; border-radius: 0.8em; padding: 0.1em 0.3em; } .leg-scoresheet-table .ton-score { color: var(--accent-primary); font-weight: 600; border: 2px solid #000; border-radius: 0.8em; padding: 0.1em 0.3em; } .short-leg-badge { display: inline-block; background: var(--accent-success); color: var(--bg-dark); font-size: 0.625rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; margin-left: 4px; text-transform: uppercase; } /* In-progress badge for live stats */ .in-progress-badge { display: inline-block; background: var(--accent-warning); color: var(--bg-dark); font-size: 0.625rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; } /* Leg in progress styling */ .leg-in-progress { border: 2px solid var(--accent-warning); } /* Current remaining row in live stats */ .current-remaining-row { background: var(--bg-dark); } .current-remaining { font-weight: 700; color: var(--accent-warning); } .leg-scoresheet-table tr:last-child td { border-bottom: none; } /* PWA install banner */ .install-banner { position: fixed; bottom: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 16px; background: var(--bg-dark); border-top: 2px solid var(--accent-primary); font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--text-light); transform: translateY(100%); transition: transform 0.3s ease; z-index: 200; padding-bottom: max(10px, env(safe-area-inset-bottom)); } .install-banner.visible { transform: translateY(0); } .install-btn { padding: 6px 16px; border: none; border-radius: 6px; cursor: pointer; background: var(--accent-primary); color: var(--text-light); font-family: var(--font-body); font-size: 13px; font-weight: 700; } .install-btn:hover { background: var(--accent-primary-hover); } .install-dismiss { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 16px; padding: 4px 6px; line-height: 1; } .install-dismiss:hover { color: var(--text-light); }