@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;1,500&family=DM+Sans:wght@400;500;600;700&display=swap');
:root{color-scheme:light;--ink:#29483e;--gold:#ae8547;--paper:#f5efdf;--emerald:#075743;--muted:#737b6a}*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at 50% 15%,#fffcf3 0,#f3eddd 48%,#e6dec9 100%);color:var(--ink);font-family:'DM Sans',Arial,sans-serif;min-height:100vh}button,input{font:inherit}button{cursor:pointer;touch-action:manipulation}button:focus-visible{outline:3px solid #c38b30;outline-offset:4px}button:disabled{opacity:.6;cursor:wait}.atelier{max-width:1450px;margin:auto;display:grid;grid-template-columns:1fr minmax(330px,475px) 1fr;align-items:center;gap:clamp(25px,4vw,75px);padding:30px 50px}.edition,.eyebrow{font-size:10px;letter-spacing:2.5px;color:#8d764e;font-weight:600}.editorial h1{font-family:'Cormorant Garamond',Georgia,serif;font-size:clamp(46px,4.6vw,72px);font-weight:500;line-height:.94;letter-spacing:-2px;margin:32px 0}.editorial h1 em{font-weight:500;color:#9d7a42}.editorial>p{font-size:15px;line-height:1.9;color:#637365}.material-note{display:flex;gap:14px;align-items:center;font-size:12px;margin:35px 0}.material-note small{display:block;font-size:10px;color:#7b8274;margin-top:6px}.enamel-swatch{display:block;width:30px;height:36px;transform:rotate(-12deg);border:2px solid #c49c50;background:linear-gradient(135deg,#11366f,#244c83 30%,#0b2c61 55%,#456999 80%,#0b244c);box-shadow:inset 0 0 0 2px #bf9a52,0 3px 8px #54452b30;border-radius:5px}.instructions{border-top:1px solid #cfc5ac;padding-top:22px;max-width:250px}.instructions>span{font-size:10px;letter-spacing:2px}.instructions p{font-size:12px;line-height:1.7;color:#5f6c60}.instructions .quiet{font-size:10px;color:#929284}.game{background:linear-gradient(140deg,#fffdf5,#f3ecdc);padding:22px 20px 14px;border:1px solid #c7b992;border-radius:28px;box-shadow:0 25px 65px #63502e22,0 3px 6px #65553016,inset 0 1px 0 #fff;position:relative;min-width:0}header{display:flex;align-items:center;justify-content:space-between;padding:0 6px 14px}.eyebrow{font-size:8px;letter-spacing:2.3px}.wordmark{font-family:'Cormorant Garamond',Georgia,serif;font-size:39px;line-height:1.1;color:#64502c;letter-spacing:-1px}.wordmark span{font-size:24px;margin-left:5px;color:#a48446}.header-actions{display:flex;gap:6px}.header-actions button,#restart{border:1px solid #d8cbaa;background:linear-gradient(145deg,#fffef5,#e7d9b9);color:#7a5c2f;border-radius:50%;width:39px;height:39px;font-size:20px;box-shadow:inset 0 1px #fff}.header-actions .off{font-size:8px;display:block;line-height:8px}.header-actions button:first-child{font-size:17px}.score-row{display:flex;align-items:center;justify-content:space-between;gap:7px;font-size:9px;letter-spacing:1.25px;margin:0 7px 9px;color:#8d794d}#lives{color:#8e2942;letter-spacing:3px;white-space:nowrap}#boost{color:#fff5ce;background:linear-gradient(110deg,#8d641d,#d9a939);border:1px solid #f1d985;border-radius:12px;padding:3px 7px;box-shadow:0 2px 8px #6b481d33;letter-spacing:.7px;white-space:nowrap;animation:boostPulse 1s ease-in-out infinite alternate}#boost[hidden]{display:none}@keyframes boostPulse{to{filter:brightness(1.18);transform:scale(1.025)}}.progress-row{display:flex;align-items:center;justify-content:space-between;margin:0 7px 7px;font-size:11px;color:#6b7565}.progress-row strong{font-family:'Cormorant Garamond',Georgia,serif;font-size:27px;font-weight:600;color:#075441}.progress-row small{font-size:16px;font-weight:500;color:#8a825f}.progress{height:5px;background:#dfd8c4;border-radius:4px;overflow:hidden;margin:0 7px 5px}#progress-fill{height:100%;width:0;background:linear-gradient(90deg,#063d33,#148665);transition:width .6s}#stage{position:relative;aspect-ratio:24/34;margin:0 -9px;touch-action:none;isolation:isolate}canvas{display:block;width:100%;height:100%;touch-action:none}#loading{position:absolute;inset:0;display:grid;place-content:center;color:#6e6649;font-family:Georgia,serif;background:#f5efdf}#reward{pointer-events:none;position:absolute;left:50%;top:38%;transform:translate(-50%,15px);opacity:0;transition:opacity .3s,transform .4s;background:#fff9e9ed;border:1px solid #d1b979;box-shadow:0 10px 35px #35281625;border-radius:16px;padding:14px 23px;text-align:center;white-space:nowrap}#reward.show{opacity:1;transform:translate(-50%,0)}#reward span{font-size:8px;letter-spacing:2px;color:#8f7040}#reward strong{display:block;font-family:Georgia,serif;font-size:36px;font-weight:400;margin-top:5px;color:#075743}#overlay{position:absolute;inset:12% 6%;z-index:4;background:#fbf6e9ef;backdrop-filter:blur(8px);border:1px solid #cfbb8a;border-radius:20px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px;box-shadow:0 15px 45px #3c301322}#overlay[hidden]{display:none}#overlay-kicker{font-size:9px;letter-spacing:2px;color:#8f7040}#overlay h2{font-family:Georgia,serif;font-size:35px;font-weight:400;margin:20px 0 8px}#overlay p{font-size:13px;line-height:1.6;color:#68715e}#resume{background:#075743;color:#fff8df;border:0;border-radius:24px;padding:13px 30px;margin-top:15px}.status{display:flex;align-items:center;justify-content:center;gap:7px;min-height:32px;font-size:11px;text-align:center;color:#69705d;margin-top:-3px}.status-dot{width:5px;height:5px;border-radius:50%;background:#bb9149;flex-shrink:0}.actions{display:flex;gap:8px;margin:7px 2px 10px}.actions button{min-height:43px;border-radius:22px;font-size:11px;padding:10px 14px}.primary{flex:1;background:linear-gradient(125deg,#0a5e4b,#063c31);border:1px solid #b59b60;color:#fff2cd;box-shadow:0 3px 5px #052f2420,inset 0 1px #ffffff30}.primary span{margin-left:8px}.secondary{background:transparent;color:#776138;border:1px solid #cabb97}.control-row{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:0 4px}.control-row p{font-size:10px;line-height:1.6;text-align:center;color:#586a5d}.control-row p span{color:#919381;font-size:9px}.direction-pad{display:flex;align-items:center;gap:3px}.direction-pad>div{display:flex;flex-direction:column;gap:3px}.direction-pad button{width:29px;height:27px;padding:0;border:1px solid #d8cba9;background:#f9f4e8;border-radius:8px;color:#74603b;font-size:16px}#restart{width:31px;height:31px;font-size:21px}footer{display:flex;align-items:center;justify-content:space-between;gap:8px;border-top:1px solid #e2d9c2;margin-top:12px;padding-top:11px;font-size:7px;letter-spacing:1px;color:#97917b}footer label{font-size:9px;letter-spacing:0;display:flex;align-items:center;gap:3px}footer input{accent-color:#075743;width:12px;height:12px}.detail h2{font-family:'Cormorant Garamond',Georgia,serif;font-size:43px;font-weight:500;line-height:1.05;margin:25px 0 40px}.detail-item{display:flex;gap:18px;margin:28px 0}.detail-item b{font-family:Georgia,serif;font-size:13px;font-weight:400;color:#ab8951;padding-top:3px}.detail-item h3{font-size:13px;font-weight:500;margin:0 0 7px}.detail-item p{font-size:12px;line-height:1.75;color:#7f8575;margin:0}.keyboard{font-size:8px;letter-spacing:1.2px;color:#9e967b;margin-top:40px}.keyboard span{margin:0 8px}@media(min-width:1100px){.game{max-width:440px}.atelier{grid-template-columns:1fr 440px 1fr}}@media(max-width:1000px){.atelier{grid-template-columns:minmax(290px,430px) 1fr;max-width:850px;padding:25px;gap:35px}.editorial{display:none}.game{order:0}.detail{order:1}}@media(max-width:650px){body{background:#f5efdf}.atelier{display:block;padding:0;max-width:460px}.editorial,.detail{display:none}.game{border:0;border-radius:0;box-shadow:none;padding:14px 13px max(12px,env(safe-area-inset-bottom))}header{padding-bottom:9px}.wordmark{font-size:32px}.score-row{margin-bottom:5px}#stage{aspect-ratio:24/33}.actions{margin-top:3px}.direction-pad button{width:40px;height:36px}.header-actions button{width:44px;height:44px}.control-row p{font-size:11px}.status{font-size:11px}.actions button{font-size:12px;min-height:46px}footer{font-size:7px}.eyebrow{font-size:9px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
/* Fit a complete playable board and primary actions in the available screen. */
#stage{height:clamp(330px,calc(100svh - 315px),600px);aspect-ratio:auto}.atelier{padding-top:18px;padding-bottom:18px}.game{padding-top:16px}.control-row{min-height:54px}.control-row p{margin:4px 0}footer{margin-top:7px;padding-top:7px}
@media(max-width:650px){#stage{height:clamp(330px,calc(100svh - 300px),650px)}.game{padding-top:10px}.progress-row{margin-bottom:3px}.status{min-height:29px}.control-row{min-height:60px}footer{padding-top:6px}}
@media(min-width:651px){#stage{height:600px}}
@media(max-width:650px){#stage{height:clamp(440px,calc(100svh - 275px),650px)}}
@media(max-width:650px){.atelier{padding:0}.game{padding-top:7px}header{padding-bottom:4px}.score-row{font-size:10px}.progress-row{font-size:12px}.status{font-size:12px}.control-row{min-height:44px}.control-row p{display:none}.direction-pad>div{display:contents}.direction-pad button{width:44px;height:40px}.direction-pad{gap:5px}.actions{margin-bottom:8px}footer{font-size:8px}.wordmark{font-size:30px}#stage{height:clamp(420px,calc(100svh - 280px),650px)}}
/* The whole play surface accepts directional swipes; taps retain their controls. */
.game{touch-action:none}
@media(max-width:650px){body{touch-action:none;overscroll-behavior:none}}
.game{user-select:none;-webkit-user-select:none}

/* Fine-jewelry renderer integration: the dark velvet well separates raised stones from the paper UI. */
#stage{
  overflow:hidden;
  border:1px solid #b99553;
  border-radius:4px 18px 4px 18px;
  background:
    radial-gradient(ellipse at 48% 25%,#173a2e 0,#071a14 54%,#030a08 100%);
  box-shadow:inset 0 0 32px #0009,0 9px 24px #33240f22;
}
.study-link{color:#9a7b42;text-decoration:none;letter-spacing:.04em;white-space:nowrap}
.study-link:hover{text-decoration:underline}
@media(max-width:650px){
  #stage{margin-left:-4px;margin-right:-4px;border-radius:3px 14px 3px 14px}
  footer{gap:5px}
  .study-link{font-size:8px}
}

@media(max-width:420px){.score-row{font-size:8px;letter-spacing:.8px}#boost{font-size:7px;padding:3px 5px}}
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
@media(max-width:650px){.game{padding-bottom:max(8px,env(safe-area-inset-bottom))}#stage{margin-bottom:0}}

/* A quiet, readable explanation of the current cut, outside the playfield. */
.play-feedback{min-height:76px;text-align:center;padding:13px 8px 7px;max-width:390px;margin:auto;}
.play-feedback p{margin:0;line-height:1.45;}
#status{font-size:14px;font-weight:600;color:#29483e;}
#play-hint{font-size:13px;color:#626850;margin-top:4px;}
.score-row{display:grid;grid-template-columns:1fr auto;font-size:10px;letter-spacing:.65px;}
#level{grid-column:1;grid-row:1;}
#lives{grid-column:2;grid-row:1;}
#boost{display:inline-block;font-size:12px;letter-spacing:.4px;padding:4px 9px;animation:none;margin-top:7px;}
#boost[hidden]{display:none;}
@media(max-width:650px){
  #stage{height:clamp(260px,calc(100svh - 280px),650px);}
  .play-feedback{min-height:76px;}
}
