* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--fxm-gray-900);
    background: var(--fxm-white);
    font-family: var(--fxm-font);
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    margin: 0 auto;
    background: var(--fxm-white);
    display: flex;
    flex-direction: column;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px 14px;
    background: var(--fxm-white);
    border-bottom: 1px solid var(--fxm-gray-100);
}

.app-screen {
    flex: 1;
    padding: 16px 20px 28px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    color: var(--fxm-ink);
    cursor: pointer;
}

.profile-menu {
    position: relative;
}

.profile-menu summary {
    list-style: none;
}

.profile-menu summary::-webkit-details-marker {
    display: none;
}

.avatar-wrap {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--fxm-white);
    font-size: 13px;
    font-weight: 800;
    background: linear-gradient(135deg, #5c82f2, var(--fxm-purple));
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 190px;
    padding: 8px;
    border: 1px solid var(--fxm-gray-300);
    border-radius: var(--fxm-radius-sm);
    background: var(--fxm-white);
    box-shadow: var(--fxm-shadow-soft);
}

.profile-dropdown a {
    display: block;
    padding: 10px 12px;
    color: var(--fxm-gray-700);
    font-size: 13px;
    font-weight: 700;
    border-radius: 10px;
}

.profile-dropdown a:hover {
    color: var(--fxm-purple);
    background: var(--fxm-gray-100);
}

.screen-title {
    margin: 4px 0 2px;
    color: var(--fxm-gray-900);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.18;
}

.screen-subtitle {
    margin: 0 0 18px;
    color: var(--fxm-gray-500);
    font-size: 14px;
}

.section-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
}

.section-title {
    color: var(--fxm-gray-900);
    font-size: 16px;
    font-weight: 800;
}

.link-purple {
    color: var(--fxm-purple);
    font-size: 12.5px;
    font-weight: 700;
}

.app-card {
    border: 1px solid var(--fxm-gray-300);
    border-radius: var(--fxm-radius-md);
    background: var(--fxm-white);
    padding: 12px 14px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 0 0 22px;
}

.stat-card {
    min-height: 94px;
    padding: 14px 6px;
    border-radius: 14px;
    background: var(--fxm-gray-100);
    text-align: center;
}

.stat-icon {
    width: 24px;
    height: 24px;
    margin: 0 auto 6px;
    font-size: 18px;
}

.stat-value {
    color: var(--fxm-gray-900);
    font-size: 16px;
    font-weight: 800;
}

.stat-label {
    margin-top: 3px;
    color: var(--fxm-gray-500);
    font-size: 9.5px;
    font-weight: 700;
    line-height: 1.25;
}

.challenge-list,
.danger-list,
.discovered-list,
.discipline-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--fxm-gray-300);
    border-radius: var(--fxm-radius-md);
    background: var(--fxm-white);
}

.item-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 800;
}

.icon-symbol {
    position: relative;
    display: inline-grid;
    width: 24px;
    height: 24px;
    place-items: center;
    color: currentColor;
    font-size: 0;
    line-height: 1;
    vertical-align: middle;
}

.item-icon.icon-symbol {
    width: 42px;
    height: 42px;
    display: grid;
}

.review-badge.icon-symbol {
    width: 44px;
    height: 44px;
    display: grid;
}

.icon-symbol::before,
.icon-symbol::after {
    content: "";
    position: absolute;
    display: block;
}

.icon-symbol--scales::before {
    width: 20px;
    height: 14px;
    left: 50%;
    top: 50%;
    border-top: 2px solid currentColor;
    border-left: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: translate(-50%, -45%);
}

.icon-symbol--scales::after {
    width: 2px;
    height: 22px;
    left: 50%;
    top: 50%;
    background: currentColor;
    box-shadow: -9px 10px 0 2px currentColor, 9px 10px 0 2px currentColor;
    transform: translate(-50%, -65%);
}

.icon-symbol--deck::before {
    width: 18px;
    height: 24px;
    left: 50%;
    top: 50%;
    border: 2px solid currentColor;
    border-radius: 4px;
    transform: translate(-42%, -50%) rotate(6deg);
}

.icon-symbol--deck::after {
    width: 18px;
    height: 24px;
    left: 50%;
    top: 50%;
    border: 2px solid currentColor;
    border-radius: 4px;
    transform: translate(-62%, -50%) rotate(-8deg);
    opacity: 0.55;
}

.icon-symbol--law::before {
    width: 20px;
    height: 20px;
    left: 50%;
    top: 50%;
    border-left: 3px solid currentColor;
    border-bottom: 3px solid currentColor;
    transform: translate(-35%, -60%) rotate(-45deg);
}

