/* ==============================================================
   Refatoraded Console — v0.1.0
   Layout fullscreen para o console de jogos.
   ============================================================== */

:root {
    --rfcon-bg:        #05070d;
    --rfcon-bg-2:      #0a0e18;
    --rfcon-accent:    #378ADD;
    --rfcon-accent-2:  #6ad1ff;
    --rfcon-text:      #e7eef7;
    --rfcon-text-dim:  #8ea2bb;
    --rfcon-border:    #1a2130;
}

/* Página em tela cheia quando o console está ativo */
body.rfcon-fullscreen {
    margin: 0;
    padding: 0;
    background: var(--rfcon-bg);
    overflow: hidden;
}
body.rfcon-fullscreen .site-content,
body.rfcon-fullscreen .entry-content,
body.rfcon-fullscreen #primary,
body.rfcon-fullscreen main {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
}

/* ---------- Wrapper principal ---------- */
#rfcon-wrap {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(ellipse at top, #0d1524 0%, var(--rfcon-bg) 60%),
        var(--rfcon-bg);
    color: var(--rfcon-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    z-index: 9999;
}

/* ---------- Topbar ---------- */
.rfcon-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    background: rgba(0, 0, 0, 0.35);
    border-bottom: 1px solid var(--rfcon-border);
    flex-shrink: 0;
    height: 52px;
    box-sizing: border-box;
}

.rfcon-hub-btn {
    background: transparent;
    border: 1px solid var(--rfcon-accent);
    color: var(--rfcon-accent);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.18s ease;
    font-weight: 500;
}
.rfcon-hub-btn:hover {
    background: var(--rfcon-accent);
    color: #fff;
}

.rfcon-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rfcon-text-dim);
}
.rfcon-brand-mark {
    color: var(--rfcon-accent-2);
    font-size: 12px;
}
.rfcon-brand-name {
    font-weight: 600;
}

.rfcon-topbar-spacer {
    width: 120px; /* equilibra com o botão Hub à esquerda */
}

/* ---------- Stage (área do jogo) ---------- */
.rfcon-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.rfcon-game-mount {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rfcon-game-mount canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 0 60px rgba(55, 138, 221, 0.15);
}

/* ---------- Placeholder (antes do jogo carregar) ---------- */
.rfcon-placeholder {
    text-align: center;
    user-select: none;
}
.rfcon-placeholder-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--rfcon-accent-2);
    margin-bottom: 8px;
}
.rfcon-placeholder-sub {
    font-size: 14px;
    color: var(--rfcon-text-dim);
    margin-bottom: 20px;
    letter-spacing: 0.05em;
}
.rfcon-placeholder-dots {
    display: inline-flex;
    gap: 6px;
}
.rfcon-placeholder-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--rfcon-accent);
    animation: rfcon-pulse 1.2s infinite ease-in-out;
}
.rfcon-placeholder-dots span:nth-child(2) { animation-delay: 0.15s; }
.rfcon-placeholder-dots span:nth-child(3) { animation-delay: 0.30s; }

@keyframes rfcon-pulse {
    0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); }
    40%           { opacity: 1;    transform: scale(1.1); }
}

/* ---------- Bottombar ---------- */
.rfcon-bottombar {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.35);
    border-top: 1px solid var(--rfcon-border);
}
.rfcon-footer-text {
    font-size: 11px;
    color: var(--rfcon-text-dim);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
    .rfcon-brand-name  { display: none; }
    .rfcon-topbar-spacer { width: 40px; }
    .rfcon-placeholder-title { font-size: 22px; }
}

/* ==============================================================
   Regras universais para melhor experiência em touch
   ==============================================================
   Estas regras são aplicadas em qualquer dispositivo, mas só têm
   efeito visível em dispositivos com toque. Elas previnem três
   comportamentos nativos do navegador que atrapalham jogos:

     1. Seleção de texto ao segurar o dedo (parece que travou algo)
     2. Menu de contexto com toque longo (interrompe o jogo)
     3. Scroll/zoom da página ao arrastar sobre o canvas
   ============================================================== */

#rfcon-wrap,
#rfcon-wrap * {
    /* Impede seleção de texto em toque longo */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;

    /* Impede destaque azul/cinza quando o dedo toca um elemento */
    -webkit-tap-highlight-color: transparent;
}

#rfcon-wrap canvas,
.rfcon-game-mount canvas,
.rfcon-touch-root {
    /* Impede o navegador de interpretar arrastos como scroll/zoom */
    touch-action: none;
}

/* Os controles touch em si, caso o JS falhe em aplicar inline */
.rfcon-touch-root,
.rfcon-touch-stick,
.rfcon-touch-fire,
.rfcon-touch-knob {
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
}
