/* Auto Town — estilo inspirado en Car Town: azules brillantes, botones redondos y gruesos, paneles blancos. */
:root {
  --blue: #2a7fd4;
  --blue-d: #1a5a9a;
  --blue-dd: #12406f;
  --navy: #1b2a4a;
  --orange: #f7a11a;
  --orange-d: #d4760a;
  --green: #3cc24a;
  --green-d: #258a30;
  --red: #e5483a;
  --red-d: #a8281d;
  --purple: #8a52e0;
  --cyan: #2ec4e6;
  --gold: #ffd23a;
  --panel: #ffffff;
  --panel2: #eef6fd;
  --text: #1b2a4a;
  --muted: #6a7b93;
  --font: 'Fredoka', 'Trebuchet MS', Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--text); background: #5fb4ee; overflow: hidden; user-select: none; -webkit-user-select: none; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

/* ---------------- Logo ---------------- */
.logo { font-family: 'Luckiest Guy', 'Arial Black', sans-serif; font-size: clamp(44px, 9vw, 96px); margin: 0; letter-spacing: 2px; line-height: 1; text-align: center; }
.logo span { display: inline-block; color: var(--gold); -webkit-text-stroke: 3px var(--blue-dd); text-shadow: 0 6px 0 var(--blue-dd), 0 10px 18px rgba(0,0,0,.25); transform: rotate(-3deg); }
.logo span + span { color: #ff7a2a; transform: rotate(2deg); }
.logo.small { font-size: 54px; }

/* ---------------- Landing ---------------- */
body.landing { overflow: auto; background: linear-gradient(#3e9be6, #9fd6fb 55%, #8fd26f 55%, #6fb84f); min-height: 100%; }
.land { min-height: 100vh; display: flex; justify-content: center; padding: 24px 16px; }
.land-inner { max-width: 1040px; width: 100%; }
.tagline { text-align: center; color: #fff; font-size: 20px; font-weight: 600; text-shadow: 0 2px 0 rgba(0,0,0,.25); margin: 14px 0 6px; }
.land-grid { display: flex; gap: 20px; align-items: center; justify-content: center; flex-wrap: wrap; }
#land-car { max-width: 100%; }
.auth-box { background: #fff; border-radius: 22px; padding: 18px; width: 340px; max-width: 100%; box-shadow: 0 8px 0 var(--blue-d), 0 14px 30px rgba(0,0,0,.25); border: 4px solid #fff; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.auth-tabs button { flex: 1; border: 0; border-radius: 12px; padding: 10px; font-size: 16px; font-weight: 700; background: var(--panel2); color: var(--muted); }
.auth-tabs button.on { background: var(--blue); color: #fff; box-shadow: 0 4px 0 var(--blue-d); }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form input, .inp { border: 3px solid #cfe1f3; border-radius: 12px; padding: 11px 12px; font-size: 16px; outline: none; width: 100%; }
.auth-form input:focus, .inp:focus { border-color: var(--blue); }
.auth-err { color: var(--red); font-weight: 600; min-height: 22px; margin-top: 8px; text-align: center; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 24px; }
.features div { background: rgba(255,255,255,.92); border-radius: 16px; padding: 14px; font-size: 14px; color: var(--muted); box-shadow: 0 5px 0 rgba(0,0,0,.12); }
.features b { display: block; color: var(--navy); font-size: 18px; margin: 4px 0; }

/* ---------------- Botones ---------------- */
.btn { border: 0; border-radius: 14px; padding: 9px 16px; font-size: 15px; font-weight: 700; color: #fff; position: relative; top: 0;
  box-shadow: 0 4px 0 rgba(0,0,0,.25), inset 0 2px 0 rgba(255,255,255,.35); text-shadow: 0 1px 0 rgba(0,0,0,.3); transition: transform .08s, filter .1s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.btn.orange { background: linear-gradient(#ffc04a, var(--orange) 50%, var(--orange-d)); }
.btn.blue { background: linear-gradient(#5ab0f5, var(--blue) 50%, var(--blue-d)); }
.btn.green { background: linear-gradient(#6fe07a, var(--green) 50%, var(--green-d)); }
.btn.red { background: linear-gradient(#ff7a6a, var(--red) 50%, var(--red-d)); }
.btn.gray { background: linear-gradient(#c3ccd6, #9aa7b6 50%, #7d8a99); }
.btn.purple { background: linear-gradient(#b08af0, var(--purple) 50%, #6a35b8); }
.btn.cyan { background: linear-gradient(#7fe3f7, var(--cyan) 50%, #1a94b0); }
.btn.big { font-size: 20px; padding: 12px 26px; border-radius: 18px; }
.btn.small { font-size: 13px; padding: 6px 11px; border-radius: 11px; }
.btn .price, .btn .price.blue { color: #fff; }

/* ---------------- HUD ---------------- */
#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
#hud { height: 66px; display: flex; align-items: center; gap: 14px; padding: 0 12px; background: linear-gradient(#3d93e0, #2373c4); border-bottom: 4px solid var(--blue-dd); z-index: 5; box-shadow: 0 3px 10px rgba(0,0,0,.25); }
.hud-player { display: flex; align-items: center; gap: 8px; position: relative; min-width: 0; }
.hud-avatar, .avatar { width: 48px; height: 48px; border-radius: 12px; border: 3px solid #fff; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 22px; text-shadow: 0 2px 0 rgba(0,0,0,.25); box-shadow: 0 3px 0 rgba(0,0,0,.25); flex: none; }
.hud-star { position: absolute; left: 30px; top: 26px; width: 32px; height: 32px; background: var(--gold); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: var(--navy); }
.hud-pinfo { margin-left: 8px; min-width: 0; }
.hud-name { color: #fff; font-weight: 700; font-size: 17px; text-shadow: 0 2px 0 rgba(0,0,0,.25); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.xpbar { position: relative; width: 170px; height: 18px; background: var(--blue-dd); border-radius: 9px; border: 2px solid #fff; overflow: hidden; }
.xpfill { height: 100%; background: linear-gradient(#a8f07a, #4cbf2a); width: 0; transition: width .6s; }
.xpbar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; font-weight: 700; text-shadow: 0 1px 0 #000; }
.hud-res { display: flex; gap: 10px; margin-left: auto; }
.pill { display: flex; align-items: center; gap: 6px; background: #fff; border-radius: 20px; padding: 4px 14px 4px 5px; font-weight: 700; font-size: 18px; box-shadow: 0 3px 0 rgba(0,0,0,.25); min-width: 110px; }
.pill.bump { animation: bump .35s; }
@keyframes bump { 40% { transform: scale(1.15); } }
.coin-ico, .blue-ico { display: inline-block; width: 22px; height: 22px; border-radius: 50%; flex: none; vertical-align: middle; position: relative; }
.coin-ico { background: radial-gradient(circle at 35% 35%, #fff6b0, #ffd23a 40%, #e09a0a); border: 2px solid #c07a00; }
.coin-ico::after { content: '$'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #a06000; }
.blue-ico { background: radial-gradient(circle at 35% 35%, #d6f3ff, #4cb8ff 40%, #1a6ad8); border: 2px solid #11509f; }
.blue-ico::after { content: '◆'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; color: #fff; }
.price { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: #b06d00; }
.price .coin-ico, .price .blue-ico { width: 18px; height: 18px; }
.price .coin-ico::after { font-size: 10px; }
.price.blue { color: #1a6ad8; }
.hud-btns { display: flex; gap: 6px; }
.hb { width: 44px; height: 44px; border-radius: 12px; border: 0; background: linear-gradient(#ffffff, #dcecf9); font-size: 22px; box-shadow: 0 4px 0 var(--blue-dd); position: relative; display: flex; align-items: center; justify-content: center; }
.hb:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--blue-dd); }
.hb.off { opacity: .5; filter: grayscale(1); }
.hb.glow { animation: glow 1.2s infinite; }
@keyframes glow { 50% { box-shadow: 0 4px 0 var(--blue-dd), 0 0 16px 6px #ffe04a; transform: scale(1.06); } }
.badge { position: absolute; top: -6px; right: -6px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; padding: 0 4px; }

/* ---------------- Escenario ---------------- */
#stage { flex: 1; position: relative; overflow: hidden; }
#gcv { position: absolute; inset: 0; display: block; cursor: grab; touch-action: none; }
.zoom-btns { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 8px; }
.zoom-btns .hb { font-size: 20px; font-weight: 700; color: var(--navy); }
#edit-bar, #visit-bar { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); background: rgba(255,255,255,.96); border-radius: 16px; padding: 8px 14px; display: none; gap: 8px; align-items: center;
  box-shadow: 0 5px 0 rgba(0,0,0,.18); font-weight: 600; max-width: calc(100% - 90px); flex-wrap: wrap; justify-content: center; z-index: 3; }
body.editing #edit-bar { display: flex; }
body.visiting #visit-bar { display: flex; }
body.visiting #toolbar { opacity: .5; pointer-events: none; }
body.editing #btn-edit { background: linear-gradient(#6fe07a, var(--green)); }

/* ---------------- Barra de herramientas ---------------- */
#toolbar { display: flex; gap: 6px; padding: 8px 10px; background: linear-gradient(#2a7fd4, #1a5a9a); justify-content: center; border-top: 4px solid var(--blue-dd); overflow-x: auto; z-index: 4; }
.tb { border: 0; background: linear-gradient(#ffffff, #dcecf9); border-radius: 16px; width: 92px; height: 70px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  box-shadow: 0 5px 0 var(--blue-dd); position: relative; flex: none; transition: transform .1s; }
.tb:hover { transform: translateY(-3px); }
.tb:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--blue-dd); }
.tb i { font-style: normal; font-size: 30px; line-height: 1; filter: drop-shadow(0 2px 0 rgba(0,0,0,.2)); }
.tb span { font-size: 12px; font-weight: 700; color: var(--navy); }

/* ---------------- Vecinos ---------------- */
#neighbors { background: #e9f3fc; border-top: 3px solid #b9d6f0; padding: 6px 10px; overflow-x: auto; }
#neighbors-list { display: flex; gap: 8px; }
.nb { width: 72px; flex: none; text-align: center; cursor: pointer; position: relative; padding: 4px; border-radius: 12px; background: #fff; box-shadow: 0 3px 0 #b9d6f0; }
.nb:hover { background: #fff8e0; }
.nb .avatar { width: 46px; height: 46px; margin: 0 auto; font-size: 20px; }
.nb .avatar.plus { background: var(--orange); font-size: 30px; }
.nb.empty .avatar { background: #c9d6e3; }
.nb-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-lvl { position: absolute; top: 34px; right: 8px; background: var(--gold); border-radius: 50%; width: 22px; height: 22px; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }

/* ---------------- Ventanas ---------------- */
#modal-root { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
.modal-back { position: absolute; inset: 0; background: rgba(10,30,60,.45); display: flex; align-items: center; justify-content: center; pointer-events: auto; animation: fadein .15s; padding: 12px; }
.modal-back.out { animation: fadeout .16s forwards; }
@keyframes fadein { from { opacity: 0; } }
@keyframes fadeout { to { opacity: 0; } }
.modal { background: var(--panel); border-radius: 22px; width: 560px; max-width: 100%; max-height: calc(100vh - 24px); display: flex; flex-direction: column; border: 5px solid #fff;
  box-shadow: 0 8px 0 var(--blue-d), 0 20px 50px rgba(0,0,0,.35); animation: pop .22s cubic-bezier(.3,1.5,.6,1); overflow: hidden; }
@keyframes pop { from { transform: scale(.8); opacity: 0; } }
.modal.small { width: 420px; }
.modal.wide { width: 760px; }
.modal.xwide { width: 1000px; }
.modal-head { background: linear-gradient(#4aa2ec, #2373c4); padding: 10px 14px; display: flex; align-items: center; border-radius: 16px 16px 0 0; }
.modal-title { flex: 1; color: #fff; font-size: 22px; font-weight: 700; text-shadow: 0 2px 0 rgba(0,0,0,.3); }
.modal-x { width: 36px; height: 36px; border-radius: 50%; border: 3px solid #fff; background: var(--red); color: #fff; font-size: 16px; font-weight: 700; box-shadow: 0 3px 0 rgba(0,0,0,.3); }
.modal-body { padding: 14px 16px; overflow: auto; flex: 1; }
.modal-foot { padding: 10px 16px 16px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; border-top: 2px solid var(--panel2); }
.center { text-align: center; }
.muted { color: var(--muted); font-size: 14px; }
h4 { margin: 14px 0 8px; color: var(--blue-d); font-size: 17px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.center { justify-content: center; }
select { border: 3px solid #cfe1f3; border-radius: 10px; padding: 6px 8px; font-size: 15px; }

/* tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tab { border: 0; border-radius: 12px; padding: 8px 14px; font-weight: 700; font-size: 14px; background: var(--panel2); color: var(--blue-d); box-shadow: 0 3px 0 #c9dcef; }
.tab.on { background: var(--orange); color: #fff; box-shadow: 0 3px 0 var(--orange-d); }

/* tarjetas */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.card { background: var(--panel2); border-radius: 16px; padding: 8px; text-align: center; cursor: pointer; border: 3px solid transparent; position: relative; transition: transform .1s; box-shadow: 0 4px 0 #c9dcef; }
.card:hover { border-color: var(--orange); transform: translateY(-2px); }
.card.locked { filter: grayscale(.7); opacity: .75; }
.card-title { font-weight: 700; font-size: 15px; margin-top: 4px; }
.card-sub { font-size: 13px; color: var(--muted); display: flex; gap: 4px; justify-content: center; align-items: center; flex-wrap: wrap; }
.card-price { margin-top: 4px; }
.card canvas { max-width: 100%; }
.thumb { width: 120px; height: 90px; }
.lock { position: absolute; top: 6px; right: 6px; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 8px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; color: #fff; background: var(--orange); border-radius: 7px; padding: 1px 6px; margin-left: 4px; }
.tag.gray { background: #8a97a8; } .tag.red { background: var(--red); } .tag.blue { background: var(--blue); } .tag.green { background: var(--green); } .tag.orange { background: var(--orange); }

/* clases de rendimiento */
.cls { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 6px; color: #fff; font-weight: 700; font-size: 14px; text-shadow: 0 1px 0 rgba(0,0,0,.3); }
.cls-D { background: #7f8c8d; } .cls-C { background: #2db35b; } .cls-B { background: #2f6fc8; } .cls-A { background: #8a52e0; } .cls-S { background: #e5483a; }

/* trabajos */
.job-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.job-card { background: var(--panel2); border-radius: 16px; padding: 10px; text-align: center; cursor: pointer; border: 3px solid transparent; position: relative; box-shadow: 0 4px 0 #c9dcef; }
.job-card:hover { border-color: var(--orange); background: #fff8e8; }
.job-card.locked { opacity: .55; filter: grayscale(.8); }
.job-ico { font-size: 40px; }
.job-name { font-weight: 700; }
.job-time { color: var(--blue-d); font-weight: 600; font-size: 14px; }
.job-rew { display: flex; justify-content: center; gap: 8px; align-items: center; margin-top: 4px; }
.xp { color: var(--green-d); font-weight: 700; font-size: 14px; }
.job-cost { font-size: 12px; color: var(--muted); margin-top: 2px; }
.job-cost.free { color: var(--green-d); font-weight: 700; }
.job-info { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 10px; font-weight: 600; }
.big-timer { font-size: 40px; font-weight: 700; color: var(--blue-d); }
.pbar { height: 18px; background: var(--panel2); border-radius: 9px; overflow: hidden; border: 2px solid #c9dcef; margin: 8px 0; }
.pfill { height: 100%; background: linear-gradient(#7fd0ff, #2a7fd4); width: 0; transition: width .5s; }
.cust-ico { font-size: 56px; }

/* autos */
.car-menu { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.car-preview { border-radius: 16px; cursor: grab; display: block; }
.car-side { flex: 1; min-width: 260px; }
.car-name { font-size: 22px; font-weight: 700; }
.pi-row { display: flex; align-items: center; gap: 6px; margin: 6px 0; font-size: 18px; }
.car-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.dealer { display: flex; gap: 12px; min-height: 420px; }
.dealer-list { width: 280px; overflow: auto; max-height: 62vh; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; }
.dl-item { background: var(--panel2); border-radius: 12px; padding: 8px 10px; cursor: pointer; border: 3px solid transparent; }
.dl-item.on { border-color: var(--orange); background: #fff8e8; }
.dl-item.locked { opacity: .6; }
.dl-name { font-weight: 700; }
.dl-price { display: flex; justify-content: space-between; align-items: center; }
.lock-s { font-size: 12px; color: var(--muted); }
.dealer-detail { flex: 1; display: flex; flex-direction: column; gap: 6px; align-items: stretch; min-width: 0; }
.dealer-detail canvas { align-self: center; max-width: 100%; }
.dd-head { display: flex; align-items: center; gap: 8px; }
.stat { display: grid; grid-template-columns: 80px 1fr 90px; gap: 8px; align-items: center; font-size: 14px; font-weight: 600; }
.sbar { height: 12px; background: var(--panel2); border-radius: 6px; overflow: hidden; }
.sbar div { height: 100%; background: linear-gradient(90deg, #4cbf2a, #ffd23a, #ff7a2a); }
.dd-colors { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.dd-buy { display: flex; align-items: center; justify-content: flex-end; gap: 14px; font-size: 20px; margin-top: auto; }
.swatches { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.sw { width: 28px; height: 28px; border-radius: 8px; border: 3px solid #fff; box-shadow: 0 0 0 1px #c9dcef; padding: 0; }
.sw.on { box-shadow: 0 0 0 3px var(--orange); transform: scale(1.1); }
.sw.none { background: #fff; color: var(--muted); font-weight: 700; }
.sw-custom { width: 34px; height: 30px; border: 0; padding: 0; background: none; cursor: pointer; }
.customize { display: flex; gap: 14px; flex-wrap: wrap; }
.cust-left { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cust-cost { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.cust-right { flex: 1; min-width: 300px; }
.opt-row { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { border: 3px solid #c9dcef; background: #fff; border-radius: 10px; padding: 6px 12px; font-weight: 600; font-size: 14px; min-width: 40px; min-height: 34px; }
.opt.on { border-color: var(--orange); background: #fff3dc; }
.opt.neon { min-width: 46px; }
.rim-row { display: flex; gap: 8px; flex-wrap: wrap; }
.rim-opt { text-align: center; }
.rim-pv { border-radius: 50%; border: 3px solid #c9dcef; cursor: pointer; background: #fff; }
.rim-pv.on { border-color: var(--orange); }
.up-row { display: flex; align-items: center; gap: 12px; background: var(--panel2); border-radius: 14px; padding: 8px 12px; margin-bottom: 8px; }
.up-ico { font-size: 32px; }
.up-info { flex: 1; display: flex; flex-direction: column; }
.up-info small { color: var(--muted); }
.pips { display: flex; gap: 4px; margin-top: 4px; }
.pips span { width: 26px; height: 9px; border-radius: 5px; background: #c9d6e3; }
.pips span.on { background: linear-gradient(#ffe36a, #f7a11a); }
.up-buy { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.up-max { font-weight: 700; color: var(--green-d); font-size: 18px; }
.pi-big { font-size: 20px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }

/* carreras */
.race-cars { display: flex; gap: 6px; flex-wrap: wrap; }
.rc { border: 3px solid #c9dcef; background: #fff; border-radius: 12px; padding: 6px 10px; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.rc.on { border-color: var(--orange); background: #fff3dc; }
.opp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 8px; }
.opp-card { display: flex; align-items: center; gap: 8px; background: var(--panel2); border-radius: 14px; padding: 6px 10px; }
.opp-info { flex: 1; font-size: 14px; }
.race-screen { position: fixed; inset: 0; z-index: 80; background: #000; }
.race-screen canvas { position: absolute; inset: 0; }
.race-top { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; }
.race-name { background: #fff; border-radius: 14px; padding: 6px 14px; font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 6px; box-shadow: 0 4px 0 rgba(0,0,0,.3); }
.race-name .dot { width: 14px; height: 14px; border-radius: 50%; }
.race-name.me .dot { background: #3a8ee6; } .race-name.opp .dot { background: #e74c3c; }
.race-vs { font-family: 'Luckiest Guy', sans-serif; color: var(--gold); font-size: 30px; -webkit-text-stroke: 2px var(--navy); }
.race-help { position: absolute; top: 120px; left: 50%; transform: translateX(-50%); background: rgba(255,255,255,.95); padding: 10px 16px; border-radius: 14px; max-width: 520px; text-align: center; font-weight: 600; }
.race-btn { position: absolute; right: 30px; bottom: 30px; width: 170px; height: 170px; border-radius: 50%; border: 6px solid #fff; color: #fff; font-size: 24px; font-weight: 700;
  box-shadow: 0 8px 0 rgba(0,0,0,.35); text-shadow: 0 2px 0 rgba(0,0,0,.35); touch-action: none; }
.race-btn.gas { background: radial-gradient(circle at 40% 35%, #8ff07a, #2fae2a); }
.race-btn.shift { background: radial-gradient(circle at 40% 35%, #ffd27a, #f08a1a); }
.race-btn:active { transform: translateY(5px); box-shadow: 0 3px 0 rgba(0,0,0,.35); }
.race-quit { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; background: var(--red); color: #fff; font-weight: 700; }
.race-result { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: #fff; border-radius: 24px; padding: 20px 26px; text-align: center; width: 420px; max-width: 92vw;
  border: 6px solid #fff; box-shadow: 0 10px 0 var(--blue-d), 0 20px 50px rgba(0,0,0,.4); animation: pop .3s cubic-bezier(.3,1.5,.6,1); }
.rr-title { font-family: 'Luckiest Guy', sans-serif; font-size: 52px; color: var(--green); -webkit-text-stroke: 2px var(--navy); }
.race-result.lose .rr-title { color: var(--red); }
.rr-times { display: flex; justify-content: space-around; margin: 10px 0; }
.rr-times div { display: flex; flex-direction: column; }
.rr-times b { font-size: 24px; }
.rr-shifts { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
.rr-shifts i { font-style: normal; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 8px; color: #fff; }
.q-perfect { background: var(--green); } .q-good { background: #e0b21a; } .q-early { background: var(--orange-d); }
.rr-reward { font-size: 22px; font-weight: 700; display: flex; justify-content: center; align-items: center; gap: 8px; }
.xp-ico { background: var(--green); color: #fff; border-radius: 6px; padding: 0 5px; font-size: 14px; }
.rr-note { color: var(--muted); font-size: 13px; }
.rr-btns { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }

/* viajes */
.trip-row { display: flex; align-items: center; gap: 10px; background: var(--panel2); border-radius: 14px; padding: 8px 12px; margin-bottom: 6px; }
.trip-ico, .dest-ico { font-size: 38px; }
.trip-info { flex: 1; }
.trip-time { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-weight: 700; color: var(--blue-d); }
.live-timer { font-weight: 700; color: var(--blue-d); }

/* car show */
.show { display: flex; gap: 14px; flex-wrap: wrap; }
.show-vote { flex: 2; min-width: 320px; }
.show-side { flex: 1; min-width: 240px; }
.vote-row { display: flex; align-items: center; gap: 8px; justify-content: center; flex-wrap: wrap; }
.vote-card { background: var(--panel2); border-radius: 18px; padding: 8px; cursor: pointer; text-align: center; border: 4px solid transparent; }
.vote-card:hover { border-color: var(--orange); }
.vs { font-family: 'Luckiest Guy', sans-serif; font-size: 36px; color: var(--orange); -webkit-text-stroke: 2px var(--navy); }
.show-top ol { padding-left: 22px; margin: 4px 0; }
.show-top li { margin: 3px 0; }

/* ruleta */
.wheel { display: block; margin: 8px auto 14px; }

/* empleados y vecinos */
.worker-list { display: flex; flex-wrap: wrap; gap: 8px; }
.worker { background: var(--panel2); border-radius: 14px; padding: 8px; width: 130px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.friend-row { display: flex; align-items: center; gap: 10px; background: var(--panel2); border-radius: 14px; padding: 6px 10px; margin-bottom: 6px; }
.friend-row .avatar { width: 40px; height: 40px; font-size: 18px; }
.fr-info { flex: 1; }
.fr-act { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* noticias y ranking */
.news-row { display: flex; gap: 10px; padding: 8px 10px; border-radius: 12px; margin-bottom: 4px; background: var(--panel2); }
.news-row.new { background: #fff6d8; }
.news-row small { display: block; color: var(--muted); font-size: 12px; }
.news-ico { font-size: 24px; }
.lb-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; margin-bottom: 4px; background: var(--panel2); }
.lb-row.me { background: #fff3dc; }
.lb-row .avatar { width: 36px; height: 36px; font-size: 16px; }
.lb-pos { width: 30px; font-weight: 700; font-size: 18px; color: var(--blue-d); text-align: center; }
.lb-val { margin-left: auto; font-weight: 700; }

/* bono diario y nivel */
.daily-days { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.day { background: var(--panel2); border-radius: 14px; padding: 10px; width: 110px; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 3px solid transparent; }
.day.today { border-color: var(--orange); background: #fff3dc; transform: scale(1.06); }
.day.past { opacity: .5; }
.day-ico { font-size: 34px; }
.levelup .modal-head { background: linear-gradient(#ffcf4a, #f08a1a); }
.lvl-star { width: 130px; height: 130px; margin: 0 auto; background: var(--gold); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  display: flex; align-items: center; justify-content: center; font-family: 'Luckiest Guy', sans-serif; font-size: 48px; color: var(--navy); padding-top: 12px; animation: spinin .6s; }
@keyframes spinin { from { transform: rotate(-180deg) scale(.2); } }
.unlock { text-align: left; display: inline-block; }

/* avisos */
#toasts { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: #fff; border-radius: 14px; padding: 9px 16px; font-weight: 600; box-shadow: 0 4px 0 rgba(0,0,0,.2), 0 8px 20px rgba(0,0,0,.2); border-left: 6px solid var(--green); animation: pop .25s; transition: opacity .4s, transform .4s; max-width: 90vw; }
.toast.err { border-left-color: var(--red); }
.toast.out { opacity: 0; transform: translateY(-10px); }
.fly-coin { position: fixed; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff6b0, #ffd23a 40%, #e09a0a); border: 2px solid #c07a00; z-index: 120; pointer-events: none; }

/* carga */
#loading { position: fixed; inset: 0; background: linear-gradient(#3e9be6, #9fd6fb); z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; transition: opacity .4s; color: #fff; font-weight: 700; font-size: 20px; }
#loading.hide { opacity: 0; pointer-events: none; }
.spinner { width: 54px; height: 54px; border: 7px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.load-err { background: #fff; color: var(--red); padding: 14px 20px; border-radius: 14px; }

/* móvil */
@media (max-width: 760px) {
  #hud { height: 58px; gap: 6px; padding: 0 6px; }
  .hud-pinfo { display: none; }
  .pill { min-width: 0; font-size: 15px; padding: 3px 10px 3px 4px; }
  .hud-btns .hb { width: 36px; height: 36px; font-size: 18px; }
  #btn-rank, #btn-sound { display: none !important; }
  .tb { width: 70px; height: 60px; }
  .tb i { font-size: 24px; }
  .tb span { font-size: 10px; }
  #toolbar { justify-content: flex-start; }
  .dealer { flex-direction: column; }
  .dealer-list { width: 100%; max-height: 180px; }
  .race-btn { width: 120px; height: 120px; font-size: 18px; right: 16px; bottom: 16px; }
  .modal-title { font-size: 18px; }
}
