/* Cart Caddy — modern dark theme. Scoped to #playView so it doesn't leak
   into the rest of the app. Charcoal base, electric chartreuse accent,
   Inter type. White text for readable data. */

#playView {
    --cc-bg:           #0a0d11;
    --cc-surface:      #14181e;
    --cc-surface-hi:   #1c2128;
    --cc-border:       rgba(255, 255, 255, 0.08);
    --cc-border-hi:    rgba(255, 255, 255, 0.14);
    --cc-text:         #f0f2f5;
    --cc-text-dim:     #8a9099;
    --cc-accent:       #b6ff3a;
    --cc-accent-soft:  rgba(182, 255, 58, 0.12);
    --cc-accent-mid:   rgba(182, 255, 58, 0.30);
    --cc-accent-ink:   #0a0d11;
    --cc-warn:         #ff8a8a;

    background: var(--cc-bg);
    color: var(--cc-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Take over the area between the top of the viewport and the bottom tab bar
   so internal flex layout has a known height to fill. Without this, the
   play view inherits .tab-view { display: block } and overflows behind the
   bottom tab bar. */
#playView.active {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: calc(56px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1;
}

#playView .cc-screen {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;       /* allow inner flex children to scroll if needed */
    overflow: hidden;
}

/* --- Topbar --- */

#playView .cc-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 12px;
    background: var(--cc-bg);
    border-bottom: 1px solid var(--cc-border);
    flex-shrink: 0;
}

#playView .cc-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--cc-text);
    letter-spacing: -0.01em;
    margin: 0;
}

#playView .cc-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-left: -10px;
    border-radius: 50%;
    color: var(--cc-text);
    font-size: 22px;
    line-height: 1;
    text-decoration: none;
    transition: background .15s ease;
}
#playView .cc-back:active { background: var(--cc-surface-hi); }

/* Topbar action button (e.g. Save). Always visible — sits in the topbar
 * so the mobile keyboard can't hide it. */
#playView .cc-topbar-action {
    appearance: none;
    background: none;
    border: none;
    padding: 8px 4px;
    margin-right: -4px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    color: var(--cc-accent);
    letter-spacing: -0.01em;
    cursor: pointer;
    min-width: 56px;
    text-align: right;
}
#playView .cc-topbar-action:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
#playView .cc-topbar-action:not(:disabled):active {
    filter: brightness(0.85);
}

#playView .cc-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

#playView .cc-gps-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--cc-text-dim);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

#playView .cc-gps-pill::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cc-text-dim);
}
#playView .cc-gps-pill[data-state="ok"]::before  { background: var(--cc-accent); box-shadow: 0 0 6px var(--cc-accent-mid); }
#playView .cc-gps-pill[data-state="ok"]          { color: var(--cc-text); }
#playView .cc-gps-pill[data-state="off"]::before { background: transparent; border: 1px solid var(--cc-text-dim); }

#playView .cc-battery {
    font-size: 12px;
    font-weight: 500;
    color: var(--cc-text-dim);
    font-variant-numeric: tabular-nums;
}

#playView .cc-hole-counter {
    font-size: 13px;
    font-weight: 500;
    color: var(--cc-text-dim);
    font-variant-numeric: tabular-nums;
}

/* In-development notice on the landing — sets expectations before the user
   taps Start Round and discovers there's only one course. */
#playView .cc-notice {
    margin: 12px 16px 0;
    padding: 12px 14px;
    background: var(--cc-accent-soft);
    border-left: 3px solid var(--cc-accent);
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--cc-text);
    flex-shrink: 0;
}

#playView .cc-notice strong {
    color: var(--cc-accent);
    font-weight: 700;
}

/* --- Landing tile stack --- */

#playView .cc-grid-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
    flex: 1;
    min-height: 0;
}

#playView .cc-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: 22px;
    padding: 22px;
    text-decoration: none;
    color: var(--cc-text);
    transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

#playView .cc-tile--lg {
    flex: 1;
    font-size: 22px;
    font-weight: 600;
}

#playView .cc-tile:active {
    transform: scale(0.98);
    background: var(--cc-surface-hi);
    border-color: var(--cc-border-hi);
}

