@keyframes toastSlideIn {
    0% { transform: translateX(100%); opacity: 0 }
    to { transform: translateX(0); opacity: 1 }
}
@keyframes toastFadeOut {
    to { transform: translateY(-10px); opacity: 0 }
}
@keyframes pulse-border {
    0%,to { border-color: #dc3545 }
    50% { border-color: #ffc107 }
}
@keyframes pulse {
    0% { transform: scale(.95); box-shadow: 0 0 0 0 rgba(211,47,47,.7) }
    70% { transform: scale(1); box-shadow: 0 0 0 10px transparent }
    to { transform: scale(.95); box-shadow: 0 0 0 0 transparent }
}
@keyframes spin {
    0% { transform: rotate(0deg) }
    to { transform: rotate(360deg) }
}
@keyframes modalSlideUp {
    0% { transform: translateY(20px); opacity: 0 }
    to { transform: translateY(0); opacity: 1 }
}

:root {
    --grass: #2d5a27;
    --fairway: #4f7942;
    --sand: #f4f1ea;
    --dark: #333333;
    --text-dark: #444;
    --text-light: #555;
    --bg-color: #f0f2f0;
    --lt-gray: #eee;
    --med-gray: #ccc;
    --dk-gray: #666;
    --danger: #b00020;
    --off-white: #f9f9f9;
    --white: #ffffff;
    --radius: 12px
}

body {
    font-family: "Segoe UI",sans-serif;
    background: var(--bg-color)
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -ms-text-size-adjust: 100%
}

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

.view {
    display: none;
    padding: 10px 10px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,.1)
}

.view.active {
    display: block
}

.club-card,.live-card,.modal-content,.view {
    background: var(--white)
}

.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.app-navbar,.club-actions,.club-info,.hole-nav,.modal-header,.score-counter {
    display: flex;
    align-items: center
}

.app-navbar,.hole-nav,.modal-header,.score-counter {
    justify-content: space-between
}

.score-decorator,.score-grid .grid-header,.score-grid .row-label,.score-wrapper {
    display: flex;
    align-items: center;
    justify-content: center
}

.mini-stats-container,.stat-toggles {
    display: flex;
    align-items: center
}

#processing-overlay,.club-badge,.club-icon,.compact-row td .cell-wrapper,.grid-input,.modal-overlay {
    display: flex;
    align-items: center;
    justify-content: center
}

.app-navbar {
    padding: 12px 10px;
    background: var(--white);
    border-bottom: 1px solid var(--lt-gray);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    overflow: hidden;
    border-bottom: none;
    box-shadow: 0 4px 12px rgba(0,0,0,.05)
}

.navbar-brand, .logo {
    display: flex;
    align-items: center;
}

.header-logo {
    height: 1.3em;
    width: auto;
    vertical-align: middle;
    margin-right: 2px;
    image-rendering: -webkit-optimize-contrast;
}

.logo:hover .header-logo {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

.brand-name {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--grass);
    text-decoration: none
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer
}

.help-icon {
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    
    background-color: var(--grass);
    color: var(--white) !important;
    
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;

    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1;
    transition: all 0.2s ease-in-out;
}

.help-icon:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

#navbar-guest,.analytics-card {
    margin-bottom: 20px
}

.analytics-card {
    background: #fff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,.05);
    border-top: 4px solid var(--grass);
    border-bottom: 2px solid var(--grass)
}

.stat-card h2 {
    color: var(--grass);
    margin: 5px 0 0;
    font-size: 1.8rem
}

.stat-card-analytics {
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
    text-align: center;
    transition: transform .2s
}

#fir-card,#gir-card {
    border-left: 6px solid #2d5a27!important;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px
}

#gir-card {
    border-left: 6px solid #1976d2!important
}

.empty-state-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 20px;
    height: 100%
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    opacity: .8
}

.empty-state-container h3 {
    color: #2d5a27;
    margin-bottom: 10px;
    font-size: 1.4rem
}

.empty-state-container p {
    color: #666;
    max-width: 280px;
    line-height: 1.6;
    margin-bottom: 25px
}

.status-badge {
    padding: 4px 10px;
    border-radius: var(--radius);
    font-size: .65rem;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-block;
    border: 1px solid transparent
}

.status-badge:hover {
    transform: scale(1.05)
}

.badge-pro {
    background-color: #e8f5e9;
    color: #1b5e20;
    border-color: #c8e6c9
}

.badge-admin {
    background-color: #f3e5f5;
    color: #4a148c;
    border-color: #e1bee7
}

.badge-trial {
    background-color: #e3f2fd;
    color: #0d47a1;
    border-color: #bbdefb
}