.icon-symbol--law::after {
    width: 18px;
    height: 3px;
    left: 50%;
    top: 50%;
    background: currentColor;
    border-radius: 3px;
    transform: translate(-50%, 160%);
}

.icon-symbol--check::before {
    width: 18px;
    height: 9px;
    left: 50%;
    top: 50%;
    border-left: 3px solid currentColor;
    border-bottom: 3px solid currentColor;
    transform: translate(-50%, -65%) rotate(-45deg);
}

.icon-symbol--target::before {
    width: 22px;
    height: 22px;
    left: 50%;
    top: 50%;
    border: 2px solid currentColor;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.icon-symbol--target::after {
    width: 8px;
    height: 8px;
    left: 50%;
    top: 50%;
    border-radius: 50%;
    background: currentColor;
    transform: translate(-50%, -50%);
}

.icon-symbol--streak::before {
    width: 16px;
    height: 22px;
    left: 50%;
    top: 50%;
    background: currentColor;
    border-radius: 70% 30% 70% 45%;
    transform: translate(-50%, -50%) rotate(35deg);
}

.icon-symbol--trophy::before {
    width: 20px;
    height: 16px;
    left: 50%;
    top: 46%;
    border: 2px solid currentColor;
    border-radius: 4px 4px 10px 10px;
    transform: translate(-50%, -50%);
}

.icon-symbol--trophy::after {
    width: 16px;
    height: 8px;
    left: 50%;
    top: 67%;
    border-bottom: 3px solid currentColor;
    border-left: 3px solid currentColor;
    border-right: 3px solid currentColor;
    transform: translate(-50%, -50%);
}

.icon-symbol--star::before {
    width: 22px;
    height: 22px;
    left: 50%;
    top: 50%;
    background: currentColor;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 56%, 79% 91%, 50% 70%, 21% 91%, 32% 56%, 2% 35%, 39% 35%);
    transform: translate(-50%, -52%);
}

.icon-symbol--percent::before {
    content: "%";
    inset: auto;
    left: 50%;
    top: 50%;
    color: currentColor;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    transform: translate(-50%, -50%);
}

.icon-symbol--trap::before {
    width: 4px;
    height: 16px;
    left: 50%;
    top: 42%;
    background: currentColor;
    border-radius: 4px;
    transform: translate(-50%, -50%);
}

.icon-symbol--trap::after {
    width: 5px;
    height: 5px;
    left: 50%;
    top: 70%;
    background: currentColor;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.item-icon--purple {
    color: #5b3fe0;
    background: var(--fxm-purple-soft);
}

.item-icon--green {
    color: var(--fxm-green);
    background: var(--fxm-green-soft);
}

.item-icon--orange {
    color: var(--fxm-orange);
    background: var(--fxm-orange-soft);
}

.item-icon--red {
    color: var(--fxm-red);
    background: var(--fxm-red-soft);
}

.item-body {
    min-width: 0;
    flex: 1;
}

.item-title {
    color: var(--fxm-gray-900);
    font-size: 14.5px;
    font-weight: 800;
    line-height: 1.25;
}

.item-subtitle {
    margin-top: 2px;
    color: var(--fxm-gray-500);
    font-size: 12px;
    line-height: 1.35;
}

.pill-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 10px;
    color: var(--fxm-white);
    background: var(--fxm-purple);
    font-size: 12.5px;
    font-weight: 800;
    white-space: nowrap;
}

.bottom-nav {
    position: sticky;
    bottom: 0;
    z-index: 35;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    padding: 6px 0 10px;
    border-top: 1px solid var(--fxm-gray-300);
    background: var(--fxm-white);
}

.nav-item {
    min-height: 42px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--fxm-gray-500);
    font-size: 10.5px;
    font-weight: 700;
}

.nav-item:hover {
    color: var(--fxm-purple);
}

.nav-item--active.nav-item--inicio {
    color: var(--fxm-purple);
}

.nav-item--active.nav-item--baralho {
    color: var(--fxm-blue);
}

.nav-item--active.nav-item--tribunal {
    color: var(--fxm-orange);
}

.nav-item--active.nav-item--armadilhas {
    color: var(--fxm-red);
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    font-size: 16px;
    line-height: 1;
}

.nav-icon svg {
    width: 20px;
    height: 20px;
}

.modal-shell {
    display: none;
}

@media (min-width: 700px) {
    body {
        padding: 18px 0;
    }

    .app-shell {
        min-height: calc(100vh - 36px);
        border: 1px solid var(--fxm-gray-300);
        border-radius: 24px;
        overflow: hidden;
        box-shadow: var(--fxm-shadow-soft);
    }
}
