.sgmaq{--sgmaq-blue:#2299cc;--sgmaq-gold:#cc9933;--sgmaq-red:#cc2222;--sgmaq-char-cell:27px;position:relative;max-width:600px;margin:0 auto;padding:20px;box-sizing:border-box;text-align:center;background:#fff;box-shadow:0 0 10px rgba(0,0,0,.1);color:#222;font-family:"Yu Gothic","Hiragino Kaku Gothic ProN","ヒラギノ角ゴシック ProN",Meiryo,sans-serif;font-weight:700;line-height:1.7}
.sgmaq *{box-sizing:border-box}.sgmaq [hidden]{display:none!important}.sgmaq button,.sgmaq input{font:inherit}.sgmaq button{cursor:pointer}.sgmaq-screen{position:relative;min-height:400px;margin-top:20px}.sgmaq h2{font-size:1.28rem;font-weight:700;margin:22px 0 10px}.sgmaq-intro{padding:12px 16px;border:1px solid #ddd;background:#fafafa;text-align:justify;font-weight:500}.sgmaq-intro p{margin:.35em 0}.sgmaq-intro-link{text-align:right!important;font-size:.92rem}.sgmaq-tabs,.sgmaq-ranking-tabs{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-bottom:20px}.sgmaq-tab,.sgmaq-ranking-tab{padding:7px 13px;border:1px solid #ccc;border-radius:5px;background:#eee;color:#222}.sgmaq-tab.is-selected,.sgmaq-ranking-tab.is-selected{background:#ccf;border-color:#99a}.sgmaq-start-btn,.sgmaq-next-btn,.sgmaq-ranking-btn,.sgmaq-share-btn,.sgmaq-back-btn,.sgmaq-nickname-area button{border:0;border-radius:5px;color:#fff}.sgmaq-start-btn{display:block;margin:24px auto 30px;padding:11px 24px;background:var(--sgmaq-blue);font-size:16px}.sgmaq-ranking-btn{padding:11px 14px;background:var(--sgmaq-gold);font-size:13px}.sgmaq-back-btn{position:absolute;z-index:5;top:0;right:0;padding:5px 9px;background:#888;font-size:12px}.sgmaq-progress{text-align:left;padding-right:56px}.sgmaq-scrambled-container{position:relative;overflow:hidden;width:100%;aspect-ratio:16/9;margin:20px 0;background:#f8f8f8}.sgmaq-scrambled-text{position:absolute;z-index:2;top:50%;left:0;width:100%;transform:translateY(-50%);padding:.5em .45em;display:flex;flex-wrap:wrap;justify-content:center;align-content:center;color:#111;font-size:24px;line-height:1.45;letter-spacing:2px;background:transparent}.sgmaq-scrambled-text.is-multiline{display:block}.sgmaq-scrambled-line{display:flex;width:100%;justify-content:space-between}.sgmaq-scrambled-line.is-last{justify-content:flex-start}.sgmaq-scrambled-text.with-band{background:rgba(0,0,0,.5)}.sgmaq-scrambled-text>span,.sgmaq-scrambled-line>span{display:block;flex:0 0 var(--sgmaq-char-cell);width:var(--sgmaq-char-cell);text-align:center}.sgmaq-result-images{position:absolute;z-index:1;inset:0;overflow:hidden}.sgmaq-result-images img{position:absolute;height:auto;max-height:100%;border:1px solid #ccc;border-radius:5px}.sgmaq-result-images.mix-2 img{max-width:49%}.sgmaq-result-images.mix-3 img{max-width:49%}.sgmaq-result-images .left-image{left:0;top:0}.sgmaq-result-images.mix-2 .right-image{right:0;bottom:0}.sgmaq-result-images.mix-3 .center-image{left:50%;bottom:0;transform:translateX(-50%)}.sgmaq-result-images.mix-3 .right-image{right:0;top:0}.sgmaq-choice{display:block;width:80%;margin:7px auto;padding:10px;border:1px solid #ccc;border-radius:5px;background:#e0e0e0;color:#222;font-size:16px;white-space:normal;overflow-wrap:anywhere}.sgmaq-choice:hover:not(:disabled){background:#d0d0d0}.sgmaq-choice.is-correct{background:var(--sgmaq-blue)!important;color:#fff}.sgmaq-choice.is-wrong{background:var(--sgmaq-red)!important;color:#fff}.sgmaq-next-btn{margin-top:20px;padding:10px 20px;border:1px solid #999;background:#777;font-size:16px}.sgmaq-result{font-size:20px}.sgmaq-result p{margin:.5em 0}.sgmaq-rank-message{font-weight:700}.sgmaq-registration-message{padding-bottom:10px}.sgmaq-nickname-area{display:flex;justify-content:center;gap:8px;margin:12px 0}.sgmaq-nickname-area input{min-width:0;max-width:280px;padding:.5em;border:1px solid #aaa;border-radius:4px}.sgmaq-nickname-area button{padding:.45em 1em;background:var(--sgmaq-blue)}.sgmaq-result-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:18px}.sgmaq-share-btn{padding:10px 18px;background:#1d9bf0}.sgmaq-ranking h2{margin-top:8px}.sgmaq-ranking-content{overflow-x:auto}.sgmaq-ranking-table{width:100%;max-width:520px;margin:0 auto;border-collapse:collapse;font-size:15px}.sgmaq-ranking-table th,.sgmaq-ranking-table td{padding:8px;border:1px solid #ccc}.sgmaq-ranking-table th{background:#f2f2f2}.sgmaq-ranking-empty{font-weight:500}
@media(max-width:768px){.sgmaq{--sgmaq-char-cell:clamp(20px,5.6vw,24px);width:100%;padding:14px}.sgmaq-screen{min-height:360px}.sgmaq-scrambled-text{font-size:clamp(18px,5.3vw,22px);letter-spacing:1px}.sgmaq-choice{width:94%;font-size:15px}.sgmaq-transition-button{display:none}.sgmaq-result{font-size:17px}}
@media(min-width:769px){.sgmaq-transition-swipe{display:none}}

/* ================================================================
   v0.1.3 — Series title screen / dedicated game page
   The game logic and anagram rendered-line alignment remain unchanged.
   ================================================================ */
html.sgmaq-app-html,body.sgmaq-app-page{margin:0!important;padding:0!important;width:100%;min-height:100%;}
body.sgmaq-app-page{--sgmaq-admin-bar-offset:0px;background:#f0eee7!important;color:#243d32;}
body.admin-bar.sgmaq-app-page{--sgmaq-admin-bar-offset:32px;}
@media(max-width:782px){body.admin-bar.sgmaq-app-page{--sgmaq-admin-bar-offset:46px;}}
body.sgmaq-app-page #wpadminbar{position:fixed!important;}
body.sgmaq-app-page.sgmaq-state-start{overflow:hidden!important;}
body.sgmaq-app-page:not(.sgmaq-state-start){overflow-x:hidden!important;overflow-y:auto!important;}
body.sgmaq-settings-open{overflow:hidden!important;}
.sgmaq-app-main{position:relative;width:100%;height:calc(100dvh - var(--sgmaq-admin-bar-offset));min-height:0;margin:0;padding:0;overflow:hidden;}
.sgmaq-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;}

body.sgmaq-app-page .sgmaq{position:relative;width:100%;max-width:none;height:100%;min-height:0;margin:0;padding:0;background:transparent;box-shadow:none;text-align:center;color:#222;}
body.sgmaq-app-page .sgmaq[data-screen="start"]{height:100%;overflow:hidden;}
body.sgmaq-app-page .sgmaq-start{position:relative;width:100%;height:100%;min-height:0;margin:0!important;padding:0;overflow:hidden;}

.sgmaq-title-stage{position:absolute;inset:0;width:100%;height:100%;min-height:0;margin:0;overflow:hidden;container-type:inline-size;color:#1e3b30;font-family:"Yu Mincho","Hiragino Mincho ProN",serif;background:#ead09a url("../images/paper-texture.webp") center/520px 520px repeat;isolation:isolate;}
.sgmaq-title-stage::before{content:"";position:absolute;inset:0;z-index:-3;background:radial-gradient(circle at 50% 46%,rgba(255,250,224,.96) 0 18%,rgba(255,244,206,.62) 38%,rgba(216,174,91,.12) 70%,rgba(97,66,30,.13) 100%),linear-gradient(90deg,rgba(117,79,28,.10),transparent 18%,transparent 82%,rgba(117,79,28,.10));}
.sgmaq-title-stage::after{content:"";position:absolute;inset:0;z-index:-2;pointer-events:none;box-shadow:inset 0 0 90px rgba(89,58,21,.18);}
.sgmaq-title-header-line{position:absolute;left:22%;right:22%;top:6.8%;height:1px;background:rgba(85,73,45,.42);}
.sgmaq-title-mobile-header{position:absolute;z-index:8;left:23%;right:23%;top:2.1%;height:4.2%;display:flex;align-items:center;justify-content:space-between;}
.sgmaq-title-brand,.sgmaq-title-help{color:#2f3e34;text-decoration:none;font-weight:600;line-height:1;letter-spacing:.035em;white-space:nowrap;}
.sgmaq-title-brand{font-size:clamp(11px,.82cqw,17px);}.sgmaq-title-help{font-size:clamp(11px,.78cqw,16px);}
.sgmaq-title-copy{position:absolute;z-index:3;left:17%;top:9.7%;width:66%;text-align:center;}
.sgmaq-title-kicker{font-size:clamp(8px,.54cqw,11px);letter-spacing:.34em;color:#9a7221;font-weight:700;margin-bottom:.55em;}
.sgmaq-title-copy h2{margin:0!important;padding:0!important;border:0!important;background:none!important;color:#1b4a39!important;font-size:clamp(25px,2.25cqw,46px)!important;font-weight:600!important;line-height:1.18!important;letter-spacing:.025em!important;text-shadow:0 1px rgba(255,255,255,.5);}
.sgmaq-title-copy p{margin:.55em 0 0!important;font-size:clamp(13px,1.08cqw,22px);font-weight:500;letter-spacing:.025em;color:#344b40;}

.sgmaq-title-visual{position:absolute;z-index:2;left:25%;top:29%;width:50%;height:37%;filter:drop-shadow(0 13px 11px rgba(74,48,21,.18));}
.sgmaq-anagram-board,.sgmaq-anagram-slip{position:absolute;border:1px solid rgba(188,142,30,.86);box-shadow:0 5px 13px rgba(58,42,25,.22);}
.sgmaq-anagram-board{left:25%;top:7%;width:50%;height:84%;z-index:5;border-radius:4px;background:linear-gradient(150deg,#163f31,#0e2d24 72%,#173b2f);color:#f6e5b3;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:4%;outline:1px solid rgba(242,206,116,.34);outline-offset:-7px;}
.sgmaq-anagram-board::before,.sgmaq-anagram-board::after{content:"✦";position:absolute;color:#cba344;font-size:clamp(10px,1.15cqw,23px);top:7%;}.sgmaq-anagram-board::before{left:7%;}.sgmaq-anagram-board::after{right:7%;}
.sgmaq-anagram-board-top{font-size:clamp(9px,.76cqw,15px);letter-spacing:.28em;margin-bottom:6%;}
.sgmaq-anagram-board-main{font-family:Georgia,"Times New Roman",serif;font-size:clamp(19px,1.65cqw,34px);line-height:1.12;letter-spacing:.10em;font-weight:600;}
.sgmaq-anagram-board-rule{width:56%;height:1px;background:#b68c2f;margin:7% 0 5%;}
.sgmaq-anagram-board-small{font-size:clamp(7px,.48cqw,10px);letter-spacing:.18em;white-space:nowrap;opacity:.9;}
.sgmaq-anagram-slip{width:18%;height:32%;z-index:2;border-radius:3px;background:#f7edce;display:grid;place-items:center;color:#27503f;background-image:linear-gradient(rgba(255,255,255,.34),rgba(255,255,255,0));}
.sgmaq-anagram-slip span{font-size:clamp(22px,2.4cqw,49px);font-weight:600;line-height:1;}
.sgmaq-slip-a{left:4%;top:3%;transform:rotate(-8deg)}.sgmaq-slip-b{left:3%;bottom:5%;transform:rotate(6deg)}
.sgmaq-slip-c{left:18%;top:35%;transform:rotate(-3deg);z-index:3}.sgmaq-slip-d{right:18%;top:35%;transform:rotate(4deg);z-index:3}
.sgmaq-slip-e{right:3%;top:4%;transform:rotate(8deg)}.sgmaq-slip-f{right:4%;bottom:4%;transform:rotate(-7deg)}

.sgmaq-title-start,.sgmaq-title-settings,.sgmaq-title-ranking{position:absolute;z-index:6;border:0;background:transparent;font-family:"Yu Mincho","Hiragino Mincho ProN",serif;cursor:pointer;}
.sgmaq-title-start{left:39.6973%;top:74.9334%;width:20.5078%;height:9.3842%;display:flex;align-items:center;justify-content:center;border:1px solid #c79a36;border-radius:7px;background:linear-gradient(#1d5a44,#123f31);color:#fff!important;font-size:clamp(18px,1.33cqw,27px);font-weight:600;box-shadow:0 7px 15px rgba(55,39,20,.22),inset 0 1px rgba(255,255,255,.16);text-shadow:0 1px 2px rgba(0,0,0,.28);}
.sgmaq-title-start:hover{filter:brightness(1.05);}
.sgmaq-title-current-label,.sgmaq-title-rule,.sgmaq-title-footer{position:absolute;z-index:5;display:flex;align-items:center;justify-content:center;text-align:center;}
.sgmaq-title-current-label{left:42.2%;top:86.2%;width:15.6%;height:2.2%;font-size:clamp(12px,.82cqw,17px);font-weight:500;white-space:nowrap;}
.sgmaq-title-current-label::before,.sgmaq-title-current-label::after{content:"";height:1px;background:#aa8127;opacity:.8;flex:1 1 auto;}.sgmaq-title-current-label span{padding:0 .8em;}
.sgmaq-title-rule{left:29%;top:89.8%;width:42%;height:2.2%;font-size:clamp(10px,.69cqw,14px);font-weight:500;white-space:nowrap;}
.sgmaq-title-settings,.sgmaq-title-ranking{top:94.5%;height:2.2%;display:inline-flex;align-items:center;justify-content:center;gap:.42em;color:#243d32;font-weight:500;white-space:nowrap;font-size:clamp(12px,.75cqw,16px);}
.sgmaq-title-settings{left:40.4%;width:9.8%;}.sgmaq-title-ranking{left:47.5%;width:11.8%;}
.sgmaq-title-settings-icon,.sgmaq-title-ranking-crown{display:inline-grid;place-items:center;color:#b98b20;flex:0 0 auto;}.sgmaq-title-settings-icon svg{width:1.05em;height:1.05em;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;}.sgmaq-title-ranking-crown svg{width:1.15em;height:.9em;fill:currentColor;stroke:currentColor;stroke-width:1;}
.sgmaq-title-footer{left:auto;right:1.5vw;top:96%;bottom:auto;width:auto;height:2.7%;gap:1em;justify-content:flex-end;text-align:right;color:#4d4639;font-size:clamp(9px,.56cqw,12px);white-space:nowrap;}.sgmaq-title-footer a{color:inherit;text-decoration:none;}

.sgmaq-settings-overlay{position:absolute;inset:0;z-index:30;display:flex;align-items:center;justify-content:center;padding:20px;}
.sgmaq-settings-backdrop{position:absolute;inset:0;background:rgba(25,30,27,.48);backdrop-filter:blur(3px);}
.sgmaq-settings-panel{position:relative;z-index:2;width:min(92vw,590px);max-height:min(88vh,760px);overflow:auto;border:1px solid #b98b2e;border-radius:12px;background:#fffaf0 url("../images/paper-texture.webp") center/420px repeat;padding:30px 30px 27px;box-shadow:0 18px 55px rgba(25,20,13,.34);color:#263c32;text-align:center;}
.sgmaq-settings-panel::before{content:"";position:absolute;inset:7px;border:1px solid rgba(185,139,46,.28);border-radius:8px;pointer-events:none;}
.sgmaq-settings-close{position:absolute;z-index:4;right:14px;top:10px;width:36px;height:36px;border:0;background:transparent;color:#586058;font:400 30px/1 Georgia,serif;cursor:pointer;}
.sgmaq-settings-panel h3{margin:0 0 23px!important;color:#1e4938!important;font-size:28px!important;font-weight:600!important;}
.sgmaq-settings-group{position:relative;z-index:2;margin:0 0 20px;}.sgmaq-settings-group h4{margin:0 0 9px!important;color:#4a4d45;font-size:15px;font-weight:600;}
.sgmaq-settings-panel .sgmaq-tabs{margin:0;display:flex;justify-content:center;gap:8px;flex-wrap:wrap;}
.sgmaq-settings-panel .sgmaq-tab{min-width:105px;margin:0;padding:9px 16px;border:1px solid #bca96f;border-radius:6px;background:#f2ead4;color:#3b473f;font-family:inherit;font-size:14px;}
.sgmaq-settings-panel .sgmaq-tab.is-selected{border-color:#1e5b44;background:#1e5b44;color:#fff;box-shadow:0 3px 8px rgba(26,77,59,.19);}
.sgmaq-settings-help{position:relative;z-index:2;margin:0 0 16px!important;font-size:13px;}.sgmaq-settings-help a{color:#396252;}
.sgmaq-settings-done{position:relative;z-index:3;min-width:210px;border:1px solid #b98b2e;border-radius:6px;background:#184c39;color:#fff;padding:11px 23px;font-family:inherit;font-size:15px;cursor:pointer;}

/* Until the later game-screen redesign, keep v0.1.2 game/result/ranking UI intact inside the dedicated page. */
body.sgmaq-app-page .sgmaq-game,body.sgmaq-app-page .sgmaq-result,body.sgmaq-app-page .sgmaq-ranking{width:min(calc(100% - 28px),600px);min-height:400px;margin:20px auto!important;padding:20px;background:#fff;box-shadow:0 0 10px rgba(0,0,0,.1);}
body.sgmaq-app-page .sgmaq-result{font-size:20px;}

@media(min-width:769px) and (max-aspect-ratio:4/3){
  .sgmaq-title-settings{left:auto;right:calc(50% + 20px);width:max-content;white-space:nowrap;}
  .sgmaq-title-ranking{left:calc(50% + 20px);right:auto;width:max-content;white-space:nowrap;}
}

@media(max-width:768px){
  .sgmaq-app-main{height:calc(100dvh - var(--sgmaq-admin-bar-offset));}
  .sgmaq-title-header-line{left:6.2%;right:6.2%;top:6.25%;}
  .sgmaq-title-mobile-header{left:6.2%;right:6.2%;top:2%;height:3.5%;}
  .sgmaq-title-brand,.sgmaq-title-help{font-size:clamp(12px,3.3vw,16px);}
  .sgmaq-title-copy{left:5%;top:8.5%;width:90%;}
  .sgmaq-title-kicker{font-size:clamp(8px,2.2vw,11px);letter-spacing:.24em;}
  .sgmaq-title-copy h2{font-size:clamp(22px,6.5vw,34px)!important;line-height:1.2!important;letter-spacing:.005em!important;}
  .sgmaq-title-copy p{font-size:clamp(11px,3.1vw,15px);line-height:1.42;margin-top:.55em!important;}
  .sgmaq-title-visual{left:7%;width:86%;filter:drop-shadow(0 9px 8px rgba(74,48,21,.16));}
  .sgmaq-anagram-board{left:22%;width:56%;}.sgmaq-anagram-slip{width:18%;height:29%;}
  .sgmaq-anagram-board-top{font-size:clamp(7px,2vw,10px);}.sgmaq-anagram-board-main{font-size:clamp(17px,5vw,26px);}.sgmaq-anagram-board-small{font-size:clamp(5px,1.45vw,8px);}.sgmaq-anagram-slip span{font-size:clamp(20px,6vw,32px);}
  .sgmaq-title-start{font-size:clamp(19px,5.2vw,27px);}
  .sgmaq-title-current-label{font-size:clamp(12px,3.3vw,16px);}.sgmaq-title-rule{font-size:clamp(10px,2.75vw,14px);}
  .sgmaq-title-settings,.sgmaq-title-ranking{font-size:clamp(14px,3.8vw,19px);}
  .sgmaq-title-footer{font-size:clamp(9px,2.7vw,13px);gap:.7em;}
  .sgmaq-settings-overlay{padding:12px;}.sgmaq-settings-panel{width:min(94vw,560px);padding:27px 16px 22px;}.sgmaq-settings-panel h3{font-size:24px!important;margin-bottom:19px!important;}.sgmaq-settings-group{margin-bottom:16px;}.sgmaq-settings-panel .sgmaq-tab{min-width:88px;padding:8px 11px;font-size:13px;}

  .sgmaq-title-stage[data-mobile-master="standard"] .sgmaq-title-copy{top:8.2%;}
  .sgmaq-title-stage[data-mobile-master="standard"] .sgmaq-title-visual{top:25%;height:28%;}
  .sgmaq-title-stage[data-mobile-master="standard"] .sgmaq-title-start{left:17%;top:59%;width:66%;height:7.8%;}
  .sgmaq-title-stage[data-mobile-master="standard"] .sgmaq-title-current-label{left:23%;top:70.2%;width:54%;height:2.5%;}
  .sgmaq-title-stage[data-mobile-master="standard"] .sgmaq-title-rule{left:4%;top:74%;width:92%;height:3%;}
  .sgmaq-title-stage[data-mobile-master="standard"] .sgmaq-title-settings{left:8%;top:81.2%;width:40%;height:4%;}
  .sgmaq-title-stage[data-mobile-master="standard"] .sgmaq-title-ranking{left:48%;top:81.2%;width:44%;height:4%;}
  .sgmaq-title-stage[data-mobile-master="standard"] .sgmaq-title-footer{left:10%;right:auto;top:96.5%;width:80%;height:2.2%;}

  .sgmaq-title-stage[data-mobile-master="tall"] .sgmaq-title-copy{top:8.0%;}
  .sgmaq-title-stage[data-mobile-master="tall"] .sgmaq-title-visual{top:22%;height:27%;}
  .sgmaq-title-stage[data-mobile-master="tall"] .sgmaq-title-start{left:19%;top:55%;width:62%;height:6.6%;}
  .sgmaq-title-stage[data-mobile-master="tall"] .sgmaq-title-current-label{left:24%;top:65.3%;width:52%;height:2.3%;}
  .sgmaq-title-stage[data-mobile-master="tall"] .sgmaq-title-rule{left:4%;top:69%;width:92%;height:2.8%;}
  .sgmaq-title-stage[data-mobile-master="tall"] .sgmaq-title-settings{left:25%;top:76%;width:50%;height:3.6%;}
  .sgmaq-title-stage[data-mobile-master="tall"] .sgmaq-title-ranking{left:22%;top:81%;width:56%;height:3.6%;}
  .sgmaq-title-stage[data-mobile-master="tall"] .sgmaq-title-footer{left:10%;right:auto;top:94%;width:80%;height:2.2%;}

  .sgmaq-title-stage[data-mobile-master="super-tall"] .sgmaq-title-copy{top:8.4%;}
  .sgmaq-title-stage[data-mobile-master="super-tall"] .sgmaq-title-visual{top:22.5%;height:26%;}
  .sgmaq-title-stage[data-mobile-master="super-tall"] .sgmaq-title-start{left:19%;top:56%;width:62%;height:6.5%;}
  .sgmaq-title-stage[data-mobile-master="super-tall"] .sgmaq-title-current-label{left:24%;top:66.7%;width:52%;height:2.3%;}
  .sgmaq-title-stage[data-mobile-master="super-tall"] .sgmaq-title-rule{left:4%;top:70.5%;width:92%;height:2.8%;}
  .sgmaq-title-stage[data-mobile-master="super-tall"] .sgmaq-title-settings{left:25%;top:77.5%;width:50%;height:3.5%;}
  .sgmaq-title-stage[data-mobile-master="super-tall"] .sgmaq-title-ranking{left:22%;top:82%;width:56%;height:3.5%;}
  .sgmaq-title-stage[data-mobile-master="super-tall"] .sgmaq-title-footer{left:10%;right:auto;top:95%;width:80%;height:2.2%;}

  body.sgmaq-app-page .sgmaq-game,body.sgmaq-app-page .sgmaq-result,body.sgmaq-app-page .sgmaq-ranking{width:calc(100% - 20px);margin:10px auto!important;padding:14px;}
}
body.sgmaq-app-page:not(.sgmaq-state-start) .sgmaq-app-main{overflow-y:auto!important;overflow-x:hidden!important;-webkit-overflow-scrolling:touch;}

/* ========================================================================
   v0.1.6 — Series active quiz / result / ranking UI
   Keeps the v0.1.2 rendered-line anagram alignment intact:
   single line centered; completed wrapped rows justified; final row natural-left.
   ======================================================================== */
html.sgmaq-app-html{
  --sgmaq-page:#f7f2e4;
  --sgmaq-surface:#fffdf7;
  --sgmaq-surface-soft:#fbf8ef;
  --sgmaq-ink:#151b18;
  --sgmaq-muted:#6f7772;
  --sgmaq-line:#dfe3de;
  --sgmaq-line-strong:#cbd2cc;
  --sgmaq-accent:#254b3f;
  --sgmaq-accent-2:#315f50;
  --sgmaq-gold-ui:#9b7439;
  --sgmaq-danger-ui:#a7443f;
  --sgmaq-danger-soft:#f8e9e7;
  --sgmaq-success-ui:#255d43;
  --sgmaq-success-soft:#e7f1eb;
  --sgmaq-shadow:0 24px 70px rgba(25,36,30,.08);
}
body.sgmaq-app-page.sgmaq-state-game,
body.sgmaq-app-page.sgmaq-state-result{
  background:
    radial-gradient(900px 480px at 50% -180px,rgba(255,255,255,.68),rgba(255,255,255,0) 72%),
    linear-gradient(180deg,#faf6ea 0%,var(--sgmaq-page) 100%)!important;
  color:var(--sgmaq-ink);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans CJK JP","Hiragino Sans","Hiragino Kaku Gothic ProN","Yu Gothic UI","Yu Gothic",Meiryo,sans-serif;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
body.sgmaq-app-page.sgmaq-state-game .sgmaq,
body.sgmaq-app-page.sgmaq-state-result .sgmaq{
  color:var(--sgmaq-ink);
  font-family:inherit;
  font-weight:400;
  line-height:1.65;
}

/* ---------- Game screen ---------- */
body.sgmaq-app-page .sgmaq .sgmaq-screen-game{
  width:100%;
  min-height:calc(100dvh - var(--sgmaq-admin-bar-offset));
  margin:0!important;
  padding:clamp(18px,4vh,42px) 20px;
  background:transparent!important;
  box-shadow:none!important;
  display:flex;
  align-items:center;
  justify-content:center;
}
.sgmaq .sgmaq-game-shell{width:min(100%,840px);margin:0 auto;}
.sgmaq .sgmaq-gamebar{
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  gap:12px;
  min-height:46px;
  padding:0 4px 10px;
  color:#59635d;
  font-size:12px;
}
.sgmaq .sgmaq-gamebar-exit{
  justify-self:start;
  border:0;
  background:transparent;
  color:#6a736e;
  padding:5px 0;
  font:inherit;
  font-weight:650;
  cursor:pointer;
}
.sgmaq .sgmaq-progress-wrap{justify-self:center;text-align:center;}
.sgmaq .sgmaq-counter{font-weight:760;letter-spacing:.03em;font-variant-numeric:tabular-nums;}
.sgmaq .sgmaq-timer{justify-self:end;color:#39423d;font-variant-numeric:tabular-nums;font-size:12px;font-weight:700;}
.sgmaq .sgmaq-timer small{font-size:1em;margin-left:2px;}
.sgmaq .sgmaq-progress-line{height:3px;margin:0 2px 12px;background:#e0e4e0;border-radius:999px;overflow:hidden;}
.sgmaq .sgmaq-progress-line span{display:block;width:0;height:100%;background:var(--sgmaq-accent);transition:width .22s ease;}
.sgmaq .sgmaq-question-stage{position:relative;width:100%;min-height:0;}
.sgmaq .sgmaq-anagram-card{
  position:relative;
  width:100%;
  min-height:clamp(220px,31vh,260px);
  padding:clamp(20px,3vw,28px) clamp(20px,5vw,52px) clamp(18px,2.7vw,24px);
  overflow:hidden;
  border:1px solid rgba(37,75,63,.11);
  border-radius:18px;
  background:
    radial-gradient(circle at 50% 5%,rgba(255,255,255,.97),rgba(255,253,247,.92) 55%,rgba(247,242,228,.86) 100%),
    url("../images/paper-texture.webp") center/420px repeat;
  box-shadow:0 16px 44px rgba(25,36,30,.09);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
}
.sgmaq .sgmaq-anagram-card::before{
  content:"";
  position:absolute;
  inset:8px;
  border:1px solid rgba(155,116,57,.17);
  border-radius:12px;
  pointer-events:none;
}
.sgmaq .sgmaq-question-kicker{
  position:relative;
  z-index:4;
  margin:0 0 13px!important;
  color:var(--sgmaq-gold-ui);
  font-size:11px;
  font-weight:760;
  letter-spacing:.18em;
}
.sgmaq .sgmaq-anagram-card .sgmaq-scrambled-container{
  position:relative;
  z-index:2;
  width:100%;
  height:clamp(135px,19vh,165px);
  aspect-ratio:auto;
  margin:0;
  overflow:hidden;
  border:1px solid rgba(37,75,63,.10);
  border-radius:13px;
  background:rgba(255,255,255,.58);
  box-shadow:inset 0 0 34px rgba(45,59,51,.035);
}
/* Do not replace these line-layout rules with whole-flex space-between.
   They are the core v0.1.2 fix for a short final wrapped line. */
.sgmaq .sgmaq-scrambled-text{
  position:absolute;
  z-index:3;
  top:50%;
  left:0;
  width:100%;
  transform:translateY(-50%);
  padding:.5em .45em;
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  align-content:center;
  color:#111;
  font-size:24px;
  font-weight:760;
  line-height:1.45;
  letter-spacing:2px;
  background:transparent;
}
.sgmaq .sgmaq-scrambled-text.is-multiline{display:block;}
.sgmaq .sgmaq-scrambled-line{display:flex;width:100%;justify-content:space-between;}
.sgmaq .sgmaq-scrambled-line.is-last{justify-content:flex-start;}
.sgmaq .sgmaq-scrambled-text>span,
.sgmaq .sgmaq-scrambled-line>span{display:block;flex:0 0 var(--sgmaq-char-cell);width:var(--sgmaq-char-cell);text-align:center;}
.sgmaq .sgmaq-scrambled-text.with-band{
  background:rgba(8,18,14,.66);
  box-shadow:0 0 18px rgba(0,0,0,.08);
  text-shadow:0 1px 2px rgba(0,0,0,.48);
}
.sgmaq .sgmaq-result-images{position:absolute;z-index:1;inset:0;overflow:hidden;background:#ece9df;}
.sgmaq .sgmaq-result-images:empty{background:transparent;}
.sgmaq .sgmaq-result-images img{
  position:absolute;
  display:block;
  max-width:none;
  max-height:none;
  margin:0!important;
  border:0;
  border-radius:0;
  object-fit:cover;
  box-shadow:none;
}
.sgmaq .sgmaq-result-images.mix-2 img{width:52%;height:100%;}
.sgmaq .sgmaq-result-images.mix-2 .left-image{left:0;top:0;}
.sgmaq .sgmaq-result-images.mix-2 .right-image{right:0;bottom:0;}
.sgmaq .sgmaq-result-images.mix-3 img{width:52%;height:72%;}
.sgmaq .sgmaq-result-images.mix-3 .left-image{left:0;top:0;}
.sgmaq .sgmaq-result-images.mix-3 .center-image{left:50%;bottom:0;transform:translateX(-50%);z-index:2;}
.sgmaq .sgmaq-result-images.mix-3 .right-image{right:0;top:0;}
.sgmaq .sgmaq-question-help{
  position:relative;
  z-index:4;
  max-width:680px;
  margin:13px auto 0!important;
  color:var(--sgmaq-muted);
  font-size:11px;
  font-weight:500;
  line-height:1.65;
}
.sgmaq .sgmaq-answer-row{position:relative;width:100%;margin:0 auto;}
.sgmaq .sgmaq-choices{display:flex;flex-direction:column;gap:9px;width:100%;padding:14px 2px 22px;}
.sgmaq .sgmaq-choice{
  display:flex;
  align-items:center;
  width:100%;
  min-height:52px;
  margin:0;
  padding:12px 16px;
  border:1px solid var(--sgmaq-line);
  border-radius:12px;
  background:rgba(255,255,255,.86);
  color:var(--sgmaq-ink);
  box-shadow:0 4px 14px rgba(25,36,30,.025);
  font:inherit;
  font-size:15px;
  font-weight:680;
  line-height:1.45;
  text-align:left;
  white-space:normal;
  overflow-wrap:anywhere;
  cursor:pointer;
  transition:transform .14s ease,background .14s ease,border-color .14s ease,box-shadow .14s ease;
}
@media(hover:hover){.sgmaq .sgmaq-choice:not(:disabled):hover{border-color:#abbab1;background:#fff;transform:translateY(-1px);}}
.sgmaq .sgmaq-choice:disabled{cursor:default;opacity:1;transform:none;}
.sgmaq .sgmaq-choice.is-correct{background:var(--sgmaq-success-soft)!important;border-color:#82ad96!important;color:#214f3a!important;}
.sgmaq .sgmaq-choice.is-wrong{background:var(--sgmaq-danger-soft)!important;border-color:#d18c87!important;color:#7d2925!important;}
.sgmaq .sgmaq-choice.is-correct::before,
.sgmaq .sgmaq-choice.is-wrong::before{display:inline-block;flex:0 0 auto;margin-right:8px;font-size:1.05em;font-weight:760;line-height:1;}
.sgmaq .sgmaq-choice.is-correct::before{content:"✓";}
.sgmaq .sgmaq-choice.is-wrong::before{content:"×";}
.sgmaq .sgmaq-next-btn{
  margin:0 auto 18px;
  min-width:220px;
  min-height:54px;
  padding:0 18px;
  border:0;
  border-radius:12px;
  background:var(--sgmaq-accent);
  color:#fff;
  font:inherit;
  font-size:16px;
  font-weight:700;
  cursor:pointer;
}
.sgmaq .sgmaq-next-btn:hover{background:#1f4036;}
.sgmaq .sgmaq-next-chevron{display:none;}
.sgmaq .sgmaq-next-label{display:inline;}
.sgmaq .sgmaq-swipe-hint{margin:8px 0 0!important;color:var(--sgmaq-muted);font-size:12px;font-weight:500;text-align:center;}
.sgmaq .sgmaq-next-btn:not(.is-visible){display:none!important;}
.sgmaq .sgmaq-next-btn.is-visible{display:flex!important;align-items:center;justify-content:center;}
@media(min-width:769px) and (max-width:1159px){
  .sgmaq .sgmaq-next-btn.is-visible{position:static;width:min(100%,280px);min-width:0;margin:0 auto 18px;}
}
@media(min-width:1160px){
  .sgmaq .sgmaq-next-btn.is-visible{
    position:absolute;
    left:calc(100% + 14px);
    top:14px;
    width:56px;
    min-width:56px;
    height:calc(100% - 36px);
    min-height:0;
    margin:0;
    padding:0;
    display:grid!important;
    place-items:center;
    border-radius:14px;
  }
  .sgmaq .sgmaq-next-btn.is-visible .sgmaq-next-label{display:none;}
  .sgmaq .sgmaq-next-btn.is-visible .sgmaq-next-chevron{display:block;width:20px;height:40px;}
  .sgmaq .sgmaq-next-btn.is-visible .sgmaq-next-chevron svg{display:block;width:100%;height:100%;overflow:visible;}
  .sgmaq .sgmaq-next-btn.is-visible .sgmaq-next-chevron path{fill:none;stroke:currentColor;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;}
}

/* ---------- Result screen ---------- */
body.sgmaq-app-page .sgmaq .sgmaq-screen-result{
  width:100%;
  min-height:calc(100dvh - var(--sgmaq-admin-bar-offset));
  margin:0!important;
  padding:clamp(18px,4vh,42px) 20px;
  background:transparent!important;
  box-shadow:none!important;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:inherit;
}
.sgmaq .sgmaq-result-card{
  width:min(100%,720px);
  margin:0 auto;
  padding:clamp(28px,5vw,48px);
  border:1px solid rgba(37,75,63,.10);
  border-radius:22px;
  background:rgba(255,255,255,.94);
  box-shadow:var(--sgmaq-shadow);
  text-align:center;
}
.sgmaq .sgmaq-result-kicker{margin:0 0 6px!important;color:var(--sgmaq-accent);font-size:11px;font-weight:760;letter-spacing:.22em;}
.sgmaq .sgmaq-result-card>h2{
  margin:0 0 20px!important;
  padding:0!important;
  border:0!important;
  background:none!important;
  color:var(--sgmaq-ink)!important;
  font-family:inherit!important;
  font-size:25px!important;
  font-weight:760!important;
}
.sgmaq .sgmaq-result-score{margin:8px 0 0;color:var(--sgmaq-ink);font-size:clamp(52px,10vw,78px);font-weight:800;line-height:1;font-variant-numeric:tabular-nums;letter-spacing:-.04em;}
.sgmaq .sgmaq-result-time{margin:10px 0 24px;color:var(--sgmaq-muted);font-size:20px;font-weight:500;font-variant-numeric:tabular-nums;}
.sgmaq .sgmaq-rank-message{min-height:1.5em;margin:0 auto 12px!important;color:#77551c;font-weight:720;}
.sgmaq .sgmaq-registration-message{margin:0 auto 12px!important;padding:0;color:#77551c;font-size:13px;font-weight:600;}
.sgmaq .sgmaq-nickname-area{display:block;max-width:520px;margin:0 auto 22px;padding:17px;border-radius:13px;background:#f7f8f6;text-align:left;}
.sgmaq .sgmaq-nickname-area label{display:block;margin-bottom:8px;font-size:13px;font-weight:720;}
.sgmaq .sgmaq-nickname-area>div{display:flex;gap:8px;}
.sgmaq .sgmaq-nickname-area input{min-width:0;max-width:none;flex:1;padding:10px 12px;border:1px solid var(--sgmaq-line);border-radius:10px;background:#fff;color:var(--sgmaq-ink);font:inherit;}
.sgmaq .sgmaq-nickname-area button{padding:9px 16px;border:0;border-radius:12px;background:var(--sgmaq-gold-ui);color:#fff;font:inherit;font-weight:720;cursor:pointer;}
.sgmaq .sgmaq-result-actions{display:flex;flex-direction:column;align-items:center;gap:10px;margin-top:18px;}
.sgmaq .sgmaq-result-primary,
.sgmaq .sgmaq-result-secondary{width:min(100%,380px);min-height:48px;padding:12px 16px;border:0;border-radius:12px;font:inherit;font-weight:700;cursor:pointer;}
.sgmaq .sgmaq-result-primary{background:var(--sgmaq-accent);color:#fff;}
.sgmaq .sgmaq-result-primary:hover{background:#1f4036;}
.sgmaq .sgmaq-result-secondary{background:#eef1ee;color:var(--sgmaq-ink);}
.sgmaq .sgmaq-result-secondary:hover{background:#e5eae6;}

/* ---------- Ranking modal ---------- */
body.sgmaq-app-page.sgmaq-ranking-open{overflow:hidden!important;}
.sgmaq-ranking-overlay{
  position:fixed;
  inset:var(--sgmaq-admin-bar-offset,0px) 0 0;
  z-index:60;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
}
.sgmaq-ranking-backdrop{position:absolute;inset:0;background:rgba(15,21,18,.54);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);}
.sgmaq-ranking-panel{
  position:relative;
  z-index:1;
  width:min(100%,760px);
  max-height:calc(100dvh - var(--sgmaq-admin-bar-offset,0px) - 36px);
  overflow:auto;
  padding:clamp(28px,5vw,48px);
  color:#263c32;
  text-align:left;
  background:#fffaf0 url("../images/paper-texture.webp") center/420px repeat;
  border:1px solid rgba(185,139,46,.72);
  border-radius:18px;
  box-shadow:0 18px 55px rgba(25,20,13,.34);
}
.sgmaq-ranking-panel::before{content:"";position:absolute;inset:7px;border:1px solid rgba(185,139,46,.23);border-radius:13px;pointer-events:none;}
.sgmaq-ranking-close{position:absolute;z-index:3;right:18px;top:16px;border:0;background:transparent;color:#687169;font-family:inherit;font-size:13px;cursor:pointer;}
.sgmaq-ranking-kicker{position:relative;z-index:2;margin:0 0 6px!important;color:#a27825;font-size:11px;font-weight:700;letter-spacing:.22em;}
.sgmaq-ranking-panel>h2{position:relative;z-index:2;margin:0 0 24px!important;padding:0!important;border:0!important;background:none!important;color:#1e4938!important;font-family:inherit!important;font-size:25px!important;line-height:1.3!important;font-weight:650!important;letter-spacing:.02em!important;}
.sgmaq-ranking-panel .sgmaq-ranking-tabs{position:relative;z-index:2;display:flex;flex-wrap:wrap;gap:9px;margin:0 0 10px;}
.sgmaq-ranking-panel .sgmaq-ranking-tab{flex:1 1 110px;min-height:44px;margin:0;padding:10px 12px;border:1px solid #c7b684;border-radius:9px;background:#f2ead4;color:#33483e;font-family:inherit;font-size:14px;font-weight:600;cursor:pointer;}
.sgmaq-ranking-panel .sgmaq-ranking-tab.is-selected{border-color:#1e5b44;background:#1e5b44;color:#fff;box-shadow:0 3px 8px rgba(26,77,59,.19);}
.sgmaq-ranking-panel .sgmaq-ranking-content{position:relative;z-index:2;min-height:160px;margin:20px 0 0;overflow-x:auto;}
.sgmaq-ranking-panel .sgmaq-ranking-table{width:100%;max-width:none;margin:0;border-collapse:collapse;background:transparent;font-size:13px;}
.sgmaq-ranking-panel .sgmaq-ranking-table th,
.sgmaq-ranking-panel .sgmaq-ranking-table td{padding:12px 10px;border:0;border-bottom:1px solid rgba(128,113,76,.22);background:transparent;color:#33483e;text-align:left;}
.sgmaq-ranking-panel .sgmaq-ranking-table th{color:#6b746d;font-size:11px;font-weight:700;letter-spacing:.04em;}
.sgmaq-ranking-panel .sgmaq-ranking-table th:first-child,
.sgmaq-ranking-panel .sgmaq-ranking-table td:first-child{width:72px;text-align:center;}
.sgmaq-ranking-panel .sgmaq-ranking-table th:nth-child(2),
.sgmaq-ranking-panel .sgmaq-ranking-table td:nth-child(2){width:120px;text-align:right;font-variant-numeric:tabular-nums;}
.sgmaq-ranking-panel .sgmaq-ranking-empty{font-weight:500;}

/* Active screens can legitimately exceed one viewport because five choices remain readable. */
body.sgmaq-app-page.sgmaq-state-game .sgmaq-app-main,
body.sgmaq-app-page.sgmaq-state-result .sgmaq-app-main{
  height:calc(100dvh - var(--sgmaq-admin-bar-offset));
  min-height:calc(100dvh - var(--sgmaq-admin-bar-offset));
  overflow-y:auto!important;
  overflow-x:hidden!important;
  -webkit-overflow-scrolling:touch;
}



/* Short desktop viewport: keep the same one-column series UI, only tighten vertical metrics. */
@media (min-width:769px) and (max-height:700px){
  body.sgmaq-app-page .sgmaq .sgmaq-screen-game{
    padding:12px 20px 14px;
  }
  .sgmaq .sgmaq-gamebar{
    min-height:38px;
    padding-bottom:6px;
  }
  .sgmaq .sgmaq-progress-line{
    margin-bottom:8px;
  }
  .sgmaq .sgmaq-anagram-card{
    min-height:170px;
    padding:14px 34px 12px;
    border-radius:16px;
  }
  .sgmaq .sgmaq-question-kicker{
    margin-bottom:8px!important;
    font-size:10px;
  }
  .sgmaq .sgmaq-anagram-card .sgmaq-scrambled-container{
    height:100px;
  }
  .sgmaq .sgmaq-question-help{
    margin-top:8px!important;
    font-size:10px;
  }
  .sgmaq .sgmaq-choices{
    gap:7px;
    padding:8px 2px 12px;
  }
  .sgmaq .sgmaq-choice{
    min-height:46px;
    padding:9px 14px;
    font-size:14px;
  }
}

@media(max-width:768px){
  body.sgmaq-app-page .sgmaq .sgmaq-screen-game,
  body.sgmaq-app-page .sgmaq .sgmaq-screen-result{padding:16px 12px 24px;align-items:flex-start;}
  .sgmaq .sgmaq-game-shell{padding-top:2px;}
  .sgmaq .sgmaq-gamebar{min-height:40px;padding-bottom:8px;}
  .sgmaq .sgmaq-progress-line{margin-bottom:10px;}
  .sgmaq .sgmaq-anagram-card{min-height:205px;padding:20px 14px 17px;border-radius:14px;}
  .sgmaq .sgmaq-anagram-card::before{inset:6px;border-radius:10px;}
  .sgmaq .sgmaq-question-kicker{margin-bottom:9px!important;font-size:10px;}
  .sgmaq .sgmaq-anagram-card .sgmaq-scrambled-container{height:clamp(125px,18vh,150px);aspect-ratio:auto;border-radius:10px;}
  .sgmaq .sgmaq-scrambled-text{font-size:clamp(18px,5.3vw,22px);letter-spacing:1px;}
  .sgmaq .sgmaq-question-help{margin-top:10px!important;font-size:10px;line-height:1.55;}
  .sgmaq .sgmaq-choices{gap:8px;padding:11px 0 16px;}
  .sgmaq .sgmaq-choice{min-height:48px;padding:11px 13px;font-size:14px;border-radius:11px;}
  .sgmaq .sgmaq-result-card{margin:auto 0;padding:26px 18px;border-radius:18px;}
  .sgmaq .sgmaq-result-card>h2{font-size:23px!important;}
  .sgmaq .sgmaq-result-time{font-size:18px;}
  .sgmaq .sgmaq-nickname-area>div{flex-direction:column;}
  .sgmaq .sgmaq-nickname-area button{min-height:42px;}
  .sgmaq-ranking-overlay{padding:12px;}
  .sgmaq-ranking-panel{width:100%;max-height:calc(100dvh - var(--sgmaq-admin-bar-offset,0px) - 24px);padding:30px 18px 22px;border-radius:14px;}
  .sgmaq-ranking-close{right:14px;top:12px;}
  .sgmaq-ranking-panel>h2{font-size:22px!important;}
  .sgmaq-ranking-panel .sgmaq-ranking-tab{flex:1 1 90px;min-height:42px;font-size:13px;}
}
@media(max-width:380px){
  body.sgmaq-app-page .sgmaq .sgmaq-screen-game{padding-left:9px;padding-right:9px;}
  .sgmaq .sgmaq-anagram-card{padding-left:9px;padding-right:9px;}
  .sgmaq .sgmaq-question-help{font-size:9.5px;}
  .sgmaq .sgmaq-choice{min-height:44px;padding:9px 11px;font-size:13px;}
}

/* v0.1.10 — answer text remains the hero; images are only a darkened background. */
.sgmaq .sgmaq-anagram-card .sgmaq-scrambled-container{
  height:clamp(190px,24vh,225px);
}
.sgmaq .sgmaq-scrambled-container.has-results{
  display:block;
  padding:8px;
  background:#111;
}
.sgmaq .sgmaq-scrambled-container.has-results .sgmaq-result-images{
  position:absolute;
  inset:8px;
  z-index:1;
  display:grid;
  gap:10px;
  min-width:0;
  min-height:0;
  padding:0;
  overflow:hidden;
  background:#111;
}
.sgmaq .sgmaq-scrambled-container.has-results .sgmaq-result-images::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:2;
  background:rgba(0,0,0,.52);
  pointer-events:none;
}
.sgmaq .sgmaq-scrambled-container.has-results .sgmaq-result-images.mix-2{
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.sgmaq .sgmaq-scrambled-container.has-results .sgmaq-result-images.mix-3{
  grid-template-columns:repeat(3,minmax(0,1fr));
}
.sgmaq .sgmaq-scrambled-container.has-results .sgmaq-result-images img,
.sgmaq .sgmaq-scrambled-container.has-results .sgmaq-result-images.mix-2 img,
.sgmaq .sgmaq-scrambled-container.has-results .sgmaq-result-images.mix-3 img{
  position:static;
  display:block;
  width:100%;
  height:100%;
  min-width:0;
  min-height:0;
  max-width:none;
  max-height:none;
  object-fit:cover;
  border:0;
  border-radius:10px;
  box-shadow:none;
}
.sgmaq .sgmaq-scrambled-container.has-results .sgmaq-result-images .left-image,
.sgmaq .sgmaq-scrambled-container.has-results .sgmaq-result-images .center-image,
.sgmaq .sgmaq-scrambled-container.has-results .sgmaq-result-images .right-image{
  left:auto;
  right:auto;
  top:auto;
  bottom:auto;
  transform:none;
  z-index:auto;
}
/* Keep exactly the same answer-text position as the unanswered state. */
.sgmaq .sgmaq-scrambled-container.has-results .sgmaq-scrambled-text{
  position:absolute;
  z-index:3;
  top:50%;
  left:0;
  width:100%;
  right:auto;
  bottom:auto;
  transform:translateY(-50%);
  margin:0;
  padding:.5em .45em;
  border-radius:0;
  background:transparent;
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
  box-shadow:none;
  font-size:24px;
  line-height:1.45;
}
@media(min-width:769px) and (max-height:820px){
  .sgmaq .sgmaq-anagram-card .sgmaq-scrambled-container{height:175px;}
  .sgmaq .sgmaq-anagram-card{padding-top:16px;padding-bottom:14px;}
  .sgmaq .sgmaq-choices{gap:7px;padding-top:9px;padding-bottom:12px;}
  .sgmaq .sgmaq-choice{min-height:47px;padding-top:9px;padding-bottom:9px;}
  .sgmaq .sgmaq-scrambled-container.has-results .sgmaq-result-images{inset:7px;gap:8px;}
}
@media(min-width:769px) and (max-height:700px){
  .sgmaq .sgmaq-anagram-card .sgmaq-scrambled-container{height:160px;}
  .sgmaq .sgmaq-scrambled-container.has-results .sgmaq-result-images{inset:6px;gap:7px;}
}
@media(max-width:768px){
  .sgmaq .sgmaq-anagram-card .sgmaq-scrambled-container{height:clamp(180px,24vh,215px);}
  .sgmaq .sgmaq-scrambled-container.has-results .sgmaq-result-images{inset:7px;gap:7px;}
  .sgmaq .sgmaq-scrambled-container.has-results .sgmaq-scrambled-text{
    font-size:clamp(18px,5.3vw,22px);
    letter-spacing:1px;
  }
}

/* v0.1.11 — answer colors switch instantly; no fade on the answer text. */
.sgmaq .sgmaq-scrambled-text.with-band{animation:none!important;opacity:1!important;}


/* v0.1.13 — shared series sound toggle. Mute state uses sgqSoundEnabledV1. */
.sgmaq-title-mobile-header-right{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:clamp(7px,.62cqw,13px);
  min-width:0;
}
.sgmaq-title-sound{
  display:grid;
  place-items:center;
  width:clamp(24px,1.75cqw,36px);
  height:clamp(24px,1.75cqw,36px);
  padding:0;
  margin:0;
  border:0;
  border-radius:50%;
  background:transparent;
  color:#2f3e34;
  cursor:pointer;
  line-height:1;
  opacity:.92;
  transition:opacity .15s ease,background .15s ease,transform .15s ease;
}
@media(hover:hover){
  .sgmaq-title-sound:hover{background:rgba(255,255,255,.48);transform:translateY(-1px)}
}
.sgmaq-title-sound.is-muted{opacity:.58}
.sgmaq-sound-glyph{display:block;width:68%;height:68%}
.sgmaq-sound-glyph svg{display:block;width:100%;height:100%;overflow:visible}
.sgmaq-sound-glyph path{fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.sgmaq-speaker-body{fill:currentColor!important;stroke:none!important}
.sgmaq-speaker-muted{display:none}
.sgmaq-title-sound.is-muted .sgmaq-speaker-waves{display:none}
.sgmaq-title-sound.is-muted .sgmaq-speaker-muted{display:block}
@media(max-width:768px){
  .sgmaq-title-mobile-header-right{gap:8px}
  .sgmaq-title-sound{width:30px;height:30px}
}


/* ========================================================================
   0.1.14 — SEO content below the full-screen start view.
   The game viewport remains one screen high; only the start state can scroll
   down to static explanatory and FAQ content. During play/results it is hidden.
   ======================================================================== */
body.sgmaq-app-page.sgmaq-state-start{
  overflow-x:hidden!important;
  overflow-y:auto!important;
}
body.sgmaq-app-page:not(.sgmaq-state-start) .sgmaq-seo-content{
  display:none!important;
}
.sgmaq-seo-content{
  position:relative;
  z-index:2;
  width:100%;
  margin:0;
  padding:clamp(44px,7vw,76px) 20px clamp(60px,9vw,96px);
  background:#fffdf7;
  color:#26332e;
  border-top:1px solid rgba(77,91,82,.16);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans CJK JP","Hiragino Sans","Yu Gothic",Meiryo,sans-serif;
  line-height:1.9;
}
.sgmaq-seo-inner{
  width:min(100%,860px);
  margin:0 auto;
}
.sgmaq-seo-content h2{
  margin:0 0 22px;
  padding:0 0 12px;
  color:#254b3f;
  font-family:"Yu Mincho","Hiragino Mincho ProN","Yu Mincho",serif;
  font-size:clamp(24px,3.2vw,34px);
  font-weight:600;
  line-height:1.45;
  border-bottom:1px solid rgba(155,116,57,.32);
}
.sgmaq-seo-content h2:not(:first-child){margin-top:54px;}
.sgmaq-seo-content p{margin:0 0 18px;font-size:15px;}
.sgmaq-seo-help-link{
  color:#254b3f!important;
  font-weight:700;
  text-decoration:underline!important;
  text-underline-offset:4px;
}
.sgmaq-seo-faq{
  display:grid;
  gap:0;
  border-top:1px solid rgba(77,91,82,.13);
}
.sgmaq-seo-faq-item{
  padding:22px 0 20px;
  border-bottom:1px solid rgba(77,91,82,.13);
}
.sgmaq-seo-faq-item h3{
  margin:0 0 9px;
  color:#263b31;
  font-size:17px;
  font-weight:750;
  line-height:1.6;
}
.sgmaq-seo-faq-item p{margin:0;color:#4d5752;}
@media(max-width:768px){
  .sgmaq-seo-content{padding:38px 20px 64px;}
  .sgmaq-seo-content h2{font-size:24px;margin-bottom:18px;}
  .sgmaq-seo-content h2:not(:first-child){margin-top:44px;}
  .sgmaq-seo-content p{font-size:14px;line-height:1.9;}
  .sgmaq-seo-faq-item{padding:19px 0 17px;}
  .sgmaq-seo-faq-item h3{font-size:16px;}
}


/* ========================================================================
   v0.1.18 — AdSense parity with Scene / Date / Cast & Staff quizzes.
   Mobile: responsive slot 3327093842 at the bottom of the active quiz.
   Desktop: 300x250 slot 8269044239 only when >=348px of real right space
   exists beside the question stage (48px gap + 300px ad width).
   ======================================================================== */
.sgmaq .sgmaq-mobile-quiz-ad,
.sgmaq .sgmaq-pc-quiz-ad{
  display:none!important;
}

@media(max-width:768px){
  .sgmaq .sgmaq-mobile-quiz-ad{
    display:block!important;
    position:relative!important;
    box-sizing:border-box!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:18px 0 calc(24px + env(safe-area-inset-bottom, 0px))!important;
    padding:0!important;
    text-align:center!important;
    overflow:hidden!important;
    contain:layout paint inline-size!important;
  }
  .sgmaq .sgmaq-mobile-quiz-ad-label{
    margin:0 0 7px!important;
    padding:0!important;
    color:rgba(34,43,38,.48)!important;
    font-size:10px!important;
    font-weight:400!important;
    line-height:1.3!important;
    letter-spacing:.05em!important;
    text-align:center!important;
  }
  .sgmaq .sgmaq-mobile-quiz-ad .adsbygoogle{
    display:block!important;
    box-sizing:border-box!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin-left:auto!important;
    margin-right:auto!important;
    overflow:hidden!important;
  }
  .sgmaq .sgmaq-mobile-quiz-ad iframe{
    max-width:100%!important;
  }
}

@media(min-width:769px){
  .sgmaq .sgmaq-screen-game{
    overflow:visible!important;
  }
  .sgmaq .sgmaq-question-stage{
    position:relative!important;
    overflow:visible!important;
  }
  .sgmaq .sgmaq-pc-quiz-ad.is-visible{
    display:block!important;
    position:absolute!important;
    left:calc(100% + 48px)!important;
    top:0!important;
    width:300px!important;
    min-width:300px!important;
    margin:0!important;
    padding:0!important;
    text-align:center!important;
    z-index:3!important;
    contain:none!important;
    overflow:visible!important;
  }
  .sgmaq .sgmaq-pc-quiz-ad-label{
    margin:0 0 8px!important;
    padding:0!important;
    color:rgba(34,43,38,.44)!important;
    font-size:11px!important;
    font-weight:400!important;
    line-height:1.3!important;
    letter-spacing:.05em!important;
    text-align:center!important;
  }
  .sgmaq .sgmaq-pc-quiz-ad .adsbygoogle{
    display:inline-block!important;
    width:300px!important;
    height:250px!important;
    margin:0 auto!important;
    vertical-align:top!important;
  }
  .sgmaq .sgmaq-pc-quiz-ad-slot{
    display:block!important;
    width:300px!important;
    min-width:300px!important;
    max-width:300px!important;
    height:250px!important;
    min-height:250px!important;
    max-height:250px!important;
    margin:0 auto!important;
    padding:0!important;
    overflow:visible!important;
  }
  .sgmaq .sgmaq-pc-quiz-ad-slot > ins.adsbygoogle{
    display:inline-block!important;
    width:300px!important;
    min-width:300px!important;
    max-width:300px!important;
    height:250px!important;
    min-height:250px!important;
    max-height:250px!important;
    margin:0!important;
    padding:0!important;
  }
}
