/* Dollar-bill palette layered over the existing, compact Book I layout. */
#coin-trader{--ct-floor:#173b28;--ct-panel:#1a3a29;--ct-line:#8c956e;--ct-ink:#f8f1db;--ct-muted:#d7d8bd;--ct-gold:#e8d89c}
#coin-trader .ct-app{background:#153722 url('./money-engraving.png') center/cover}
#coin-trader .ct-app::before{background:linear-gradient(#15352266,#102c1c77)}
#coin-trader .ct-top{background:#143c28e8;border-bottom:1px solid #d7c89488}
#coin-trader .ct-header-back{width:37px;height:37px;border:1px solid #dbce9a;border-radius:50%;background:#153923;color:#f7e9bd;font-size:28px;line-height:1}
#coin-trader .ct-brand-name{text-transform:uppercase;color:#f9efcf}
#coin-trader .ct-wallet{background:#efe2b7;color:#173c28;border:1px solid #173c28;box-shadow:inset 0 0 0 2px #c9bd8e}
#coin-trader .ct-wallet span{color:#31503a}
#coin-trader .ct-home-grid button,#coin-trader .ct-home-feature,#coin-trader .b1-spotlight{background:linear-gradient(120deg,#e0d2a8,#f7edcd 47%,#e3d5ad);color:#153b27;border:2px solid #d9c993;box-shadow:inset 0 0 0 1px #34543b,0 3px 6px #051a0e88;text-shadow:none}
#coin-trader .ct-home-grid button strong{color:#183b28}
#coin-trader .ct-home-feature{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:12px;padding:10px 16px;position:relative}
#coin-trader .ct-home-feature-art{width:27%;height:100%;flex:none;display:flex;align-items:center;justify-content:center}
#coin-trader .ct-home-feature-art img{width:100%;height:100%;object-fit:contain}
#coin-trader .ct-home-new{top:0;left:0;background:#34583a;color:#f4e8be}
#coin-trader .b1-feature-copy{display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center;min-width:0}
#coin-trader .b1-feature-copy strong{font-size:clamp(14px,4vw,21px);line-height:1.05;color:#193d29}
#coin-trader .b1-feature-copy small{color:#415943}
#coin-trader .b1-spotlight{min-height:104px;display:flex;align-items:center;gap:12px;padding:9px 14px;text-align:left}
#coin-trader .b1-spotlight-art{height:75px;width:75px;flex:none}
#coin-trader .b1-spotlight-art img{width:100%;height:100%;object-fit:contain}
#coin-trader .b1-spotlight>span:last-child{display:flex;flex-direction:column;line-height:1.25}
#coin-trader .b1-spotlight small{font-size:9px;letter-spacing:.12em}
#coin-trader .b1-spotlight strong{font:700 16px Georgia,serif}
#coin-trader .b1-spotlight em{font:700 11px Georgia,serif;color:#36563b;margin-top:4px}
#coin-trader .ct-nav,#coin-trader .ct-fixed-screen .ct-nav{background:#163b28f2;border-top:1px solid #d3c48e}
#coin-trader .ct-nav button{color:#e7e0c6}
#coin-trader .ct-nav button[aria-current=page]{color:#f4db96}
#coin-trader .b1-stats span,#coin-trader .b1-change{background:#eee1bd;color:#193b29;border-color:#b7a574}
#coin-trader .ct-screen-vault,#coin-trader .ct-screen-book,#coin-trader .ct-screen-stats,#coin-trader .ct-screen-rankings{padding:4px 4px 5px}
#coin-trader .b1-vault-page,#coin-trader .ct-collection-page.ct-tier-page,#coin-trader .ct-journal-page{margin:0;width:100%;max-height:none;min-height:0;flex:1 1 auto}
#coin-trader .b1-vault-page-content,#coin-trader .ct-tier-page .ct-book-page-content{padding-top:clamp(60px,11vh,90px)}
#coin-trader .ct-journal-page>img{visibility:hidden}
#coin-trader .ct-journal-page{background:linear-gradient(125deg,#d1b98d,#f0dfb8 22%,#e5d1a5 75%,#c8ae7e);border:7px double #765a32;border-radius:5px;box-shadow:inset 0 0 30px #6c4a2e55}
#coin-trader .ct-journal-page-content{padding:6% 7% 4%;color:#49351f}
#coin-trader .ct-journal-page .ct-book-page-heading,#coin-trader .ct-journal-page .ct-tier-controls,#coin-trader .ct-journal-page .ct-tier-controls small,#coin-trader .ct-journal-page .ct-book-swipe-hint{color:#48331e}
#coin-trader .ct-journal-page .ct-tier-controls button{background:#e5d1a4;color:#46331e;border-color:#86683e}
#coin-trader .ct-journal-rows{background:transparent;box-shadow:none;border:0;color:#3c2c1d}
#coin-trader .ct-journal-you{color:#433014;font-weight:700}
@media(max-height:700px){#coin-trader .b1-spotlight{min-height:82px}#coin-trader .b1-spotlight-art{height:56px;width:56px}}

/* Six engraved pictograms share one banknote-style art sheet. */
#coin-trader .ct-engraved-icon{display:block;width:100%;height:100%;background-image:url('./engraved/icons.png');background-size:300% 200%;background-repeat:no-repeat}
#coin-trader .ct-engraved-vault{background-position:0% 0%}
#coin-trader .ct-engraved-exchange{background-position:50% 0%}
#coin-trader .ct-engraved-achievement,#coin-trader .ct-engraved-journal{background-position:100% 0%}
#coin-trader .ct-engraved-pack{background-position:0% 100%}
#coin-trader .ct-engraved-trade{background-position:50% 100%}
#coin-trader .ct-engraved-leader{background-position:100% 100%}
#coin-trader .ct-nav-symbol .ct-engraved-icon{filter:grayscale(1) sepia(.35) brightness(1.45) contrast(1.05)}
#coin-trader .ct-nav-symbol img{filter:grayscale(1) sepia(.5) hue-rotate(40deg) saturate(.65)}
#coin-trader .b1-home-heading{padding:0;text-align:center}
#coin-trader .b1-engraved-title{display:block;width:min(100%,320px);height:clamp(48px,9vh,78px);object-fit:contain;margin:0 auto}
#coin-trader .ct-fixed-screen .ct-main.b1-home{display:flex;flex-direction:column}
#coin-trader .ct-home{margin:auto auto 0}
#coin-trader .b1-home-settings{color:#f0e4bd}
@media(max-height:700px){#coin-trader .b1-engraved-title{height:44px}}

#coin-trader .ct-home-balance.b1-wallet-link{border:2px solid #d9c993;border-radius:6px;background:linear-gradient(110deg,#e1d3ad,#f6eccd,#dfd0a3);color:#173d29;box-shadow:inset 0 0 0 1px #31513a,0 2px 5px #07170e77;padding:5px 17px;font:700 12px Georgia,serif;letter-spacing:.04em}
#coin-trader .ct-home-balance.b1-wallet-link small{color:#52654c;font:600 8px system-ui}

/* Keep the title at the top and the controls near the navigation. */
#coin-trader .ct-fixed-screen .b1-home{position:relative}
#coin-trader .b1-home-heading{position:absolute;top:clamp(8px,3vh,28px);left:16px;right:16px}
#coin-trader .ct-home{padding-top:clamp(60px,11vh,92px)}
@media(max-height:650px){#coin-trader .ct-home{padding-top:50px}#coin-trader .b1-home-heading{top:4px}}

/* The credit plaque belongs directly beneath the title on every screen size. */
#coin-trader .ct-home-balance.b1-wallet-link{position:absolute;top:calc(clamp(8px,3vh,28px) + clamp(48px,9vh,78px) + 2px);left:50%;transform:translateX(-50%);margin:0;white-space:nowrap;font-size:11px;padding:4px 14px;z-index:1}
#coin-trader .ct-home{padding-top:clamp(96px,15vh,132px)}
#coin-trader .b1-home-heading::before{content:'';position:absolute;inset:-8px -8px;background:url('./engraved/header-branches.png') center/100% 100% no-repeat;pointer-events:none}
#coin-trader .b1-engraved-title{position:relative;z-index:1}
#coin-trader .ct-nav button[aria-current=page] .ct-nav-symbol img{filter:grayscale(1) sepia(.4) brightness(1.35) contrast(1.1)}
@media(max-height:650px){#coin-trader .ct-home{padding-top:83px}#coin-trader .ct-home-balance.b1-wallet-link{top:50px}}

/* Keep the home artwork and credits clear of the iPhone status area. */
#coin-trader .b1-home{--b1-header-safe:max(30px, env(safe-area-inset-top, 0px))}
#coin-trader .b1-home-heading{top:calc(var(--b1-header-safe) + clamp(8px,3vh,28px))}
#coin-trader .ct-home-balance.b1-wallet-link{top:calc(var(--b1-header-safe) + clamp(8px,3vh,28px) + clamp(48px,9vh,78px) + 2px)}
#coin-trader .ct-home{padding-top:calc(var(--b1-header-safe) + clamp(96px,15vh,132px))}
@media(max-height:650px){#coin-trader .b1-home-heading{top:calc(var(--b1-header-safe) + 4px)}#coin-trader .ct-home-balance.b1-wallet-link{top:calc(var(--b1-header-safe) + 50px)}#coin-trader .ct-home{padding-top:calc(var(--b1-header-safe) + 83px)}}
/* The bottom bar lets the engraved background show through, with fine rules. */
#coin-trader .ct-nav,#coin-trader .ct-fixed-screen .ct-nav{background:linear-gradient(180deg,rgba(24,64,42,.70),rgba(16,51,33,.76));border-top:1px solid #e0d4a096;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}
#coin-trader .ct-nav::before{content:'';position:absolute;inset:0; background:url('./engraved/nav-frame.svg') center / 100% 100% no-repeat;pointer-events:none}
#coin-trader .ct-nav button{position:relative;z-index:1}
#coin-trader .ct-nav button:not(:last-child)::after{content:'';position:absolute;right:0;top:16%;height:55%;border-right:1px solid #eadcb477;pointer-events:none}
#coin-trader .ct-nav button[aria-current=page]::before{content:'';position:absolute;bottom:2px;width:26px;height:2px;border-radius:2px;background:#ead69a;pointer-events:none}

/* Keep the controls close to the bottom while leaving a small home-indicator clearance. */
#coin-trader .ct-nav,#coin-trader .ct-fixed-screen .ct-nav{height:calc(73px + min(12px,env(safe-area-inset-bottom,0px)));padding:8px 8px min(12px,env(safe-area-inset-bottom,0px))}
#coin-trader #ct-content{padding-bottom:calc(73px + min(12px,env(safe-area-inset-bottom,0px)))}

/* Leave a little room below the engraved frame so its corners stay visible. */
#coin-trader .ct-nav,#coin-trader .ct-fixed-screen .ct-nav{bottom:10px}
#coin-trader #ct-content{padding-bottom:calc(83px + min(12px,env(safe-area-inset-bottom,0px)))}

/* Approved banknote frame: the page texture stays visible behind real controls. */
#coin-trader .ct-nav,#coin-trader .ct-fixed-screen .ct-nav{background:transparent;border-top:0;-webkit-backdrop-filter:none;backdrop-filter:none}
#coin-trader .ct-nav::before{background-image:url('./engraved/nav-frame-transparent.png')}
#coin-trader .ct-nav button:not(:last-child)::after,#coin-trader .ct-nav button[aria-current=page]::before{content:none}
#coin-trader .ct-app:has(.b1-home)::after{content:'';position:absolute;z-index:19;inset:max(3px,env(safe-area-inset-top,0px)) 4px 4px;border:1px solid #d7d7b3;border-radius:2px;pointer-events:none}

/* Center the controls inside the visible engraving and extend the background to the viewport edge. */
html,body{background-color:#153722}
#coin-trader{background:#153722 url('./money-engraving.png') center/cover}
#coin-trader .ct-nav,#coin-trader .ct-fixed-screen .ct-nav{bottom:0;padding:4px 8px calc(4px + min(12px,env(safe-area-inset-bottom,0px)));align-items:stretch}
#coin-trader .ct-nav::before{inset:0 0 min(12px,env(safe-area-inset-bottom,0px))}
#coin-trader #ct-content{padding-bottom:calc(73px + min(12px,env(safe-area-inset-bottom,0px)))}

/* Extend the engraving into the existing bottom clearance without moving its top. */
#coin-trader .ct-nav::before{inset:0}
#coin-trader .ct-nav,#coin-trader .ct-fixed-screen .ct-nav{padding:4px 8px}

/* One full-screen banknote artwork, with live controls placed over the bottom panel. */
#coin-trader .ct-app{background:#153722 url('./engraved/full-screen-background.png') center/100% 100% no-repeat}
#coin-trader .ct-app:has(.b1-home)::after,#coin-trader .ct-nav::before{content:none}
#coin-trader .ct-nav,#coin-trader .ct-fixed-screen .ct-nav{position:absolute;inset:auto 0 0;transform:none;width:100%;height:10.5%;min-height:0;padding:0 8px min(12px,env(safe-area-inset-bottom,0px));display:grid;align-items:stretch;background:transparent;border:0}
#coin-trader .ct-nav button{min-width:0;min-height:44px;justify-content:center}
#coin-trader #ct-content{padding-bottom:10.5dvh}
/* The desktop play area has its own contained layout; the navigation belongs to it. */
@media(min-width:600px){
 #coin-trader .ct-app,#coin-trader .ct-app.ct-fixed-screen{height:min(900px,calc(100dvh - 36px));max-height:min(900px,calc(100dvh - 36px))}
 #coin-trader #ct-content{padding-bottom:min(94.5px,calc(10.5dvh - 3.78px))}
}

/* Banknote-style header and vertically centered navigation across the game. */
#coin-trader .ct-top{position:relative;background:transparent;border:0;isolation:isolate}
#coin-trader .ct-top::before{content:'';position:absolute;inset:1px 4px;z-index:0;background:url('./engraved/nav-frame-transparent.png') center/100% 100% no-repeat;pointer-events:none}
#coin-trader .ct-top .ct-brand,#coin-trader .ct-top .ct-header-actions{position:relative;z-index:1}
#coin-trader .ct-app:has(.b1-home)::after{content:'';position:absolute;z-index:19;left:4px;right:4px;top:0;height:18px;background:url('./engraved/nav-frame-transparent.png') center top/100% 72px no-repeat;pointer-events:none}
#coin-trader .ct-nav,#coin-trader .ct-fixed-screen .ct-nav{padding:5px 8px 0;align-items:stretch}
#coin-trader .ct-nav button{display:flex;flex-direction:column;align-items:center;justify-content:center}

/* Fit the decorative frame inside the header while leaving controls unchanged. */
#coin-trader .ct-top::before{inset:0;background-size:96% 80%;background-position:center;background-repeat:no-repeat}

/* Place engraved top borders below the iPhone status area, around the header controls. */
#coin-trader .ct-top::before{inset:calc(env(safe-area-inset-top,0px) + 2px) 4px 2px;background-size:100% 100%;background-position:center}
#coin-trader .ct-app:has(.b1-home)::after{top:calc(env(safe-area-inset-top,0px) + 2px)}

/* Align the Home ornament with the background edge rather than layering a second strip. */
#coin-trader .ct-app:has(.b1-home)::after{top:0}
#coin-trader{touch-action:pan-x pan-y}

/* A single visible Home top edge below the status area; navigation is unchanged. */
#coin-trader .ct-app:has(.b1-home)::after{top:calc(env(safe-area-inset-top,0px) + 2px);height:20px;background:url('./engraved/home-top-line.svg') center/100% 100% no-repeat}

/* Give the engraved title bars more room around the existing controls. */
#coin-trader .ct-top,#coin-trader .ct-fixed-screen .ct-top{padding-top:calc(15px + env(safe-area-inset-top,0px));padding-bottom:12px}

/* Remove the separate decorative line above the Home logo. */
#coin-trader .ct-app:has(.b1-home)::after{content:none}