.badge-expired {
    background-color: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca
}

.btn-track-finish,.btn-track-start {
    font-weight: 700
}

#btn-resume-round,.btn-track-finish,.btn-track-start {
    width: 100%;
    border-radius: 8px;
    cursor: pointer
}

.submit-btn {
    width: 100%;
    cursor: pointer;
    padding: 16px 0 16px 0;
    background: var(--grass);
    color: var(--white);
    border: 0;
    border-radius: 10px;
    font-weight: 700
}

.submit-btn.secondary {
    background: #444
}

#view-landing .submit-btn,#view-login .submit-btn,#view-setup .submit-btn,#view-signup .submit-btn {
    margin-top: 10px
}

.btn-track-start {
    background-color: #f0f4ef;
    color: var(--grass);
    border: 2px solid var(--grass);
    padding: 12px
}

#btn-resume-round,.btn-track-finish {
    background-color: var(--grass);
    color: var(--white);
    border: 0
}

.btn-track-finish {
    padding: 15px;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(45,90,39,.3)
}

#btn-resume-round {
    padding: 14px;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0,0,0,.1)
}

#btn-delete-round,.btn-add-dist,.btn-delete,.btn-gps,.btn-picker-club,.btn-save-manual,.counter-btn,.stat-btn {
    cursor: pointer
}

.stat-btn {
    flex: 1;
    background: #888;
    color: #fff;
    font-weight: 700;
    border-radius: 8px
}

.stat-btn.active {
    background: var(--fairway);
    border-color: var(--fairway)
}

.counter-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--grass);
    background: var(--white);
    font-size: 1.4rem
}

.btn-picker-club {
    background: var(--white);
    border: 1px solid #ddd;
    padding: 15px 5px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 1.1rem
}

.btn-picker-club:active,.mini-stat-btn.active {
    background: var(--grass);
    color: var(--white);
    border-color: var(--grass)
}

.btn-add-dist {
    background: var(--fairway);
    color: var(--white);
    border: 0;
    border-radius: 6px;
    padding: 0 10px
}

.btn-save-manual {
    background: #f0f0f0;
    border: 0;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: .8rem
}

.btn-gps {
    background: var(--grass);
    border: 0;
    width: 38px;
    height: 38px;
    border-radius: 8px
}

.btn-gps.tracking-active {
    background: #ff9800;
    animation: pulse 1.5s infinite
}

.live-view-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 15px;
    width: 100%;
    box-sizing: border-box
}

.gps-master-control {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.gps-toggle-icon {
    font-size: 1.2rem;
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.2));
}

/* The Switch Shell */
.gps-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 46px;
    height: 24px;
    margin-bottom: 12px
}

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

/* The Slider */
.gps-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 24px;
}

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

/* Green State */
input:checked + .gps-slider {
    background-color: var(--grass); /* Your green variable */
}

input:checked + .gps-slider:before {
    transform: translateX(22px);
}

#btn-delete-round {
    background: 0 0;
    color: #dc3545;
    border: 1px solid #dc3545;
    padding: 10px;
    border-radius: 8px;
    font-size: .85rem
}

#btn-delete-round:hover {
    background: rgba(220,53,69,.05)
}

.btn-delete {
    background: 0 0;
    border: 0;
    font-size: 1.1rem;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background .2s
}

.btn-delete:hover {
    background-color: #ffebee
}

.btn-history-chart,.btn-remove-club {
    position: absolute;
    top: 10px;
    background: 0 0;
    border: 0;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--med-gray);
    transition: transform .2s,color .2s;
    padding: 5px;
    line-height: 1
}

.btn-remove-club {
    left: 10px
}

.btn-history-chart {
    right: 10px
}

.btn-remove-club:hover {
    color: #b71c1c;
    transform: scale(1.1)
}

.btn-history-chart:hover {
    color: var(--grass);
    transform: scale(1.1)
}

#course-search,input[type=date],input[type=email],input[type=number],input[type=password],input[type=text],select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 16px;
    box-sizing: border-box;
    background: var(--white);
    color: var(--text-dark)
}

#course-search:focus,input[type=date]:focus,input[type=email]:focus,input[type=number]:focus,input[type=password]:focus,input[type=text]:focus,select:focus {
    outline: 0;
    border-color: var(--fairway);
    box-shadow: 0 0 0 2px rgba(79,121,66,.15)
}

input[type=email],input[type=password],input[type=text] {
    appearance: none;
    -webkit-appearance: none
}

.required-pulse {
    border: 2px solid #dc3545!important;
    box-shadow: 0 0 5px rgba(220,53,69,.2);
    animation: pulse-border 1.5s infinite
}

