/* CarsCoin Garage: the workshop and the test track (garage.html) */
.gg { background: #0d0d11; background-image: var(--carbon); color: #e9e4d4; padding: 18px 0 44px; }
.gg .wrap { max-width: 1240px; }
.gg-grid { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 16px; align-items: start; }
.gg-stage { position: relative; height: min(68vh, 620px); min-height: 320px; border: 1px solid rgba(201,162,74,.3); border-radius: 8px; overflow: hidden; background: #101015; touch-action: pan-y; cursor: grab; }
.gg-stage canvas { display: block; width: 100%; height: 100%; }
.gg-name { position: absolute; left: 14px; top: 12px; font: 600 .78rem var(--display); letter-spacing: .14em; color: var(--gold-light); pointer-events: none; }
.gg-hint { position: absolute; left: 14px; bottom: 10px; font-size: .95rem; color: #aaa596; pointer-events: none; }
.gg-go { position: absolute; right: 14px; bottom: 14px; display: flex; gap: 8px; }
.gg-go .btn.ghost { color: var(--gold-light); border-color: var(--gold); }
.gg-views { position: absolute; right: 12px; top: 10px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; max-width: 70%; }
.gg-views button { font: 600 .64rem var(--display); letter-spacing: .05em; padding: 7px 8px; color: #fff; background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.3); border-radius: 3px; cursor: pointer; }
.gg-views button[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #15151b; }
.gg-err { padding: 24px; color: #e9e4d4; }

.gg-side { display: grid; gap: 12px; }
.gg-card { background: #15151b; border: 1px solid rgba(201,162,74,.22); border-radius: 8px; padding: 12px 14px; }
.gg-card h2 { font: 600 .8rem var(--display); letter-spacing: .14em; color: var(--gold-light); margin: 0 0 8px; }
.gg-card h2::after { display: none; }
.gg-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.gg-cats button { font: 600 .68rem var(--display); letter-spacing: .08em; padding: 7px 9px; color: #d9d4c4; background: transparent; border: 1px solid rgba(201,162,74,.3); border-radius: 3px; cursor: pointer; }
.gg-cats button[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #15151b; }
.gg-opts { display: grid; gap: 6px; }
.gg-pts { float: right; letter-spacing: .02em; color: #fff; font-variant-numeric: tabular-nums; }
.gg-opt.locked { background: #17171c; }
.gg-opt.locked b { color: #c9c4b4; }
.gg-opt em { float: right; font-style: normal; font-size: .95rem; font-weight: 600; color: var(--gold-light); }
.gg-opt.short em { color: #ef7a8a; }
.gg-opt { display: block; width: 100%; text-align: left; font: inherit; color: inherit; background: #1c1c24; border: 1px solid transparent; border-radius: 5px; padding: 7px 10px; cursor: pointer; }
.gg-opt b { display: block; font-weight: 600; font-size: 1.04rem; }
.gg-opt span { display: block; font-size: .95rem; line-height: 1.25; color: #aaa596; }
.gg-opt:hover { border-color: rgba(201,162,74,.4); }
.gg-opt[aria-pressed="true"] { border-color: var(--gold); background: #262219; }
.gg-paints { display: flex; flex-wrap: wrap; gap: 8px; }
.gg-paints button { width: 38px; height: 38px; border-radius: 50%; border: 2px solid rgba(255,255,255,.2); cursor: pointer; }
.gg-paints button[aria-pressed="true"] { border-color: var(--gold-light); box-shadow: 0 0 0 2px #15151b, 0 0 0 4px var(--gold); }
/* Holder paints: locked ones are dimmed with a small padlock */
.gg-perk-note { margin: 14px 0 8px; }
.gg-paints button.locked { position: relative; opacity: .45; }
.gg-paints button.locked::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 9px; margin: -2px 0 0 -6px; border-radius: 2px; background: #f4efe1; }
.gg-paints button.locked::before { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 7px; margin: -8px 0 0 -5px; border: 2px solid #f4efe1; border-bottom: 0; border-radius: 5px 5px 0 0; }
.gg-tier { font: 600 .66rem var(--display); font-style: normal; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-light); border: 1px solid rgba(201,162,74,.5); border-radius: 3px; padding: 0 4px; margin-right: 6px; }
.gg-stats { width: 100%; border-collapse: collapse; font-size: 1.02rem; }
.gg-stats td { padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.gg-stats td:nth-child(2) { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.gg-stats td:nth-child(3) { text-align: right; width: 76px; font-size: .92rem; font-variant-numeric: tabular-nums; }
.gg-up { color: #5fd19b; } .gg-down { color: #ef7a8a; }
.gg-note { font-size: .95rem; color: #aaa596; margin: 8px 0 0; line-height: 1.3; }
.gg-link { background: none; border: 0; padding: 0; font: inherit; font-size: .95rem; color: var(--gold-light); text-decoration: underline; cursor: pointer; }

/* My cars and My photos */
.gg-save { display: flex; gap: 6px; margin-bottom: 8px; }
.gg-save input { flex: 1; min-width: 0; font: inherit; padding: 7px 9px; color: #e9e4d4; background: #1c1c24; border: 1px solid rgba(201,162,74,.3); border-radius: 4px; }
.gg-mini { font: 600 .66rem var(--display); letter-spacing: .06em; padding: 8px 9px; color: #d9d4c4; background: transparent; border: 1px solid rgba(201,162,74,.3); border-radius: 3px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.gg-mini.main { background: var(--gold); border-color: var(--gold); color: #15151b; }
.gg-mini:disabled { opacity: .45; cursor: default; }
.gg-car { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid rgba(255,255,255,.07); }
.gg-car div { flex: 1; min-width: 0; }
.gg-car b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gg-car span { display: block; font-size: .92rem; color: #aaa596; }
.gg-car.on b { color: var(--gold-light); }
.gg-album { margin-top: 16px; }
.gg-editor { position: fixed; inset: 0; z-index: 1050; display: grid; grid-template-columns: minmax(0, 1fr) 300px; background: #111114; color: #e9e4d4; }
.gg-editor[hidden] { display: none; }
.gg-ed-map { position: relative; min-height: 0; min-width: 0; overflow: hidden; }
.gg-ed-map canvas { display: block; touch-action: none; }
.gg-ed-side { padding: 12px 14px; overflow: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-content: start; background: #15151b; }
.gg-ed-side h2 { font: 600 .85rem var(--display); letter-spacing: .14em; color: var(--gold-light); margin: 0; }
.gg-ed-side h2::after { display: none; }
.gg-ed-side .gg-note { margin: 0; }
.gg-ed-side label { display: block; font-size: 1rem; }
.gg-ed-side input[type=range] { width: 100%; accent-color: var(--gold); }
.gg-ed-side select { display: block; width: 100%; font: inherit; padding: 6px 8px; margin-top: 3px; color: #e9e4d4; background: #1c1c24; border: 1px solid rgba(201,162,74,.3); border-radius: 4px; }
.gg-ed-side > input { font: inherit; padding: 7px 9px; color: #e9e4d4; background: #1c1c24; border: 1px solid rgba(201,162,74,.3); border-radius: 4px; }
.gg-ed-row { display: flex; flex-wrap: wrap; gap: 6px; }
.gg-ed-streets { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.gg-ed-streets input { min-width: 0; flex: 1; }
.gg-ed-streets[hidden], .gg-ed-row[hidden] { display: none; }
.gg-ed-places { display: grid; gap: 4px; }
.gg-ed-places button { text-align: left; white-space: normal; }
@media (max-width: 760px), (orientation: portrait) { .gg-editor { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; } .gg-ed-side { max-height: 46vh; } }
.gg-fix { display: grid; grid-template-columns: 92px minmax(0, 1fr) 38px auto; gap: 8px; align-items: center; padding: 3px 0; font-size: 1rem; }
.gg-fix i { display: block; height: 7px; background: rgba(255,255,255,.1); border-radius: 4px; overflow: hidden; }
.gg-fix i b { display: block; height: 100%; background: #5fd19b; }
.gg-fix.mid i b { background: #e6cd8a; } .gg-fix.low i b { background: #ef7a8a; }
.gg-fix small { grid-column: 1 / -1; margin-top: -3px; font-size: .88rem; color: #ef9aa6; }
.gg-dmg { margin-top: 4px; font-size: .92rem; line-height: 1.2; color: #ffc4cc; }
.gg-fix span { text-align: right; font-variant-numeric: tabular-nums; font-size: .92rem; }
.gg-hit { position: absolute; inset: 0; background: rgba(179,38,58,.42); opacity: 0; transition: opacity .35s; pointer-events: none; }
.gg-hit.on { opacity: 1; transition: none; }
.gg-lap { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid rgba(255,255,255,.07); }
.gg-lap b { font-variant-numeric: tabular-nums; }
.gg-lap div { min-width: 0; }
.gg-lap div a, .gg-lap div span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gg-lap div span { font-size: .92rem; color: #aaa596; }
.gg-lap.me { color: var(--gold-light); }
.gg-times .ahead { color: #7fe0b0; } .gg-times .behind { color: #ffb0ba; }
.gg-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.gg-photo img { display: block; width: 100%; aspect-ratio: 8/5; object-fit: cover; border-radius: 5px; background: #1c1c24; }
.gg-photo div { display: flex; justify-content: space-between; gap: 6px; margin-top: 5px; }

/* Photo mode */
.gg-shoot { position: absolute; inset: auto 0 0 0; padding: 10px 14px 12px; background: linear-gradient(transparent, rgba(0,0,0,.72) 26%); display: grid; gap: 6px; }
.gg-pick { display: flex; align-items: center; gap: 8px; }
.gg-pick span { width: 56px; flex: none; font-size: .95rem; color: #e9e4d4; }
.gg-pick div { display: flex; flex-wrap: wrap; gap: 5px; }
.gg-pick button { font: 600 .64rem var(--display); letter-spacing: .05em; padding: 7px 8px; color: #fff; background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.3); border-radius: 3px; cursor: pointer; }
.gg-pick button[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #15151b; }
.gg-shoot-go { display: flex; justify-content: flex-end; gap: 8px; }
.gg-shoot-go .btn.ghost { color: var(--gold-light); border-color: var(--gold); }
.gg-preview { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.82); }
.gg-preview[hidden] { display: none; }
.gg-preview-box { width: min(920px, 100%); max-height: 100%; overflow: auto; padding: 12px; background: #15151b; border: 1px solid rgba(201,162,74,.35); border-radius: 8px; }
.gg-preview-box img { display: block; width: 100%; max-height: 68vh; object-fit: contain; border-radius: 5px; }
.gg-preview-go { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.gg-preview-go .btn.ghost { color: var(--gold-light); border-color: var(--gold); }
.gg-photo p { margin: 5px 0 0; font-size: .92rem; line-height: 1.25; color: #aaa596; }
.gg-nft { display: grid; gap: 9px; width: min(560px, 100%); color: #e9e4d4; }
.gg-nft h2 { font: 600 .9rem var(--display); letter-spacing: .12em; color: var(--gold-light); margin: 0; }
.gg-nft h2::after { display: none; }
.gg-nft img { max-height: 30vh; }
.gg-nft .gg-note { margin: 0; }
.gg-nft label { display: grid; gap: 3px; font-size: 1rem; }
.gg-nft input:not([type=checkbox]), .gg-nft textarea, .gg-nft select { width: 100%; box-sizing: border-box; font: inherit; padding: 7px 9px; color: #e9e4d4; background: #1c1c24; border: 1px solid rgba(201,162,74,.3); border-radius: 4px; }
.gg-nft label.gg-agree { display: flex; gap: 8px; align-items: flex-start; font-size: .95rem; line-height: 1.3; }

/* Test drive: the stage fills the screen */
body.gg-driving { overflow: hidden; }
.gg-stage.driving { position: fixed; inset: 0; z-index: 1000; height: auto; min-height: 0; border: 0; border-radius: 0; touch-action: none; cursor: default; }
.gg-hud { position: absolute; inset: 0; pointer-events: none; user-select: none; -webkit-user-select: none; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.gg-stage.driving .gg-hud { left: env(safe-area-inset-left); right: env(safe-area-inset-right); bottom: env(safe-area-inset-bottom); }
.gg-turn { display: none; position: absolute; left: 50%; top: 62px; transform: translateX(-50%); width: max-content; max-width: 86vw; padding: 6px 12px; font-size: 1.05rem; text-align: center; background: rgba(201,162,74,.9); color: #15151b; text-shadow: none; border-radius: 5px; }
.gg-set { position: absolute; z-index: 5; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100% - 24px)); max-height: calc(100% - 20px); box-sizing: border-box; overflow: auto; padding: 12px 14px; color: #e9e4d4; background: rgba(21,21,27,.96); border: 1px solid rgba(201,162,74,.4); border-radius: 8px; cursor: default; touch-action: pan-y; }
.gg-set h2 { font: 600 .8rem var(--display); letter-spacing: .14em; color: var(--gold-light); margin: 0 0 6px; }
.gg-set h2::after { display: none; }
.gg-set label { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; margin-bottom: 7px; font-size: 1rem; }
.gg-set label small { grid-column: 1 / -1; font-size: .88rem; line-height: 1.2; color: #aaa596; }
.gg-set input { grid-column: 1 / -1; width: 100%; margin: 3px 0; accent-color: var(--gold); touch-action: none; }
.gg-set .btn.ghost { color: var(--gold-light); border-color: var(--gold); }
.gg-times { position: absolute; left: 14px; top: 12px; font-size: 1.05rem; line-height: 1.3; font-variant-numeric: tabular-nums; }
.gg-times b { font-size: 1.7rem; display: block; }
.gg-dial { position: absolute; right: 16px; bottom: 16px; width: 190px; text-align: right; }
.gg-speed { font: 700 3rem/1 var(--body); font-variant-numeric: tabular-nums; }
.gg-speed small { font-size: 1rem; font-weight: 400; }
.gg-gear { font-size: 1.1rem; }
.gg-bar { height: 7px; margin-top: 5px; background: rgba(0,0,0,.45); border-radius: 4px; overflow: hidden; }
.gg-bar i { display: block; height: 100%; width: 0; background: var(--gold); }
.gg-bar.boost i { background: #4fb3e8; }
.gg-msg { position: absolute; left: 50%; top: 16%; transform: translateX(-50%); padding: 7px 16px; max-width: 88vw; text-align: center; font-size: 1.25rem; background: rgba(0,0,0,.55); border-radius: 5px; }
.gg-tools { position: absolute; right: 12px; top: 10px; display: flex; flex-wrap: wrap; justify-content: flex-end; max-width: calc(100% - 100px); gap: 6px; pointer-events: auto; }
.gg-tools button { font: 600 .68rem var(--display); letter-spacing: .06em; padding: 9px 10px; color: #fff; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.3); border-radius: 4px; cursor: pointer; }
.gg-touch { position: absolute; inset: auto 0 0 0; display: none; justify-content: space-between; padding: 0 14px 14px; pointer-events: none; }
.gg-touch { align-items: flex-end; }
.gg-wheel { width: 136px; height: 136px; padding: 6px; box-sizing: border-box; border-radius: 50%; background: rgba(0,0,0,.28); pointer-events: auto; touch-action: none; -webkit-tap-highlight-color: transparent; }
.gg-wheel svg { display: block; width: 100%; height: 100%; pointer-events: none; }
.gg-pedals { display: flex; gap: 10px; }
.gg-pedal { position: relative; width: 62px; height: 136px; overflow: hidden; background: rgba(0,0,0,.42); border: 2px solid rgba(255,255,255,.45); border-radius: 10px; box-sizing: border-box; pointer-events: auto; touch-action: none; -webkit-tap-highlight-color: transparent; }
.gg-pedal i { position: absolute; inset: auto 0 0 0; height: 0; background: rgba(179,38,58,.78); }
.gg-pedal.gas i { background: rgba(201,162,74,.82); }
.gg-pedal span { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font: 600 .6rem var(--display); letter-spacing: .04em; color: #fff; }
.gg-keys { position: absolute; left: 14px; bottom: 12px; font-size: .95rem; color: #eee; }
@media (hover: none) and (pointer: coarse) and (orientation: portrait) { .gg-turn { display: block; } }
@media (hover: none) and (pointer: coarse) {
  .gg-touch { display: flex; } .gg-keys { display: none; }
  .gg-dial { right: 50%; transform: translateX(50%); bottom: 158px; width: 130px; text-align: center; }
  .gg-speed { font-size: 2.1rem; }
}
@media (hover: none) and (pointer: coarse) and (orientation: landscape) {
  .gg-stage.driving .gg-dial { right: 14px; bottom: 156px; width: 130px; transform: none; text-align: right; }
  .gg-times b { font-size: 1.3rem; }
  .gg-tools button { padding: 7px 8px; font-size: .6rem; }
  .gg-msg { top: 13%; font-size: 1.05rem; }
}
@media (max-width: 900px) {
  .gg-grid { grid-template-columns: minmax(0, 1fr); }
  .gg-stage { height: 46vh; }
}
