@font-face{font-family:TangramKai;src:url('assets/Kai.ttf')}#tg-app{--ink:#253b38;--teal:#16776b;--paper:#f7f5ef;--line:#dddcd4;color:var(--ink);background:var(--paper);font:20px TangramKai,serif;min-height:100vh}body{margin:0}#tg-app *{box-sizing:border-box}#tg-app button,#tg-app select,#tg-app input{font:inherit;color:inherit}#tg-app button{cursor:pointer;border:1px solid var(--line);background:white;border-radius:10px;padding:10px 16px;min-height:44px;transition:background .12s}#tg-app button:hover:enabled{background:#e9f4ef}#tg-app button:disabled{cursor:not-allowed;opacity:.43}#tg-app button[aria-pressed=true],#tg-app .tg-primary{background:var(--teal);color:white;border-color:var(--teal)}#tg-app :focus-visible{outline:3px solid #d28b27;outline-offset:3px}#tg-app [hidden]{display:none!important}#tg-app header{display:flex;align-items:center;gap:20px;padding:15px 28px;border-bottom:1px solid var(--line);background:#fffdf8}#tg-app .tg-brand{font-size:31px;font-weight:bold;white-space:nowrap}#tg-app .tg-brand span{color:var(--teal)}#tg-app .tg-badge{font-size:15px;background:#ece8df;padding:6px 10px;border-radius:15px}#tg-app .tg-preview{margin-left:auto;display:flex;gap:7px;align-items:center;font-size:17px}#tg-app #tg-setup{max-width:1450px;margin:auto;padding:25px}#tg-app h1{font-size:30px;margin:0 0 14px}#tg-app h2{font-size:24px;margin:0 0 16px}#tg-app p{line-height:1.5}#tg-app .tg-muted{color:#6e7772;font-size:17px}#tg-app .tg-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:14px 0}#tg-app .tg-split{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(335px,1fr);gap:26px}#tg-app .tg-panel{background:#fffdf9;border:1px solid var(--line);border-radius:16px;padding:22px;min-width:0}#tg-app .tg-puzzles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px;margin-top:18px}#tg-app .tg-card{padding:12px;min-width:0;text-align:left}#tg-app .tg-card svg{width:100%;height:138px;display:block}#tg-app .tg-card[aria-pressed=true]{background:#e6f3ed;color:var(--ink);border:2px solid var(--teal)}#tg-app .tg-card strong{display:block;margin:8px 0}#tg-app .tg-card small{font-size:16px}#tg-app .tg-setrow{display:flex;align-items:center;gap:12px;border-bottom:1px solid #eee9e1;padding:11px 0}#tg-app .tg-setrow svg{width:55px;height:55px;flex-shrink:0}#tg-app select{max-width:100%;padding:9px;border:1px solid #d6d9d3;border-radius:8px;background:white}#tg-app .tg-setrow select{flex:1;min-width:0}#tg-app .tg-setrow button{font-size:16px;padding:7px}#tg-app .tg-count{font-size:27px;padding:18px;background:#e4f1eb;border-radius:12px;margin-bottom:12px}#tg-app .tg-modehelp{padding:12px;border-left:3px solid var(--teal);background:#f2f6f0;font-size:17px}#tg-app #tg-start{width:100%;font-size:26px;margin-top:18px}#tg-app #tg-classbar{display:flex;align-items:center;justify-content:space-between;padding:9px 22px;gap:12px;flex-wrap:wrap}#tg-app #tg-classbar .tg-row{margin:0}#tg-app #tg-stage{position:relative;height:calc(100vh - 340px);min-height:330px;margin:0 20px;background:#fffefa;border:1px solid var(--line);border-radius:15px;overflow:hidden;touch-action:none}#tg-app #tg-stage canvas{display:block;width:100%;height:100%}#tg-app #tg-boardlabel{position:absolute;top:12px;left:16px;pointer-events:none;font-size:16px;color:#6b7971;z-index:1}#tg-app #tg-tools{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);display:flex;gap:6px;align-items:center;white-space:nowrap;padding:7px;background:#fffffff0;border:1px solid var(--line);border-radius:12px;box-shadow:0 3px 10px #0001}#tg-app #tg-tools button{font-size:17px;padding:7px 10px}#tg-app #tg-tools span{font-size:16px;padding:0 5px}#tg-app #tg-tray{padding:10px 22px 0}#tg-app .tg-tabs{display:flex;gap:6px;align-items:center;flex-wrap:wrap}#tg-app .tg-tabs button{padding:5px 12px;font-size:17px}#tg-app .tg-pieces{display:flex;gap:10px;overflow-x:auto;padding:9px 0;max-height:180px}#tg-app .tg-piece{min-width:105px;padding:5px 10px!important;font-size:15px!important;flex:1;max-width:175px}#tg-app .tg-piece svg{display:block;width:100%;height:60px}#tg-app .tg-piece[aria-pressed=true]{background:#e1f2eb;color:var(--ink);border:2px solid var(--teal)}#tg-app #tg-feedback{min-height:35px;padding:3px 24px;font-size:18px}#tg-app #tg-dialog{width:min(900px,95vw);max-height:92vh;border:1px solid var(--line);border-radius:18px;padding:24px;background:var(--paper);color:var(--ink);font:20px TangramKai,serif}#tg-app #tg-dialog::backdrop{background:#20352e66}#tg-app #tg-dialogbody{overflow:auto}#tg-app #tg-dialogbody svg.tg-solution{width:100%;height:440px;background:white;border-radius:10px}#tg-app #tg-close{margin-top:18px;float:right}#tg-app .tg-permissions{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}#tg-app .tg-permissions button{padding:16px 8px}#tg-app .tg-permissions small{display:block;font-size:15px;margin-top:7px}#tg-app label.tg-switch{display:flex;align-items:center;gap:12px;padding:15px 0;border-bottom:1px solid var(--line)}#tg-app input[type=checkbox]{width:22px;height:22px;accent-color:var(--teal)}#tg-app .tg-colors{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}#tg-app .tg-colors label{display:flex;align-items:center;gap:10px}#tg-app input[type=color]{width:60px;height:40px;padding:0;border:0;background:none}#tg-app #tg-toast{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);padding:12px 24px;border-radius:12px;background:#25453d;color:white;display:none;z-index:10;max-width:90vw}#tg-app .tg-detail{border-top:1px solid var(--line);padding-top:15px;margin-top:15px}#tg-app .tg-request{background:#fff1cc;padding:7px 13px;border-radius:9px}#tg-app .tg-legend{font-size:17px;display:flex;gap:12px;flex-wrap:wrap}#tg-app .tg-legend span{white-space:nowrap}#tg-app .tg-mobiletip{font-size:15px;color:#6e7772}#tg-app .tg-error{padding:25px;color:#963825}#tg-app .tg-actions{display:flex;gap:8px;flex-wrap:wrap}
#tg-app button[aria-pressed=true]:hover:enabled,#tg-app .tg-primary:hover:enabled{background:#116357;color:white}#tg-app .tg-card[aria-pressed=true]:hover:enabled,#tg-app .tg-piece[aria-pressed=true]:hover:enabled{background:#d4eade;color:var(--ink)}
@media(max-width:900px){#tg-app .tg-split{grid-template-columns:1fr}#tg-app .tg-puzzles{grid-template-columns:repeat(3,1fr)}#tg-app header{padding:12px;gap:8px;flex-wrap:wrap}#tg-app .tg-brand{font-size:25px}#tg-app .tg-preview{font-size:15px}#tg-app #tg-setup{padding:15px}#tg-app #tg-stage{margin:0 8px;min-height:350px}#tg-app #tg-tools{max-width:98%;overflow:auto;bottom:7px}#tg-app #tg-tools span{display:none}#tg-app #tg-tray{padding:10px}#tg-app #tg-classbar{padding:9px}#tg-app .tg-panel{padding:16px}}
@media(max-width:480px){#tg-app .tg-badge{font-size:13px}#tg-app .tg-preview{margin-left:0}#tg-app .tg-puzzles{grid-template-columns:repeat(2,1fr)}#tg-app .tg-card svg{height:110px}#tg-app .tg-setrow{gap:6px}#tg-app .tg-setrow svg{width:40px;height:40px}#tg-app #tg-stage{height:390px}#tg-app .tg-permissions{grid-template-columns:1fr}#tg-app .tg-permissions button{padding:10px}#tg-app .tg-colors{grid-template-columns:1fr}#tg-app #tg-dialogbody svg.tg-solution{height:370px}}