.format-selector {
    display: flex;
    background: #f0f0f0;
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 1px solid #e0e0e0
}

.format-selector input[type=radio] {
    display: none
}

.format-selector label {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-size: .85rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-radius: 9px;
    transition: all .2s ease;
    user-select: none
}

.format-selector input[type=radio]:checked+label {
    background: #2d5a27;
    color: #fff;
    box-shadow: 0 2px 8px rgba(45,90,39,.3)
}

.format-selector label:hover:not(:checked) {
    background: #e8e8e8
}

.toast {
    min-width: 250px;
    padding: 15px 20px;
    background: rgba(255,255,255,.95);
    color: var(--dark);
    border-left: 5px solid var(--grass);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,.2);
    font-size: .9rem;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(5px);
    animation: toastSlideIn .3s ease forwards;
    cursor: pointer
}

.toast.error {
    border-left-color: #b91c1c
}

.toast.info {
    border-left-color: #0d47a1
}

.toast-fade-out {
    animation: toastFadeOut .5s ease forwards
}

#view-landing,#view-login,#view-signup {
    text-align: left
}

#view-landing .menu-grid {
    grid-template-columns: 1fr 1fr
}

#view-login label,#view-signup label {
    display: block;
    font-weight: 600;
    margin: 10px 0 6px;
    color: var(--text-dark)
}

#login-error,#signup-error {
    min-height: 18px
}

#view-paywall {
    display: none;
    flex-direction: column;
    z-index: 9999;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
}

/* --- Membership Page Layout --- */
.membership-container {
    max-width: 1000px;
    margin: 0 auto 60px 0;
    padding: 20px;
    text-align: center;
}

.membership-container h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 40px;
    letter-spacing: -1px;
}

/* --- The Grid --- */
.plan-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    justify-items: center;
}

/* --- The Cards --- */
.plan-card {
    background: var(--grass);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 400px;
    height: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.plan-card form {
    margin-top: auto; 
    
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.plan-card h3, 
.plan-card .amount, 
.plan-card .plan-description,
.plan-card label {
    color: #ffffff !important;
}

.plan-card .duration {
    color: rgba(255, 255, 255, 0.8);
}

.plan-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.plan-description {
    margin-bottom: 20px;
    flex-grow: 0;
}

/* Highlight the Best Value (1 or 2 Year) */
.plan-card.best-value {
    background: #1e5c3f;
    border: 2px solid white;
    transform: scale(1.02);
    margin: 10px 0;
}

.plan-card.best-value:hover {
    transform: scale(1.05) translateY(-10px);
}

.plan-card.best-value::before {
    content: "RECOMMENDED";
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--grass);
    color: white;
    padding: 4px 15px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
}

/* --- Typography & Price --- */
.price-display .currency {
    font-size: 1.5rem;
    vertical-align: top;
    color: #ffffff !important;
    font-weight: 800;
    margin-right: 2px;
}

.plan-card .duration {
    color: rgba(255, 255, 255, 0.9) !important; 
    font-size: 1.1rem;
    font-weight: 600;
}

.price-display .amount {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    color: #ffffff;
}

/* --- Form & Inputs --- */
.qty-selector {
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.qty-selector input {
    background: white;
    border: none;
    color: #333;
    border-radius: 6px;
    padding: 6px;
    width: 60px;
    font-weight: 800;
    text-align: center;
}

/* --- The CTA Button --- */
.buy-btn {
    background: white;
    color: var(--grass);
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 900;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.buy-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Mobile Tweak */
@media (max-width: 480px) {
    .price-display .amount { font-size: 2.8rem; }
    .membership-container h2 { font-size: 1.8rem; }
}

/* ------------------------------ Membership Card Page ------------------------------ */

.membership-card-container {
    padding: 10px;
    max-width: 450px;
    margin: 0 auto
}

.membership-card {
    background: linear-gradient(135deg,#1b5e20 0,#2e7d32 100%);
    color: var(--white);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,.15);
    margin-bottom: 15px;
    position: relative;
    overflow: hidden
}

.membership-card.trial {
    background: linear-gradient(135deg,#f57f17 0,#fbc02d 100%)
}

.membership-card.expired {
    background: linear-gradient(135deg,#b71c1c 0,#e53935 100%)
}

.membership-card.admin {
    background-color: #f3e5f5!important;
    background-image: none!important;
    color: #4a148c!important;
    border: 1px solid #e1bee7
}

.card-header h4 {
    margin: 0!important;
    line-height: 1.2;
    font-size: 1.1rem
}

.card-header {
    margin-bottom: 5px;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start
}

.card-description {
    font-size: .85rem;
    color: #777;
    margin-top: 2px;
    margin-bottom: 12px;
    display: block
}

.card-brand {
    font-weight: 900;
    letter-spacing: 1px;
    font-size: .9rem;
    text-transform: uppercase
}

#card-user-name {
    font-size: 1.8rem;
    margin: 0
}

#card-user-email {
    opacity: .8;
    font-size: .9rem;
    margin-top: 5px
}

.card-footer {
    display: flex;
    gap: 40px;
    margin-top: 40px;
    border-top: 1px solid rgba(255,255,255,.2);
    padding-top: 20px
}

.footer-item small {
    display: block;
    font-size: .6rem;
    opacity: .7;
    letter-spacing: 1px;
    margin-bottom: 5px
}

.footer-item span {
    font-weight: 700;
    font-size: .9rem
}

.days-remaining-box,.stats-header {
    text-align: center;
    margin-bottom: 15px;
    color: var(--dark)
}

.days-remaining-box h1 {
    font-size: 3rem;
    margin: 0;
    color: var(--grass)
}

#stats-lifetime, #stats-live {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.stats-header {
    margin-bottom: 15px;
    background: var(--grass);
    padding: 15px;
    border-radius: 15px;
    color: var(--white);
    display: block;
    width: auto;
}

.stat-item {
    border-right: 1px solid rgba(255,255,255,.2)
}

.stat-item:last-child {
    border-right: none
}

.stat-item small {
    display: block;
    font-size: .8rem;
    opacity: .9
}

.stat-item span {
    display: block;
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: .5px
}

.back-link {
    color: var(--grass);
    cursor: pointer;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 12px
}

.course-search {
    position: relative;
    margin-bottom: 12px
}

#course-search-results,.course-results {
    position: absolute;
    left: 0;
    width: 100%;
    background-color: var(--white);
    border: 1px solid #ddd;
    border-radius: 0 0 8px 8px
}

#course-search-results {
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0,0,0,.15);
    z-index: 1000;
    margin-top: -1px
}

