html, body {
    overscroll-behavior: none;
    touch-action: manipulation;
}

:root {
    --bg: #f5f5f5;
    --card: #ffffff;
    --text: #111;
    --text-bright: #111;
    --text-muted: #555;
    --text-dim: #666;
    --text-subtle: #666;
    --text-soft: #444;
    --text-strong: #222;
    --text-button: #222;
    --text-faint: #777;
    --panel: #ffffff;
    --panel-2: #f2f2f2;
    --panel-3: #ededed;
    --panel-4: #e4e4e4;
    --input-bg: #ffffff;
    --border: #d3d3d3;
    --border-strong: #c7c7c7;
    --border-input: #c0c0c0;
    --border-btn: #b7b7b7;
    --seg-bg: #f2f2f2;
    --banner-bg: #e0e0e0;
    --banner-title: #111;
    --banner-sub: #333;
    --danger: #d64b4b;
    --overlay: rgba(0,0,0,0.4);
    --overlay-strong: rgba(0,0,0,0.6);
    --scrollbar: #c7c7c7;
}

:root[data-theme="dark"] {
    --bg: #111;
    --card: #111;
    --text: #eee;
    --text-bright: #fff;
    --text-muted: #aaa;
    --text-dim: #888;
    --text-subtle: #777;
    --text-soft: #bdbdbd;
    --text-strong: #d0d0d0;
    --text-button: #bbb;
    --text-faint: #8c8c8c;
    --panel: #151515;
    --panel-2: #1a1a1a;
    --panel-3: #171717;
    --panel-4: #1e1e1e;
    --input-bg: #222;
    --border: #2a2a2a;
    --border-strong: #333;
    --border-input: #444;
    --border-btn: #555;
    --seg-bg: #111;
    --banner-bg: #8c8c8c;
    --banner-title: #111111;
    --banner-sub: #151515;
    --danger: #ff6b6b;
    --overlay: rgba(0,0,0,0.65);
    --overlay-strong: rgba(0,0,0,0.72);
    --scrollbar: #2a2a2a;
}
body {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    letter-spacing: 0.4px;
    background: var(--bg);
    color: var(--text);
    padding: 0px 20px 40px 20px;
    max-width: 860px;
    margin: 0 auto;
}

body.pwa {
    padding-top: calc(0px + env(safe-area-inset-top));
}

body.profilePage {
    max-width: none;
    padding: 0;
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.profileWrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.profileCard {
    width: min(340px, 92vw);
    height: min(420px, 78vh);
    background: var(--panel);
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    perspective: 1200px;
    overflow: hidden;
    cursor: pointer;
}

.profileCta {
    width: min(340px, 92vw);
    height: 54px;
    border-radius: 12px;
    border: 1px solid var(--border-btn);
    background: var(--panel-2);
    color: var(--text-bright);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.5px;
    margin-bottom: 0;
}

.profileActions {
    position: relative;
    width: min(340px, 92vw);
    height: 54px;
    perspective: 1200px;
}

.profileActions .profileCta {
    position: absolute;
    inset: 0;
    margin: 0;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    transition: transform 420ms ease;
}

.profileActions .actionBack {
    transform: rotateY(180deg);
}

.profileActions.is-flipped .actionFront {
    transform: rotateY(180deg);
    pointer-events: none;
}

.profileActions.is-flipped .actionBack {
    transform: rotateY(0deg);
    pointer-events: auto;
}

.flipInner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 420ms ease;
}

.profileCard.is-flipped .flipInner {
    transform: rotateY(180deg);
}

.profileFace {
    position: absolute;
    inset: 0;
    padding: 26px 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    backface-visibility: hidden;
    background: var(--panel);
}

.profileFace.front {
    justify-content: flex-start;
}

.profileFace.back {
    justify-content: center;
    padding-top: 40px;
    text-align: left;
    transform: rotateY(180deg);
}

.profileTitle {
    font-size: 48px;
    font-weight: 900;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    text-align: left;
}

.profileUser {
    font-size: 24px;
    color: var(--text-bright);
    margin-bottom: 18px;
    margin-top: 12px;
    text-align: left;
}

.profileRow {
    font-size: 14px;
    color: var(--text-muted);
    margin: 8px 0;
    text-align: left;
}

.shareRow {
    margin-top: 40px;
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    align-items: left;
    flex-wrap: wrap;
}

.shareBtn {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-btn);
    border-radius: 10px;
    background: var(--panel-2);
    color: var(--text-bright);
    text-decoration: none;
    padding: 0;
    line-height: 0;
}

.shareBtn:active {
    transform: translateY(1px);
}

.shareIcon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.shareIconFill {
    fill: currentColor;
    stroke: none;
}

