@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700&family=Source+Sans+Pro:wght@400;600;700;900&display=swap');

/* =====================================================================
   Buryhome website - classic Roblox 2017-2020 look, same skin as the
   launcher, with a light and a dark theme.
   ===================================================================== */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
	color-scheme: light;

	--bg: #e3e3e3;
	--topbar: #232527;
	--panel: #ffffff;
	--surface-2: #f4f4f4;
	--surface-3: #ececec;
	--border: #c3c3c3;
	--border-dark: #999999;
	--text: #191919;
	--text-soft: #333333;
	--muted: #757575;
	--link: #0074bd;
	--green: #02b757;
	--green-dark: #029a49;
	--grey-btn: #e0e0e0;
	--grey-btn-dark: #cfcfcf;
	--red: #c00;
	--placeholder: #adadad;
	--shadow: 0 1px 6px rgba(0, 0, 0, .18);
	--shadow-lg: 0 6px 24px rgba(0, 0, 0, .28);
	--modal-shadow: 0 10px 40px rgba(0, 0, 0, .4);

	/* aliases used by the older page scripts */
	--text-primary: var(--text);
	--text-secondary: var(--muted);
	--text-muted: var(--muted);
	--bg-primary: var(--bg);
	--bg-secondary: var(--surface-2);
	--bg-tertiary: var(--surface-3);
	--bg-card: var(--panel);
	--bg-input: var(--panel);
	--bg-hover: var(--surface-2);
	--bg-active: var(--surface-3);
	--border-color: var(--border);
	--border-light: var(--border-dark);
	--accent: var(--green);
	--accent-hover: var(--green-dark);
	--danger: var(--red);
}

:root[data-theme="dark"] {
	color-scheme: dark;

	--bg: #17181a;
	--topbar: #0e0f11;
	--panel: #232527;
	--surface-2: #2a2c2f;
	--surface-3: #313438;
	--border: #383b3f;
	--border-dark: #4b4f54;
	--text: #e9e9e9;
	--text-soft: #d2d2d2;
	--muted: #9aa0a6;
	--link: #58a9e8;
	--green: #02b757;
	--green-dark: #03a94f;
	--grey-btn: #2f3235;
	--grey-btn-dark: #3a3e42;
	--red: #ff6b6b;
	--placeholder: #6b7075;
	--shadow: 0 1px 8px rgba(0, 0, 0, .55);
	--shadow-lg: 0 8px 30px rgba(0, 0, 0, .65);
	--modal-shadow: 0 14px 50px rgba(0, 0, 0, .7);
}

html { background: var(--bg); }

body {
	font-family: 'Source Sans Pro', 'Segoe UI', Arial, sans-serif;
	background: var(--bg);
	color: var(--text);
	font-size: 14px;
	line-height: 1.45;
	-webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; color: inherit; }
img { -webkit-user-drag: none; }
a { color: var(--link); }

/* ======================= TOP BAR ======================= */

.topbar {
	height: 48px;
	background: var(--topbar);
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 0 12px 0 14px;
	position: sticky;
	top: 0;
	z-index: 100;
	flex-shrink: 0;
	border-bottom: 1px solid rgba(0, 0, 0, .25);
}

.brand { display: flex; align-items: center; padding: 0 14px 0 2px; }
.brand-text {
	color: #fff;
	font-family: 'Orbitron', 'Source Sans Pro', 'Segoe UI', Arial, sans-serif;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: 1px;
	text-decoration: none;
	cursor: pointer;
}

.nav { display: flex; align-items: center; height: 48px; }

