:root {
    --bg-top: #140000;
    --bg-bottom: #FCF7F7;
    --phone-edge: rgba(255, 255, 255, 0.08);
    --phone-inner: #FCF7F7;
    --card: rgba(255, 255, 255, 0.94);
    --card-strong: #ffffff;
    --ink: #262626;
    --muted: #7a8085;
    --line: rgba(186, 191, 194, 0.40);
    --brand: #E5291C;
    --brand-strong: #BA0017;
    --brand-soft: rgba(229, 41, 28, 0.12);
    --warm: #E5291C;
    --warm-soft: #E5DFDE;
    --cool-soft: #BABFC2;
    --success-soft: #dff5ec;
    --danger-soft: #f8dddd;
    --shadow-lg: 0 26px 80px rgba(0, 0, 0, 0.22);
    --shadow-md: 0 16px 34px rgba(0, 0, 0, 0.10);
    --radius-xl: 30px;
    --radius-lg: 22px;
    --radius-md: 18px;
    --radius-sm: 14px;
}

* {
    box-sizing: border-box;
}

.rotate-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #140000;
    color: #ffffff;
    align-items: center;
    justify-content: center;
}

.rotate-overlay__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
    padding: 32px;
}

.rotate-overlay__content p {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

@media (orientation: landscape) and (hover: none) and (pointer: coarse) {
    .rotate-overlay {
        display: flex;
    }
}

[hidden] {
    display: none !important;
}

html,
body {
    width: 100%;
    height: 100%;
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html {
    height: -webkit-fill-available;
    background: #262626;
}

body {
    margin: 0;
    font-family: Arial, "Helvetica Neue", sans-serif;
    color: var(--ink);
    background:
        linear-gradient(180deg, var(--bg-top) 0%, #262626 20%, var(--bg-bottom) 100%);
    overflow: hidden;
    background-color: #262626;
    min-height: -webkit-fill-available;
}

button,
input,
select,
textarea {
    font: inherit;
}

li {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.app-shell {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    padding: 0;
    overflow: hidden;
    background: #262626;
    min-height: -webkit-fill-available;
}

.app-phone {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    background: var(--phone-inner);
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    background-color: #ffffff;
    min-height: -webkit-fill-available;
}

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 14px;
    background: linear-gradient(180deg, #140000, #262626);
}

.topbar-slogan {
    flex: 1;
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255, 255, 255);
    font-style: italic;
    line-height: 1.3;
    min-width: 0;
    text-align: right;
}

.topbar-slogan--right {
    text-align: left;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    flex-shrink: 0;
}

.brand-lockup strong {
    display: block;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.brand-lockup__logo {
    width: 120px;
    object-fit: contain;
    flex-shrink: 0;
}

.icon-button {
    min-height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.app-main {
    background: transparent;
    overflow: hidden;
    display: block;
    min-height: 0;
    position: relative;
}

.ptr-indicator {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-48px);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #E5291C;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0,0,0,.22);
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0;
    z-index: 100;
    pointer-events: none;
}

.ptr-indicator svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
    transition: transform 0.2s ease;
}

.ptr-indicator.ptr--pulling {
    opacity: 1;
}

.ptr-indicator.ptr--refreshing svg {
    animation: ptr-spin 0.7s linear infinite;
}

@keyframes ptr-spin {
    to { transform: rotate(360deg); }
}

.screen {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 16px calc(112px + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.screen--guest {
    display: grid;
    align-content: start;
    padding-top: 18px;
    padding-bottom: 24px;
}

.screen--app {
    display: block;
}

.app-view {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.hero-card,
.card,
.summary-card {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.hero-card {
    padding: 22px;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.10), transparent 24%),
        linear-gradient(145deg, #140000, #262626);
    color: #ffffff;
}

.hero-card h1,
.hero-card h2 {
    margin: 10px 0 8px;
    font-family: Arial, "Helvetica Neue", sans-serif;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 0.98;
    text-transform: uppercase;
}

.hero-card h1 {
    font-size: clamp(2.25rem, 9vw, 3.4rem);
}

.hero-card h2 {
    font-size: clamp(1.8rem, 8vw, 2.8rem);
}

.hero-card p {
    margin: 0;
    color: #ffffff;
    font-weight: 700;
    line-height: 1.6;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
}

.hero-card--logged {
    padding-bottom: 18px;
    background:
        linear-gradient(to right, #140000 30%, transparent 62%),
        url('../images/01_Jogador_Inicio.png') bottom right / auto 80% no-repeat,
        url('../images/01_Inicio_Desktop.png') top right / auto 100% no-repeat,
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.10), transparent 24%),
        linear-gradient(145deg, #140000, #262626);
}

.hero-card--login {
    min-height: 200px;
    background:
        linear-gradient(to right, #BA0017 30%, transparent 62%),
        url('../images/02_BG_Palpites_Desktop.png') top right / auto 100% no-repeat,
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.10), transparent 24%),
        linear-gradient(145deg, #BA0017, #E5291C);
}

.hero-card--login p::before {
    content: '• ';
}

.login-shell {
    width: min(100%, 400px);
    margin: 0 auto;
    display: grid;
    gap: 16px;
}

.login-title {
    margin: 0 0 4px;
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--ink);
}

.hero-card__chips {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-top: 16px;
}

.hero-card__chips .chip {
    border-radius: 4px;
}

.card-chip-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.card {
    background: var(--card);
    border: 1px solid rgba(28, 37, 41, 0.07);
    padding: 18px;
    min-width: 0;
}

.card--match {
    background: var(--card-strong);
}

.card__header span,
.field span {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
}

.summary-card small {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
}

.card__header strong,
.summary-card strong,
.stack-row strong {
    display: block;
    margin-top: 6px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.match-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.summary-card {
    background: #E5DFDE;
    border: 1px solid rgba(28, 37, 41, 0.06);
    padding: 16px 14px;
    text-align: center;
}

.summary-card strong {
    font-size: 4rem;
    font-weight: 900;
    margin-top: 0;
    margin-bottom: 8px;
    line-height: 1;
    letter-spacing: -0.03em;
    display: block;
}

.summary-card span {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.45;
}

.summary-tile {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(28, 37, 41, 0.06);
    border-radius: 16px;
    padding: 14px 12px;
}

.summary-tile small {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
}

.summary-tile strong {
    display: block;
    margin-top: 8px;
    font-size: 1.15rem;
}

.summary-tile span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.summary-tile--accent {
    background: rgba(15, 114, 105, 0.10);
    border-color: rgba(15, 114, 105, 0.14);
}

.summary-tile--muted {
    background: rgba(28, 37, 41, 0.05);
    border-color: rgba(28, 37, 41, 0.08);
}

.form-stack {
    display: grid;
    gap: 10px;
    margin-top: 14px;
    min-width: 0;
}

.form-stack--compact {
    gap: 8px;
}

.field {
    display: grid;
    gap: 7px;
}

.field input,
.field select {
    width: 100%;
    min-height: 50px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #ffffff;
    padding: 12px 14px;
    color: var(--ink);
    outline: none;
}

.field input:focus,
.field select:focus {
    border-color: rgba(229, 41, 28, 0.40);
    box-shadow: 0 0 0 4px rgba(229, 41, 28, 0.08);
}

.field--score input {
    text-align: center;
    font-weight: 800;
    font-size: 1.15rem;
}

.checkbox-field {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    color: var(--muted);
    font-size: 0.92rem;
}

.button {
    min-height: 50px;
    padding: 0 16px;
    border-radius: 16px;
    font-weight: 700;
}

.button--primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    color: #fff;
}

.button--soft {
    background: #edf0eb;
    color: var(--ink);
}

.home-account-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}

.button--change-password,
.button--logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.85rem;
}

.feedback {
    min-height: 44px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #f3ece2;
    color: var(--muted);
    line-height: 1.5;
}

.feedback.is-success {
    background: var(--success-soft);
    color: var(--brand-strong);
}

.feedback.is-error {
    background: var(--danger-soft);
    color: #8a3232;
}

.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.chip--soft {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.chip--warm {
    background: #E5291C;
    color: #fff;
}

.chip--cool {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.chip--success {
    background: var(--success-soft);
    color: var(--brand-strong);
}

.match-list,
.league-bets-list,
.stack-list {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.special-bet-grid {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.match-meta {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.9rem;
}

.match-title {
    display: block;
    text-align: center;
}

.match-bet-panel {
    margin-top: 14px;
}

.hero-card--bets {
    min-height: 200px;
    background:
        linear-gradient(to right, #BA0017 30%, transparent 62%),
        url('../images/02_Bola_Palpites.png') bottom right / auto 80% no-repeat,
        url('../images/02_BG_Palpites_Desktop.png') top right / auto 100% no-repeat,
        linear-gradient(145deg, #BA0017, #E5291C);
}

.feedback--hero {
    background: transparent !important;
    color: #ffffff !important;
    border: none !important;
    padding-left: 0;
    padding-right: 0;
    font-size: 0.72rem;
    min-height: 0;
}

.bets-hint {
    margin: -8px 0 0;
    font-size: 0.72rem;
    color: var(--muted);
    text-align: center;
}

.bet-match-card {
    padding: 0;
    overflow: hidden;
}

.bet-match-card__top {
    padding: 16px 18px 14px;
    border-bottom: 1px solid rgba(28, 37, 41, 0.06);
    background: linear-gradient(180deg, rgba(213, 43, 30, 0.2), rgba(255, 255, 255, 0.72));
    text-align: center;
}

.bet-match-card__stage,
.bet-match-card__venue {
    color: var(--muted);
    font-size: 0.84rem;
}

.bet-match-card__stage {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--brand);
}

.bet-match-card__venue {
    margin-top: 6px;
}

.team-inline {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    vertical-align: middle;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
}

.team-flag {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 8px;
    background: transparent;
    border: none;
    flex: 0 0 auto;
    box-shadow: none;
    padding: 0;
}

.score-inline {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.field--score span {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.team-inline--bet {
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.team-inline--bet-card {
    gap: 12px;
    align-items: center;
}

.team-inline--bet .team-flag {
    width: 88px;
    height: 62px;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

.team-inline--bet-card strong,
.team-inline--bet-card span {
    margin-top: 0;
    font-size: 1rem;
    line-height: 1.25;
    color: var(--ink);
    text-align: center;
    width: 100%;
}

.bet-entry-form {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.bet-entry-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.bet-entry-layout--summary {
    padding: 18px;
}

.bet-entry-team {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.bet-entry-team__label {
    display: block;
    min-width: 0;
}

.bet-entry-score-input,
.bet-entry-score-value {
    min-height: 52px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #ffffff;
    text-align: center;
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--brand);
}

.bet-entry-score-input {
    width: 100%;
    padding: 10px 12px;
    outline: none;
}

.bet-entry-score-input:focus {
    border-color: rgba(229, 41, 28, 0.40);
    box-shadow: 0 0 0 4px rgba(229, 41, 28, 0.08);
}

.bet-entry-score-value {
    display: grid;
    place-items: center;
}

.bet-entry-center {
    display: grid;
    gap: 10px;
    justify-items: center;
    align-content: center;
    text-align: center;
    min-width: 0;
    padding-top: 6px;
}

.bet-entry-center__official {
    color: var(--brand);
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
}

.bet-entry-center__separator {
    color: var(--ink);
    font-size: 1.65rem;
    line-height: 1;
    margin-top: 12px;
}

.bet-entry-center__meta {
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.35;
}

.bet-entry-points {
    color: var(--brand);
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1;
}

.bet-entry-actions {
    display: grid;
    gap: 10px;
}

.stack-row,
.ranking-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.55);
}

.stack-row > *,
.ranking-item > *,
.card__header > * {
    min-width: 0;
}

.stack-row--own {
    background: rgba(229, 41, 28, 0.06);
    border-color: rgba(229, 41, 28, 0.18);
}

.stack-row--meta {
    background: rgba(18, 52, 60, 0.06);
}

.invite-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.invite-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s;
}

.invite-action-btn--accept {
    background: var(--success-soft);
    color: #1a7a4a;
}

.invite-action-btn--accept:active {
    background: #b8edce;
}

.invite-action-btn--decline {
    background: var(--danger-soft);
    color: var(--brand-strong);
}

.invite-action-btn--decline:active {
    background: #f0b8b8;
}

.stack-row__meta {
    display: grid;
    gap: 8px;
    justify-items: end;
}

.stack-row__points {
    font-size: 0.88rem;
    color: var(--brand-strong);
}

.stack-row__result-summary {
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.35;
}

.stack-row span,
.ranking-item span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.84rem;
}

.card__header strong,
.card__header span,
.stack-row strong,
.stack-row span,
.ranking-item strong,
.ranking-item span,
.feedback,
.stack-row a {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.ranking-list {
    display: grid;
    gap: 8px;
}

.ranking-item {
    grid-template-columns: 48px minmax(0, 1fr) 116px;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(61, 34, 31, 0.08);
}

.ranking-item--current {
    background: rgba(229, 41, 28, 0.08);
    border-color: rgba(229, 41, 28, 0.24);
    box-shadow: inset 0 0 0 1px rgba(229, 41, 28, 0.10);
}

.ranking-item__place {
    display: grid;
    gap: 4px;
    justify-items: center;
    align-items: center;
    color: var(--muted);
    font-weight: 700;
    font-size: 0.8rem;
}

.ranking-item__place-number {
    display: block;
    margin-top: 0;
    font-size: 1rem;
    color: var(--ink);
    white-space: nowrap;
}

.ranking-item__place-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.ranking-item__identity {
    display: block;
    align-items: center;
    min-width: 0;
}

.ranking-item__content {
    min-width: 0;
}

.ranking-item__name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.ranking-item__name {
    display: block;
    margin-top: 0;
    font-weight: 700;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-item__meta {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.8rem;
}

.ranking-item__score {
    display: grid;
    gap: 0;
    justify-items: end;
    width: 116px;
    align-content: center;
}

.ranking-item__points {
    display: block;
    margin-top: 0;
    font-size: 0.96rem;
    color: var(--brand-strong);
    white-space: nowrap;
}

.ranking-item__medal {
    display: inline-block;
    margin-top: 0;
    font-size: 1.6rem;
    line-height: 1;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.ranking-item__medal--gold {
    color: #d6a20f;
}

.ranking-item__medal--silver {
    color: #aeb6c2;
}

.ranking-item__medal--bronze {
    color: #c57a32;
}

.ranking-item__you {
    display: inline-block;
    margin-top: 0;
    color: #d6a20f;
    font-size: 0.95rem;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
}

.ranking-item__meta--info {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 0.8rem;
    font-family: inherit;
    line-height: 1.3;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}

.ranking-item__meta--info:active {
    opacity: 0.65;
}

.tb-info-icon {
    font-size: 0.72rem;
    opacity: 0.55;
    flex-shrink: 0;
}

/* Error sheet (modal de erro crítico) */
.error-sheet {
    position: fixed;
    inset: 0;
    z-index: 9100;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    padding: 24px;
}

.error-sheet--open {
    pointer-events: auto;
    opacity: 1;
}

.error-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.52);
    cursor: pointer;
}

.error-sheet__panel {
    position: relative;
    width: 100%;
    max-width: 360px;
    background: var(--card-strong);
    border-radius: var(--radius-lg);
    padding: 32px 24px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.92);
    transition: transform 0.24s cubic-bezier(0.32, 0.72, 0, 1);
}

.error-sheet--open .error-sheet__panel {
    transform: scale(1);
}

.error-sheet__icon {
    font-size: 2.4rem;
    color: var(--brand);
    line-height: 1;
    margin-bottom: 4px;
}

.error-sheet__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
}

.error-sheet__message {
    margin: 0;
    font-size: 0.92rem;
    color: var(--muted);
    line-height: 1.5;
}

.error-sheet__btn {
    margin-top: 12px;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--brand);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.01em;
}

.error-sheet__btn:active {
    background: var(--brand-strong);
}

/* Tiebreak bottom-sheet */
.tiebreak-sheet {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: flex-end;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tiebreak-sheet--open {
    pointer-events: auto;
    opacity: 1;
}

.tiebreak-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.38);
    cursor: pointer;
}

.tiebreak-sheet__panel {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background: var(--card-strong);
    border-radius: 24px 24px 0 0;
    padding: 20px 20px 28px;
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.16);
}

.tiebreak-sheet--open .tiebreak-sheet__panel {
    transform: translateY(0);
}

.tiebreak-sheet__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.tiebreak-sheet__label {
    margin: 0 0 2px;
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 400;
}

.tiebreak-sheet__name {
    display: block;
    font-size: 1rem;
    color: var(--ink);
    font-weight: 700;
}

.tiebreak-sheet__close {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    color: var(--ink);
    cursor: pointer;
    font-size: 0.9rem;
    -webkit-tap-highlight-color: transparent;
}

.tiebreak-sheet__body {
    display: grid;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 14px;
}

.tiebreak-row {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.6);
    border-bottom: 1px solid var(--line);
}

.tiebreak-row:last-child {
    border-bottom: none;
}

.tiebreak-row__icon {
    color: var(--muted);
    font-size: 1rem;
    text-align: center;
}

.tiebreak-row__label {
    font-size: 0.88rem;
    color: var(--ink);
}

.tiebreak-row__value {
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--ink);
    text-align: right;
}

.tiebreak-row__value--hit {
    color: #1e8a4a;
}

.tiebreak-sheet__note {
    margin: 0;
    font-size: 0.76rem;
    color: var(--muted);
    text-align: center;
    line-height: 1.45;
}

.hero-card--special {
    min-height: 200px;
    background:
        linear-gradient(to right, #BA0017 30%, transparent 62%),
        url('../images/03_Jogador_Especiais.png') bottom right / auto 90% no-repeat,
        url('../images/02_BG_Palpites_Desktop.png') top right / auto 100% no-repeat,
        linear-gradient(145deg, #BA0017, #E5291C);
}

.special-bet-card {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: 1fr auto;
    gap: 0;
    overflow: hidden;
    background: #E5DFDE;
}

.special-bet-card__save {
    grid-column: 1 / -1;
    border-radius: var(--radius-lg);
    margin: 0 12px 12px;
}

.special-bet-card [data-special-champion-pts],
.special-bet-card [data-special-scorer-pts] {
    align-self: flex-start;
    width: fit-content;
    font-size: 0.72rem;
    min-height: 26px;
    padding: 0 8px;
}

.special-bet-card__body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.special-bet-card__title {
    font-size: 1.1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    line-height: 1.15;
}

.special-bet-card__media {
    width: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #E5DFDE;
    border-left: 1px solid rgba(28, 37, 41, 0.06);
    padding: 12px;
    flex-shrink: 0;
}

.special-bet-card__media img {
    width: 86px;
    height: 86px;
    object-fit: contain;
    border-radius: 0;
    background: #ffffff;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.special-bet-card__media img.media--player {
    object-fit: cover;
    border-radius: 0;
    padding: 0;
}

.special-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 249, 241, 0.98));
    border: 1px solid rgba(28, 37, 41, 0.08);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.special-card__media {
    min-height: 210px;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top, rgba(216, 137, 57, 0.20), transparent 36%),
        linear-gradient(180deg, rgba(18, 52, 60, 0.06), rgba(18, 52, 60, 0.02));
}

.special-card__media img {
    width: 204px;
    height: 204px;
    object-fit: cover;
    border-radius: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.special-card__media img.special-card__media--team {
    object-fit: contain;
    width: 148px;
    height: 148px;
    padding: 0;
    border-radius: 0;
}

.special-card__body {
    padding: 18px;
}

.special-card__body small {
    display: block;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
}

.special-card__body strong {
    display: block;
    margin-top: 8px;
    font-size: 1.2rem;
}

.special-card__body span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    line-height: 1.45;
}

.special-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
}

.trend-up,
.trend-down {
    font-style: normal;
    margin-left: 6px;
    font-weight: 700;
}

.trend-up {
    color: var(--brand);
}

.trend-down {
    color: #9b3b3b;
}

.app-tabbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px));
    background: #262626;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 5;
    min-height: calc(84px + env(safe-area-inset-bottom, 0px));
}