.qrTitle {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.qrImage {
    width: 220px;
    height: 220px;
    border-radius: 8px;
    background: transparent;
    display: block;
}

.qrDownload {
    margin-top: 12px;
    margin-bottom: 12px;
    font-size: 12px;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
}

.qrDownload:active {
    transform: translateY(1px);
}

.captureWrap {
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    left: -9999px;
    top: 0;
    background: #000;
}

.captureWrap .profileCard {
    cursor: default;
}

h1 {
    font-size: 48px;
    margin-bottom: 0;
    line-height: 1.05;
}

.tagline {
    color: var(--text-dim);
    font-size: 16px;
    margin-top: 6px;
    margin-bottom: 14px;
}

input, select, button {
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    display: block;
    height: 45px;
    margin: 10px 0;
    min-height: 45px;
    padding: 12px;
    background: var(--input-bg);
    border: 1px solid var(--border-input);
    color: var(--text-bright);
    border-radius: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 16px;
    letter-spacing: 0.4px;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-bright);
    box-shadow: 0 0 0px 1000px var(--input-bg) inset;
    transition: background-color 9999s ease-out 0s;
}

select {
    appearance: none;  /* Para quitar el estilo predeterminado del navegador */
    -webkit-appearance: none; /* Para Safari */
    -moz-appearance: none; /* Para Firefox */
}


input[type="password"] {
    letter-spacing: 2px;
}

.inputEye {
    position: relative;
}

.inputEye input {
    padding-right: 44px;
}