/* Icon sits in a chartreuse-tinted square chip top-left of each tile. */
#playView .cc-icon {
    width: 56px;
    height: 56px;
    padding: 12px;
    box-sizing: border-box;
    border-radius: 16px;
    background: var(--cc-accent-soft);
    color: var(--cc-accent);
    margin: 0;
}

#playView .cc-tile span {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.005em;
    color: var(--cc-text);
    line-height: 1.2;
}

/* --- Course Select --- */

#playView .cc-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

#playView .cc-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 14px 16px;
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: 14px;
    color: var(--cc-text);
    text-align: left;
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease;
    width: 100%;
    font-family: inherit;
}

#playView .cc-row-name {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.2;
}

#playView .cc-row-loc {
    font-size: 13px;
    color: var(--cc-text-dim);
    line-height: 1.2;
}

#playView .cc-row.is-selected {
    background: var(--cc-accent-soft);
    border-color: var(--cc-accent);
}

#playView .cc-row.is-selected .cc-row-name { color: var(--cc-accent); }

/* Up/down chevrons in the topbar - decorative until 2+ courses. */
#playView .cc-chevrons {
    display: flex;
    gap: 6px;
    color: var(--cc-text-dim);
    font-size: 16px;
    opacity: 0.5;
}

#playView .cc-chev {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid var(--cc-border);
    border-radius: 6px;
    line-height: 1;
}

/* --- Sticky bottom CTA --- */

#playView .cc-cta {
    margin: 12px 16px calc(env(safe-area-inset-bottom) + 12px);
    padding: 14px 18px;
    background: var(--cc-accent);
    color: var(--cc-accent-ink);
    border: none;
    border-radius: 14px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    cursor: pointer;
    flex-shrink: 0;
    transition: filter .12s ease, transform .12s ease;
}

#playView .cc-cta:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

#playView .cc-cta:not(:disabled):active {
    filter: brightness(0.9);
    transform: scale(0.99);
}

/* Inline variant: lives inside a scrollable body next to its inputs so the
 * mobile keyboard can't hide it. Drops the bottom-anchored margins. */
#playView .cc-cta.cc-cta-inline {
    margin: 4px 0 0;
}

/* --- Hole screen --- */

#playView .cc-hole-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 10px 18px;
    border-bottom: 1px solid var(--cc-border);
    font-size: 13px;
    font-weight: 500;
    color: var(--cc-text-dim);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex-shrink: 0;
}

#playView .cc-hole-num,
#playView .cc-hole-par {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
}

#playView .cc-data {
    color: var(--cc-text);
    font-weight: 600;
    font-size: 18px;
}

#playView .cc-distances {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr;
    align-items: center;
    padding: 14px 12px;
    gap: 6px;
    flex: 1;
    min-height: 0;
}

#playView .cc-dist {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

#playView .cc-dist-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--cc-text-dim);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#playView .cc-dist-value {
    font-size: 56px;
    line-height: 1;
    color: var(--cc-text);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    letter-spacing: -0.02em;
}

#playView .cc-dist--primary .cc-dist-value {
    font-size: 84px;
    color: var(--cc-accent);
}

#playView .cc-dist-unit {
    font-size: 11px;
    font-weight: 600;
    color: var(--cc-text-dim);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Suggested club band */
#playView .cc-suggest {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    padding: 6px 18px;
    flex-shrink: 0;
}

#playView .cc-suggest-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--cc-text-dim);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#playView .cc-suggest-club {
    font-size: 22px;
    font-weight: 600;
    color: var(--cc-text);
    letter-spacing: -0.01em;
}

#playView .cc-suggest-conf {
    font-size: 13px;
    font-weight: 500;
    color: var(--cc-text-dim);
    font-variant-numeric: tabular-nums;
}

#playView .cc-gps-status {
    text-align: center;
    padding: 4px 18px 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--cc-text-dim);
    letter-spacing: 0.02em;
    flex-shrink: 0;
}
#playView .cc-gps-status.is-warn { color: var(--cc-warn); }

/* Last-shot read-out — appears after the second Log Shot tap and updates
   on every subsequent tap with the distance between the latest pair. */
