/* Book I layout, with the original two-sided moving coin. */
#coin-trader .ct-app{height:100dvh;min-height:0;max-height:100dvh;padding-bottom:0;overflow:hidden}
#coin-trader #ct-content{display:flex;flex-direction:column;height:100%;min-height:0}
#coin-trader .ct-main.b1-main{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain}
#coin-trader .ct-fixed-screen .ct-main.b1-home,#coin-trader .ct-fixed-screen .ct-main.b1-play{overflow-y:auto}
#coin-trader .ct-nav,#coin-trader .ct-fixed-screen .ct-nav{position:relative;inset:auto;left:auto;bottom:auto;transform:none;flex:0 0 calc(73px + env(safe-area-inset-bottom));width:100%;padding:5px 0 env(safe-area-inset-bottom)}
#coin-trader .b1-home-settings{position:absolute;right:16px;top:calc(10px + env(safe-area-inset-top));border:0;background:transparent;color:#e4c77d;font-size:24px;z-index:2}
#coin-trader .b1-play{min-height:100%;height:100%;gap:3px}
#coin-trader .b1-play .ct-stage,#coin-trader .ct-fixed-screen .ct-screen-play .ct-stage{width:100%;flex:1 1 auto;min-height:130px;height:auto;padding:0 0 8px;align-items:flex-end;overflow:visible;container-type:size}
#coin-trader .b1-play .ct-flight,#coin-trader .ct-fixed-screen .ct-screen-play .ct-flight{width:min(225px,max(100px,calc(100cqh - 65px)));height:min(225px,max(100px,calc(100cqh - 65px)))}
#coin-trader .b1-play .ct-result{min-height:0;margin:0;color:#f2d898;font-size:13px}
#coin-trader .b1-play .ct-result strong{font-size:13px}
#coin-trader .b1-play .ct-result span{display:block;font-size:11px}
#coin-trader .b1-play .ct-coin-button{width:100%;height:100%;padding:0;border:0;background:transparent}
@media(max-height:700px){#coin-trader .ct-home-hero{height:112px}#coin-trader .ct-home-grid{margin:8px 0;gap:5px}#coin-trader .ct-home-grid button{min-height:51px}#coin-trader .ct-home-feature{height:88px}#coin-trader .ct-home-feature-art{height:37px}#coin-trader .ct-home-flip{height:51px}#coin-trader .ct-home-balance{margin-bottom:7px}}

/* Keep navigation at the viewport edge while leaving Home and Flip contained. */
#coin-trader #ct-content{padding-bottom:calc(73px + env(safe-area-inset-bottom, 0px))}
#coin-trader .ct-nav,#coin-trader .ct-fixed-screen .ct-nav{position:fixed;inset:auto auto 0 50%;transform:translateX(-50%);width:min(100%,420px);height:calc(73px + env(safe-area-inset-bottom, 0px));z-index:20;padding:5px 0 env(safe-area-inset-bottom, 0px)}
#coin-trader .ct-screen-book{display:flex;flex-direction:column;min-height:0;overflow:auto;padding-bottom:8px}
#coin-trader .ct-screen-book>.ct-back{flex:0 0 auto;min-height:32px}
#coin-trader .ct-collection-page.ct-tier-page{flex:1 0 auto;min-height:465px;height:100%;max-height:780px;aspect-ratio:auto;touch-action:pan-y;overflow:hidden}
#coin-trader .ct-tier-page .ct-book-page-content{padding:clamp(46px,10vh,84px) 6% 12px}
#coin-trader .ct-tier-page .ct-book-page-heading{gap:2px;flex:none}
#coin-trader .ct-tier-page .ct-book-page-heading strong{font-size:clamp(16px,4vw,22px)}
#coin-trader .ct-tier-controls{display:grid;grid-template-columns:40px 1fr 40px;align-items:center;flex:none;margin:5px 0;color:#e8cf90;text-align:center}
#coin-trader .ct-tier-controls div{display:flex;flex-direction:column;line-height:1.15}
#coin-trader .ct-tier-controls strong{font:700 15px Georgia,serif}
#coin-trader .ct-tier-controls small{font-size:9px;color:#d5c69d;margin-top:2px}
#coin-trader .ct-tier-controls button{min-width:40px;min-height:40px;border:1px solid #977d48;border-radius:10px;background:#142919;color:#ebd29c;font-size:23px;line-height:1}
#coin-trader .ct-tier-controls button:disabled{opacity:.3}
#coin-trader .ct-tier-page .ct-coin-grid{flex:1 1 auto;height:auto;min-height:0;grid-template-rows:repeat(5,minmax(0,1fr));gap:2px}
#coin-trader .ct-tier-page .ct-coin-slot{justify-content:center;overflow:hidden;gap:0}
#coin-trader .ct-tier-page .ct-coin-slot img{width:auto;height:auto;max-width:min(48px,100%);max-height:58%;aspect-ratio:1;filter:brightness(.85) drop-shadow(0 2px 2px #000b)}
#coin-trader .ct-tier-page .ct-coin-slot.is-discovered img{filter:drop-shadow(0 2px 2px #000b)}
#coin-trader .ct-tier-page .ct-coin-slot>span{min-width:0;max-width:100%;width:auto;min-height:0;max-height:2.3em;margin:0;padding:1px 3px;overflow:hidden;white-space:normal;line-height:1.08;text-wrap:balance;font-size:clamp(7px,2.3vw,9px)}
#coin-trader .ct-tier-page .ct-coin-slot small{font-size:8px;line-height:1;color:#dbc48d}
#coin-trader .ct-book-swipe-hint{flex:none;margin:3px 0 0;text-align:center;color:#d2c092;font-size:9px}
@media(prefers-reduced-motion:no-preference){#coin-trader .ct-page-from-left{animation:book-page-left .22s ease-out}#coin-trader .ct-page-from-right{animation:book-page-right .22s ease-out}@keyframes book-page-left{from{opacity:.65;transform:translateX(-12px)}to{opacity:1;transform:none}}@keyframes book-page-right{from{opacity:.65;transform:translateX(12px)}to{opacity:1;transform:none}}}
#coin-trader .ct-screen-stats,#coin-trader .ct-screen-rankings{display:flex;flex-direction:column;min-height:0;overflow:auto;padding-bottom:8px}
#coin-trader .ct-journal-page{flex:1 0 auto;min-height:465px;height:100%;max-height:780px;aspect-ratio:auto;overflow:hidden;touch-action:pan-y}
#coin-trader .ct-journal-page-content{position:absolute;inset:0;display:flex;flex-direction:column;padding:clamp(75px,15vh,120px) 9% 7%;color:#f0e4c7}
#coin-trader .ct-journal-rows{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;margin:12px 0;padding:0 4px}
#coin-trader .ct-journal-row{display:flex;justify-content:space-between;align-items:baseline;gap:12px;padding:10px 3px;border-bottom:1px solid #b49a6355;font:14px Georgia,serif}
#coin-trader .ct-journal-row span{min-width:0;overflow-wrap:anywhere}#coin-trader .ct-journal-row strong{color:#f3d98d;flex:none}
#coin-trader .ct-journal-you{color:#e8ca7d}#coin-trader .ct-journal-note{font-size:11px;color:#cbbb94;line-height:1.4}

/* Journal, collection and recovery improvements. */
#coin-trader .b1-live{color:#e3d3a7;font-size:11px;text-align:center;margin:3px 0}
#coin-trader .b1-change{padding:5px 9px;border:1px solid #a88749;border-radius:12px;color:#f0d18b;background:#203124;font-size:11px}
#coin-trader .b1-spotlight{display:block;width:100%;min-height:40px;margin:6px auto 0;border:1px solid #9c814b;border-radius:10px;color:#f3d793;background:linear-gradient(#294530,#142a1c);font-weight:700}
#coin-trader .ct-screen-journal{display:flex;flex-direction:column}
#coin-trader .ct-screen-journal .ct-journal-stack{margin-top:auto;margin-bottom:0}
#coin-trader .ct-screen-stats>.ct-back,#coin-trader .ct-screen-rankings>.ct-back{flex:none;min-height:34px;align-self:flex-start}
#coin-trader .ct-journal-rows{background:linear-gradient(110deg,#dfcca0,#f7e9c5 22%,#ead8ae 80%,#d4bd8b);color:#3c2c1d;border:1px solid #bfa271;box-shadow:inset 0 0 16px #8b6e3940;padding:12px 14px;border-radius:3px}
#coin-trader .ct-journal-row{border-color:#957a4b66;font:16px Georgia,serif}
#coin-trader .ct-journal-row strong{color:#553c1c}
#coin-trader .ct-journal-note{color:#634c2b}
#coin-trader .b1-save-overlay{z-index:120;background:#060c08d9}
#coin-trader .b1-save-overlay .ct-modal-card{max-width:380px;width:100%;text-align:center}
#coin-trader .b1-save-overlay .ct-button{width:100%;margin-top:14px}
@media(prefers-reduced-motion:no-preference){
 #coin-trader .ct-volume{animation:b1-cover-enter .35s ease-out both;transform-origin:left center}
 #coin-trader .ct-journal-page{animation:b1-page-open .3s ease-out both;transform-origin:left center}
 @keyframes b1-cover-enter{from{opacity:0;transform:translateY(10px) scale(.98)}to{opacity:1;transform:none}}
 @keyframes b1-page-open{from{opacity:.3;transform:perspective(900px) rotateY(-8deg)}to{opacity:1;transform:none}}
}
#coin-trader .b1-home-heading{text-align:center;color:#edd7a4;font-family:Georgia,serif;padding:3px 0 2px}
#coin-trader .b1-home-heading span{display:block;color:#aaa994;font:9px system-ui;letter-spacing:.15em}
#coin-trader .b1-home-heading strong{font-size:22px;font-weight:400}
#coin-trader .b1-wallet-link{display:block;margin:2px auto 4px;cursor:pointer}
#coin-trader .ct-home-grid{margin:8px 0}
#coin-trader .ct-home-grid button{min-height:57px}
#coin-trader .ct-home-feature{height:104px}
@media(max-height:700px){#coin-trader .ct-home-grid button{min-height:48px}#coin-trader .ct-home-feature{height:88px}#coin-trader .b1-spotlight{min-height:36px}}
#coin-trader .ct-screen-vault{display:flex;flex-direction:column;min-height:0}
#coin-trader .b1-vault-page{position:relative;flex:1 0 auto;min-height:490px;max-height:780px;overflow:hidden;touch-action:pan-y}
#coin-trader .b1-vault-page>img{width:100%;height:100%;position:absolute;inset:0;object-fit:fill}
#coin-trader .b1-vault-page-content{position:absolute;inset:0;display:flex;flex-direction:column;padding:clamp(75px,13vh,105px) 7% 6%}
#coin-trader .b1-vault-page .b1-vault-grid{display:grid;flex:1;min-height:0;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(5,minmax(0,1fr));gap:3px}
#coin-trader .b1-vault-page .b1-vault-card{border:0;background:transparent;padding:2px;gap:1px;justify-content:center;min-height:0;overflow:hidden}
#coin-trader .b1-vault-page .b1-vault-card img{height:65%;width:auto;max-width:100%;object-fit:contain}
#coin-trader .b1-vault-page .b1-vault-card strong{font:700 clamp(8px,2.3vw,11px) Georgia,serif;line-height:1.05}
#coin-trader .b1-vault-page .b1-vault-card small{font-size:9px}
#coin-trader .ct-collection-page .ct-coin-grid.b1-full-grid .ct-coin-slot:nth-child(13){grid-column:auto}
#coin-trader .b1-collection-pages{display:flex;flex:none;justify-content:center;align-items:center;gap:12px;color:#e6d5ac;font-size:10px}
#coin-trader .b1-collection-pages button{min-width:35px;min-height:32px;background:#19301e;border:1px solid #9a814d;color:#f0d694;border-radius:8px;font-size:18px}
