/* Твій оригінальний базовий стиль */
body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
  background: black;
  color: white;
  user-select: none;
  -webkit-user-select: none;
}

#main-background {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: url('main_bg.png') center/cover no-repeat;
  filter: brightness(0.4);
  z-index: -1;
}

/* Кнопка Info в кутку */
#infoBtnFixed {
    position: fixed;
    right: 20px;
    bottom: 25px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
}

#infoBtnFixed svg { width: 24px; height: 24px; stroke: white; opacity: 0.8; }

/* Оверлей правил */
#rulesOverlay {
    position: fixed;
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s ease;
}

#rulesOverlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.rules-card {
    width: 90%;
    max-width: 360px;
    background: #1c1c1e;
    border-radius: 24px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 15px 50px rgba(0,0,0,0.5);
    transform: scale(0.8);
    transition: transform 0.2s ease;
}

#rulesOverlay.active .rules-card {
    transform: scale(1);
}

.rules-content {
    width: 100%;
    max-height: 65vh;
    overflow-y: auto;
    margin-bottom: 16px;
    border-radius: 12px;
}

.rules-content img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

/* Інші системні блоки */
#pc-blocker { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #111; display: none; flex-direction: column; align-items: center; justify-content: center; z-index: 9999; text-align: center; padding: 20px; }
#pc-blocker h2 { color: #ff3b30; }
#qr-code { background: white; padding: 15px; border-radius: 15px; }
#ad-notice { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); display: none; flex-direction: column; align-items: center; justify-content: center; z-index: 2000; text-align: center; padding: 20px; }
#top-bar { position: fixed; top: 10px; left: 0; width: 100%; display: none; justify-content: center; gap: 10px; align-items: center; z-index: 100; }
.combined-info { display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,0.8); padding: 6px 12px; border-radius: 15px; backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.1); }
#fps { color: #00ff00; font-weight: bold; font-size: 14px; min-width: 55px; }
#deviceName { font-size: 12px; opacity: 0.9; }
#graphCanvas { width: 50px; height: 20px; background: rgba(0,255,0,0.05); border-radius: 3px; }
#counter { background: rgba(0,0,0,0.8); padding: 8px 14px; border-radius: 15px; border: 1px solid rgba(255,255,255,0.1); font-size: 14px; }
#vsScreen { position: absolute; top: 10px; width: 100%; display: none; justify-content: space-around; padding: 0 10px; box-sizing: border-box; z-index: 100; }
.vsBox { width: 46%; padding: 8px; border-radius: 15px; background: rgba(0,0,0,0.85); border: 2px solid white; text-align: center; position: relative; }
.check-mark { position: absolute; top: -10px; right: -10px; background: #00ff88; color: black; border-radius: 50%; width: 25px; height: 25px; display: none; align-items: center; justify-content: center; font-weight: bold; font-size: 16px; border: 2px solid white; }
#menu { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 200; }
.bot-logo { width: 100px; height: 100px; background: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px auto; flex-shrink: 0; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.bot-logo svg { width: 55px; height: 55px; fill: #1c1c1c; display: block; }
.menu-buttons { display: flex; flex-direction: column; gap: 12px; width: 85%; max-width: 320px; margin: 0 auto; }
#resultModal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); display: none; flex-direction: column; align-items: center; justify-content: center; z-index: 2000; text-align: center; }
#resEmoji { font-size: 80px; }
#resStatus { font-size: 32px; font-weight: 900; color: #ffcc00; text-transform: uppercase; letter-spacing: 2px; }
.stats-container { margin: 15px 0; background: rgba(255,255,255,0.08); padding: 20px; border-radius: 20px; width: 80%; }
.stat-row { display: flex; justify-content: space-between; margin: 8px 0; font-size: 18px; }
#centerText { position: absolute; top: 55%; left: 50%; transform: translate(-50%, -50%); font-size: 24px; display: none; pointer-events: none; z-index: 50; text-shadow: 0 0 10px black; font-weight: bold; opacity: 0.8; }
#countdown { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 100px; font-weight: bold; display: none; z-index: 300; }
#searchingPlayer { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); display: none; flex-direction: column; align-items: center; justify-content: center; z-index: 1500; }
canvas#game { display: block; position: absolute; top: 0; left: 0; z-index: 10; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================
   ДОДАНИЙ КОД: MINECRAFT ULTIMATE STYLE
   ========================================= */

/* 1. Шрифти та Текст */
h1, h2, #resStatus, #fps, #counter, #centerText, button, .mc-font {
    font-family: 'Courier New', Courier, monospace !important;
    text-transform: uppercase !important;
    font-weight: bold !important;
    text-shadow: 2px 2px 0px #000 !important;
}

/* 2. Кнопки Minecraft */
#startBtn, #duelBtn, #rulesBtn, #closeRulesBtn, #retryBtn, #homeBtn, #adConfirmBtn, .mc-button {
    border-radius: 0 !important; 
    border: 4px solid #000 !important;
    background: #7c7c7c !important; 
    box-shadow: inset -4px -4px #404040, inset 4px 4px #c2c2c2 !important;
    color: white !important;
    font-size: 18px !important;
    padding: 16px !important;
    transition: none !important;
    cursor: pointer;
}

#startBtn:active, #duelBtn:active, #rulesBtn:active, #closeRulesBtn:active {
    box-shadow: inset 4px 4px #404040, inset -4px -4px #c2c2c2 !important;
}