.course-results {
    top: 100%;
    right: 0;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    z-index: 10
}

.course-result,.search-result-item {
    cursor: pointer;
    border-bottom: 1px solid var(--lt-gray)
}

.search-result-item {
    padding: 12px 15px;
    transition: background .2s;
    background-color: var(--off-white)
}

.course-result:last-child,.search-result-item:last-child {
    border-bottom: none
}

.search-result-item:hover {
    background-color: #e8f5e9;
    color: var(--grass)
}

.course-result {
    padding: 10px 12px
}

.course-result:hover {
    background: #f4f4f4
}

.course-context-header {
    background: var(--sand);
    text-align: center;
    padding: 5px;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0
}

.course-context-header h4 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--grass)
}

.course-context-header p {
    margin: 3px 0 0;
    font-size: .9rem;
    color: var(--text-dark)
}

.hole-nav {
    margin: 12px 0
}

.hole-display {
    flex: 1;
    text-align: center
}

.hole-display h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--grass)
}

.hole-display small {
    display: block;
    color: var(--text-light)
}

.score-counter {
    background: var(--sand);
    padding: 7px;
    border-radius: var(--radius)
}

.score-box {
    text-align: center
}

.score-box span {
    font-size: 2.4rem;
    font-weight: 700
}

.stat-buttons {
    display: flex;
    justify-content: space-around;
    gap: 10px;
    margin-top: 15px
}

#btn-finish-live {
    background-color: #d32f2f!important;
    border: 2px solid #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,.2)
}

.live-card {
    padding: 10px;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    text-align: center
}

.tracking-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 1.1rem
}

#active-shot-distance {
    color: #ff4b4b;
    font-variant-numeric: tabular-nums
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background-color: #d32f2f;
    border-radius: 50%;
    animation: pulse 1.5s infinite
}

.club-picker-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 10px
}

.header-date {
    display: block;
    font-size: .85rem;
    opacity: .7;
    margin-top: 2px;
    font-weight: 400
}

.score-grid-container {
    margin-bottom: 20px
}

.grid-info {
    background: var(--off-white);
    font-size: .8rem;
    color: #777;
    text-align: center;
    padding: 4px;
    border-radius: 4px
}

.score-grid {
    display: grid;
    grid-template-columns: 60px repeat(9,1fr) 70px;
    gap: 8px;
    background: #fff;
    padding: 12px 10px;
    border-radius: 10px;
    border: 1px solid #ddd;
}

.score-grid .grid-header, .score-grid .row-label {
    background: var(--lt-gray);
    font-weight: 700;
    font-size: .9rem;
    text-align: center;
    border-radius: 6px;
    padding: 6px;
    display: flex;
}

