/* Community (community.go): Add to my clubs, the Trophy cabinet, Patches, activity, Garage. */

.cm-follow { gap: 8px; }
.cm-follow-ico { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid currentColor; font-size: 12px; line-height: 1; }
.cm-follow[aria-pressed="true"] .cm-follow-ico { background: currentColor; }
.cm-follow[aria-pressed="true"] .cm-follow-ico { color: inherit; }
.cm-follow-n { font-size: .8rem; opacity: .75; padding-left: 6px; border-left: 1px solid currentColor; }
.btn.cm-follow[aria-pressed="true"] { border-color: var(--brand); color: var(--brand); }

/* Trophy cabinet */
.cm-cabinet { overflow: hidden; }
.cm-shelf { list-style: none; margin: 0; padding: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 12px;
  background: linear-gradient(180deg, transparent 0 calc(100% - 10px), var(--surface-3) calc(100% - 10px)); }
.cm-trophy > a, .cm-trophy > .cm-cup { color: inherit; text-decoration: none; }
.cm-trophy { min-width: 0; }
.cm-trophy > a, .cm-trophy:not(:has(> a)) { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); min-height: 64px; }
.cm-trophy > a:hover { border-color: var(--tc); }
.cm-cup { position: relative; flex: none; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--tc) 30%, transparent), transparent 70%); }
.cm-cup svg { width: 38px; height: 38px; }
.cm-cup-body { fill: var(--tc); }
.cm-cup-handle { stroke: var(--tc); stroke-width: 3; }
.cm-cup b { position: absolute; right: -4px; bottom: -4px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: var(--bg); border: 1.5px solid var(--tc);
  color: var(--text); font-size: 11px; display: grid; place-items: center; }