#duelBtn { background: #5a5a5a !important; }

/* 3. Картки та Діалоги */
.rules-card, .stats-container, .vsBox, #ad-notice > div, .sub-card, .mc-dialog {
    border-radius: 0 !important;
    border: 4px solid #000 !important;
    background: #c6c6c6 !important; 
    box-shadow: inset -6px -6px #555, inset 6px 6px #fff !important;
    color: #333 !important;
}

.rules-card *, .stats-container *, .vsBox *, .sub-card *, .mc-dialog * {
    color: #333 !important;
    text-shadow: none !important;
}

/* 4. Ізоляція екранів */
#menu, #rulesOverlay.active, #resultModal[style*="display: flex"], #searchingPlayer[style*="display: flex"], #sub-overlay, #ad-notice {
    background: #313131 !important;
    background-image: 
        linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)),
        url('https://www.transparenttextures.com/patterns/carbon-fibre.png') !important;
}

/* 5. HUD */
.combined-info, #counter {
    border-radius: 0 !important;
    border: 3px solid #000 !important;
    background: rgba(0,0,0,0.85) !important;
    box-shadow: inset -3px -3px #333, inset 3px 3px #555 !important;
}

/* 6. Логотип */
.bot-logo {
    border-radius: 0 !important;
    border: 5px solid #000;
    background: #7c7c7c;
    box-shadow: inset -4px -4px #404040, inset 4px 4px #c2c2c2;
}

/* 7. Лоадер */
#searchingPlayer div[style*="spin"] {
    border-radius: 0 !important;
    border: 6px solid #000 !important;
    border-top-color: #fff !important;
    animation: mc-spin 0.8s steps(8) infinite !important;
}

@keyframes mc-spin { to { transform: rotate(360deg); } }

/* 8. Картинка в правилах */
.rules-content img {
    border: 4px solid #000;
    border-radius: 0 !important;
    image-rendering: pixelated;
}

/* =========================================
   ФІКС ЦЕНТРУВАННЯ (РЕКЛАМА ТА ПІДПИСКА)
   ========================================= */

/* Оверлеї на весь екран */
#ad-notice, #sub-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: none; /* Змінюється скриптом на flex/grid */
    align-items: center !important;
    justify-content: center !important;
    z-index: 10000 !important;
    box-sizing: border-box !important;
}

/* Центрування самої картки всередині */
#ad-notice > div, .sub-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    width: 90% !important;
    max-width: 320px !important;
    margin: auto !important; /* Гарантований центр */
}

/* Кнопки всередині карток — на всю ширину */
#adConfirmBtn, #sub-overlay .mc-button, #sub-overlay a {
    width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
    margin: 10px 0 !important;
}

/* Текст всередині */
#ad-notice p, #sub-overlay p {
    width: 100% !important;
    text-align: center !important;
    margin-bottom: 20px !important;
}