.nav-item {
	height: 100%;
	display: flex;
	align-items: center;
	padding: 0 14px;
	background: none;
	border: none;
	border-radius: 0;
	color: #d0d0d0;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: background .1s, color .1s;
	white-space: nowrap;
}
.nav-item:hover { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: none; }
.nav-item.active { color: #fff; box-shadow: inset 0 -3px 0 var(--link); background: none; }
.nav-item.hidden { display: none; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.search { position: relative; width: 240px; }
.search input,
.search .search-input {
	width: 100%;
	height: 30px;
	padding: 0 10px;
	border: none;
	border-radius: 3px;
	outline: none;
	background: var(--panel);
	color: var(--text);
	font-size: 14px;
}
.search .search-input {
	line-height: 30px;
	overflow: hidden;
	white-space: nowrap;
	cursor: text;
}
.search .search-input:empty::before {
	content: attr(data-placeholder);
	color: var(--muted);
	pointer-events: none;
}
.search input::placeholder { color: var(--muted); }
.search input:focus,
.search .search-input:focus { box-shadow: 0 0 0 2px rgba(2, 183, 87, .5); }

.top-user { display: flex; align-items: center; gap: 7px; padding: 0 6px; cursor: pointer; }
.top-avatar { width: 30px; height: 30px; border-radius: 3px; object-fit: cover; background: #444; }
.top-avatar-fallback {
	width: 30px; height: 30px; border-radius: 3px; background: #444; color: #ddd;
	display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.top-username {
	color: #fff; font-size: 14px; font-weight: 600;
	max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.top-user:hover .top-username { text-decoration: underline; }

.balance {
	display: inline-flex; align-items: center; gap: 6px;
	height: 30px; padding: 0 10px;
	background: rgba(255, 255, 255, .1);
	border-radius: 3px;
	color: #fff; font-weight: 700; font-size: 13px;
}
.balance img { width: 18px; height: 18px; object-fit: contain; display: block; }

.icon-btn {
	background: none;
	border: none;
	color: #d0d0d0;
	cursor: pointer;
	padding: 6px;
	border-radius: 3px;
	display: flex;
	align-items: center;
	justify-content: center;
	height: auto;
}
.icon-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: none; transform: none; }
.icon-btn svg { display: block; }

/* ======================= CONTENT ======================= */

.content {
	padding: 18px 22px 48px;
	max-width: 1240px;
	margin: 0 auto;
	min-height: calc(100vh - 48px);
}

.view { display: none; }
.view.active { display: block; }

/* ======================= AUTH-ONLY SHELL ======================= */
/* Signed-out visitors only ever see the login box. */
html.auth-only .topbar { display: none !important; }
html.auth-only .view { display: none !important; }
html.auth-only main.content {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}
html.auth-only #view-auth.active,
html.auth-only #view-login.active,
html.auth-only #view-register.active,
html.auth-only #view-forgot.active {
	display: flex !important;
	justify-content: center;
	width: 100%;
	padding-top: 0;
}
html.auth-only #view-auth .auth-box,
html.auth-only #view-login .auth-box,
html.auth-only #view-register .auth-box,
html.auth-only #view-forgot .auth-box { margin: 0; }

.section-head {
	border-bottom: 1px solid var(--border);
	margin: 20px 0 14px;
	padding-bottom: 6px;
	display: flex;
	align-items: center;
	gap: 10px;
}
.section-head:first-child { margin-top: 0; }
.section-title { font-size: 20px; font-weight: 700; color: var(--text); }

/* ------------------------------- friends ------------------------------- */
.friends-section { margin-top: 20px; }
.friends-head { justify-content: space-between; }
.friends-count { color: var(--muted); font-size: 16px; font-weight: 600; }
.friends-see-all { color: var(--text-soft); font-size: 14px; font-weight: 600; text-decoration: none; }
.friends-see-all:hover { color: var(--link); }

.friends-strip {
	display: flex;
	gap: 18px;
	overflow-x: auto;
	overflow-y: hidden;
	padding: 2px 2px 16px;
	scrollbar-width: thin;
	scrollbar-color: var(--border-dark) transparent;
}

.friend-card {
	flex: 0 0 auto;
	width: 88px;
	color: var(--text);
	text-decoration: none;
}

.friend-avatar {
	position: relative;
	display: block;
	width: 88px;
	height: 88px;
	border-radius: 50%;
	background: var(--surface-2);
	border: 1px solid var(--border);
}

.friend-face {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	overflow: hidden;
	background: var(--surface-2);
}

.friend-face img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.friend-initial {
	font-size: 34px;
	font-weight: 700;
	color: var(--muted);
	text-transform: uppercase;
	user-select: none;
}

.friend-status {
	position: absolute;
	right: 1px;
	bottom: 1px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	box-shadow: 0 0 0 3px var(--bg);
}
.friend-status.online { background: #2f80ed; }
.friend-status.playing { background: #22c55e; }

.friend-name {
	display: block;
	margin-top: 8px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.view-head { margin-bottom: 6px; }
.view-head h1 { font-size: 24px; font-weight: 700; }

.empty-note { color: var(--muted); font-size: 14px; padding: 10px 2px; }

/* ======================= PANELS & FORMS ======================= */

.panel {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 4px;
	padding: 18px 20px;
}
.panel-title { font-size: 20px; font-weight: 700; color: var(--text); }
.muted { color: var(--muted); font-size: 13px; }

input[type=text], input[type=password], input[type=number], input[type=email],
input:not([type]), textarea, select {
	width: 100%;
	padding: 8px 10px;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 3px;
	color: var(--text);
	font-size: 14px;
	outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--link); box-shadow: none; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input[readonly] { background: var(--surface-2); color: var(--muted); }
textarea { min-height: 110px; resize: vertical; }
select { cursor: pointer; }
input[type=file] { padding: 6px; background: var(--panel); border: 1px solid var(--border); border-radius: 3px; }

.field { display: flex; flex-direction: column; gap: 4px; }
.field > label { font-size: 13px; font-weight: 700; color: var(--muted); }
.form-panel { display: flex; flex-direction: column; gap: 14px; }
.form-panel h2 { font-size: 20px; font-weight: 700; }

/* ======================= BUTTONS ======================= */

button {
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-family: inherit;
	transition: background .12s, border-color .12s;
}

.btn-green, button.primary {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	background: var(--green); color: #fff;
	padding: 9px 22px;
	font-size: 15px; font-weight: 700;
}
.btn-green:hover, button.primary:hover { background: var(--green-dark); }

.btn-grey, button.secondary {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	background: var(--grey-btn); color: var(--text);
	border: 1px solid var(--border);
	padding: 9px 20px;
	font-size: 14px; font-weight: 600;
}
.btn-grey:hover, button.secondary:hover { background: var(--grey-btn-dark); }

.btn-block { width: 100%; }
button:disabled { opacity: .5; cursor: not-allowed; }

.btn-link {
	background: none; color: var(--link); padding: 0;
	font-size: 14px; font-weight: 600;
}
.btn-link:hover { text-decoration: underline; }

/* ======================= CARDS ======================= */

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }

.place-card {
	height: auto;
	min-width: 0;
	padding: 0;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 4px;
	color: var(--text);
	text-align: left;
	cursor: pointer;
	transition: box-shadow .12s, border-color .12s;
}
.place-card:hover {
	border-color: var(--border-dark); box-shadow: var(--shadow);
	background: var(--panel); transform: none;
}
.place-card-media {
	position: relative;
	width: 100%;
	aspect-ratio: 1;
	display: block;
	overflow: hidden;
	background: var(--surface-2);
}
.place-card-image { width: 100%; height: 100%; display: block; object-fit: cover; }
.place-card-image.missing { display: none; }
.place-card-body { padding: 7px 9px 9px; display: flex; flex-direction: column; gap: 2px; }
.place-card-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-card-online { font-size: 12px; color: var(--muted); }

/* ======================= PLACE DETAIL ======================= */

.back-btn {
	display: inline-flex; align-items: center; gap: 6px;
	background: none; border: none; color: var(--link);
	font-size: 14px; font-weight: 600; cursor: pointer;
	padding: 4px 0; margin-bottom: 12px;
}
.back-btn:hover { text-decoration: underline; background: none; }

.place-detail {
	display: flex; gap: 22px; align-items: flex-start;
	background: var(--panel); border: 1px solid var(--border); border-radius: 4px;
	padding: 18px 20px;
	max-width: 860px;
}
.place-detail-img {
	width: 300px; max-width: 45%; aspect-ratio: 1; flex-shrink: 0;
	border-radius: 3px; background: var(--surface-2); overflow: hidden;
	display: flex; align-items: center; justify-content: center;
}
.place-detail-img img { width: 100%; height: 100%; object-fit: cover; }
.place-detail-img .placeholder { color: var(--placeholder); font-size: 52px; font-weight: 700; }
.place-detail-info { flex: 1; min-width: 0; }
.place-detail h1 { font-size: 24px; font-weight: 700; }
.place-detail-author { font-size: 13px; color: var(--muted); margin-top: 2px; }
.place-detail-author a { text-decoration: none; font-weight: 600; }
.place-detail-author a:hover { text-decoration: underline; }
.place-detail-desc { color: var(--muted); font-size: 14px; margin-top: 10px; line-height: 1.5; }
.place-detail-stats { display: flex; gap: 26px; margin-top: 16px; }
.place-detail-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.place-detail-stat-value { font-size: 17px; font-weight: 700; }
.place-detail-stat-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.place-detail-play {
	margin-top: 18px;
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	background: var(--green); color: #fff;
	padding: 11px 44px;
	font-size: 16px; font-weight: 700;
}
.place-detail-play:hover { background: var(--green-dark); }
.place-detail-play svg { width: 18px; height: 18px; }

/* ======================= MARKETPLACE ======================= */

.market-categories { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.market-category {
	height: 30px; padding: 0 14px;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 3px;
	color: var(--text-soft);
	font-size: 13px; font-weight: 600;
}
.market-category:hover { background: var(--surface-2); }
.market-category.active { background: var(--green); border-color: var(--green); color: #fff; }
.market-category.active:hover { background: var(--green-dark); }

.market-item-card {
	min-width: 0; overflow: hidden;
	display: flex; flex-direction: column;
	background: var(--panel); border: 1px solid var(--border); border-radius: 4px;
	transition: box-shadow .12s, border-color .12s;
}
.market-item-card:hover { border-color: var(--border-dark); box-shadow: var(--shadow); }
.market-item-media { height: 170px; background: var(--surface-2); overflow: hidden; }
.market-item-media img,
.market-item-preview, .market-item-preview canvas, .market-item-preview img {
	width: 100%; height: 100%; display: block; object-fit: contain;
}
.market-item-info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.market-item-name { font-size: 14px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.market-item-footer { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; margin-top: auto; }
.market-buy-button { width: 100%; padding: 7px 0; background: var(--green); color: #fff; font-size: 13px; font-weight: 700; }
.market-buy-button:hover { background: var(--green-dark); }

/* ======================= AVATAR ======================= */

.avatar-layout { display: flex; gap: 20px; align-items: flex-start; }
.avatar-preview {
	width: 320px; height: 400px; flex-shrink: 0;
	background: var(--panel); border: 1px solid var(--border); border-radius: 4px;
	overflow: hidden; display: flex; align-items: center; justify-content: center;
	position: sticky; top: 66px;
}
#avatarPreview3d {
	position: relative;
	width: 100%; height: 100%;
	overflow: hidden;
	background: var(--surface-2);
	cursor: grab;
}
#avatarPreview3d:active { cursor: grabbing; }
#avatarPreview3d canvas,
#profileAvatarPreview canvas {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	display: block;
}

.avatar-editor {
	flex: 1; min-width: 0;
	display: flex; flex-direction: column; gap: 4px;
	background: var(--panel); border: 1px solid var(--border); border-radius: 4px;
	padding: 18px 20px;
}
.avatar-editor .panel-title { margin-bottom: 2px; }
.profile-balance {
	display: inline-flex; align-items: center; gap: 6px;
	align-self: flex-start;
	margin: 8px 0 4px;
	padding: 4px 12px;
	background: var(--surface-2); border: 1px solid var(--border); border-radius: 3px;
}
.profile-token-icon { width: 18px; height: 18px; object-fit: contain; }
.profile-balance span:not(.profile-balance-label) { font-size: 15px; font-weight: 700; }
.profile-balance-label { font-size: 12px; color: var(--muted); }

.editor-label {
	font-size: 13px; font-weight: 700; color: var(--muted);
	text-transform: uppercase; letter-spacing: .4px;
	margin: 18px 0 10px;
}

.color-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.color-swatch {
	display: flex; align-items: center; gap: 10px;
	background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 7px 10px;
}
.color-swatch label { font-size: 13px; font-weight: 600; color: var(--text-soft); flex: 1; }
.color-swatch input[type=color] {
	-webkit-appearance: none; appearance: none;
	width: 28px; height: 28px; padding: 0; flex-shrink: 0;
	border: 1px solid var(--border); border-radius: 3px;
	background: none; cursor: pointer;
}
.color-swatch input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.color-swatch input[type=color]::-webkit-color-swatch { border: none; border-radius: 2px; }

.avatar-items { display: flex; flex-direction: column; gap: 18px; }
.avatar-item-section h2 { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.avatar-item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.avatar-item-card {
	height: auto; min-width: 0; padding: 0; overflow: hidden; position: relative;
	display: grid; grid-template-rows: 110px auto;
	background: var(--panel); border: 1px solid var(--border); border-radius: 4px;
	color: var(--text); text-align: left; cursor: pointer;
}
.avatar-item-card:hover {
	border-color: var(--border-dark); background: var(--panel);
	box-shadow: var(--shadow); transform: none;
}
.avatar-item-card.equipped { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.avatar-item-check {
	position: absolute; z-index: 3; top: 5px; right: 7px;
	color: var(--green); font-size: 20px; line-height: 1; font-weight: 900;
}
.avatar-item-preview { width: 100%; height: 110px; display: block; background: var(--surface-2); overflow: hidden; }
.avatar-item-preview canvas, .avatar-item-preview model-viewer, .avatar-item-preview img {
	width: 100%; height: 100%; display: block; object-fit: contain;
}
.avatar-item-name {
	min-width: 0; padding: 7px 9px;
	font-size: 12.5px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere;
}
.avatar-items-empty { color: var(--muted); font-size: 14px; }

/* ======================= CREATE ======================= */

.edit-panel {
	background: var(--panel); border: 1px solid var(--border); border-radius: 4px;
	padding: 18px 20px; display: flex; flex-direction: column; gap: 14px;
}
.edit-panel h2 { font-size: 20px; font-weight: 700; }
.content-section.narrow { max-width: 720px; }
.upload-fields { display: flex; flex-direction: column; gap: 12px; }
.upload-field-group { display: flex; flex-direction: column; gap: 5px; }
.upload-field-group label { font-size: 13px; font-weight: 700; color: var(--muted); }
.template-help { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 10px 12px; }
.template-help a { font-weight: 600; }

/* ======================= UPDATES ======================= */

.update-card { max-width: 760px; margin-bottom: 18px; }
.uv-versions { display: flex; gap: 40px; margin-bottom: 12px; }
.uv-item { display: flex; flex-direction: column; gap: 2px; }
.uv-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.uv-value { font-size: 20px; font-weight: 700; }
.uv-accent { color: var(--green); }
.uv-desc { font-size: 13px; color: var(--muted); margin-top: 2px; }
.uv-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

.updates-list { display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.update-entry { background: var(--panel); border: 1px solid var(--border); border-radius: 4px; padding: 12px 16px; }
.update-entry.latest { border-color: var(--green); }
.update-head { display: flex; align-items: center; gap: 10px; }
.update-version { font-size: 16px; font-weight: 700; }
.update-badge {
	font-size: 11px; font-weight: 700; text-transform: uppercase;
	background: var(--green); color: #fff; padding: 2px 7px; border-radius: 3px;
}
.update-date { font-size: 13px; color: var(--muted); margin-left: auto; }
.update-notes { margin: 8px 0 0; padding-left: 20px; }
.update-notes li { font-size: 14px; color: var(--text-soft); line-height: 1.6; }

/* ======================= AUTH / BAN ======================= */

#view-auth.active, #view-login.active, #view-register.active, #view-forgot.active, #view-ban.active { display: flex; justify-content: center; padding-top: 30px; }
.auth-box {
	width: 100%; max-width: 380px;
	background: var(--panel); border: 1px solid var(--border); border-radius: 4px;
	padding: 24px 24px 20px;
	display: flex; flex-direction: column; align-items: center;
}
.auth-subtitle { color: var(--muted); margin-top: 4px; font-size: 14px; }
.auth-form { width: 100%; margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.auth-form > .panel-title, .auth-form > .auth-subtitle { text-align: center; }
.auth-field { display: flex; flex-direction: column; gap: 4px; }
.auth-field label { font-size: 13px; font-weight: 700; color: var(--muted); }
.auth-error { font-size: 13px; color: var(--red); min-height: 0; line-height: 1.4; }
.auth-switch { margin-top: 14px; font-size: 14px; color: var(--muted); }
.auth-switch a { text-decoration: none; font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

.ban-page { max-width: 460px; }
.ban-page h2 { font-size: 20px; font-weight: 700; text-align: center; }
.ban-details { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }

/* ======================= SEARCH DROPDOWN ======================= */

.search-dropdown {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	width: 420px;
	max-width: calc(100vw - 32px);
	background: var(--panel);
	border: 1px solid var(--border-dark);
	border-radius: 3px;
	box-shadow: var(--shadow-lg);
	overflow: hidden;
	z-index: 120;
	max-height: 460px;
	display: flex;
	flex-direction: column;
}
.search-dropdown.hidden { display: none !important; }
.search-tabs { display: flex; gap: 4px; padding: 7px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.search-tab {
	height: 26px; padding: 0 11px;
	background: none; border: 1px solid transparent; border-radius: 3px;
	color: var(--muted); font-size: 12.5px; font-weight: 600;
}
.search-tab:hover { background: var(--surface-3); }
.search-tab.active { background: var(--panel); border-color: var(--border); color: var(--text); }
.search-results { flex: 1; overflow-y: auto; padding: 4px 0; }
.search-result-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; }
.search-result-item:hover { background: var(--surface-2); }
.search-result-icon {
	width: 34px; height: 34px; flex-shrink: 0;
	border-radius: 3px; background: var(--surface-2); overflow: hidden;
	display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.search-result-icon img { width: 100%; height: 100%; object-fit: cover; }
.search-result-info { flex: 1; min-width: 0; }
.search-result-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-empty, .search-result-loading { padding: 22px 12px; text-align: center; color: var(--muted); font-size: 13px; }

/* ======================= MODALS ======================= */

.purchase-modal {
	position: fixed; inset: 0; z-index: 200;
	background: rgba(0, 0, 0, .5);
	display: flex; align-items: center; justify-content: center;
	padding: 16px;
}
.purchase-modal.hidden { display: none !important; }

.purchase-dialog {
	width: 400px; max-width: 100%;
	background: var(--panel); border: 1px solid var(--border-dark); border-radius: 4px;
	padding: 22px 22px 18px;
	position: relative;
	box-shadow: var(--modal-shadow);
}
.purchase-close {
	position: absolute; top: 8px; right: 10px;
	width: 28px; height: 28px; padding: 0;
	background: none; color: var(--muted); font-size: 22px; line-height: 1;
	border-radius: 3px;
}
.purchase-close:hover { background: var(--surface-2); color: var(--text); }
.purchase-preview {
	width: 110px; height: 110px; margin: 4px auto 14px;
	background: var(--surface-2); border: 1px solid var(--border); border-radius: 3px; overflow: hidden;
}
.purchase-preview img { width: 100%; height: 100%; object-fit: contain; }
.purchase-dialog h2 { font-size: 19px; font-weight: 700; text-align: center; }
.purchase-dialog p { text-align: center; color: var(--muted); margin: 4px 0 14px; font-size: 13.5px; }
.purchase-price {
	display: flex; align-items: center; justify-content: center; gap: 8px;
	font-size: 19px; font-weight: 700; margin-bottom: 18px;
}
.purchase-price img { width: 24px; height: 24px; }
.purchase-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.purchase-actions button { padding: 9px 12px; }
.purchase-actions #purchaseConfirm, .purchase-actions #resultOk { background: var(--green); color: #fff; font-weight: 700; }
.purchase-actions #purchaseConfirm:hover, .purchase-actions #resultOk:hover { background: var(--green-dark); }
.result-dialog .purchase-actions { grid-template-columns: 1fr; }

.modal-title { font-size: 16px; font-weight: 600; text-align: center; line-height: 1.4; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn-grey, .modal-actions .btn-green { flex: 1; }

/* ======================= TOAST ======================= */
.toast {
	position: fixed; left: 50%; bottom: 26px;
	transform: translateX(-50%) translateY(12px);
	background: var(--topbar); color: #fff;
	border: 1px solid rgba(0, 0, 0, .5); border-radius: 4px;
	padding: 10px 20px;
	font-size: 14px; font-weight: 600;
	opacity: 0; pointer-events: none;
	transition: opacity .2s, transform .2s;
	z-index: 300; max-width: calc(100vw - 32px); text-align: center;
}
:root[data-theme="dark"] .toast { border-color: var(--border-dark); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ======================= STORE PAGE ======================= */
.page-wrap { max-width: 1100px; margin: 0 auto; padding: 26px 22px 48px; }
.store-container { display: flex; gap: 28px; align-items: flex-start; }
.store-item-panel {
	width: 360px; flex-shrink: 0;
	background: var(--panel); border: 1px solid var(--border); border-radius: 4px;
	overflow: hidden; position: sticky; top: 66px;
}
#storeItemPreview {
	width: 100%; aspect-ratio: 1/1; background: var(--surface-2);
	display: flex; align-items: center; justify-content: center; overflow: hidden;
}
#storeItemPreview img { width: 100%; height: 100%; object-fit: contain; }
#storeItemPreview model-viewer { width: 100%; height: 100%; }
.store-info { flex: 1; min-width: 0; }
.store-header { padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.store-name { font-size: 28px; font-weight: 700; }
.store-creator { font-size: 14px; color: var(--muted); }
.store-creator a { font-weight: 600; text-decoration: none; }
.store-creator a:hover { text-decoration: underline; }
.store-details { display: flex; flex-direction: column; gap: 6px; }
.store-detail-item {
	display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px;
	background: var(--panel); border: 1px solid var(--border); border-radius: 3px;
}
.store-detail-label { color: var(--muted); font-weight: 600; }
.store-detail-value { font-weight: 600; }
.store-description {
	margin-top: 12px; padding: 12px 14px;
	background: var(--panel); border: 1px solid var(--border); border-radius: 3px;
	color: var(--text-soft); line-height: 1.55;
}
.store-buy-section {
	margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border);
	display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.store-price { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.store-price img { width: 24px; height: 24px; }
.store-buy-button { padding: 11px 32px; background: var(--green); color: #fff; font-size: 15px; font-weight: 700; }
.store-buy-button:hover { background: var(--green-dark); }
.store-owned-badge {
	padding: 7px 18px; background: var(--surface-2); border: 1px solid var(--green);
	border-radius: 3px; color: var(--green); font-weight: 700; font-size: 14px;
}
.store-error, .store-loading { text-align: center; padding: 60px 20px; color: var(--muted); }
.store-error h2, .store-loading h2 { color: var(--text); font-size: 20px; margin-bottom: 8px; }
.store-error button { margin-top: 14px; }

/* ======================= PROFILE PAGE ======================= */
.profile-container { display: flex; gap: 28px; align-items: flex-start; }
.profile-avatar-panel {
	width: 360px; flex-shrink: 0;
	background: var(--panel); border: 1px solid var(--border); border-radius: 4px;
	overflow: hidden; position: sticky; top: 66px;
	height: fit-content;
}
#profileAvatarPreview {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	height: auto;
	max-height: 460px;
	overflow: hidden;
	background: var(--surface-2);
	cursor: grab;
	touch-action: pan-y;
}
#profileAvatarPreview:active { cursor: grabbing; }
.profile-info { flex: 1; min-width: 0; }
.profile-header { padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.profile-username { font-size: 28px; font-weight: 700; }
.profile-status { font-size: 14px; color: var(--muted); }
.profile-details { display: flex; flex-direction: column; gap: 6px; }
.profile-detail-item {
	display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px;
	background: var(--panel); border: 1px solid var(--border); border-radius: 3px;
}
.profile-detail-label { color: var(--muted); font-weight: 600; }
.profile-detail-value { font-weight: 600; }
.profile-error { text-align: center; padding: 60px 20px; color: var(--muted); }
.profile-error h2 { color: var(--text); font-size: 20px; margin-bottom: 8px; }
.profile-error button { margin-top: 14px; }

/* ======================= UTILITIES ======================= */
.hidden { display: none !important; }

/* ======================= RESPONSIVE ======================= */
@media (max-width: 1100px) {
	.search { width: 180px; }
}

@media (max-width: 900px) {
	.topbar { height: auto; flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
	.nav { order: 3; width: 100%; height: 38px; overflow-x: auto; }
	.nav-item { padding: 0 10px; font-size: 13.5px; }
	.topbar-right { margin-left: auto; }
	.search { width: 150px; }
	.content { padding: 14px 14px 40px; }
	.avatar-layout, .store-container, .profile-container { flex-direction: column; }
	.avatar-preview, .store-item-panel, .profile-avatar-panel { position: static; width: 100%; max-width: 360px; margin: 0 auto; }
	.place-detail { flex-direction: column; }
	.place-detail-img { max-width: 100%; width: 100%; }
	.color-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
	.brand-text { font-size: 16px; letter-spacing: 1px; }
	.top-username { display: none; }
	.search { width: 120px; }
	.card-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
	.purchase-actions { grid-template-columns: 1fr; }
}

@keyframes spin { to { transform: rotate(360deg); } }

/* =====================================================================
   MODERN UI PASS (home hero, profile, footer, auth)
   ===================================================================== */

[hidden] { display: none !important; }

:root {
	--radius-lg: 20px;
	--radius-md: 14px;
	--radius-sm: 10px;
	--panel-glow: rgba(0, 116, 189, .10);
	--hero-shadow: 0 24px 60px rgba(0, 0, 0, .18);
}
:root[data-theme="dark"] {
	--panel-glow: rgba(2, 183, 87, .08);
	--hero-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}

body {
	background:
		radial-gradient(900px 520px at 12% -10%, var(--panel-glow), transparent 60%),
		radial-gradient(700px 480px at 100% 0%, rgba(2, 183, 87, .05), transparent 60%),
		var(--bg);
	background-attachment: fixed;
}

/* top bar */
.topbar {
	height: 56px;
	box-shadow: 0 1px 0 rgba(255, 255, 255, .05), 0 12px 34px rgba(0, 0, 0, .18);
}
.nav { height: 56px; }
.nav-item {
	height: 36px;
	margin: 0 2px;
	padding: 0 15px;
	border-radius: 999px;
}
.nav-item.active {
	background: rgba(255, 255, 255, .12);
	box-shadow: none;
}
.content {
	max-width: 1240px;
	padding: 26px 22px 54px;
	min-height: calc(100vh - 56px);
}
.section-head { border-bottom: 0; margin: 28px 0 16px; padding-bottom: 0; }
.section-title { font-size: 22px; letter-spacing: -.2px; }

/* home hero */
.home-hero {
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: 344px;
	border-radius: var(--radius-lg);
	overflow: hidden;
	background: linear-gradient(135deg, #1b2430, #0f141a);
	box-shadow: var(--hero-shadow);
	isolation: isolate;
}
.home-hero-media { position: absolute; inset: 0; }
.home-hero-media img {
	width: 100%; height: 100%; object-fit: cover;
	transform: scale(1.02);
}
.home-hero-shade {
	position: absolute; inset: 0;
	background:
		linear-gradient(90deg, rgba(8, 10, 14, .94) 0%, rgba(8, 10, 14, .62) 46%, rgba(8, 10, 14, .12) 100%),
		linear-gradient(0deg, rgba(8, 10, 14, .82), transparent 58%);
}
.home-hero-content {
	position: relative; z-index: 1;
	padding: 38px 42px;
	max-width: 650px;
	color: #fff;
}
.home-hero-kicker {
	display: inline-flex; align-items: center;
	font-size: 11px; font-weight: 800;
	letter-spacing: 1.6px; text-transform: uppercase;
	color: #8fe6b6;
}
.home-hero-content h1 {
	font-size: 40px; line-height: 1.04;
	margin: 10px 0 8px;
	letter-spacing: -.6px;
}
.home-hero-content p {
	color: rgba(255, 255, 255, .78);
	font-size: 15px; line-height: 1.55;
	max-width: 540px;
}
.home-hero-meta {
	display: flex; align-items: center; gap: 8px;
	margin-top: 14px;
	font-size: 13px; color: rgba(255, 255, 255, .62);
}
.home-hero-dot { opacity: .6; }
.home-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.btn-play {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 12px 24px; border-radius: 999px;
	background: linear-gradient(135deg, #02c865, #02a84f);
	color: #06130c; font-size: 15px; font-weight: 800;
	box-shadow: 0 10px 26px rgba(2, 187, 92, .35);
}
.btn-play svg { width: 15px; height: 15px; }
.btn-play:hover { filter: brightness(1.06); }

.btn-ghost {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 11px 18px; border-radius: 999px;
	border: 1px solid var(--border);
	background: var(--panel);
	color: var(--text);
	font-size: 14px; font-weight: 600;
	text-decoration: none;
	transition: background .15s, border-color .15s;
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-dark); }
.home-hero .btn-ghost {
	color: #fff;
	border-color: rgba(255, 255, 255, .26);
	background: rgba(255, 255, 255, .07);
}
.home-hero .btn-ghost:hover { background: rgba(255, 255, 255, .14); }

/* home stats */
.home-stats {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin: 16px 0 6px;
}
.home-stat {
	display: flex; flex-direction: column; gap: 3px;
	padding: 16px 18px;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	box-shadow: 0 10px 28px rgba(0, 0, 0, .04);
}
.home-stat-value { font-size: 24px; font-weight: 800; }
.home-stat-label {
	font-size: 10px; font-weight: 800; letter-spacing: .9px;
	text-transform: uppercase; color: var(--muted);
}

/* place cards */
.place-card {
	border-radius: var(--radius-md);
	transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
	text-decoration: none;
}
.place-card:hover {
	transform: translateY(-3px);
	border-color: var(--border-dark);
	box-shadow: 0 16px 36px rgba(0, 0, 0, .14);
}
.place-card-image { transition: transform .35s ease; }
.place-card:hover .place-card-image { transform: scale(1.04); }
.place-card-body { padding: 10px 12px 12px; }
.place-card-name { font-size: 14px; }

/* auth */
.auth-box {
	max-width: 420px;
	padding: 34px 32px 30px;
	border-radius: var(--radius-lg);
	border: 1px solid var(--border);
	background: linear-gradient(180deg, var(--panel), var(--surface-2));
	box-shadow: 0 30px 80px rgba(0, 0, 0, .18);
}
.auth-logo {
	font-family: 'Orbitron', 'Source Sans Pro', sans-serif;
	font-size: 22px; font-weight: 700; letter-spacing: 2px;
	margin-bottom: 18px;
}
.auth-box .panel-title { font-size: 26px; }
.auth-box .btn-green, .auth-box .btn-grey { border-radius: 999px; }

/* footer */
.site-footer {
	margin-top: 48px;
	border-top: 1px solid var(--border);
	background: var(--panel);
}
.site-footer-inner {
	max-width: 1240px; margin: 0 auto;
	padding: 26px 22px;
	display: flex; align-items: flex-start; justify-content: space-between;
	gap: 24px; flex-wrap: wrap;
}
.footer-logo { font-family: 'Orbitron', sans-serif; font-size: 16px; letter-spacing: 1px; }
.site-footer-brand p { color: var(--muted); font-size: 13px; margin-top: 6px; max-width: 300px; }
.site-footer-links { display: flex; flex-wrap: wrap; gap: 16px; padding-top: 3px; }
.site-footer-links a { color: var(--text-soft); font-size: 14px; font-weight: 600; text-decoration: none; }
.site-footer-links a:hover { color: var(--link); }
.site-footer-meta { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 8px; }
.site-footer-dot { opacity: .5; }
.site-footer-meta a { color: var(--text-soft); font-weight: 600; text-decoration: none; }
.site-footer-meta a:hover { color: var(--link); }
html.auth-only .site-footer { display: none !important; }

/* profile */
.profile-page { max-width: 1120px; padding-top: 22px; }
.profile-banner {
	position: relative;
	height: 190px;
	border-radius: var(--radius-lg);
	overflow: hidden;
	background:
		radial-gradient(620px 260px at 16% 0%, var(--profile-accent-2, #7fb2ff), transparent 62%),
		linear-gradient(120deg, var(--profile-accent, #2f7eea), #0d1218 88%);
	box-shadow: var(--hero-shadow);
}
.profile-banner-grid {
	position: absolute; inset: 0;
	background-image:
		linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
	background-size: 46px 46px;
	mask-image: linear-gradient(90deg, rgba(0, 0, 0, .9), transparent 75%);
	-webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, .9), transparent 75%);
}
.profile-main {
	display: grid;
	grid-template-columns: 320px minmax(0, 1fr);
	gap: 20px;
	align-items: start;
	margin-top: -74px;
	padding: 0 24px;
	position: relative;
	z-index: 1;
}
.profile-card, .profile-details-panel {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	box-shadow: 0 18px 46px rgba(0, 0, 0, .10);
}
.profile-card { overflow: hidden; }
.profile-avatar-frame {
	height: 330px;
	background:
		radial-gradient(80% 70% at 50% 35%, var(--surface-3), var(--surface-2));
	border-bottom: 1px solid var(--border);
	overflow: hidden;
}
.profile-avatar-frame #profileAvatarPreview {
	width: 100%; height: 100%;
	aspect-ratio: auto; max-height: none;
	background: transparent;
}
.profile-card-body { padding: 18px 20px 20px; text-align: center; }
.profile-username { font-size: 24px; font-weight: 800; letter-spacing: -.3px; }
.profile-status {
	display: inline-flex; align-items: center; gap: 7px;
	margin-top: 10px; padding: 5px 12px;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: var(--surface-2);
	color: var(--muted);
	font-size: 11px; font-weight: 800;
	letter-spacing: .5px; text-transform: uppercase;
}
.profile-status::before {
	content: ""; width: 7px; height: 7px; border-radius: 50%;
	background: currentColor;
}
.profile-status.online { color: #2f80ed; border-color: rgba(47, 128, 237, .35); background: rgba(47, 128, 237, .08); }
.profile-status.playing { color: #22c55e; border-color: rgba(34, 197, 94, .35); background: rgba(34, 197, 94, .08); }
.profile-status.offline { color: var(--muted); }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.profile-actions .btn-ghost { padding: 8px 13px; font-size: 12px; }
.profile-details-panel { padding: 24px; }
.profile-stats {
	display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
}
.profile-stat {
	padding: 14px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	text-align: center;
}
.profile-stat-value { display: block; font-size: 20px; font-weight: 800; }
.profile-stat-label {
	display: block; margin-top: 3px;
	font-size: 10px; font-weight: 800; letter-spacing: .8px;
	text-transform: uppercase; color: var(--muted);
}
.profile-section { margin-top: 24px; }
.profile-section-title { font-size: 18px; font-weight: 800; }
.profile-section-head { margin-bottom: 12px; }
.profile-about {
	display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px; margin-top: 12px;
}
.profile-about-row {
	display: flex; justify-content: space-between; gap: 12px;
	padding: 10px 12px;
	background: var(--surface-2);
	border-radius: var(--radius-sm);
	font-size: 13px;
}
.profile-about-label { color: var(--muted); font-weight: 600; }
.profile-about-value { font-weight: 700; text-align: right; }
.profile-places { margin-top: 12px; }
.profile-loading {
	display: flex; gap: 20px; padding: 40px 0;
}
.profile-loading-avatar {
	width: 320px; height: 330px; border-radius: var(--radius-lg);
	background: var(--surface-2);
	animation: profile-pulse 1.2s ease-in-out infinite;
}
.profile-loading-lines { flex: 1; display: flex; flex-direction: column; gap: 12px; padding-top: 18px; }
.profile-loading-lines span {
	display: block; height: 18px; border-radius: 8px;
	background: var(--surface-2);
	animation: profile-pulse 1.2s ease-in-out infinite;
}
.profile-loading-lines span:nth-child(1) { width: 45%; height: 28px; }
.profile-loading-lines span:nth-child(2) { width: 80%; }
.profile-loading-lines span:nth-child(3) { width: 65%; }
@keyframes profile-pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

@media (max-width: 900px) {
	.home-hero { min-height: 300px; }
	.home-hero-content { padding: 26px; }
	.home-hero-content h1 { font-size: 30px; }
	.home-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.profile-main { grid-template-columns: 1fr; margin-top: -52px; padding: 0 12px; }
	.profile-avatar-frame { height: 270px; }
	.profile-details-panel { padding: 18px; }
	.profile-about { grid-template-columns: 1fr; }
	.profile-loading-avatar { width: 100%; height: 260px; }
}
@media (max-width: 560px) {
	.home-hero-content h1 { font-size: 25px; }
	.home-stats { grid-template-columns: 1fr; }
	.site-footer-inner { flex-direction: column; }
	.profile-stats { grid-template-columns: 1fr; }
}

/* =====================================================================
   MODERN UI PASS - remaining pages (avatar, market, create, creator,
   updates, settings, place, store, ban)
   ===================================================================== */

.view-subtitle { color: var(--muted); font-size: 14px; margin: -8px 0 20px; max-width: 720px; }

/* shared surfaces and forms */
.panel, .edit-panel, .avatar-editor, .avatar-preview, .update-card, .store-info, .store-item-panel {
	border-radius: var(--radius-lg);
	border: 1px solid var(--border);
	box-shadow: 0 14px 38px rgba(0, 0, 0, .06);
}
.edit-panel { padding: 30px; gap: 18px; }
.edit-panel h2 { font-size: 24px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
	font-size: 11px; font-weight: 800; letter-spacing: .7px;
	text-transform: uppercase; color: var(--muted);
}
.field input, .field select, .field textarea {
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 11px 12px;
	outline: none;
	transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
	border-color: var(--link);
	box-shadow: 0 0 0 3px rgba(0, 116, 189, .14);
}
.field textarea { min-height: 110px; resize: vertical; }

/* avatar editor */
.avatar-layout {
	display: grid;
	grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
	gap: 22px;
	align-items: start;
}
.avatar-preview {
	position: sticky;
	top: 76px;
	width: auto;
	max-width: none;
	height: 540px;
	overflow: hidden;
	background: radial-gradient(80% 70% at 50% 35%, var(--surface-3), var(--surface-2));
}
#avatarPreview3d { width: 100%; height: 100%; }
.avatar-editor { padding: 26px 28px 28px; }
.avatar-editor .panel-title { font-size: 28px; }
.avatar-editor .profile-balance {
	display: inline-flex; align-items: center; gap: 8px;
	margin-top: 10px; padding: 6px 12px;
	background: var(--surface-2); border: 1px solid var(--border);
	border-radius: 999px; font-weight: 700;
}
.editor-label {
	margin: 24px 0 10px;
	font-size: 11px; font-weight: 800; letter-spacing: 1px;
	text-transform: uppercase; color: var(--muted);
}
.color-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.color-swatch {
	display: flex; align-items: center; gap: 10px;
	padding: 9px 10px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 12px;
}
.color-swatch label { font-size: 12px; font-weight: 600; color: var(--muted); }
.color-swatch input[type="color"] {
	width: 34px; height: 34px; padding: 0;
	border: 0; background: none; cursor: pointer;
}
.avatar-items { display: flex; flex-direction: column; gap: 18px; }
.avatar-item-section h2 { font-size: 15px; font-weight: 800; margin-bottom: 10px; }
.avatar-item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.avatar-item-card {
	position: relative;
	border-radius: 14px;
	border: 1px solid var(--border);
	overflow: hidden;
	background: var(--panel);
	transition: transform .15s, box-shadow .15s, border-color .15s;
}
.avatar-item-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,.1); border-color: var(--border-dark); }
.avatar-item-card.equipped { border-color: var(--green); box-shadow: 0 0 0 1px var(--green) inset; }
.avatar-item-preview { height: 92px; }
.avatar-item-name { padding: 8px 10px; font-size: 12px; font-weight: 600; }
#saveAvatar { margin-top: 22px; border-radius: 999px; padding: 12px 20px; }

/* marketplace */
.market-categories { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.market-category {
	padding: 8px 16px;
	border-radius: 999px;
	background: var(--panel);
	border: 1px solid var(--border);
	font-size: 13px; font-weight: 700;
	transition: background .15s, color .15s, border-color .15s;
}
.market-category:hover { background: var(--surface-2); }
.market-category.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.market-item-card {
	border-radius: 16px;
	overflow: hidden;
	background: var(--panel);
	border: 1px solid var(--border);
	transition: transform .16s, box-shadow .16s, border-color .16s;
}
.market-item-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(0,0,0,.13); border-color: var(--border-dark); }
.market-item-media { aspect-ratio: 1; background: var(--surface-2); }
.market-item-info { padding: 12px 14px 14px; }
.market-item-name { font-size: 14px; font-weight: 700; }
.market-buy-button { border-radius: 999px; padding: 8px 16px; }

/* create */
.content-section.narrow { max-width: 820px; margin: 0 auto; }
#view-create .edit-panel { background: var(--panel); }
.upload-fields { display: flex; flex-direction: column; gap: 12px; }
.upload-fields .field { padding: 12px; background: var(--surface-2); border: 1px dashed var(--border-dark); border-radius: 12px; }

/* creator */
#view-creator .panel { max-width: 860px; margin: 0 auto; padding: 34px; }
#view-creator .panel-title { font-size: 28px; }
.creator-features {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin-top: 22px;
}
.creator-feature {
	padding: 16px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 14px;
}
.creator-feature strong { display: block; font-size: 15px; margin-bottom: 4px; }
.creator-feature span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.creator-feature::before {
	content: "";
	display: block;
	width: 26px; height: 26px;
	margin-bottom: 10px;
	border-radius: 8px;
	background: linear-gradient(135deg, var(--green), var(--link));
	opacity: .85;
}

/* updates */
.update-card { max-width: 860px; padding: 26px; }
.uv-versions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.uv-item {
	display: flex; flex-direction: column; gap: 3px;
	padding: 13px 16px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 12px;
	min-width: 140px;
}
.uv-label { font-size: 10px; letter-spacing: .7px; }
.uv-value { font-size: 20px; }
.updates-list { max-width: 860px; gap: 12px; margin-top: 18px; }
.update-entry {
	padding: 18px 20px;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 14px;
	transition: border-color .15s;
}
.update-entry.latest { border-color: var(--green); box-shadow: 0 0 0 1px var(--green) inset; }
.update-head { display: flex; align-items: center; gap: 10px; }
.update-version { font-size: 16px; font-weight: 800; }
.update-badge {
	padding: 2px 8px; border-radius: 999px;
	background: var(--green); color: #fff;
	font-size: 10px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase;
}
.update-date { margin-left: auto; font-size: 12px; color: var(--muted); }
.update-notes { margin-top: 8px; padding-left: 18px; }
.update-notes li { font-size: 13px; line-height: 1.6; color: var(--text-soft); }

/* settings */
#view-settings .panel { max-width: 560px; padding: 26px 28px; }
#view-settings .field input { background: var(--surface-2); }

/* place detail */
.place-detail {
	max-width: 980px;
	margin: 0 auto;
	padding: 0;
	gap: 0;
	overflow: hidden;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	box-shadow: var(--hero-shadow);
}
.place-detail-img {
	width: 44%;
	max-width: none;
	aspect-ratio: 1;
	border-radius: 0;
}
.place-detail-info { padding: 30px; }
.place-detail h1 { font-size: 32px; letter-spacing: -.4px; }
.place-detail-author { margin-top: 6px; }
.place-detail-desc { margin-top: 16px; font-size: 14px; line-height: 1.6; }
.place-detail-stats { margin-top: 20px; gap: 30px; }
.place-detail-stat-value { font-size: 22px; }
.place-detail-play {
	margin-top: 22px;
	border-radius: 999px;
	padding: 12px 42px;
	background: linear-gradient(135deg, #02c865, #02a84f);
	box-shadow: 0 10px 26px rgba(2, 187, 92, .28);
	/* The global button transition cannot interpolate a gradient->solid
	   hover change; it caused a one-frame blink. */
	transition: none;
}
.place-detail-play:hover {
	background: linear-gradient(135deg, #02b45a, #029647);
}

/* store */
.store-container { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.store-item-panel { overflow: hidden; aspect-ratio: 1; width: auto; max-width: none; }
.store-info { padding: 30px; }
.store-name { font-size: 30px; letter-spacing: -.4px; }
.store-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.store-detail-item {
	background: var(--surface-2);
	border: 0;
	border-radius: 10px;
	padding: 10px 12px;
}
.store-description {
	background: var(--surface-2);
	border: 0;
	border-radius: 12px;
	padding: 14px 16px;
}
.store-buy-section { border-top: 0; margin-top: 22px; padding-top: 0; }
.store-price { font-size: 24px; }
.store-buy-button { border-radius: 999px; padding: 12px 34px; }

/* ban */
.ban-page { border-radius: var(--radius-lg); padding: 30px; box-shadow: var(--hero-shadow); }

@media (max-width: 900px) {
	.avatar-layout { grid-template-columns: 1fr; }
	.avatar-preview {
		position: static;
		height: 380px;
		max-width: 420px;
		width: 100%;
		margin: 0 auto;
	}
	.creator-features { grid-template-columns: 1fr; }
	.store-container { grid-template-columns: 1fr; }
	.store-item-panel { max-width: 420px; margin: 0 auto; width: 100%; }
	.place-detail-info { padding: 22px; }
}
@media (max-width: 560px) {
	.edit-panel, #view-creator .panel, .store-info { padding: 20px; }
	.color-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.market-categories { gap: 6px; }
	.market-category { padding: 7px 12px; font-size: 12px; }
	.place-detail h1 { font-size: 26px; }
	.store-name { font-size: 24px; }
}

/* beta keys (admin settings) */
.beta-key-actions { display: flex; align-items: center; gap: 8px; margin: 16px 0 12px; flex-wrap: wrap; }
.beta-key-list { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow: auto; }
.beta-key-row {
	display: flex; align-items: center; gap: 10px;
	padding: 9px 12px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 10px;
	font-size: 13px;
}
.beta-key-row.used { opacity: .55; }
.beta-key-row code {
	font-family: 'Consolas', 'Courier New', monospace;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .2px;
}
.beta-key-state { margin-left: auto; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.beta-key-copy { padding: 6px 12px; font-size: 12px; border-radius: 999px; }

/* ======================= ADMIN REPORTS ======================= */
.icon-btn { position: relative; }
.admin-badge {
	position: absolute;
	top: -2px;
	right: -2px;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	border-radius: 999px;
	background: #e53935;
	color: #fff;
	font-size: 10px;
	font-weight: 800;
	line-height: 16px;
	text-align: center;
	box-shadow: 0 0 0 2px var(--topbar);
}
.admin-report-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 14px 0 18px;
}
.admin-report-toolbar .btn-grey { padding: 7px 13px; font-size: 12.5px; }
.admin-report-toolbar .btn-grey.active {
	background: var(--link);
	border-color: var(--link);
	color: #fff;
}
.report-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	margin-left: 4px;
	border-radius: 999px;
	background: rgba(0, 0, 0, .18);
	font-size: 10.5px;
	font-weight: 800;
}
.admin-reports { display: flex; flex-direction: column; gap: 12px; }
.report-card {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 16px 18px;
}
.report-card-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}
.report-category {
	font-size: 10.5px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--link);
	background: rgba(47, 126, 234, .12);
	border: 1px solid rgba(47, 126, 234, .28);
	border-radius: 999px;
	padding: 2px 8px;
}
.report-status {
	font-size: 10.5px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .05em;
	border-radius: 999px;
	padding: 2px 8px;
	border: 1px solid transparent;
}
.report-status.open { color: #ffb454; background: rgba(255, 180, 84, .1); border-color: rgba(255, 180, 84, .3); }
.report-status.resolved { color: #38d39f; background: rgba(56, 211, 159, .1); border-color: rgba(56, 211, 159, .3); }
.report-status.dismissed { color: var(--muted); background: rgba(151, 166, 189, .1); border-color: rgba(151, 166, 189, .26); }
.report-date { margin-left: auto; color: var(--muted); font-size: 12px; }
.report-card-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.report-card-title a { color: var(--link); }
.report-card-meta { color: var(--muted); font-size: 12.5px; margin-bottom: 8px; }
.report-card-meta a { color: var(--text-soft); font-weight: 600; }
.report-details {
	margin: 10px 0 12px;
	padding: 10px 12px;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 7px;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	font-size: 13.5px;
	color: var(--text);
}
.report-note { color: var(--green); font-size: 12.5px; margin: -4px 0 10px; }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.report-actions .btn-grey, .report-actions .btn-green { padding: 7px 13px; font-size: 12.5px; }

/* ======================= REPORT DIALOG ======================= */
.report-dialog { width: 460px; }
.report-form { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.report-form label {
	font-size: 11px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--muted);
	margin-bottom: -4px;
}
.report-form select,
.report-form textarea {
	width: 100%;
	background: var(--bg);
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: 5px;
	padding: 9px 10px;
	font: inherit;
	font-size: 13.5px;
	outline: none;
}
.report-form select:focus,
.report-form textarea:focus { border-color: var(--link); }
.report-form textarea { resize: vertical; min-height: 110px; }
.report-form .modal-actions { margin-top: 4px; }
.report-message { min-height: 18px; margin: 0; font-size: 12.5px; color: var(--red); }
.report-message.success { color: var(--green); }

/* ======================= AUTH / SECURITY ======================= */
.auth-hint { font-size: 11.5px; color: var(--muted); }
.auth-link {
	background: none;
	border: none;
	padding: 0;
	margin-top: 9px;
	color: var(--link);
	font: inherit;
	font-size: 12.5px;
	font-weight: 600;
	cursor: pointer;
	text-align: center;
	align-self: center;
}
.auth-link:hover { text-decoration: underline; }
.auth-forgot { margin-top: 12px; }
.auth-step {
	width: 100%;
	margin-top: 18px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.auth-step .panel-title { text-align: center; margin: 0; }
.auth-step .auth-subtitle { text-align: center; margin: 0; }
.auth-step .auth-field { gap: 6px; }
.auth-step .auth-error { margin: 0; }
.security-panel { max-width: 560px; margin-top: 16px; }
.security-block { padding: 14px 0; border-top: 1px solid var(--border); }
.security-block:first-of-type { border-top: 0; padding-top: 0; }
.security-block h3 { font-size: 14px; margin-bottom: 4px; }
.security-block p { margin-bottom: 10px; }
.security-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.security-row p { margin: 2px 0 0; }
.security-inline { display: flex; gap: 8px; flex-wrap: wrap; }
.security-inline input { flex: 1; min-width: 180px; }
.security-code-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.security-code-row input { flex: 1; min-width: 160px; }
.security-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.security-message { min-height: 18px; margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.security-message.success { color: var(--green); }
.security-message.error { color: var(--red); }
.auth-error.success { color: var(--green); }

/* ======================= LEGAL PAGES ======================= */
.legal-page { min-height: 100vh; background: var(--bg); }
.legal-topbar {
	display: flex; align-items: center; justify-content: space-between; gap: 16px;
	max-width: 1000px; margin: 0 auto; padding: 22px 24px 0;
}
.legal-brand { font-family: 'Orbitron', 'Source Sans Pro', sans-serif; font-weight: 800; letter-spacing: 2px; color: var(--text); text-decoration: none; }
.legal-topbar nav { display: flex; gap: 14px; flex-wrap: wrap; }
.legal-topbar nav a { color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; }
.legal-topbar nav a:hover { color: var(--text); }
.legal-wrap { max-width: 1000px; margin: 0 auto; padding: 28px 24px 70px; }
.legal-card {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	padding: 40px 46px 46px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .12);
}
.legal-card h1 { font-size: 32px; margin-bottom: 4px; }
.legal-card h2 { font-size: 18px; margin: 30px 0 8px; }
.legal-card h3 { font-size: 15px; margin: 20px 0 6px; }
.legal-card p, .legal-card li { color: var(--text-soft); font-size: 14.5px; line-height: 1.7; }
.legal-card ul, .legal-card ol { padding-left: 22px; }
.legal-card a { color: var(--link); }
.legal-meta { color: var(--muted); font-size: 12.5px; margin-bottom: 24px; }
.legal-note { padding: 12px 15px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 8px; color: var(--muted); font-size: 13px; }
.legal-footer { max-width: 1000px; margin: 0 auto; padding: 0 24px 34px; color: var(--muted); font-size: 12px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }
.legal-footer a { color: var(--muted); }
.auth-legal { text-align: center; color: var(--muted); font-size: 11.5px; line-height: 1.5; margin: 2px 0 0; }
.auth-legal a { color: var(--link); }
@media (max-width: 640px) {
	.legal-card { padding: 26px 20px 30px; }
	.legal-card h1 { font-size: 26px; }
}
.cf-turnstile { display: flex; justify-content: center; }
