*,:before,:after{box-sizing:border-box;margin:0;padding:0}body{color:#1a1a2e;background:#d9cdb7;min-height:100vh;font-family:Libre Franklin,system-ui,-apple-system,sans-serif}.app{--board-size:min(90vw, 72vh, 700px);flex-direction:column;align-items:center;min-height:100vh;padding-top:1rem;display:flex;position:relative;overflow:hidden}.splash-overlay{z-index:999;background:#1a1a2e;justify-content:center;align-items:center;transition:opacity .5s ease-out;display:flex;position:fixed;inset:0}.splash-fade-out{opacity:0;pointer-events:none}.splash-logo{object-fit:contain;filter:drop-shadow(0 4px 20px #ffffff26);width:clamp(120px,25vw,220px);height:auto;animation:1.5s cubic-bezier(.25,.46,.45,.94) both splashSpin}@keyframes splashSpin{0%{opacity:0;transform:scale(.5)rotate(-180deg)}50%{opacity:1;transform:scale(1.1)rotate(10deg)}70%{transform:scale(.95)rotate(-5deg)}to{opacity:1;transform:scale(1)rotate(0)}}.idle-overlay{z-index:998;cursor:pointer;background:#1a1a2e;flex-direction:column;justify-content:center;align-items:center;gap:2rem;transition:opacity .5s ease-out;animation:.5s ease-out fadeIn;display:flex;position:fixed;inset:0}.idle-fade-out{opacity:0;pointer-events:none}.idle-logo{object-fit:contain;filter:drop-shadow(0 4px 20px #ffffff26);width:clamp(100px,20vw,180px);height:auto;animation:3s ease-in-out infinite idleFloat}@keyframes idleFloat{0%,to{transform:translateY(0)rotate(0)}50%{transform:translateY(-10px)rotate(2deg)}}.idle-title{justify-content:center;gap:clamp(3px,1vw,8px);display:flex}.idle-title .tile{--tile-size:clamp(36px, 10vw, 70px);box-shadow:2px 3px 6px #00000080,inset 0 1px #ffffff80,inset -1px -1px #00000014}.idle-title .tile-letter{font-size:clamp(20px,5.5vw,38px)}.board-bg{z-index:0;pointer-events:none;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.board-grid{width:var(--board-size);height:var(--board-size);opacity:.35;background:#fff;border:6px solid #b22222;border-radius:8px;grid-template-columns:repeat(15,1fr);gap:2px;padding:12px;display:grid;box-shadow:inset 0 0 30px #0000004d,0 0 0 4px #d9cdb7,0 0 0 8px #b22222}.cell{background:#c8bb9e;border:1px solid #0000001a;border-radius:2px}.cell-tw{background:#b52a2a}.cell-dw{background:#c9799a}.cell-tl{background:#0767b3}.cell-dl{background:#5a9ad9}.cell-star{background:#c9799a}.content{top:calc(50% - var(--board-size) / 2 + var(--board-size) * .14);z-index:1;width:calc(var(--board-size) * .9);flex-direction:column;align-items:center;max-width:680px;display:flex;position:fixed;left:50%;transform:translate(-50%)}.header{top:calc(50% - var(--board-size) / 2);z-index:2;flex-direction:column;align-items:center;gap:.5rem;display:flex;position:fixed;left:50%;transform:translate(-50%,calc(-100% - 1.25rem))}.hasbro-logo{object-fit:contain;filter:drop-shadow(0 2px 8px #0006);width:clamp(80px,15vw,130px);height:auto}.scrabble-title{flex-wrap:nowrap;justify-content:center;gap:clamp(2px,.8vw,6px);max-width:100%;padding:0 .25rem;display:flex}.tile{--tile-size:clamp(28px, 8vw, 58px);width:var(--tile-size);height:var(--tile-size);-webkit-user-select:none;user-select:none;aspect-ratio:1;background:linear-gradient(145deg,#f7e8c1 0%,#e8d5a3 50%,#d4c08a 100%);border:1px solid #b8a67a;border-radius:clamp(2px,.5vw,4px);flex-shrink:1;justify-content:center;align-items:center;display:flex;position:relative;box-shadow:1px 2px 3px #00000040,inset 0 1px #ffffff80,inset -1px -1px #00000014}.tile-wave{animation:2s ease-in-out infinite tileWave}@keyframes tileWave{0%,to{transform:translateY(0)}50%{transform:translateY(-6px)}}.tile-letter{color:#1a1a2e;font-family:Libre Franklin,Arial Black,sans-serif;font-size:clamp(16px,4.2vw,30px);font-weight:900;line-height:1}.tile-points{color:#1a1a2e;font-family:Libre Franklin,Arial,sans-serif;font-size:clamp(6px,1.5vw,11px);font-weight:700;line-height:1;position:absolute;bottom:clamp(1px,.4vw,3px);right:clamp(2px,.6vw,5px)}.main{-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);background:#fffdf7eb;border:2px solid #c4b89799;border-radius:12px;width:100%;max-width:720px;padding:1.5rem;box-shadow:0 4px 20px #0000004d}.input-row{align-items:flex-end;gap:1rem;display:flex}.field{flex-direction:column;flex:1;min-width:0;display:flex}.field label{text-transform:uppercase;letter-spacing:.06em;color:#444;margin-bottom:.35rem;font-size:.85rem;font-weight:700}.field input{color:#1a1a2e;background:#fffdf7;border:2px solid #c4b897;border-radius:6px;outline:none;height:42px;padding:.6rem .75rem;font-size:1rem;transition:border-color .2s}.field input:focus{border-color:#b22222}.wordbank-dropdown{width:100%;position:relative}.wordbank-toggle{color:#1a1a2e;cursor:pointer;text-align:left;background:#fffdf7;border:2px solid #c4b897;border-radius:6px;justify-content:space-between;align-items:center;gap:.5rem;width:100%;height:42px;padding:.6rem .75rem;font-family:inherit;font-size:1rem;transition:border-color .2s;display:flex}.wordbank-toggle:hover{border-color:#a89870}.wordbank-toggle:focus{border-color:#b22222;outline:none}.wordbank-toggle-label{text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.wordbank-arrow{color:#888;flex-shrink:0;font-size:.75rem;transition:transform .2s}.wordbank-arrow-up{transform:rotate(180deg)}.wordbank-panel{z-index:20;background:#fffdf7;border:2px solid #c4b897;border-radius:6px;position:absolute;top:calc(100% + 4px);left:0;right:0;overflow:hidden;box-shadow:0 8px 24px #00000040}.wordbank-search{color:#1a1a2e;box-sizing:border-box;background:#f8f4ea;border:none;border-bottom:1px solid #e0d8c4;outline:none;width:100%;padding:.5rem .75rem;font-family:inherit;font-size:.9rem}.wordbank-search::placeholder{color:#aaa}.wordbank-list{max-height:200px;margin:0;padding:4px 0;list-style:none;overflow-y:auto}.wordbank-item{cursor:pointer;color:#333;padding:.45rem .75rem;font-size:.95rem;transition:background .1s}.wordbank-item:hover{background:#f0e8d4}.wordbank-item-active{color:#b22222;background:#e8dcc4;font-weight:700}.wordbank-empty{color:#999;cursor:default;font-style:italic}.wordbank-empty:hover{background:0 0}.btn-row{top:calc(50% - var(--board-size) / 2 + var(--board-size) * .06);z-index:2;align-items:center;gap:.75rem;display:flex;position:fixed;left:50%;transform:translate(-50%)}.btn-start,.btn-round{text-transform:uppercase;letter-spacing:.05em;color:#fff;cursor:pointer;white-space:nowrap;border:none;border-radius:6px;flex-shrink:0;height:42px;padding:.6rem 1.5rem;font-size:1rem;font-weight:700;transition:background .2s}.btn-start{background:#b22222}.btn-start:hover{background:#8b1a1a}.btn-start:active{background:#6e1414}.btn-start:disabled{cursor:not-allowed;background:#999}.btn-round{background:#1a6e3a}.btn-round:hover{background:#145a2f}.btn-round:active{background:#0f4823}.btn-round:disabled{cursor:not-allowed;background:#999}.btn-nudge{animation:2.5s ease-in-out infinite btnNudge}.btn-nudge:hover{animation:none}@keyframes btnNudge{0%,85%,to{transform:translate(0)}88%{transform:translate(-2px)rotate(-1deg)}91%{transform:translate(2px)rotate(1deg)}94%{transform:translate(-1.5px)rotate(-.5deg)}97%{transform:translate(1px)rotate(.5deg)}}.message-area{background:#fffdf7;border:2px solid #c4b897;border-left:5px solid #b22222;border-radius:6px;min-height:60px;margin-top:1.5rem;padding:1.25rem 1.5rem}.message-area p{color:#333;font-size:1rem;line-height:1.5}.round-output p{color:#333;word-break:break-word;margin-bottom:.4rem;font-size:.92rem;line-height:1.55}.round-output p:last-child{margin-bottom:0}.round-output strong{color:#1a1a2e;margin-right:.25rem}.btn-history{text-transform:uppercase;letter-spacing:.05em;color:#fff;cursor:pointer;background:#3a5a8c;border:none;border-radius:6px;margin:1rem auto 0;padding:.55rem 1.4rem;font-size:.9rem;font-weight:700;transition:background .2s;display:block}.btn-history:hover{background:#2d4770}.btn-history:active{background:#213558}.history-overlay{z-index:100;background:#0000008c;justify-content:center;align-items:center;animation:.2s ease-out fadeIn;display:flex;position:fixed;inset:0}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.history-panel{width:min(90vw, var(--board-size,700px));max-height:var(--board-size,700px);background:#fffdf7;border:2px solid #c4b897;border-radius:12px;flex-direction:column;animation:.25s ease-out slideUp;display:flex;box-shadow:0 12px 40px #0006}@keyframes slideUp{0%{opacity:0;transform:translateY(30px)}to{opacity:1;transform:translateY(0)}}.history-header{border-bottom:2px solid #e0d8c4;flex-shrink:0;justify-content:space-between;align-items:center;padding:1rem 1.25rem;display:flex}.history-title{text-transform:uppercase;letter-spacing:.06em;color:#1a1a2e;margin:0;font-size:1.1rem;font-weight:800}.history-close{color:#666;cursor:pointer;background:0 0;border:1px solid #d0c8b0;border-radius:6px;justify-content:center;align-items:center;width:32px;height:32px;font-size:1.4rem;line-height:1;transition:background .15s,color .15s;display:flex}.history-close:hover{color:#fff;background:#b22222;border-color:#b22222}.history-body{flex:1;padding:1rem 1.25rem;overflow-y:auto}.history-empty{text-align:center;color:#999;padding:2rem 0;font-style:italic}.history-card{background:#fffdf7;border:2px solid #c4b897;border-left:5px solid #1a6e3a;border-radius:6px;margin-bottom:.75rem;padding:.9rem 1.1rem}.history-card:last-child{margin-bottom:0}.history-card-fail{border-left-color:#b22222}.history-card-best{background:linear-gradient(135deg,#fffbe6 0%,#fff7cc 100%);border-color:#c9a800;border-left-style:solid;border-left-width:5px;box-shadow:0 0 0 1px #c9a80033,0 2px 8px #c9a80026}.history-best-badge{letter-spacing:.06em;color:#7a6000;vertical-align:middle;background:#f5e080;border-radius:4px;margin-left:.5rem;padding:.1rem .5rem;font-size:.65rem;font-weight:800;display:inline-block}.history-card-label{text-transform:uppercase;letter-spacing:.08em;color:#3a5a8c;margin-bottom:.5rem;font-size:.75rem;font-weight:800}.history-card p{color:#333;word-break:break-word;margin-bottom:.3rem;font-size:.88rem;line-height:1.5}.history-card p:last-child{margin-bottom:0}.history-card strong{color:#1a1a2e;margin-right:.25rem}.btn-help{top:calc(50% - var(--board-size) / 2 + 12px);right:calc(50% - var(--board-size) / 2 + 12px);z-index:10;color:#3a5a8c;cursor:pointer;background:#fffdf7;border:2px solid #c4b897;border-radius:50%;justify-content:center;align-items:center;width:36px;height:36px;font-size:1.15rem;font-weight:800;line-height:1;transition:background .15s,color .15s,border-color .15s;display:flex;position:fixed;box-shadow:0 2px 8px #00000026}.btn-help:hover{color:#fff;background:#3a5a8c;border-color:#3a5a8c}.htp-overlay{z-index:100;background:#0000008c;justify-content:center;align-items:center;animation:.2s ease-out fadeIn;display:flex;position:fixed;inset:0}.htp-panel{width:min(90vw, var(--board-size,700px));max-height:var(--board-size,700px);background:#fffdf7;border:2px solid #c4b897;border-radius:12px;flex-direction:column;animation:.25s ease-out slideUp;display:flex;box-shadow:0 12px 40px #0006}.htp-header{border-bottom:2px solid #e0d8c4;flex-shrink:0;justify-content:space-between;align-items:center;padding:1rem 1.25rem;display:flex}.htp-title{text-transform:uppercase;letter-spacing:.06em;color:#1a1a2e;margin:0;font-size:1.1rem;font-weight:800}.htp-close{color:#666;cursor:pointer;background:0 0;border:1px solid #d0c8b0;border-radius:6px;justify-content:center;align-items:center;width:32px;height:32px;font-size:1.4rem;line-height:1;transition:background .15s,color .15s;display:flex}.htp-close:hover{color:#fff;background:#b22222;border-color:#b22222}.htp-body{flex:1;padding:1rem 1.25rem;overflow-y:auto}.htp-steps{margin:0;padding-left:1.25rem;list-style-type:decimal}.htp-steps li{color:#333;margin-bottom:.75rem;font-size:.88rem;line-height:1.6}.htp-steps li:last-child{margin-bottom:0}.htp-steps strong{color:#1a1a2e}.htp-steps em{color:#b22222;font-style:normal;font-weight:700}.htp-tip{color:#555;background:#f0eadb;border-left:4px solid #c4944a;border-radius:4px;margin-top:1rem;padding:.75rem 1rem;font-size:.85rem;line-height:1.5}.htp-tip strong{color:#8b6128}.rack-fixed{bottom:calc(50% - var(--board-size) / 2);z-index:2;cursor:pointer;max-width:calc(var(--board-size) * .75);position:fixed;left:50%;transform:translate(-50%,75%)}.rack{background:linear-gradient(#c4944a 0%,#a87735 40%,#8b6128 100%);border:2px solid #6b4c1e;border-radius:8px;padding:10px 16px 14px;box-shadow:0 6px 16px #0006,inset 0 1px #ffffff40,inset 0 -2px 4px #0000004d}.rack-ledge{background:linear-gradient(#7a5523 0%,#6b4c1e 100%);border-radius:4px;justify-content:center;gap:4px;padding:6px 8px;display:flex;box-shadow:inset 0 2px 6px #0006}.rack-slot{background:#00000026;border:1px solid #0000001a;border-radius:3px;justify-content:center;align-items:center;width:clamp(40px,9vw,60px);height:clamp(44px,10vw,66px);display:flex}.rack-tile{-webkit-user-select:none;user-select:none;background:linear-gradient(145deg,#f7e8c1 0%,#e8d5a3 50%,#d4c08a 100%);border:1px solid #b8a67a;border-radius:4px;justify-content:center;align-items:center;width:clamp(36px,8.5vw,54px);height:clamp(36px,8.5vw,54px);display:flex;position:relative;box-shadow:1px 2px 3px #0000004d,inset 0 1px #ffffff80,inset -1px -1px #00000014}.rack-tile-blank{background:linear-gradient(145deg,#faf5e8 0%,#efe8d4 50%,#e0d8c0 100%);border:2px dashed #a09070}.rack-tile-blank .rack-tile-letter{color:#8a7a5a;opacity:.7;font-size:clamp(14px,3.5vw,22px)}.rack-tile-blank .rack-tile-points{color:#8a7a5a}.rack-tile-spin{animation:.5s cubic-bezier(.25,.46,.45,.94) both tileSpin}.rack-tile-exit{animation:.4s ease-in forwards tileExit}@keyframes tileExit{0%{opacity:1;transform:translateY(0)scale(1)}to{opacity:0;transform:translateY(-28px)scale(.7)}}@keyframes tileSpin{0%{opacity:0;transform:scale(.3)rotateY(540deg)translateY(-30px)}60%{opacity:1;transform:scale(1.1)rotateY(90deg)translateY(0)}80%{transform:scale(.95)rotateY(15deg)}to{opacity:1;transform:scale(1)rotateY(0)translateY(0)}}.rack-tile-letter{color:#1a1a2e;font-family:Libre Franklin,Arial Black,sans-serif;font-size:clamp(18px,4.5vw,28px);font-weight:900;line-height:1}.rack-tile-points{color:#1a1a2e;font-family:Libre Franklin,Arial,sans-serif;font-size:clamp(7px,1.6vw,10px);font-weight:700;line-height:1;position:absolute;bottom:2px;right:4px}@media (width<=600px){.input-row{flex-direction:column;align-items:stretch;gap:.75rem}.btn-row{flex-direction:column;width:min(70vw,280px)}.btn-start,.btn-round{width:100%}.main{padding:1rem}}