.score-grid .row-label:last-child {
    background: var(--fairway);
    color: var(--white);
    font-weight: 700;
    font-size: 1.2rem;
    border-radius: 0 8px 8px 0;
    padding: 10px 0
}

.score-wrapper {
    flex-direction: column;
    padding: 4px 0
}

.score-decorator {
    width: 34px;
    height: 34px;
    margin-bottom: 4px;
    transition: all .2s ease
}

.score-grid .hole-score {
    width: 100%;
    background: #fdfdfd;
    border: 1px solid #dcdcdc; 
    border-radius: 4px;
    padding: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    appearance: textfield;
    margin: 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.score-grid .hole-score:focus {
    outline: none;
    border-color: var(--grass);
    background: #fff;
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.1);
}

.eagle .hole-score, 
.birdie .hole-score,
.par .hole-score,
.bogey .hole-score, 
.double-bogey .hole-score, 
.triple-bogey .hole-score {
    border: none !important;
    background: transparent !important;
}

.score-grid .hole-score::-webkit-inner-spin-button,.score-grid .hole-score::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0
}

.birdie,.eagle {
    background-color: #e02f2f;
    border: 1.5px solid var(--text-dark)!important;
    border-radius: 50%!important;
    color: var(--white)!important
}

.eagle {
    box-shadow: 0 0 0 2px #fff,0 0 0 3.5px var(--text-dark)
}

.birdie .hole-score,.eagle .hole-score {
    color: var(--white)!important;
    -webkit-text-fill-color: var(--white)!important
}

.birdie .hole-score::placeholder,.eagle .hole-score::placeholder {
    color: rgba(255,255,255,.7)
}

.bogey,.double-bogey,.triple-bogey {
    border: 1.5px solid var(--text-dark);
    color: var(--text-dark)
}

.double-bogey,.triple-bogey {
    position: relative
}

.double-bogey::after,.triple-bogey::after {
    content: "";
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 1px solid var(--text-dark)
}

.triple-bogey {
    background: repeating-linear-gradient(45deg,rgba(0,0,0,.05),rgba(0,0,0,.05) 4px,rgba(0,0,0,.1) 4px,rgba(0,0,0,.1) 8px)
}

.hole-score {
    color: inherit;
    font-weight: 700
}

.scorecard-legend {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    padding: 5px 0;
    border-top: 1px solid var(--lt-gray);
    font-size: .7rem
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px
}

.legend-swatch {
    width: 14px!important;
    height: 14px!important;
    font-size: 0!important
}

.legend-swatch.eagle {
    box-shadow: 0 0 0 1px #fff,0 0 0 2px var(--text-dark)
}

.legend-swatch.double-bogey::after,.legend-swatch.triple-bogey::after {
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px
}

#scorecard-back,#scorecard-front {
    margin-bottom: 10px
}

.mini-stats-container,.stat-toggles {
    gap: 4px;
    justify-content: center
}

.dot-toggle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid var(--med-gray);
    cursor: pointer;
    background: #fff
}

.dot-toggle.active {
    background: var(--fairway);
    border-color: var(--fairway)
}

.mini-stats-container {
    margin-top: 4px;
    min-height: 20px
}

.mini-stat-btn {
    font-size: .65rem;
    font-weight: 700;
    display: flex;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1px solid #ddd;
    border-radius: 3px;
    user-select: none;
    background: #fff;
    color: var(--med-gray)
}

.mini-stat-btn.disabled-historical {
    cursor: default;
    opacity: .5
}

#stat-tracking-wrapper {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px
}

.switch-label {
    font-size: .85rem;
    font-weight: 700;
    color: #555
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px
}

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

.slider,.slider:before {
    position: absolute;
    transition: .4s
}

.slider {
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--grass);
    border-radius: 34px
}

.slider:before {
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    border-radius: 50%
}

input:checked+.slider {
    background-color: #ccc
}

input:checked+.slider:before {
    transform: translateX(18px)
}

#view-post.hide-stats .mini-stats-container {
    display: none!important;
    visibility: hidden!important;
    height: 0!important;
    margin: 0!important;
    padding: 0!important
}

#view-post.hide-stats .score-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center
}

.resume-card {
    background-color: #f0f9f0;
    border: 1px solid #cce7cc;
    border-radius: var(--radius);
    padding: 24px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,.03)
}

.resume-card h3 {
    margin-top: 0;
    color: #2d5a2d;
    font-size: 1.2rem
}

.resume-card p {
    color: #4a6b4a;
    font-size: .95rem;
    margin-bottom: 24px
}

.resume-actions {
    display: flex;
    flex-direction: column;
    gap: 12px
}

.total-box,.totals-bar {
    display: flex;
    align-items: center;
    justify-content: center
}