.app-tabbar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(env(safe-area-inset-bottom, 0px) * -1);
    height: env(safe-area-inset-bottom, 0px);
    background: #262626;
}

.tabbar-button {
    min-height: 58px;
    border-radius: 14px;
    background: #BA0017;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 700;
    display: grid;
    place-items: center;
    gap: 2px;
    padding: 6px 8px;
}

.tabbar-button__icon {
    display: none;
}

.tabbar-button__label {
    display: none;
}

.tabbar-button img {
    width: auto;
    height: 44px;
    object-fit: contain;
    display: block;
}

.tabbar-button.is-active {
    background: #E5291C;
    color: #fff;
}

.card--league-hero {
    background: linear-gradient(145deg, #BA0017, #E5291C);
    border-color: transparent;
    color: #fff;
}

.card--league-hero .card__header span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.card--league-hero .card__header strong {
    color: #fff;
    font-size: 1.15rem;
    text-transform: uppercase;
    font-weight: 900;
    margin-top: 4px;
}

.card--league-hero .stack-row {
    background: rgba(20, 0, 0, 0.38);
    border-color: rgba(20, 0, 0, 0.24);
    color: #fff;
}

.card--league-hero .stack-row strong,
.card--league-hero .stack-row span,
.card--league-hero .stack-row a {
    color: #fff;
}

.card--league-hero .stack-row__points {
    color: rgba(255, 255, 255, 0.80);
}

.view-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
    min-width: 0;
}