.eyeBtn {
    position: absolute;
    right: 0px;
    top: 28%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 41px;
    border-radius: 10px;
    border-top-left-radius: 0px;
    border-bottom-left-radius: 0px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    color: var(--text-button);
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

.eyeIcon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.eyeBtn .eyeOff {
    display: none;
}

.eyeBtn.is-visible .eyeOn {
    display: none;
}

.eyeBtn.is-visible .eyeOff {
    display: block;
}

input:focus,
input:focus-visible,
select:focus,
select:focus-visible,
textarea:focus,
textarea:focus-visible,
button:focus,
button:focus-visible {
    outline: none;
    box-shadow: none;
}

button {
  cursor: pointer;
  border: 1px solid var(--border-btn);
}

.shareRow .shareBtn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.hitBtn {
  height: 90px;
  font-size: 18px;
}

.hitBtnIcon {
  width: 24px;
  height: 24px;
  display: inline-block;
}

.hitBtn.hitSuccess {
  background: #1f7a3e;
  border-color: #1f7a3e;
  color: #fff;
}

button:active {
    transform: translateY(1px);
}

.eyeBtn:active {
    transform: none;
}

hr {
    margin: 22px 0;
    border: 0;
    border-top: 1px solid var(--border-strong);
}

.feedback {
    min-height: 22px;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 14px;
    opacity: 0;
    transition: opacity 180ms ease;
}
.feedback.show { opacity: 1; }
.feedback.ok { color: var(--text-soft); }
.feedback.err { color: var(--danger); }

.dashTop {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}
.dashTop h2 { font-size: 1.2em; margin: 0; }

.exitBtn {
    width: auto;
    padding: 10px 14px;
    border-radius: 10px;
}

.publicHead{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
}
.publicTitle {
    color: var(--text-subtle);
    font-size: 13px;
    margin-bottom: 8px;
    text-transform: lowercase;
}

.tinyBtn{
    width:auto;
    min-width: 120px;
    margin:0;
    padding:8px 12px;
    font-size:13px;
    border-radius:10px;
    background:var(--panel-2);
    border:1px solid var(--border);
    color:var(--text-button);
}

#publicWrap { margin: 10px 0 18px; }

.ticker {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
}
.ticker::-webkit-scrollbar { height: 8px; }
.ticker::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

.tickerCard {
    flex: 0 0 auto;
    min-width: 220px;
    background: var(--panel-3);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    scroll-snap-align: start;
}
.tickerWhen {
    color: var(--text-soft);
    font-size: 12px;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tickerWhen a {
    color: var(--text-soft);
    text-decoration: none;
}

.tickerMove {
    color: var(--text-strong);
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tickerNums {
    color: var(--text-faint);
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-line;
}


.sectionTitle {
    margin-top: 10px;
    margin-bottom: 6px;
    color: var(--text-subtle);
    font-size: 13px;
    white-space: nowrap;
}

.sectionRow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 18px;
    margin-bottom: 6px;
}

.sectionRow .sectionTitle {
    margin: 0;
}

.profileWrap {
    margin-bottom: 6px;
}

.profileMeta {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 8px;
}

.profileSubTitle {
    margin: 6px 0;
    color: var(--text-subtle);
    font-size: 12px;
    text-transform: lowercase;
}

.stats {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    white-space: pre-line;
}

.byActionHead{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:5px;
    margin-top:18px;
    margin-bottom:6px;
    padding-top: 0px;
}

.byActionHead .sectionTitle {
    min-width: 60px;
}

.byActionControls{
    display:flex;
    gap:8px;
    align-items:center;
    width:100%;
}

.segSwitch {
    margin-bottom: 8px;
}

.segSwitchSm{
    height: 30px;
    border-radius: 10px;
}

.segSwitchSm .segBtn{
    font-size: 13px;
    padding: 0 10px;
}

.sortSelect{
    flex:1;
    min-width: 170px;
    width:auto;
    padding:10px 12px;
    font-size:13px;
    border-radius:10px;
    background:var(--panel-2);
    border:1px solid var(--border);
    color:var(--text-button);
    text-align: center;
}

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

.actionCard {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
}

.actionName {
    color: var(--text-strong);
    font-size: 14px;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.actionName span {
    float: right;
    font-size: 13px;
    color: var(--text-faint);
}
  .actionNums {
    color: var(--text-faint);
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-line;
}

.dashMsg {
    min-height: 22px;
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 180ms ease;
}
.dashMsg.show { opacity: 1; }
.dashMsg.ok { color: var(--text-soft); }
.dashMsg.err { color: var(--danger); }

.installBanner {
    margin: 14px 0 10px;
    padding: 12px;
    border: 1px solid var(--border);
    background: var(--banner-bg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.installTitle {
    color: var(--banner-title);
    font-size: 14px;
    margin-bottom: 2px;
}

.installSub {
    color: var(--banner-sub);
    font-size: 13px;
    line-height: 1.35;
}

.installActions {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}

.installActions .tinyBtn {
    margin: 0;
}

.publicIntro {
    margin-top: 14px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
}

.publicIntroTitle {
    color: var(--text-subtle);
    font-size: 13px;
    margin-bottom: 6px;
    text-transform: lowercase;
}

.publicIntroText {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.55;
}

.dashActions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.optBtn {
    width: auto;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--panel-2);
    border: 1px solid var(--border-btn);
    color: var(--text-button);
    font-size: 18px;
    line-height: 1;
}

.optBtn:hover,
.optBtn:focus,
.optBtn:focus-visible {
    border:1px solid var(--border-btn);
}

.optBtn:active {
    transform: translateY(1px);
}

.dashActions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.updateBanner {
    margin: 14px auto;
    max-width: 520px;
    background: var(--banner-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.updateText { flex: 1; }

.updateTitle {
    color: var(--banner-title);
    font-size: 13px;
    margin-bottom: 4px;
    text-transform: lowercase;
}

.updateSub {
    color: var(--banner-sub);
    font-size: 13px;
    line-height: 1.4;
}

.updateActions {
    display: flex;
    gap: 8px;
}

.updateBlocker {
    position: fixed;
    inset: 0;
    background: var(--overlay-strong);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.updateBlockerBox {
    width: min(520px, 100%);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
}

.modalOverlay{
    position: fixed;
    inset: 0;
    background: var(--overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    z-index: 9999;
}

.modalCard{
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 80px);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    overflow-y: auto;
}

.modalHead{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
}

.modalTitle{
    color:var(--text-strong);
    font-size:18px;
}

.modalTitle.profileLink{
    cursor:pointer;
}

.versionInfo {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}

.versionInfoText {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.versionInfoAction {
    display: flex;
    align-items: center;
}

.versionChanges {
    margin-top: 8px;
    padding: 10px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}

.versionChangeTitle {
    color: var(--text-soft);
    font-size: 12px;
    text-transform: lowercase;
}

.versionChangeToggle {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.versionChangeContent {
    margin-top: 6px;
}

.versionChangeContent[hidden] {
    display: none;
}

.versionChangeList {
    margin: 0;
    padding-left: 16px;
}

.versionChangeList li {
    margin: 2px 0;
}

.versionChangeBlock + .versionChangeBlock {
    margin-top: 10px;
}

.ptrIndicator {
    position: fixed;
    top: -40px;
    left: 0;
    right: 0;
    height: 40px;
    background: var(--card);
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: top 0.2s ease;
    z-index: 10000;
}

.ptrIndicator.show {
    top: 0;
}

.segSwitch {
    width: 100%;
    display: flex;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    height: 44px;
    margin-top: 10px;
    background: var(--seg-bg);
}

.segBtn {
    flex: 1;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 0px;
    text-transform: lowercase;
}

.segBtn.active {
    background: var(--panel-4);
    border: 1px solid var(--border-input);
    color: var(--text-bright);
}

.cupo {
    cursor: pointer;
}

@media (max-width: 380px) {
    .tickerCard { min-width: 210px; }
}

/* mobile: stack "by move" + filter + sort in 3 lines */
@media (max-width: 520px){

    h1 {
        font-size: 40px;
        line-height: 35px;
    }
    p.tagline {
        font-size: 12px;
        line-height: 20px;
        margin-top: 0px;
    }

    .byActionHead{
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 8px;
    }

    .byActionControls{
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 8px;
    }

    
    .byActionControls .segSwitch{
        width: 100%;
        margin-bottom: 0;
    }

    .byActionControls .sortSelect{
        width: 100%;
        min-width: 0;
    }

    .byActionHead .sectionTitle{
        min-width: 0;
    }
}