.totals-bar {
    padding: 10px;
    margin: 10px auto;
    width: 100px
}

.total-box {
    flex: 1;
    background: var(--fairway);
    color: var(--white);
    padding: 15px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    font-weight: 700;
    font-size: 1rem;
    flex-direction: column
}

.total-box span {
    font-size: 2rem;
    font-weight: 700
}

.total-box {
    min-height: 60px;
}

#out-total, #in-total, #total-score {
    display: flex !important;
    flex-direction: column !important; 
    align-items: center;
    justify-content: center;
    line-height: 1.1 !important;
    font-size: 1.5rem;
    padding: 5px 0;
}

#out-total small, 
#in-total small, 
#total-score small {
    font-size: 0.7rem !important; /* Smaller Relation to Par */
    font-weight: 600;
    opacity: 0.8;
    margin-top: 2px;
}


#total-score {
    display: inline-block;
    vertical-align: middle;
}

#history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px
}

/* Optional: Make the delete button itself more compact on mobile */
@media (max-width: 768px) {
    #history-table td:first-child, 
    #history-table th:first-child {
        font-size: 0.8rem;
        white-space: nowrap !important;
        width: 1%;
        padding-right: 5px;
    }
    
    /* Tighten up the Delete column */
    #history-table td:last-child, 
    #history-table th:last-child {
        padding-left: 3px !important;
        padding-right: 3px !important;
        width: 1%;
        text-align: center;
    }
    
    .btn-delete {
        padding: 5px 5px;
        font-size: 0.8rem;
    }
}

#history-table td,#history-table th {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center
}

#history-table th {
    background: var(--lt-gray);
    font-weight: 700
}

#history-table a {
    color: var(--grass);
    text-decoration: none
}

#history-table a:hover,.admin-link:hover,.clickable-date {
    text-decoration: underline
}

.clickable-date {
    color: var(--grass);
    cursor: pointer;
    font-weight: 500
}

.clickable-date:hover {
    color: #2e7d32
}

#gps-distance-display,#gps-main-content {
    display: flex;
    flex-direction: column;
    align-items: center
}

#gps-distance-display {
    width: 100%;
    height: 175px;
    background: var(--grass);
    transition: background .2s,transform .1s,box-shadow .2s;
    color: var(--white);
    position: relative;
    overflow: hidden;
    justify-content: space-between;
    padding: 10px 0;
    border-radius: 15px;
    margin: 10px 0;
    cursor: pointer;
    box-shadow: inset 0 0 20px rgba(0,0,0,.2)
}

#gps-distance-display::after {
    content: "TAP TO REFRESH";
    position: absolute;
    bottom: 6px;
    font-size: .5rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    opacity: .4;
    width: 100%;
    text-align: center
}

#gps-distance-display:active {
    transform: scale(.97);
    filter: brightness(.9)
}

#gps-distance-display h1 {
    font-size: 5rem;
    margin: 0;
    line-height: 1
}

#gps-distance-display small {
    font-size: 1rem;
    font-weight: 700;
    opacity: .8;
    letter-spacing: 2px
}

#gps-main-content {
    flex: 1;
    justify-content: center
}

#gps-stat-bar {
    width: 100%;
    text-align: center;
    padding-bottom: 15px
}

.gps-spinner,.spinner {
    border-radius: 50%;
    animation: spin 1s linear infinite
}

.gps-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,.3);
    border-top: 4px solid var(--white);
    margin-bottom: 10px
}

.club-avg small,.gps-loading-text {
    text-transform: uppercase;
    letter-spacing: 1px
}

.gps-loading-text {
    font-size: .8rem;
    opacity: .8
}

.gps-accuracy {
    font-size: .65rem;
    font-weight: 700;
    color: rgba(255,255,255,.7);
    margin-top: 0;
    background: rgba(0,0,0,.2);
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 1px
}

.refresh-icon {
    position: absolute;
    top: 10px;
    right: 15px;
    opacity: .5;
    display: block;
    font-size: 1.2rem;
    margin-bottom: -5px;
    color: #2d5a27
}

.gps-display-wrapper:active {
    transform: scale(.96);
    transition: transform .1s
}

.accuracy-good {
    color: #4caf50
}

.accuracy-fair {
    color: #ffc107
}

.accuracy-poor {
    color: #f44336
}

.club-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(140px,1fr));
    gap: 15px;
    padding: 10px 0
}

.club-card {
    border-radius: 15px;
    border: 1px solid var(--lt-gray);
    padding: 15px;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,.05);
    display: flex;
    flex-direction: column;
    align-items: center
}

.club-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    background: var(--sand);
    padding: 10px;
    border-radius: 8px
}

