/**
 * Cards de apps gamificados (RPG) — face: ícone · nome · plataforma
 * Clique: grimório com detalhes + download
 */

#komikku.acr-section,
#komikku.mek-section {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto 2rem;
  padding: 18px 14px;
  border-radius: 18px;
  border: 1px solid rgba(201, 162, 39, 0.45);
  background: rgba(14, 12, 16, 0.72);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  font-family: var(--mek-font, Outfit, sans-serif);
  color: var(--mek-text, #f2ead8);
}

.acr-head {
  text-align: center;
  margin: 0 0 18px;
}

.acr-kicker {
  margin: 0 0 4px;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mek-gold, #e8c547);
  font-family: var(--mek-display, Cinzel, serif);
}

.acr-title {
  margin: 0;
  font-family: var(--mek-display, Cinzel, serif);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  color: #f7efd8;
  letter-spacing: 0.03em;
}

.acr-sub {
  margin: 6px auto 0;
  max-width: 36rem;
  font-size: 0.88rem;
  color: var(--mek-muted, #9a8f7a);
  line-height: 1.45;
}

/* Tabs */
.acr-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 20px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(201, 162, 39, 0.35);
  background: rgba(0, 0, 0, 0.32);
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.acr-tab {
  appearance: none;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--mek-muted, #9a8f7a);
  font-family: var(--mek-display, Cinzel, serif);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.acr-tab:hover,
.acr-tab:focus-visible {
  color: #f7efd8;
  border-color: rgba(201, 162, 39, 0.4);
  outline: none;
}

.acr-tab.is-active {
  color: #1a1408;
  border-color: rgba(255, 230, 150, 0.55);
  background: linear-gradient(165deg, #e8c547 0%, #c9a227 55%, #8a6914 100%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.acr-panel[hidden] {
  display: none !important;
}

.acr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 200px));
  gap: 16px;
  justify-content: center;
  justify-items: stretch;
}

.acr-empty,
.acr-loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--mek-muted, #9a8f7a);
  padding: 28px 12px;
  font-size: 0.9rem;
}

/* Card face */
.acr-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(201, 162, 39, 0.5);
  background: #16120e;
  background-image: linear-gradient(165deg, #2a2216 0%, #0e0e14 100%);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s ease, border-color 0.15s ease;
  overflow: hidden;
  color: var(--mek-text, #f2ead8);
  contain: content;
  content-visibility: auto;
  contain-intrinsic-size: auto 220px;
}

.acr-card:hover,
.acr-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(232, 197, 71, 0.85);
  outline: none;
}

.acr-card-icon {
  width: 78px;
  height: 78px;
  border-radius: 18px;
  border: 1px solid rgba(201, 162, 39, 0.45);
  background: #0c0b10;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.acr-card-icon img {
  width: 82%;
  height: 82%;
  object-fit: contain;
}

.acr-card-name {
  margin: 0;
  font-family: var(--mek-display, Cinzel, serif);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #f7efd8;
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.acr-platforms {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.acr-plat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(201, 162, 39, 0.4);
  background: rgba(0, 0, 0, 0.35);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #e8dfcc;
}

.acr-plat i {
  font-size: 0.78rem;
  color: var(--mek-gold, #e8c547);
}

.acr-plat--android i {
  color: #a3e635;
}

.acr-plat--ios i {
  color: #e2e8f0;
}

.acr-plat--web i {
  color: #7dd3fc;
}

.acr-plat--windows i,
.acr-plat--macos i,
.acr-plat--linux i {
  color: #93c5fd;
}

.acr-card-hint {
  margin: 0;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(154, 143, 120, 0.75);
}

/* Leitura vs mídia — leve diferença de atmosfera */
.acr-card--leitura {
  border-color: rgba(180, 150, 70, 0.5);
}

.acr-card--midia {
  border-color: rgba(180, 120, 70, 0.55);
  background-image: linear-gradient(165deg, #2a1e16 0%, #100e12 100%);
}

/* Modal */
.acr-modal {
  position: fixed;
  inset: 0;
  z-index: 100060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.acr-modal[hidden] {
  display: none;
}

.acr-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 10, 0.82);
}

.acr-modal-panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(88vh, 820px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #14110c;
  background-image: linear-gradient(180deg, #241e14 0%, #121218 42%, #101018 100%);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.6);
  animation: acrModalIn 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}

.acr-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 14px;
  border-bottom: 1px solid rgba(201, 162, 39, 0.22);
  flex-shrink: 0;
}

.acr-modal-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.acr-modal-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  border: 1px solid rgba(201, 162, 39, 0.45);
  background: rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
}

.acr-modal-icon-wrap img {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

.acr-modal-kicker {
  margin: 0 0 2px;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mek-gold, #e8c547);
  font-family: var(--mek-display, Cinzel, serif);
}

.acr-modal-head h2 {
  margin: 0;
  font-family: var(--mek-display, Cinzel, serif);
  font-size: 1.2rem;
  color: #f7efd8;
  line-height: 1.25;
  word-break: break-word;
}

.acr-modal-plats {
  margin-top: 8px;
}

.acr-modal-close {
  appearance: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(201, 162, 39, 0.35);
  background: rgba(0, 0, 0, 0.35);
  color: #e8dfcc;
  cursor: pointer;
  flex-shrink: 0;
}

.acr-modal-close:hover {
  border-color: rgba(232, 197, 71, 0.7);
  color: #f7efd8;
}

.acr-modal-body {
  padding: 16px 20px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.acr-block {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(201, 162, 39, 0.22);
  background: rgba(0, 0, 0, 0.28);
}

.acr-block strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--mek-display, Cinzel, serif);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mek-gold, #e8c547);
}

.acr-block p {
  margin: 0;
  color: #d8d0c0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.acr-block ul {
  margin: 0;
  padding-left: 18px;
  color: #d8d0c0;
  font-size: 0.86rem;
  line-height: 1.45;
}

.acr-block--pros ul {
  color: #b7e4a5;
}

.acr-block--cons ul {
  color: #f0b4ae;
}

.acr-block--warn {
  border-color: rgba(245, 185, 66, 0.4);
  background: rgba(245, 185, 66, 0.08);
}

.acr-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 520px) {
  .acr-cols {
    grid-template-columns: 1fr;
  }
}

.acr-modal-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 !important;
  padding: 14px 18px 18px !important;
  border-top: 1px solid rgba(201, 162, 39, 0.35) !important;
  background: linear-gradient(180deg, rgba(36, 30, 18, 0.95) 0%, rgba(18, 15, 12, 0.98) 100%) !important;
  flex-shrink: 0;
}

.acr-foot-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid rgba(201, 162, 39, 0.5);
  font-family: var(--mek-display, Cinzel, serif);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-decoration: none !important;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  width: auto !important;
  height: auto !important;
}

.acr-foot-btn--ghost {
  background: rgba(0, 0, 0, 0.35);
  color: #e8dfcc;
  border-color: rgba(201, 162, 39, 0.35);
}

.acr-foot-btn--ghost:hover {
  border-color: rgba(232, 197, 71, 0.65);
  color: #f7efd8;
}

.acr-foot-btn--gold {
  background: linear-gradient(165deg, #e8c547 0%, #c9a227 48%, #8a6914 100%);
  color: #1a1408 !important;
  border-color: rgba(255, 230, 150, 0.55);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.acr-foot-btn--gold:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.acr-foot-btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

@keyframes acrModalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 600px) {
  #komikku.acr-section,
  #komikku.mek-section {
    padding: 14px 10px;
  }

  .acr-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 170px));
    gap: 12px;
    justify-content: center;
  }
}
