*{box-sizing:border-box}html,body{height:100%}body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,Helvetica,Arial,sans-serif;background:#f6f7fb;color:#111;display:flex;flex-direction:column}
.app-header{display:flex;flex-wrap:wrap;justify-content:space-between;gap:1rem;align-items:center;padding:1rem 1.2rem;background:#7c4a0e;color:#fff;box-shadow:0 2px 8px rgba(0,0,0,.15)}
.brand{display:flex;gap:.8rem;align-items:center}.brand .logo{font-size:2rem}.subtitle{margin:.2rem 0 0;opacity:.9}
.controls{display:flex;gap:.8rem;align-items:center;flex-wrap:wrap}
.controls .primary,.secondary{border:none;border-radius:12px;padding:.6rem .9rem;font-weight:600;cursor:pointer}
.primary{background:#ffd23f}.primary:hover{filter:brightness(1.05)}.secondary{background:#e8ecf3}.secondary:hover{filter:brightness(1.03)}
.toggle{display:flex;gap:.4rem;align-items:center;background:#5c3508;padding:.3rem .5rem;border-radius:10px}
.toggle input{transform:scale(1.2)}
main{display:flex;flex-direction:column;gap:1rem;padding:1rem;max-width:1100px;margin:0 auto;flex:1;width:100%}
.board-card,.game-card,.pool-card{background:#fff;border-radius:16px;box-shadow:0 8px 24px rgba(0,0,0,.08);padding:1rem}
.board{--cols:10;--rows:10;display:grid;grid-template-columns:repeat(var(--cols),40px);grid-template-rows:repeat(var(--rows),40px);gap:2px;justify-content:center;position:relative;margin-bottom:.6rem;min-height:420px}
.board-fallback{color:#7c4a0e;opacity:.7;align-self:center;grid-column:1/-1;padding:1rem}
.cell{width:40px;height:40px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:.8rem;background:#f3ede4;border:1px solid #e2d4bf;position:relative}
.cell:nth-child(odd){background:#efe5d7}
.num{opacity:.5;font-size:.7rem;position:absolute;left:4px;top:2px}
.pawn{position:absolute;width:28px;height:28px;border-radius:50%;background:#0e7c86;box-shadow:0 2px 6px rgba(0,0,0,.2);display:flex;align-items:center;justify-content:center;color:#fff;font-weight:800;transition:left .15s linear, top .15s linear}
.pawn.player{background:#0e7c86}
.pawn.rival{background:#9b2c2c}
.pawn-sample{display:inline-flex;width:22px;height:22px;border-radius:50%;align-items:center;justify-content:center;color:#fff;font-weight:800;background:#0e7c86}
.pawn-sample.rival{background:#9b2c2c}
.ladder,.snake{position:absolute;pointer-events:none;opacity:.9}
.ladder::before{content:'🪜';font-size:1.2rem}
.snake::before{content:'🐍';font-size:1.2rem}
.score{display:flex;gap:1rem;font-weight:700;flex-wrap:wrap;align-items:center}
.sentence{font-size:1.6rem;line-height:2rem;padding:.6rem 0;min-height:3.6rem}
.sentence .token{padding:.15rem .2rem;border-radius:6px;margin:0 .05rem}
.sentence .target{background:#ffe8b2;border:2px solid #ffbf00;box-shadow:0 2px 0 #ffbf00aa}
.answers{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.6rem;margin-top:.6rem}
.answers .answer{padding:.7rem .8rem;border-radius:12px;border:2px solid #d0d7e2;background:#f2f6ff;font-weight:700;cursor:pointer;text-align:left}
.answers .answer:hover{filter:brightness(1.02)}
.help{margin-top:.4rem}.help .grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.4rem}.help .grid>div{background:#f7f9ff;border:1px dashed #cdd6ea;border-radius:10px;padding:.4rem .6rem}
.feedback{min-height:2.2rem;margin-top:.6rem;padding:.6rem .8rem;border-radius:12px;background:#f7fbf6;border:2px solid #cfe7cf;display:none}
.feedback.error{background:#fff5f5;border-color:#f2cccc}
.feedback-controls{display:flex;justify-content:flex-end;gap:.5rem;margin-top:.3rem}
.actions{display:flex;justify-content:flex-end;margin-top:.6rem}
.pool-controls{display:flex;gap:.6rem;align-items:center;margin:.6rem 0}
.pool-controls input{flex:1;padding:.5rem;border:1px solid #ccd5e3;border-radius:10px}
.pool-list{display:grid;grid-template-columns:1fr;gap:.5rem}
.pool-item{padding:.5rem .6rem;border:1px solid #e6e9f1;border-radius:12px;background:#fafbff}
.pool-item .meta{display:flex;gap:.4rem;flex-wrap:wrap;margin-bottom:.2rem}
.app-footer{padding:1rem;text-align:center;color:#333}
.modal{position:fixed;inset:0;background:rgba(0,0,0,.4);display:none;align-items:center;justify-content:center;z-index:50}
.modal.show{display:flex}
.modal .content{background:#fff;border-radius:16px;box-shadow:0 20px 50px rgba(0,0,0,.2);width:min(920px,95vw);max-height:90vh;display:flex;flex-direction:column}
.modal header{padding:1rem 1.2rem;border-bottom:1px solid #e6e9f1;display:flex;justify-content:space-between;align-items:center}
.modal .body{padding:1rem 1.2rem;overflow:auto}
.modal footer{padding:1rem 1.2rem;border-top:1px solid #e6e9f1;display:flex;justify-content:flex-end;gap:.6rem}
.modal .row{display:grid;grid-template-columns:1fr 1fr;gap:.8rem;margin-bottom:.8rem}
.modal textarea{width:100%;min-height:90px;padding:.6rem;border:1px solid #ccd5e3;border-radius:10px}
.modal select,.modal input[type="text"]{width:100%;padding:.5rem;border:1px solid #ccd5e3;border-radius:10px}
.modal .list{margin-top:.8rem;border-top:1px dashed #d5dcea;padding-top:.6rem}
.modal .item{display:grid;grid-template-columns:1fr auto;gap:.6rem;padding:.4rem .2rem;border-bottom:1px dotted #e4e8f3}
.modal .item .meta{font-size:.85rem;color:#475569}
.whiteboard body{background:#fff}.whiteboard .app-header{background:#5c3508}.whiteboard .sentence{font-size:2.2rem;line-height:2.6rem}.whiteboard .answers{grid-template-columns:repeat(3,minmax(0,1fr))}.whiteboard .answers .answer{font-size:1.2rem;padding:1rem}
.star{position:absolute;pointer-events:none;font-size:1.6rem;opacity:0;transform:translateY(0);transition:transform .8s ease,opacity .8s ease}
.star.show{opacity:1;transform:translateY(-40px)}
.dice-wrap{display:flex;align-items:center;gap:.5rem}
.dice{width:52px;height:52px;border-radius:12px;border:3px solid #222;background:#fff;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 12px rgba(0,0,0,.18);font-size:1.4rem;font-weight:800}
.dice.spin{animation:spin .6s ease}
@keyframes spin{0%{transform:rotate(0)}50%{transform:rotate(180deg)}100%{transform:rotate(360deg)}}
.dice.negative{border-color:#b42318;background:#fff5f5;color:#b42318}
.dice-note{font-size:.8rem;opacity:.7}
.diag{background:#0b0f17;color:#e9eefb;border-radius:10px;padding:.6rem;max-height:200px;overflow:auto}