#playView .cc-lastshot {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    padding: 2px 18px 8px;
    flex-shrink: 0;
}
#playView .cc-lastshot[hidden] { display: none; }

#playView .cc-lastshot-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--cc-text-dim);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#playView .cc-lastshot-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--cc-accent);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

#playView .cc-lastshot-unit {
    font-size: 11px;
    font-weight: 600;
    color: var(--cc-text-dim);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#playView .cc-hole-nav {
    display: flex;
    align-items: stretch;
    border-top: 1px solid var(--cc-border);
    flex-shrink: 0;
}

#playView .cc-nav-btn {
    flex: 1;
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--cc-text-dim);
    letter-spacing: 0.04em;
    text-decoration: none;
    text-align: center;
    text-transform: uppercase;
    transition: background .12s ease, color .12s ease;
}

#playView .cc-nav-btn:not(.is-disabled):active {
    background: var(--cc-surface-hi);
    color: var(--cc-text);
}

#playView .cc-nav-btn.is-disabled {
    opacity: 0.3;
    pointer-events: none;
}

#playView .cc-nav-btn + .cc-nav-btn {
    border-left: 1px solid var(--cc-border);
}

/* --- My Bag (single-column list + detail) --- */

#playView .cc-bag-list {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

#playView .cc-bag-listrow {
    display: grid;
    grid-template-columns: 1fr auto 16px;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    text-decoration: none;
    color: var(--cc-text);
    border-bottom: 1px solid var(--cc-border);
    transition: background .12s ease;
}

#playView .cc-bag-listrow:active {
    background: var(--cc-surface-hi);
}

#playView .cc-bag-listrow-name {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.005em;
}

#playView .cc-bag-listrow-dist {
    font-size: 16px;
    font-weight: 700;
    color: var(--cc-accent);
    font-variant-numeric: tabular-nums;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

#playView .cc-bag-listrow-unit {
    font-size: 11px;
    font-weight: 600;
    color: var(--cc-text-dim);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-left: 2px;
}

#playView .cc-bag-listrow-empty {
    color: var(--cc-text-dim);
    font-size: 18px;
    font-weight: 500;
}

#playView .cc-bag-listrow-chev {
    color: var(--cc-text-dim);
    font-size: 22px;
    line-height: 1;
    text-align: right;
}

/* Single-club edit screen */

#playView .cc-bag-detail-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

#playView .cc-bag-detail-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#playView .cc-bag-detail-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--cc-text-dim);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

#playView .cc-bag-detail-name {
    font-family: inherit;
    font-size: 22px;
    font-weight: 600;
    color: var(--cc-text);
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: 12px;
    padding: 16px 18px;
    width: 100%;
    box-sizing: border-box;
    letter-spacing: -0.01em;
    transition: border-color .12s ease, background .12s ease;
}

#playView .cc-bag-detail-name:focus {
    outline: none;
    border-color: var(--cc-accent);
    background: var(--cc-surface-hi);
}

#playView .cc-bag-detail-distrow {
    display: flex;
    align-items: baseline;
    gap: 12px;
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: 12px;
    padding: 12px 18px;
    transition: border-color .12s ease, background .12s ease;
}

#playView .cc-bag-detail-distrow:focus-within {
    border-color: var(--cc-accent);
    background: var(--cc-surface-hi);
}

#playView .cc-bag-detail-dist {
    font-family: inherit;
    font-size: 36px;
    font-weight: 700;
    color: var(--cc-accent);
    background: transparent;
    border: none;
    padding: 6px 0;
    width: 100%;
    text-align: left;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    -moz-appearance: textfield;
    appearance: textfield;
}

#playView .cc-bag-detail-dist::-webkit-outer-spin-button,
#playView .cc-bag-detail-dist::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#playView .cc-bag-detail-dist:focus {
    outline: none;
}

#playView .cc-bag-detail-dist::placeholder {
    color: var(--cc-text-dim);
    opacity: 0.6;
}

#playView .cc-bag-detail-unit {
    font-size: 16px;
    font-weight: 600;
    color: var(--cc-text-dim);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* --- Empty/loading states --- */

#playView .cc-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cc-text-dim);
    font-size: 14px;
    padding: 24px;
    text-align: center;
}