.view-toggle__button {
    min-height: 46px;
    border-radius: 16px;
    background: #edf0eb;
    color: var(--muted);
    font-weight: 700;
}

.view-toggle__button.is-active {
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    color: #fff;
}

.button-row {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.button-row > button {
    flex: 1;
}

@media (display-mode: standalone) {
    body {
        background: linear-gradient(180deg, #140000 0%, #FCF7F7 30%, #FCF7F7 100%);
    }

    .app-shell {
        background: #262626;
    }
}

@media (min-width: 768px) {
    .app-shell {
        padding: 0;
    }

    .app-phone {
        width: 100%;
        height: 100%;
        min-height: 100vh;
        min-height: 100svh;
        min-height: 100dvh;
    }

    .screen {
        padding: 24px 24px calc(112px + env(safe-area-inset-bottom, 0px));
    }

    .summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .match-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .screen--app {
        display: block;
    }

    .app-view {
        max-width: 920px;
        width: 100%;
        margin: 0 auto;
    }
}

/* ── Liga: cabeçalhos de seção ─────────────────────────────────────── */
.league-selector-header span,
.league-actions-header span {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--muted);
}

.card .league-selector-header,
.card .league-actions-header {
    margin-bottom: 12px;
}

/* ── Ranking: destaque do usuário logado ───────────────────────────── */
.card--league-hero .ranking-item {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(255, 255, 255, 0.40);
}

.card--league-hero .ranking-item--current {
    background: rgba(20, 0, 0, 0.42);
    border-color: transparent;
}

.card--league-hero .ranking-item--current .ranking-item__name,
.card--league-hero .ranking-item--current .ranking-item__meta,
.card--league-hero .ranking-item--current .ranking-item__points,
.card--league-hero .ranking-item--current .ranking-item__place-number {
    color: #fff;
}

.card--league-hero .ranking-item--current .ranking-item__you {
    color: rgba(255, 255, 255, 0.80);
}

.ranking-item--placeholder {
    opacity: 0.5;
    pointer-events: none;
}

.ranking-gap-separator {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    letter-spacing: 0.25em;
    padding: 6px 0 2px;
}

/* ── Botões de ação da liga ────────────────────────────────────────── */
.button--league-action {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    border-radius: 16px;
    background: #edf0eb;
    color: var(--ink);
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.button--league-action i {
    font-size: 1.1rem;
}

.button--league-action:hover {
    background: #e0e4de;
}

.button--league-action.is-active {
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    color: #fff;
}

.button--manage-toggle {
    width: 100%;
}

.manage-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.manage-panel > .card {
    padding: 0;
    overflow: hidden;
}

.manage-panel .card__header {
    padding: 12px 18px 14px;
    background: rgba(28, 37, 41, 0.04);
    border-bottom: 1px solid var(--line);
}

.manage-panel .card__header span {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--brand-strong);
}

.manage-panel .card__header strong {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--ink);
    margin-top: 3px;
}

.manage-panel .card > .form-stack,
.manage-panel .card > .field {
    margin: 16px 18px 0;
}

.manage-panel .card > .stack-list {
    margin: 12px 18px;
}

.manage-panel .card > .feedback {
    margin: 10px 18px 0;
}

.manage-panel .card > .button {
    display: block;
    margin: 10px 18px 0;
}

.manage-panel .card > *:last-child {
    margin-bottom: 18px;
}

/* ── Picker de convidados ──────────────────────────────────────────── */
.invite-candidates-list {
    list-style: none;
    margin: 0;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    display: grid;
    gap: 2px;
    margin-top: -6px;
    margin-bottom: 8px;
    max-height: 220px;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.invite-candidate {
    padding: 9px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.12s;
}

.invite-candidate:hover {
    background: rgba(229, 41, 28, 0.07);
}

.invite-candidate strong {
    display: block;
    font-size: 0.9rem;
    color: var(--ink);
}

.invite-candidate span {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 1px;
}

/* ── Field sem label visível ───────────────────────────────────────── */
.field--no-label > span {
    display: none;
}
