/* Web16 mock layout - flat, early-2010s style. No network calls. */
* { box-sizing: border-box; }
body {
    margin: 0;
    background: #e9e9e9;
    color: #222;
    font: 13px/1.4 Arial, Helvetica, sans-serif;
}
a { color: #1a5c9e; text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 8px; font-weight: bold; }
h1 { font-size: 20px; }
h2 { font-size: 15px; }
h3 { font-size: 13px; }

/* Top bar */
.topbar { background: #2b5f8e; color: #fff; }
.topbar .inner {
    width: 970px; margin: 0 auto; height: 40px;
    display: flex; align-items: center;
}
.logo {
    width: 110px; height: 28px; margin-right: 18px;
    border: 1px dashed #9fc0de; color: #d6e6f4;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; letter-spacing: 1px;
}
.nav a {
    color: #fff; font-weight: bold; padding: 0 12px; line-height: 40px;
    display: inline-block;
}
.nav a:hover, .nav a.active { background: #234f77; text-decoration: none; }
.userbox { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.userbox .credits { background: #234f77; padding: 3px 8px; }
.userbox a { color: #fff; }

/* Sub bar */
.subbar { background: #fff; border-bottom: 1px solid #ccc; }
.subbar .inner { width: 970px; margin: 0 auto; padding: 6px 0; color: #666; font-size: 12px; }
.subbar a { margin-right: 14px; }

/* Page */
.page { width: 970px; margin: 14px auto 30px; }
.cols { display: flex; gap: 14px; align-items: flex-start; }
.main { flex: 1; }
.side { width: 250px; }
.box { background: #fff; border: 1px solid #ccc; margin-bottom: 14px; }
.box .head {
    border-bottom: 1px solid #ddd; padding: 7px 10px;
    font-weight: bold; display: flex; justify-content: space-between;
}
.box .head a { font-weight: normal; font-size: 12px; }
.box .body { padding: 10px; }
.notice {
    background: #fff8d6; border: 1px solid #e0d38a; padding: 7px 10px;
    margin-bottom: 14px; font-size: 12px;
}

/* Placeholders (no real images) */
.ph {
    background: #d8d8d8; color: #888; display: flex;
    align-items: center; justify-content: center; font-size: 11px;
}

/* Buttons and inputs */
.btn {
    display: inline-block; border: 1px solid #1f4a70; background: #2b5f8e;
    color: #fff; padding: 4px 12px; font: bold 12px Arial, sans-serif; cursor: pointer;
}
.btn:hover { background: #234f77; text-decoration: none; }
.btn.green { background: #3b8a3b; border-color: #2c6b2c; }
.btn.green:hover { background: #327532; }
.btn.grey { background: #eee; border-color: #aaa; color: #333; }
.btn.grey:hover { background: #e2e2e2; }
input[type=text], select {
    border: 1px solid #aaa; padding: 3px 5px; font: 12px Arial, sans-serif;
}

/* Grids */
.grid { display: grid; gap: 10px; }
.grid.g5 { grid-template-columns: repeat(5, 1fr); }
.grid.g6 { grid-template-columns: repeat(6, 1fr); }
.card { border: 1px solid #ddd; padding: 6px; background: #fff; }
.card:hover { border-color: #999; }
.card .ph { height: 90px; margin-bottom: 5px; }
.card .ph.tall { height: 110px; }
.card .title { font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .meta { color: #777; font-size: 11px; }
.price { color: #3b7a3b; font-weight: bold; font-size: 12px; }

/* Lists */
.friends { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.friends .ph { height: 54px; margin-bottom: 3px; }
.friends .on { color: #3b8a3b; font-size: 11px; }
.friends .off { color: #999; font-size: 11px; }
.feed .item { border-bottom: 1px solid #eee; padding: 7px 0; display: flex; gap: 8px; }
.feed .item:last-child { border-bottom: 0; }
.feed .ph { width: 36px; height: 36px; flex: none; }
.feed .when { color: #999; font-size: 11px; }
.statline { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px solid #f0f0f0; }

/* Toolbar */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.toolbar .spacer { flex: 1; }
.tabs { border-bottom: 1px solid #ccc; margin-bottom: 10px; }
.tabs a {
    display: inline-block; padding: 5px 12px; border: 1px solid transparent;
    border-bottom: 0; margin-bottom: -1px; color: #444;
}
.tabs a.active { background: #fff; border-color: #ccc; color: #222; font-weight: bold; }

/* Game detail */
.game-top { display: flex; gap: 14px; }
.game-top .ph { width: 576px; height: 324px; flex: none; }
.game-info { flex: 1; }
.game-info .btn { display: block; text-align: center; padding: 10px; font-size: 15px; margin: 10px 0; }

/* Avatar */
.avatar-wrap { display: flex; gap: 14px; }
.avatar-wrap .ph.big { width: 250px; height: 300px; flex: none; }
.colors { display: grid; grid-template-columns: repeat(8, 22px); gap: 4px; }
.colors span { width: 22px; height: 22px; border: 1px solid #999; cursor: pointer; }

/* Footer */
.footer { width: 970px; margin: 0 auto 30px; color: #888; font-size: 11px; text-align: center; }
.footer a { color: #777; margin: 0 6px; }

#toast {
    position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
    background: #333; color: #fff; padding: 7px 14px; font-size: 12px; display: none;
}

/* ---- added for the working site ---- */
.logo { color: #fff; font-weight: bold; letter-spacing: 1px; }
.logo:hover { text-decoration: none; }
.flash { background: #fff8d6; border: 1px solid #e0d38a; padding: 7px 10px; margin-bottom: 14px; }
.flash.err { background: #fde3e1; border-color: #e3a29b; }
.form-row { margin-bottom: 8px; }
.form-row label { display: block; font-weight: bold; margin-bottom: 2px; }
input[type=password], textarea { border: 1px solid #aaa; padding: 3px 5px; font: 12px Arial, sans-serif; }
textarea { width: 100%; height: 70px; }
form.inline { display: inline; }
button.btn { font: bold 12px Arial, sans-serif; }
.card .ph { text-align: center; padding: 4px; }
.muted { color: #777; }
.empty { color: #888; font-style: italic; }
.owned { color: #555; font-size: 11px; }
/* Blocky avatar figure drawn with CSS (no renderer yet) */
.fig { position: relative; margin: 0 auto; }
.fig div { position: absolute; border: 1px solid rgba(0,0,0,.25); }
.fig .head { border-radius: 30%; }
.palette { display: grid; grid-template-columns: repeat(8, 22px); gap: 4px; margin: 4px 0 10px; }
.palette label { width: 22px; height: 22px; border: 1px solid #999; cursor: pointer; display: block; }
.palette input { display: none; }
.palette input:checked + label { outline: 2px solid #222; }
.launch { text-align: center; padding: 40px 10px; }
.launch .step { color: #666; margin: 6px 0; }
.launch .step.done { color: #3b8a3b; }
.on { color: #3b8a3b; } .off { color: #999; }
img.thumb { display: block; margin: 0 auto; background: #e4e4e4; }
.userbox a.me { display: flex; align-items: center; gap: 6px; }
.userbox a.me img.thumb { margin: 0; background: #234f77; }
img.gthumb { display: block; object-fit: cover; padding: 0; }
.card img.gthumb.ph { width: 100%; height: 90px; margin-bottom: 5px; }
.game-top img.gthumb.ph { width: 576px; height: 324px; flex: none; }

/* ---- dark theme (overrides the light colors above) ---- */
body { background: #16181c; color: #d6d8dc; }
a { color: #6aaee8; }
.topbar { background: #1d3550; }
.nav a:hover, .nav a.active, .userbox .credits { background: #152a40; }
.logo { border-color: #4f78a0; }
.subbar { background: #202328; border-bottom-color: #33373e; }
.subbar .inner { color: #8b9098; }
.box { background: #202328; border-color: #33373e; }
.box .head { border-bottom-color: #2f3238; }
.card { background: #24272c; border-color: #33373e; }
.card:hover { border-color: #5b616b; }
.card .meta, .muted, .footer, .footer a, .friends .off, .feed .when, .owned { color: #8b9098; }
.empty { color: #7a7f87; }
.ph { background: #2e3137; color: #7a7f87; }
.statline { border-bottom-color: #2c2f35; }
.tabs { border-bottom-color: #33373e; }
.tabs a { color: #aab0b8; }
.tabs a.active { background: #202328; border-color: #33373e; color: #e4e6ea; }
.notice, .flash { background: #2e2a18; border-color: #5c5228; color: #e8dca8; }
.flash.err { background: #3a1e1e; border-color: #7a3a36; color: #f0b8b2; }
.btn.grey { background: #33373e; border-color: #4a4f57; color: #d6d8dc; }
.btn.grey:hover { background: #3c4048; }
.price { color: #6cc46c; }
.friends .on, .on { color: #5fc05f; }
input[type=text], input[type=password], select, textarea {
    background: #16181c; color: #d6d8dc; border-color: #4a4f57;
}
.palette label, .colors span { border-color: #5b616b; }
.palette input:checked + label { outline-color: #e4e6ea; }
img.thumb, img.gthumb { background: #2a2d33; }
.userbox a.me img.thumb { background: #152a40; }
.fig div { border-color: rgba(0, 0, 0, .5); }
.launch .step { color: #8b9098; }
.launch .step.done { color: #5fc05f; }
.friends .empty { grid-column: 1 / -1; text-align: left; }

/* ---- admin panel ---- */
.admin { display: flex; gap: 16px; }
.admin-side { width: 170px; flex: none; display: flex; flex-direction: column; background: #202328;
    border: 1px solid #33373e; padding: 8px 0; align-self: flex-start; }
.admin-side a { padding: 6px 12px; color: #c9ccd1; }
.admin-side a.active, .admin-side a:hover { background: #2a3a4d; color: #fff; text-decoration: none; }
.admin-title { font-weight: bold; padding: 4px 12px 8px; color: #8b9098; text-transform: uppercase; font-size: 11px; }
.admin-main { flex: 1; min-width: 0; }
.admin-main h2 { margin: 0 0 12px; font-size: 18px; }
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.stat-card { background: #202328; border: 1px solid #33373e; padding: 12px; }
.stat-card .v { font-size: 22px; font-weight: bold; }
.stat-card .k { color: #8b9098; font-size: 11px; margin-top: 2px; }
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th, table.tbl td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #2c2f35; }
table.tbl th { color: #8b9098; font-weight: normal; font-size: 11px; text-transform: uppercase; }
.tag { font-size: 10px; background: #2a3a4d; color: #9fc4ea; padding: 1px 5px; border-radius: 3px; }
.tag.red { background: #4a2020; color: #f0b0aa; }
.btn.red { background: #8f2a22; border-color: #a8352c; color: #fff; }
select { background: #16181c; color: #d6d8dc; border: 1px solid #4a4f57; padding: 3px; }
img.ithumb { display: block; object-fit: contain; background: #2a2d33; width: 100%; }
.card img.ithumb.ph { height: 90px; margin-bottom: 5px; }
.card img.ithumb.tall { height: 120px; margin-bottom: 5px; }
img.ithumb.big { width: 300px; height: 300px; }
.game-top div.big { width: 300px; height: 300px; }

/* guests */
.subbar .guest-note { float: right; color: #c9a227; font-size: 12px; }
.subbar .guest-note a { color: #f0c94a; padding: 0; }
.userbox .me img { vertical-align: middle; margin-right: 4px; }

/* avatar page */
.avatar-page .side { width: 270px; }
.colors-ui { display: flex; gap: 28px; align-items: center; }
.bodymap { display: grid; grid-template-columns: 38px 76px 38px; grid-template-rows: 46px 76px 76px;
           gap: 3px; padding: 6px 10px; }
.bodymap .bp { border: 2px solid rgba(0,0,0,.35); border-radius: 3px; cursor: pointer; padding: 0; }
.bodymap .bp:hover { filter: brightness(1.12); }
.bodymap .bp.on { outline: 3px solid #4da3ff; outline-offset: 2px; }
.bp-head { grid-column: 2; grid-row: 1; width: 46px; height: 42px; justify-self: center; align-self: end; border-radius: 10px !important; }
.bp-torso { grid-column: 2; grid-row: 2; }
.bp-rarm { grid-column: 1; grid-row: 2; }
.bp-larm { grid-column: 3; grid-row: 2; }
.bp-rleg { grid-column: 2; grid-row: 3; width: 36px; justify-self: start; }
.bp-lleg { grid-column: 2; grid-row: 3; width: 36px; justify-self: end; }
.picker { flex: 1; }
.picker .picking { margin-bottom: 8px; }
.swatches { display: grid; grid-template-columns: repeat(8, 30px); gap: 6px; }
.swatches .sw { width: 30px; height: 30px; border: 1px solid #5b616b; border-radius: 4px; cursor: pointer; padding: 0; }
.swatches .sw:hover { transform: scale(1.1); }
.swatches .sw.on { outline: 2px solid #e4e6ea; outline-offset: 2px; }
.allparts { display: block; margin: 10px 0; font-size: 12px; color: #aab; cursor: pointer; }
.color-actions .btn { margin-right: 6px; }
.itemgroup h3 { margin: 4px 0 8px; font-size: 14px; }
.itemgroup + .itemgroup { margin-top: 14px; padding-top: 12px; border-top: 1px solid #33373e; }
.card.wearing { border-color: #3d8b3d; }
.card form .btn { margin-top: 4px; width: 100%; }
.wearing-list { text-align: left; margin-top: 12px; padding-top: 10px; border-top: 1px solid #33373e; font-size: 12px; }
.wearing-list b { display: block; margin-bottom: 4px; }

/* sign-up phrase keys */
.tag.green { background: #1f4024; color: #a8e0a8; }
.keys-mode { display: flex; align-items: center; justify-content: space-between; gap: 12px;
             padding: 10px 12px; margin-bottom: 14px; border-radius: 4px; border: 1px solid #33373e; }
.keys-mode.on { background: #1d2a1f; border-color: #2f5a33; }
.keys-mode.off { background: #2e2418; border-color: #6a4d22; }
code.phrase { background: #15171b; padding: 2px 6px; border-radius: 3px; font-size: 13px; }
.tbl td.actions form { display: inline-block; margin-right: 4px; }
.keyform .form-row input[type=text] { width: 300px; }
.keyform input[type=number] { background: #15171b; color: #e4e6ea; border: 1px solid #3a3f47; padding: 4px 6px; }

/* game thumbnail & banner */
.game-banner { margin-bottom: 10px; border: 1px solid #33373e; background: #202328; line-height: 0; }
.game-banner img { display: block; width: 100%; aspect-ratio: 5 / 1; object-fit: cover; }
.media-row { padding: 8px 0; border-bottom: 1px solid #2f3238; }
.media-row:last-of-type { border-bottom: 0; }
.media-row .muted { margin: 2px 0 6px; }
.media-preview { display: block; margin: 0 0 6px; border: 1px solid #33373e; background: #24272c; object-fit: cover; }
.media-preview.mp-thumb { width: 128px; height: 128px; }
.media-preview.mp-banner { width: 100%; max-width: 600px; aspect-ratio: 5 / 1; }

/* game thumbnails are square */
.gcard .ph, .gcard img.gthumb.ph { width: 100%; height: auto; aspect-ratio: 1 / 1; margin-bottom: 5px; }
.gcard img.gthumb.ph { padding: 0; }
.game-top .ph, .game-top img.gthumb.ph { width: 324px; height: 324px; flex: none; }

/* game cards: all the same, smaller size */
.grid.gg { grid-template-columns: repeat(auto-fill, 128px); }
.grid.gg .gcard { min-width: 0; }

/* game page tabs (About / Servers) */
.server { border: 1px solid #33373e; background: #24272c; padding: 10px; }
.srv-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.srv-head .btn { padding: 6px 18px; }
.srv-players { display: flex; flex-wrap: wrap; gap: 10px; }
.srv-player { display: flex; flex-direction: column; align-items: center; width: 64px; font-size: 11px; color: #aab0b8; text-align: center; }
.srv-player span { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }
.srv-player img.thumb { width: 48px; height: 48px; border-radius: 50%; background: #2e3137; }

/* Develop */
.dev-game { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #2f3238; }
.dev-game:last-child { border-bottom: 0; }
.dev-game .dev-thumb, .dev-game img.gthumb.dev-thumb { width: 64px; height: 64px; flex: none; padding: 0; font-size: 9px; text-align: center; }
.dev-game .dev-info { flex: 1; min-width: 0; }

/* Settings: layout choice */
.layout-opt { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px;
              border: 1px solid #33373e; background: #24272c; margin-bottom: 8px; }
.layout-opt.on { border-color: #3b8a3b; }
.layout-opt .muted { margin-top: 3px; max-width: 640px; }
.tag { display: inline-block; font-size: 10px; font-weight: bold; background: #3b8a3b; color: #fff; padding: 1px 6px;
       border-radius: 3px; margin-left: 6px; vertical-align: 2px; }