.club-row strong {
    grid-column: 1;
    grid-row: 1;
    justify-self: start
}

.club-distance-input,.club-row input {
    width: 60px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-align: center
}

.club-row input {
    grid-column: 1/-1;
    grid-row: 1;
    justify-self: center;
    padding: 6px;
    z-index: 1
}

.club-badge {
    background: var(--grass);
    color: var(--white);
    width: 50px;
    height: 50px;
    border-radius: var(--radius);
    font-weight: 900;
    font-size: 1.2rem;
    margin-bottom: 10px
}

.club-avg {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--dark);
    margin: 5px 0
}

.club-avg small {
    display: block;
    font-size: .6rem;
    color: #999
}

.manual-entry,.manual-entry-mini {
    display: flex;
    gap: 5px
}

.manual-entry-mini {
    margin-top: 10px;
    width: 100%
}

.manual-entry-mini input {
    flex: 1;
    padding: 8px;
    font-size: .8rem;
    margin-bottom: 0
}

.manual-entry {
    flex: 1
}

.club-icon {
    width: 40px;
    height: 40px;
    background: var(--grass);
    color: var(--white);
    border-radius: 8px;
    font-weight: 700
}

.club-actions {
    gap: 8px;
    border-top: 1px solid var(--off-white);
    padding-top: 10px
}

.club-distance-input {
    padding: 6px
}

.bag-footer {
    padding-top: 20px
}

#add-club-select {
    width: 100%;
    max-width: 300px;
    padding: 12px;
    border: 2px solid var(--grass);
    border-radius: 8px;
    background-color: var(--white);
    font-weight: 600;
    color: var(--grass);
    cursor: pointer;
    transition: all .2s ease
}

#add-club-select:hover {
    background-color: var(--grass);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(45,90,39,.2)
}

.shot-history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: .9rem
}

.shot-history-table th {
    text-align: left;
    color: #666;
    border-bottom: 2px solid #eee;
    padding: 8px 4px
}

.shot-history-table td {
    padding: 10px 4px;
    border-bottom: 1px solid #f9f9f9
}

.btn-delete-shot {
    background: 0 0;
    border: 0;
    cursor: pointer;
    opacity: .6;
    transition: opacity .2s
}

.btn-delete-shot:hover {
    opacity: 1
}

.shot-list-scrollable {
    max-height: 250px;
    overflow-y: auto;
    margin-top: 10px;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 5px
}

.stats-banner {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-size: .9rem;
    color: #444
}

canvas {
    width: 100%!important;
    height: 100%!important
}

#admin-gate .submit-btn.admin-danger,.admin-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase
}

.admin-label {
    color: #c00;
    letter-spacing: 1px;
    margin-bottom: 15px;
    text-align: center
}

#admin-gate {
    margin-top: 30px;
    background: #fff3e0;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #ffe0b2
}

#admin-gate .submit-btn.admin-danger {
    background-color: var(--danger)!important;
    color: var(--white)!important;
    border: 1px solid rgba(255,255,255,.2)!important;
    padding: 12px 2px;
    white-space: nowrap;
    box-shadow: 0 4px 6px rgba(176,0,32,.2);
    transition: transform .2s,background-color .2s
}

#admin-gate .submit-btn.admin-danger:hover {
    transform: translateY(-1px)
}

#admin-gate .submit-btn.admin-danger:active {
    transform: translateY(0)
}

#admin-gate .menu-grid,.menu-grid.admin-3-col {
    grid-template-columns: 1fr 1fr 1fr!important
}

#admin-gate .menu-grid {
    gap: 10px
}

.menu-grid.admin-3-col {
    gap: 8px
}

.admin-3-col .submit-btn,.admin-table th {
    padding: 10px 2px;
    font-size: .7rem;
    white-space: nowrap
}

.admin-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-top: 20px;
    background: #fff;
    border-radius: 8px;
    display: block
}

.admin-table {
    width: 100%!important;
    border-collapse: collapse;
    table-layout: auto;
    font-size: .85rem
}

.admin-table th {
    background-color: var(--off-white);
    color: var(--dk-gray);
    font-weight: 700;
    text-transform: uppercase;
    padding: 12px;
    border-bottom: 2px solid var(--lt-gray);
    text-align: left
}

.admin-table td {
    padding: 12px;
    border-bottom: 1px solid var(--lt-gray);
    vertical-align: middle;
    white-space: normal;
    word-break: break-word
}

.admin-table tr:hover,.admin-table tr:nth-child(even) {
    background-color: var(--off-white)
}

.admin-table td:last-child,.admin-table th:last-child {
    text-align: right;
    width: 1%;
    white-space: nowrap
}

