.hasami-content{position:relative;z-index:1;width:min(1100px,calc(100% - 32px));margin:20px auto 40px;color:#233e58;font-family:"Yu Gothic","Hiragino Kaku Gothic ProN",sans-serif;font-size:15px;line-height:1.7}.hasami-content h1,.hasami-content h2,.hasami-content h3{font-family:"Yu Mincho","Hiragino Mincho ProN",serif;margin:0 0 12px}.hasami-heading h1{font-size:32px}.hasami-heading p{margin:8px 0}.hasami-card,.hasami-side{background:rgba(255,251,242,.96);border:1px solid #d8c6ad;border-radius:20px;padding:24px}.hasami-content fieldset{border:0;padding:14px 0;margin:0}.hasami-content legend{font-weight:700}.hasami-content button:not(.hasami-square){font:inherit;cursor:pointer;min-height:44px;padding:9px 14px;border:1px solid #b0c1cf;border-radius:12px;background:#fffdf8;color:#233e58;touch-action:manipulation}.hasami-content button:disabled{opacity:.55;cursor:default}.hasami-content button:focus-visible{outline:3px solid #bd344f;outline-offset:3px}.hasami-content button:not(.hasami-square)[aria-pressed=true]{border:2px solid #b62b48;background:#fff1ee}.hasami-actions,.hasami-levels{display:flex;gap:10px;flex-wrap:wrap}.hasami-levels>button{flex:1;min-width:130px}.hasami-start>*{flex:1}.hasami-start{margin:12px 0}.hasami-teacher{display:flex;align-items:center;gap:14px;margin:12px 0 18px}.hasami-teacher>img{width:92px;height:120px;object-fit:contain;flex:none}.hasami-speech{background:#fffdf6;border:2px solid #b4c8cf;border-radius:18px;padding:14px 18px;font-weight:700;font-size:16px;line-height:1.6;overflow-wrap:anywhere;flex:1;min-width:0}.hasami-game-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap}.hasami-game-heading h1{font-size:27px;margin:0}.hasami-game-grid{display:grid;grid-template-columns:minmax(280px,560px) minmax(250px,1fr);gap:24px;align-items:start}.hasami-tally{display:grid;grid-template-columns:1fr 1fr;gap:10px}.hasami-tally>div{display:flex;flex-direction:column;background:#fffaf1;border:1px solid #d7c4a9;border-radius:12px;padding:8px 12px}.hasami-tally strong{font-size:14px}.hasami-tally span{font-weight:700}.hasami-status{font-weight:800;text-align:center;margin:10px 0}.hasami-board-help{font-size:13px;line-height:1.6;margin:8px 0}.hasami-rules{background:#fffaf2;border:1px solid #d8c6ad;border-radius:14px;padding:14px;margin:18px 0}.hasami-rules summary{cursor:pointer;font-weight:800;min-height:30px}.hasami-rules p{margin:12px 0}.hasami-rules h3{font-size:17px}.hasami-warning,.hasami-confirm{background:#fff1cc;border:1px solid #be8d40;border-radius:12px;padding:12px}.hasami-result{background:#f6f0e1;border:1px solid #d7b789;border-radius:14px;padding:16px;margin:0 0 14px}.hasami-result h2{font-size:24px}.hasami-content .primary-button{background:#233e58;color:white}.welcome-extra-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px}.welcome-extra-actions .welcome-classroom-button{margin:0;width:100%}.welcome-extra-actions button{min-width:0;padding-left:9px;padding-right:9px;font-size:clamp(13px,2.5vw,16px)}.welcome-saved-button{display:block;width:100%;margin-top:10px}.saved-record-dialog{width:min(720px,calc(100% - 32px));max-height:85dvh;padding:20px;border:1px solid #d7c4ac;border-radius:20px;background:#fffbf3;color:#233e58}.saved-record-dialog::backdrop{background:#233e5866}.saved-record-dialog .saved-records{max-height:none}.saved-record-dialog>button{float:right;min-height:44px}
@media(max-width:700px){.hasami-content{width:calc(100% - 20px);margin:12px auto 24px;font-size:14px}.hasami-game-grid{grid-template-columns:1fr;gap:10px}.hasami-content h1{font-size:25px}.hasami-card,.hasami-side{padding:14px}.hasami-teacher{gap:8px;margin:8px 0 12px}.hasami-teacher>img{width:72px;height:100px}.hasami-speech{padding:10px 12px;font-size:14px}.hasami-levels{gap:6px}.hasami-levels>button{min-width:0;font-size:13px;padding:9px 5px}.hasami-tally>div{padding:6px 10px}.hasami-side{padding-top:12px}.hasami-actions>button{flex:1;white-space:normal}.hasami-rules{margin:12px 0}.welcome-extra-actions{gap:7px;margin-top:7px}.welcome-extra-actions button{font-size:14px}.welcome-saved-button{margin-top:9px}}

.welcome-return:empty{display:none}.welcome-return:not(:empty){margin-top:10px}.welcome-return button{width:100%}.hasami-side>.hasami-actions{margin-top:8px}
@media(max-width:700px){.hasami-game-heading h1{font-size:22px}.hasami-game-heading+.hasami-teacher>img{height:80px}.hasami-tally span{font-size:13px}.hasami-game-heading+.hasami-teacher{margin-bottom:8px}}

/* Reuse the normal board's frame, coordinates, squares and five-sided pieces.
   Deliberately do not classify this independent screen as .board-column. */
.hasami-board-frame{--board-size:min(500px,calc(100vw - 76px));margin:0 auto;font-family:"Yu Mincho","Hiragino Mincho ProN",serif}
.hasami-board .hasami-square{aspect-ratio:auto;min-width:0;min-height:0;padding:0;border-radius:0;touch-action:manipulation;font:inherit}
.hasami-board .hasami-square[aria-pressed=true]{border-top:0;border-left:0;border-right:1px solid rgba(96,63,30,.61);border-bottom:1px solid rgba(96,63,30,.61)}
.hasami-piece{pointer-events:none}
.hasami-game-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-top:0}
.hasami-content .hasami-game-actions>button{min-height:42px;padding:2px 6px;border:1px solid #cbd9e6;border-radius:9px;background:#fff;color:#29445e;font:800 13px/1.2 "Yu Mincho","Hiragino Mincho ProN","Noto Serif JP",serif;letter-spacing:0;box-shadow:none;white-space:normal}
.hasami-content .hasami-game-actions>[data-hasami-action=ask-resign]{color:#a72e42}
.hasami-game-actions>[data-hasami-action=pass]{grid-column:1/-1}
.hasami-confirm-overlay{position:fixed;inset:0;z-index:800;display:grid;place-items:center;padding:20px;background:rgba(28,43,56,.46)}
.hasami-confirm{width:min(420px,100%);padding:24px;border:1px solid #d8c6ad;border-radius:18px;background:#fffaf2;box-shadow:0 14px 44px #182f4833}
.hasami-confirm h2{font-size:24px;margin:0 0 20px}
.hasami-confirm-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.hasami-content .hasami-confirm-actions>button{min-height:44px;padding:10px 8px;font-weight:700}
.hasami-content .hasami-confirm-actions>[data-hasami-action=resign]{color:#a72e42}
@media(max-width:900px){.hasami-game-grid{grid-template-columns:1fr}}
@media(min-width:1101px) and (max-height:800px){.hasami-content .hasami-game-actions>button{min-height:39px}}
@media(max-width:1100px){.hasami-content .hasami-game-actions>button{height:40px;min-height:40px;padding:4px;border-radius:8px;background:#fffaf2;color:#29445f;border-color:#c6bba9;font:700 12px Meiryo,sans-serif}}
@media(max-width:700px){
 .hasami-board-frame{--board-size:min(500px,calc(100vw - 56px));padding:3px 5px 4px;border-radius:10px;box-shadow:0 3px 0 #7d4926,0 5px 9px #442b1922}
 .hasami-board-frame .file-coordinates{height:13px;font-size:9px;padding-right:12px}
 .hasami-board-frame .rank-coordinates{width:12px;flex-basis:12px;font-size:9px}
 .hasami-board .piece{font-size:clamp(17px,calc(var(--board-size)/17),45px);width:76%;height:84%}
 .hasami-confirm{padding:20px}
}
@media(max-width:360px){.welcome-extra-actions button{font-size:13px;padding-left:5px;padding-right:5px;letter-spacing:0}}

/* Preparation actions match the normal match screen; game board is untouched. */
.hasami-content .hasami-start{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;border-top:1px solid #e8ded1;padding-top:17px;margin-top:17px}
.hasami-content .hasami-start>button{min-width:0;min-height:44px;border-radius:11px;padding:10px 14px;font:800 13px/1.4 "Yu Mincho","Hiragino Mincho ProN",serif;letter-spacing:.05em}
.hasami-content .hasami-start>.secondary-button{background:#f8f4ed;color:#304760;border:1px solid #d9cdbd;box-shadow:none}
.hasami-content .hasami-start>.primary-button{background:#243f5d;color:#fff;border:1px solid #243f5d;box-shadow:0 7px 14px #1d344f29}
.hasami-content .hasami-start>.primary-button:not(:disabled):hover{background:#315778}
.hasami-content .hasami-card button[aria-pressed]{background:#fffdf9;border:1px solid #dfd4c6;border-radius:12px;color:#304760;min-height:44px}
.hasami-content .hasami-card button[aria-pressed=true]{background:#fff0ed;border:2px solid #bc344d;color:#b52c45;font-weight:800}
.hasami-rules-entry{margin-top:14px}
.hasami-rules-overlay{position:fixed;inset:0;z-index:810;display:grid;place-items:center;padding:20px;background:#1c2b3875;overscroll-behavior:contain}
.hasami-rules-dialog{width:min(680px,100%);max-height:min(88dvh,850px);display:flex;flex-direction:column;overflow:hidden;background:#fffaf2;border:1px solid #d8c6ad;border-radius:18px;box-shadow:0 14px 44px #182f4833}
.hasami-rules-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 20px;border-bottom:1px solid #e4d7c6;flex:none}
.hasami-rules-header h2{font-size:23px;margin:0}.hasami-rules-header button{flex:none}
.hasami-rules-body{padding:8px 22px 22px;overflow-y:auto;overscroll-behavior:contain;min-height:0;line-height:1.8;overflow-wrap:anywhere}
.hasami-rules-body h3{font-size:19px;margin:24px 0 8px}.hasami-rules-body p{margin:10px 0}
.hasami-content:has(.hasami-rules-overlay){z-index:810}
html:has(.hasami-rules-overlay){overflow:hidden}
.hasami-rule-figure{margin:16px 0}.hasami-rule-figure figcaption{font-size:14px;margin-top:8px}
.hasami-rule-diagram{display:grid;grid-template-columns:repeat(5,1fr);width:min(260px,100%);border:1px solid #79552d;background:#e9bc75}
.hasami-rule-cell{display:grid;place-items:center;aspect-ratio:1;border:1px solid #a78049}
.hasami-rule-piece{display:grid;place-items:center;width:78%;height:86%;clip-path:polygon(50% 0,98% 20%,91% 100%,9% 100%,2% 20%);background:#ffedba;color:#172b3e;font:800 25px/1 "Yu Mincho",serif}
.hasami-rule-piece.opponent{transform:rotate(180deg)}
@media(max-width:1100px){.hasami-content .hasami-start{gap:7px;padding-top:9px}.hasami-content .hasami-start>button{font:700 14px/1.4 Meiryo,sans-serif;border-radius:9px;letter-spacing:0;padding:8px 6px}.hasami-content .hasami-start>.secondary-button{background:#fffaf2;color:#29445f;border-color:#c6bba9}}
@media(max-width:700px){.hasami-rules-overlay{padding:10px}.hasami-rules-dialog{max-height:calc(100dvh - 20px)}.hasami-rules-header{padding:12px}.hasami-rules-header h2{font-size:19px}.hasami-rules-body{padding:6px 16px 20px;font-size:15px}.hasami-rules-body h3{font-size:18px}.hasami-rule-piece{font-size:24px}}