.cm-trophy-text { display: flex; flex-direction: column; min-width: 0; }
.cm-trophy-text strong { font-size: .95rem; }
.cm-trophy-text span { font-size: .8rem; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cm-gold { --tc: var(--gold, #f5c84b); }
.cm-silver { --tc: var(--silver, #c9d3df); }
.cm-bronze { --tc: var(--bronze, #d98c4a); }
.cm-purple { --tc: var(--pb, #b88cff); }
.cm-brand { --tc: var(--brand); }
.cm-accent { --tc: var(--accent); }

/* Patches: embroidered discs with a stitched edge */
.cm-patches-head { padding: 4px 16px 0; }
.cm-patches-head .h3 { margin: 8px 0 0; }
.cm-patches { list-style: none; margin: 0; padding: 12px 14px 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 12px; }
.cm-patch { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; min-width: 0; }
.cm-patch-disc { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--tc) 55%, #fff 10%), var(--tc) 60%, color-mix(in srgb, var(--tc) 70%, #000));
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px color-mix(in srgb, var(--tc) 70%, #000), 0 6px 14px -6px rgba(0, 0, 0, .7); }
.cm-patch-disc::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .55); }
.cm-patch-disc span { font: 900 1rem/1 var(--font-display); color: #0b0d10; text-shadow: 0 1px 0 rgba(255, 255, 255, .35); position: relative; }
.cm-patch-label { font-size: .78rem; font-weight: 700; }
.cm-patch-hint { font-size: .7rem; color: var(--text-3); width: 100%; }
.cm-patch.is-locked .cm-patch-disc { filter: grayscale(1); opacity: .35; }
.cm-bar { display: block; height: 4px; border-radius: 2px; background: var(--surface-3); margin: 3px auto; max-width: 70px; overflow: hidden; }
.cm-bar i { display: block; height: 100%; background: var(--tc); }

/* Activity */
.cm-activity { border-top: 1px solid var(--line); padding: 14px 16px 16px; }
.cm-activity-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; margin-bottom: 12px; }
.cm-activity-stats div { display: flex; flex-direction: column; }
.cm-activity-stats strong { font-size: 1.4rem; }
.cm-activity-stats span { font-size: .75rem; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; }
.cm-heat-wrap { width: 100%; overflow: hidden; }
.cm-heat { width: 100%; height: auto; display: block; }
.cm-heat-m { fill: var(--text-3); font: 9px var(--font-body); }
.cm-h0 { fill: var(--surface-3); }
.cm-hr1 { fill: color-mix(in srgb, var(--brand) 45%, var(--surface-3)); }
.cm-hr2, .cm-key.cm-hr2 { fill: color-mix(in srgb, var(--brand) 75%, var(--surface-3)); background: color-mix(in srgb, var(--brand) 75%, var(--surface-3)); }
.cm-hr3 { fill: var(--brand); }
.cm-hs, .cm-key.cm-hs { fill: var(--accent); background: var(--accent); }
.cm-hb, .cm-key.cm-hb { fill: var(--gold, #f5c84b); background: var(--gold, #f5c84b); }
.cm-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 8px 0 0; }
.cm-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: -4px; }

/* Garage on results and ratings */
.cm-quad { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font-size: .75rem; color: var(--text-2); text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-quad:hover { color: var(--brand); border-color: var(--brand); }
.cm-rate { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; }
.cm-stars { color: var(--gold, #f5c84b); letter-spacing: 1px; }
.cm-rate-form { display: inline-flex; }
.cm-star { width: 44px; height: 44px; border: 0; background: none; color: var(--text-3); font-size: 22px; cursor: pointer; padding: 0; margin: -6px -6px; }
.cm-star.is-on, .cm-rate-form:hover .cm-star { color: var(--gold, #f5c84b); }
.cm-rate-form .cm-star:hover ~ .cm-star { color: var(--text-3); }
@media (min-width: 700px) { .cm-star { width: 32px; height: 32px; margin: 0 -3px; } }

.cm-board { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cm-board-row { display: grid; grid-template-columns: 32px 56px minmax(0, 1fr); gap: 4px 12px; align-items: center; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.cm-board-row:nth-child(1) { border-color: var(--gold, #f5c84b); }
.cm-board-pos { font-size: 1.2rem; font-weight: 800; text-align: center; color: var(--text-2); }
.cm-board-photo { width: 56px; height: 56px; border-radius: var(--r-sm); object-fit: cover; background: var(--surface-2); display: grid; place-items: center; }
.cm-board-photo svg { width: 36px; }
.cm-board-main { display: flex; flex-direction: column; min-width: 0; }
.cm-board-main a { color: inherit; }
.cm-board-score { grid-column: 3; display: flex; gap: 8px; align-items: baseline; }
@media (min-width: 700px) { .cm-board-row { grid-template-columns: 40px 64px minmax(0, 1fr) auto; } .cm-board-score { grid-column: auto; flex-direction: column; align-items: flex-end; gap: 0; } }

/* Series */
.cm-series-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 760px) { .cm-series-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cm-series-card { display: flex; gap: 14px; padding: 16px; align-items: flex-start; min-width: 0; }
.cm-series-flag { font-size: 28px; line-height: 1; }
.cm-series-body { display: flex; flex-direction: column; min-width: 0; }
.cm-series-body .row { flex-wrap: wrap; }
.cm-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.cm-tabs a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text-2); text-decoration: none; white-space: nowrap; }
.cm-tabs a[aria-current="page"] { background: var(--brand); color: var(--brand-ink); border-color: transparent; font-weight: 700; }
.cm-standings { list-style: none; margin: 0; padding: 0; }
.cm-standing { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; grid-template-areas: "pos name pts" "pos meta pts"; gap: 0 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); }
.cm-standing .pos { grid-area: pos; }
.cm-standing-name { grid-area: name; color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-standing-meta { grid-area: meta; }
.cm-standing-pts { grid-area: pts; font-size: 1.2rem; text-align: right; }
.cm-standing.is-top { background: linear-gradient(90deg, color-mix(in srgb, var(--gold, #f5c84b) 8%, transparent), transparent 60%); }

/* Watch party */
.wp-layout { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 1000px) { .wp-layout { grid-template-columns: minmax(0, 1fr) 340px; } }
.wp-stage, .wp-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.wp-player { width: 100%; }
.wp-noplayer .empty img { max-width: 200px; height: auto; }
.wp-react { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.wp-react-btn { position: relative; min-height: 52px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; overflow: visible; touch-action: manipulation; }
.wp-react-btn:active { transform: scale(.94); }
.wp-react-btn.is-cool { opacity: .5; }
.wp-emoji { font-size: 22px; line-height: 1; }
.wp-count { font-size: .85rem; color: var(--text-2); }
.wp-burst { position: absolute; bottom: 70%; font-size: 26px; pointer-events: none; animation: wp-up 1.1s ease-out forwards; }
@keyframes wp-up { from { transform: translateY(0) scale(.8); opacity: 1; } to { transform: translateY(-90px) scale(1.4); opacity: 0; } }
@media (max-width: 420px) { .wp-react-btn { flex-direction: column; gap: 2px; } .wp-count { font-size: .72rem; } }
.wp-hl { list-style: none; margin: 0; padding: 0; }
.wp-hl li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); }
.wp-hl-title { display: flex; flex-direction: column; min-width: 0; color: inherit; text-decoration: none; }
.wp-buy { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: end; }
.wp-buy .btn, .wp-buy .select { min-height: 44px; }
.wp-ticket-wrap { display: grid; place-items: center; padding: 24px 20px 48px; }
.wp-ticket { width: min(420px, 100%); text-align: center; padding: 24px 20px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line-strong);
  box-shadow: 0 30px 60px -30px var(--brand); position: relative; }
.wp-ticket::before, .wp-ticket::after { content: ""; position: absolute; top: 58%; width: 24px; height: 24px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line-strong); }
.wp-ticket::before { left: -13px; } .wp-ticket::after { right: -13px; }
.wp-qr { margin: 18px auto 8px; width: min(260px, 72vw); background: #fff; padding: 12px; border-radius: 12px; }
.wp-qr svg { width: 100%; height: auto; display: block; }
.wp-code { font-size: 1.3rem; letter-spacing: .12em; margin: 6px 0; }
.wp-admit { margin: 0 0 4px; }

/* Daily sim run and Sim duels */
.sim-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 900px) { .sim-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.sim-grid > * { min-width: 0; }
.sim-track { overflow: hidden; }
.sim-track-art { position: relative; height: 140px; color: var(--accent); background: radial-gradient(circle at 70% 30%, color-mix(in srgb, var(--accent) 25%, transparent), transparent 60%),
  repeating-linear-gradient(90deg, transparent 0 23px, var(--line) 23px 24px), repeating-linear-gradient(0deg, transparent 0 23px, var(--line) 23px 24px), var(--surface-2); }
.sim-track-art svg { position: absolute; inset: 20px 30px; width: calc(100% - 60px); height: calc(100% - 40px); }
.sim-track-art .osd-label { position: absolute; top: 12px; font: 700 11px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.sim-track-art .tl { left: 14px; } .sim-track-art .tr { right: 14px; }
.sim-form { display: grid; grid-template-columns: 1fr; gap: 10px; }
.sim-form .btn, .sim-form .input { min-height: 44px; }
@media (min-width: 560px) { .sim-form { grid-template-columns: 1fr 1fr; } .sim-form > .btn, .sim-form > .row { grid-column: 1 / -1; } }
.sim-streak { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sim-streak div { display: flex; flex-direction: column; }
.sim-streak strong { font-size: 1.6rem; }
.sim-streak span { font-size: .75rem; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; }
.sim-flag { display: inline; }
.link-btn { background: none; border: 0; padding: 6px 0; min-height: 32px; color: var(--text-3); font: inherit; cursor: pointer; }
.link-btn:hover { color: var(--danger); }
.sim-duel-times { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.sim-duel-times > span { display: flex; flex-direction: column; padding: 10px; border-radius: var(--r-md); background: var(--surface-2); }
.sim-duel-times strong { font-size: 1.3rem; }
.sim-won { border-left: 3px solid var(--brand); } .sim-lost { border-left: 3px solid var(--accent); } .sim-open { border-left: 3px solid var(--gold, #f5c84b); }
.sim-track-row { display: grid; grid-template-columns: 1fr; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
@media (min-width: 900px) { .sim-track-row { grid-template-columns: 2fr 1fr 1fr 70px 70px auto auto; align-items: center; } }
