* { box-sizing: border-box; }
body { margin: 0; background: white; color: #363636; font: 16px/1.5 "Segoe UI", sans-serif; }
header, main, footer { max-width: 1250px; margin: auto; padding: 24px; }
header { text-align: center; }
header img { width: min(100%, 650px); max-height: 170px; object-fit: contain; }
h1 { text-align: center; font-size: 22px; font-weight: 400; }
.app-tabs { display: flex; border-bottom: 1px solid #dbdbdb; margin: 28px 0; }
.app-tabs button { flex: 1; border: 1px solid transparent; background: white; padding: 14px 6px; color: #363636; cursor: pointer; font: inherit; }
.app-tabs button[aria-selected="true"] { border-color: #dbdbdb; border-bottom-color: white; color: #3273dc; margin-bottom: -1px; }
.app-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 38px; }
.app-card {
    position: relative;
    width: 100%;
    height: 312px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #363636;
    text-align: center;
    font: inherit;
    cursor: pointer;
    perspective: 1000px;
}
.app-card-inner {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}
.app-card-front, .app-card-back {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 12px;
    border: 1px solid #dbdbdb;
    border-radius: 6px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.app-card-front { background: white; }
.app-card-back {
    background: #29499b;
    color: white;
    transform: rotateY(180deg);
    padding: 24px;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.55;
    text-align: center;
    overflow-y: auto;
    justify-content: center;
    text-wrap: pretty;
}
.app-card img { display: block; width: 182px; max-width: 100%; height: 182px; object-fit: contain; margin: 0 auto 8px; }
.app-card strong { display: block; font-size: 14px; }
.app-card[aria-pressed="true"] .app-card-inner { transform: rotateY(180deg); }
.app-card:focus-visible { outline: 2px solid #3273dc; outline-offset: 4px; border-radius: 6px; }
@media (hover: hover) and (pointer: fine) {
    .app-card:hover .app-card-inner { transform: rotateY(180deg); }
}
@media (prefers-reduced-motion: reduce) {
    .app-card-inner { transition: none; }
}
[hidden] { display: none !important; }
footer { text-align: center; }
footer a { display: inline-block; background: #ffdd57; color: #363636; padding: 8px 16px; border-radius: 4px; text-decoration: none; }
@media (max-width: 600px) { header, main, footer { padding: 14px; } .app-tabs button { font-size: 12px; } .app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }

/* Reserva o espaço da barra vertical ao alternar categorias. */
html { overflow-y: scroll; scrollbar-gutter: stable; }

@media (min-width: 601px) and (max-width: 950px) { .app-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }

@media (max-width: 600px) {
    .app-card { height: 380px; }
    .app-card-back { padding: 16px 12px; font-size: 13px; line-height: 1.5; }
}
