/* bb9-app.css - Blockbench Online launcher chrome (bb.9minecraft.net). GPL-3.0-or-later. */

/* ---------- loading veil ---------- */
#bb9_veil {
	position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center;
	background: #1b1d22; color: #e6e6e6; font-family: 'Inter', 'Segoe UI', Roboto, sans-serif; transition: opacity .35s;
}
#bb9_veil.bb9-hide { opacity: 0; pointer-events: none; }
.bb9-veil-box { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; padding: 16px; max-width: 520px; }
.bb9-veil-text { font-size: 16px; line-height: 1.5; }
.bb9-veil-error .bb9-spinner { display: none; }
.bb9-veil-btn { margin-top: 12px; padding: 8px 18px; border-radius: 6px; border: 0; background: #3e90ff; color: #fff; font-size: 15px; cursor: pointer; }
.bb9-spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid #ffffff22; border-top-color: #4cbf56; animation: bb9spin .9s linear infinite; }
@keyframes bb9spin { to { transform: rotate(360deg); } }

/* ---------- top bar (inside Blockbench's <header>) ---------- */
#bb9_bar { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 0 1 auto; height: 100%; padding: 0 6px 0 4px; overflow: hidden; }
#bb9_bar .bb9-title { display: flex; align-items: center; gap: 6px; flex-shrink: 1; min-width: 0; font-weight: 600; white-space: nowrap; color: var(--color-light); }
#bb9_bar .bb9-title img { width: 20px; height: 20px; image-rendering: pixelated; }
#bb9_bar .bb9-tool-name { overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
#bb9_bar .bb9-btns { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.bb9-btn {
	display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px; border-radius: 4px; border: 0;
	background: var(--color-button); color: var(--color-text); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; min-width: 0;
}
.bb9-btn:hover { background: var(--color-accent); color: var(--color-accent_text); }
.bb9-btn i.material-icons { font-size: 18px; margin: 0; padding: 0; width: auto; }
.bb9-btn.bb9-main { background: #3c8f3f; color: #fff; }
.bb9-btn.bb9-main:hover { background: #4cae50; }
.bb9-btn.bb9-export { background: var(--color-accent); color: var(--color-accent_text); }
#corner_logo { display: none !important; }
header { gap: 0; }
/* tablet / narrow desktop: icon-only extras */
@media (max-width: 1440px) { #bb9_bar .bb9-extra span, #bb9_bar .bb9-about span { display: none; } #bb9_bar .bb9-btn.bb9-extra, #bb9_bar .bb9-btn.bb9-about { padding: 0 6px; } }
@media (max-width: 1100px) { #bb9_bar .bb9-tool-name { max-width: 170px; } }

/* ---------- embed (iframe) = compact ---------- */
.bb9-embed #bb9_bar .bb9-title .bb9-tool-name { display: none; }
.bb9-embed #bb9_bar .bb9-about span, .bb9-embed #bb9_bar .bb9-extra span { display: none; }

/* ---------- mobile layout (Blockbench.isMobile adds body.is_mobile) ---------- */
body.is_mobile #bb9_bar { padding: 0 2px; gap: 3px; }
body.is_mobile #bb9_bar .bb9-title .bb9-tool-name { display: none; }
body.is_mobile #bb9_bar .bb9-btn { height: 32px; padding: 0 8px; }
body.is_mobile #bb9_bar .bb9-btn span { display: none; }
body.is_mobile #bb9_bar .bb9-btn.bb9-main span { display: inline; }
body.is_mobile #bb9_bar .bb9-btn i.material-icons { font-size: 20px; }
@media (max-width: 420px) { body.is_mobile #bb9_bar .bb9-btn.bb9-main span { display: none; } }

/* ---------- template picker ---------- */
.bb9-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; max-height: 64vh; overflow-y: auto; padding: 2px; }
.bb9-tpl { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 8px; border-radius: 6px; border: 1px solid var(--color-border);
	background: var(--color-back); color: var(--color-text); cursor: pointer; font: inherit; text-align: center; }
.bb9-tpl:hover, .bb9-tpl:focus-visible { border-color: var(--color-accent); background: var(--color-button); outline: none; }
.bb9-tpl-img { display: flex; align-items: center; justify-content: center; height: 96px; border-radius: 4px;
	background: repeating-conic-gradient(#ffffff0d 0% 25%, transparent 0% 50%) 50% / 16px 16px; }
.bb9-tpl-img img { max-width: 100%; max-height: 96px; object-fit: contain; }
.bb9-tpl-name { font-size: 13px; line-height: 1.3; }
@media (max-width: 600px) { .bb9-tpl-grid { grid-template-columns: repeat(2, 1fr); } .bb9-tpl-img { height: 72px; } .bb9-tpl-img img { max-height: 72px; } }

/* ---------- dialogs always fit the screen on phones ---------- */
dialog.dialog { max-width: 100vw !important; }
@media (max-width: 700px) { dialog.dialog { left: 0 !important; } dialog.dialog .dialog_content img { max-width: 100%; } }
.bb9-about p { margin: 0 0 10px; }
.bb9-small { font-size: .9em; color: var(--color-subtle_text); }

/* ---------- unknown tool page ---------- */
#bb9_unknown { position: fixed; inset: 0; z-index: 10001; background: #1b1d22; color: #e6e6e6; overflow: auto; font-family: 'Segoe UI', Roboto, sans-serif; }
.bb9-unknown-box { max-width: 640px; margin: 8vh auto; padding: 0 16px; }
.bb9-unknown-box a { color: #7cc4ff; }
.bb9-unknown-box li { margin: 6px 0; }

/* ---------- plugin UI: no outbound links (self-hosted, no external requests) ---------- */
#minecraft_title_generator .github-link, .minecraft-title-links, #minecraft-title-connection-warning { display: none !important; }

/* phones: Templates / main / Download / More only */
.bb9-btn.bb9-more { display: none; }
body.is_mobile #bb9_bar .bb9-extra, body.is_mobile #bb9_bar .bb9-about { display: none; }
body.is_mobile #bb9_bar .bb9-btn.bb9-more { display: inline-flex; }
body.is_mobile header > .tool.bb9-hidden { display: none !important; }
body.is_mobile #bb9_bar { margin-left: auto; overflow: visible; }

/* EULA prompt (no eula=1): Blockbench's dialog sits above the veil, the start screen stays hidden */
html.bb9-eula #bb9_veil { z-index: 19; }
html.bb9-eula #bb9_veil .bb9-spinner { display: none; }
/* the start screen is never part of the tool app */
html.bb9:not(.bb9-make) #start_screen { visibility: hidden; }
/* second primary action (e.g. Render PNG) */
.bb9-btn.bb9-main2 { background: #2f6fd6; }
.bb9-btn.bb9-main2:hover { background: #4a86e8; }
body.is_mobile #bb9_bar .bb9-btn.bb9-main2 span { display: none; }