.admin-header {
    padding-bottom: 10px
}

.admin-search-input {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%23999" viewBox="0 0 16 16"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/></svg>');
    background-repeat: no-repeat;
    background-position: 12px center;
    padding-left: 20px!important
}

.admin-search-input:focus {
    border-color: var(--danger)!important;
    outline: 0
}

.compact-row td {
    padding: 0!important;
    height: 32px;
    vertical-align: middle;
    border-bottom: 1px solid var(--lt-gray)
}

.compact-row td .cell-wrapper {
    height: 32px;
    width: 100%;
    margin: 0;
    padding: 0
}

.grid-input {
    margin: 0!important;
    padding: 0 6px!important;
    width: 90%!important;
    height: 24px!important;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: .85rem;
    text-align: center;
    background: #fff;
    box-sizing: border-box;
    display: block
}

.grid-input.lat-input,.grid-input.lng-input {
    font-family: "Courier New",monospace;
    font-size: .7rem;
    letter-spacing: -.5px
}

.compact-row td b,.compact-row td span {
    line-height: 32px
}

.grid-input:focus {
    border-color: var(--grass);
    background-color: #f9fff9
}

.grid-input.img-input {
    text-align: left;
    width: 96%!important;
    font-family: monospace;
    font-size: .7rem
}

#processing-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,.8);
    backdrop-filter: blur(4px);
    z-index: 10000;
    flex-direction: column
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--grass)
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10000;
    
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

#modalImg {
    flex-shrink: 1; 
    min-width: 0;   
    min-height: 0;

    max-width: 95vw; 
    max-height: 85vh; 
    
    width: auto;
    height: auto;
    object-fit: contain;

    display: block;
    border-radius: 15px;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease-out;
}

.modal-content {
    width: 95%;
    max-width: 450px;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 15px 35px rgba(0,0,0,.4);
    animation: modalSlideUp .3s ease-out
}

.modal-header {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--lt-gray);
    padding-bottom: 12px
}

#edit-user-license-status,select.no-icon-select {
    background-image: none!important;
    padding-left: 10px!important;
    appearance: none;
    -webkit-appearance: none;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="%23999" viewBox="0 0 16 16"><path d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/></svg>')no-repeat;
    background-position: calc(100% - 12px) center
}

.close-modal {
    font-size: 1.8rem;
    cursor: pointer;
    color: #bbb;
    line-height: 1
}

.admin-link {
    color: var(--danger);
    font-weight: 600;
    text-decoration: none;
    vertical-align: middle
}

.breadcrumb {
    color: #888;
    cursor: pointer
}

.breadcrumb:hover {
    color: var(--danger)
}

.scorecard-scroll-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
    margin-bottom: 20px;
    background: #fff
}

.scorecard-scroll-container.is-overflowing {
    mask-image: linear-gradient(to right,#000 94%,transparent 100%);
    -webkit-mask-image: linear-gradient(to right,#000 94%,transparent 100%)
}

@media (max-width:520px) {
    #view-landing .menu-grid,.menu-grid {
        grid-template-columns: 1fr
    }

    .score-grid {
        overflow-x: auto;
        padding: 15px 5px
    }

    .score-decorator {
        width: 38px!important;
        height: 38px!important
    }

    .hole-score {
        font-size: 1.2rem!important
    }

    .grid-header,.grid-info {
        font-size: .9rem!important;
        padding: 10px 2px
    }
}

.phone-container {
    width: 280px;
    flex-shrink: 0;
    margin: 40px auto;
    position: relative;
    padding: 6px;
    background: #121212;
    border-radius: 38px;
    box-shadow: 0 15px 35px rgba(0,0,0,.4),0 0 0 2px #222;
    line-height: 0
}

.phone-screen {
    width: 100%;
    background: #000;
    border-radius: 34px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    border: 1px solid #000
}

.phone-screen img {
    width: 100%;
    height: auto;
    display: block
}

.phone-buttons {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5
}

.phone-buttons::after,.phone-buttons::before {
    content: "";
    position: absolute;
    width: 4px;
    background: #2a2a2a
}

.phone-buttons::after {
    right: -4px;
    top: 100px;
    height: 45px
}

.phone-buttons::before {
    left: -4px;
    top: 80px;
    height: 90px;
    border-radius: 4px 0 0 4px;
    box-shadow: inset 1px 0 1px rgba(255,255,255,.1)
}

.course-name-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    vertical-align: middle
}

.badge-9-hole {
    font-size: .65rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1;
    display: inline-block
}

.badge-9f {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd
}

.badge-9b {
    background-color: #f5f3ff;
    color: #6d28d9;
    border: 1px solid #ddd6fe
}