:root{--bg: #f5f0e8;--text: #2c2c2c;--accent: #2563eb;--accent-light: #dbeafe;--success: #16a34a;--danger: #dc2626;--black-cell: #1a1a1a;--cell-border: #888;--cell-active: #fbbf24;--cell-highlight: #e0e7ff;--card-bg: #fff;--shadow: 0 2px 8px rgba(0, 0, 0, .1)}*{margin:0;padding:0;box-sizing:border-box}body{font-family:Georgia,Times New Roman,Palatino Linotype,serif;background:var(--bg);color:var(--text);min-height:100vh}#app{max-width:1100px;margin:0 auto;padding:1rem}header{text-align:center;margin-bottom:1.5rem}header h1{font-size:1.8rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;border-bottom:3px double var(--black-cell);padding-bottom:.25rem}.subtitle{font-size:1rem;color:#666;margin-top:.25rem;font-style:italic}.puzzle-meta{font-size:.82rem;color:#666;margin-top:.35rem;line-height:1.4}.hidden{display:none!important}.btn{padding:.5rem 1rem;border:none;border-radius:6px;font-size:.9rem;cursor:pointer;background:var(--accent);color:#fff;transition:background .15s}.btn:hover{background:#1d4ed8}.btn-secondary{background:#6b7280}.btn-secondary:hover{background:#4b5563}.selector-panel{display:flex;flex-direction:column;gap:.85rem}.selector-section{display:flex;flex-direction:column;gap:.35rem}.selector-section__title{font-size:1.1rem;font-family:Georgia,Times New Roman,serif}.selector-section__subtitle{color:#666;font-size:.9rem}.puzzle-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:.85rem}.puzzle-card{background:var(--card-bg);border-radius:14px;padding:.95rem;box-shadow:var(--shadow);cursor:pointer;border:1px solid rgba(26,26,26,.08);transition:transform .15s,box-shadow .15s,border-color .15s;display:flex;flex-direction:column;gap:.5rem}.puzzle-card__top{display:flex;align-items:center;justify-content:flex-end;gap:.5rem}.puzzle-card__size{font-size:.76rem;color:#475569;font-family:monospace;font-weight:700;letter-spacing:.04em}.puzzle-card:hover{transform:translateY(-2px);box-shadow:0 4px 16px #00000026;border-color:#2563eb38}.puzzle-card h3{font-family:Georgia,Times New Roman,serif;font-size:1.08rem;line-height:1.25}.puzzle-card__theme{font-size:.86rem;color:#666;line-height:1.45}.puzzle-card--solved{border-left:4px solid var(--success)}.puzzle-card--in_progress{border-left:4px solid #f59e0b}.puzzle-card--available{border-left:4px solid transparent}.puzzle-card__meta{display:flex;flex-wrap:wrap;gap:.35rem .75rem;font-size:.78rem;color:#64748b}.empty-state{background:#ffffffe0;border:1px dashed rgba(26,26,26,.18);border-radius:14px;padding:1.25rem;text-align:center;display:flex;flex-direction:column;gap:.75rem}.empty-state h3{font-size:1.05rem}.empty-state p{color:#666;line-height:1.45}.loading{text-align:center;color:#999;padding:2rem}.modal{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:100}.modal-content{background:var(--card-bg);border-radius:12px;padding:2rem;text-align:center;box-shadow:0 8px 32px #0003}.modal-content h2{font-family:Georgia,Times New Roman,serif;font-size:1.5rem;margin-bottom:.5rem;color:var(--success)}.tutorial-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#0009;z-index:200;display:flex;align-items:center;justify-content:center}.tutorial-card{background:#fff;max-width:400px;width:90%;border-radius:12px;padding:2rem;text-align:center;box-shadow:0 8px 32px #0000004d}.tutorial-step{font-size:.75rem;color:#999;margin-bottom:.5rem;letter-spacing:.05em}.tutorial-title{font-family:Georgia,Times New Roman,serif;font-size:1.3rem;margin-bottom:.75rem;color:var(--text)}.tutorial-description{font-size:.95rem;color:#555;line-height:1.5;margin-bottom:1.5rem}.tutorial-actions{display:flex;gap:.75rem;justify-content:center}.tutorial-btn{min-width:100px}.pencil-help{max-width:430px;width:min(92vw,430px);text-align:left}.pencil-help__title{color:var(--accent)}.pencil-help__description{margin-bottom:.9rem;color:#555;line-height:1.5}.pencil-help__list{margin:0 0 1.25rem 1.2rem;color:#444;line-height:1.5}.pencil-help__actions{justify-content:flex-end}.puzzle-view{position:relative}.btn-back{position:absolute;left:0;top:50%;transform:translateY(-50%);background:none;border:none;font-size:1.5rem;cursor:pointer;color:var(--text);padding:.25rem .5rem;border-radius:6px;transition:background .15s;line-height:1}.btn-back:hover{background:#00000014}.grid-container{display:flex;flex-direction:column;align-items:center;gap:0}.progress-counter{display:none}.grid{display:grid;gap:1px;background:var(--cell-border);border:2px solid var(--black-cell);max-width:min(90vw,500px);width:100%;aspect-ratio:1}.cell{position:relative;aspect-ratio:1;background:#fff}.cell--black{background:var(--black-cell)}.cell--letter{background:#fff}.cell--active{background:var(--cell-active)!important}.cell--highlight{background:var(--cell-highlight)}.cell--wrong{background:#fecaca!important}.cell--revealed{background:#dcfce7}.cell__number{position:absolute;top:1px;left:2px;font-size:.55rem;line-height:1;color:#666;pointer-events:none;z-index:1}.cell__input{width:100%;height:100%;text-align:center;font-family:Georgia,Times New Roman,serif;font-size:1.2rem;font-weight:700;text-transform:uppercase;border:none;background:transparent;outline:none;caret-color:transparent;padding:0;cursor:pointer}.cell__input:focus{outline:none}.cell__input[readonly]{cursor:default}.toolbar{display:flex;gap:.45rem;flex-wrap:wrap;margin-top:.65rem;justify-content:center;width:min(100%,500px);padding:.3rem;border-radius:14px;background:#ffffffc7;box-shadow:var(--shadow)}.btn-pencil{display:inline-flex;align-items:center;justify-content:center;gap:.45rem;min-width:8.25rem;background:#64748b}.btn-pencil:hover{background:#475569}.btn-pencil__icon{display:none;font-size:1rem;line-height:1}.btn:disabled,.btn:hover:disabled{cursor:default;opacity:.55;background:#94a3b8}.btn-pencil__label{font-weight:600}.btn-pencil__state{padding:.15rem .5rem;border-radius:999px;background:#fff3;font-size:.78rem;line-height:1.2}.touch-remote{display:flex;flex-direction:column;gap:.45rem;width:min(100%,500px);margin-top:.75rem;padding:.7rem;border-radius:18px;background:#ffffffe6;box-shadow:var(--shadow)}.touch-remote__row{display:grid;gap:.35rem}.touch-remote__row--top{grid-template-columns:repeat(10,minmax(0,1fr))}.touch-remote__row--middle{grid-template-columns:repeat(9,minmax(0,1fr));padding-inline:1rem}.touch-remote__row--bottom{grid-template-columns:minmax(3.5rem,1.15fr) repeat(7,minmax(0,1fr)) minmax(3.5rem,1.15fr)}.touch-remote__key{min-height:3rem;border:1px solid rgba(26,26,26,.08);border-radius:14px;background:#f8fafc;color:var(--text);font-size:1.02rem;font-weight:700;font-family:Georgia,Times New Roman,serif;cursor:pointer;box-shadow:0 1px 3px #0f172a1f;transition:transform .1s,background .15s,box-shadow .15s}.touch-remote__key:hover{background:#e2e8f0}.touch-remote__key:active{transform:translateY(1px)}.touch-remote__key:disabled{cursor:default;opacity:.55;transform:none}.touch-remote__key--direction,.touch-remote__key--delete{background:#1e293b;color:#fff}.touch-remote__key--direction:hover,.touch-remote__key--delete:hover{background:#0f172a}.touch-remote__direction-icon{position:relative;display:inline-grid;place-items:center;width:2rem;height:2rem}.touch-remote__direction-core{width:.35rem;height:.35rem;border-radius:999px;background:#ffffffe0}.touch-remote__arrow{position:absolute;font-size:.95rem;line-height:1;color:#ffffff52;transition:color .15s,transform .15s}.touch-remote__arrow--up{top:-.05rem}.touch-remote__arrow--right{right:-.05rem}.touch-remote__arrow--down{bottom:-.05rem}.touch-remote__arrow--left{left:-.05rem}.touch-remote__key--horizontal .touch-remote__arrow--left,.touch-remote__key--horizontal .touch-remote__arrow--right,.touch-remote__key--vertical .touch-remote__arrow--up,.touch-remote__key--vertical .touch-remote__arrow--down{color:#fff;transform:scale(1.15)}.clues-container{display:flex;flex-direction:column;gap:1rem}.clue-section h3{font-size:calc(var(--clue-font-size, .9rem) + .1rem);margin-bottom:.5rem;padding-bottom:.25rem;border-bottom:2px solid var(--accent)}.clue-list{list-style:none;padding:0}.clue-item{padding:.4rem .5rem;font-size:var(--clue-font-size, .9rem);cursor:pointer;border-radius:4px;transition:background .1s;line-height:1.4}.clue-item:hover{background:var(--accent-light)}.clue-item--active{background:var(--cell-highlight);font-weight:600}.clue-item--complete{text-decoration:line-through;color:#595959}.cell--pencil .cell__input{color:#93c5fd}.btn-pencil--active{background:#2563eb;color:#fff}.btn-pencil--active .btn-pencil__state{background:#ffffff38}.font-scaler{display:flex;align-items:center;justify-content:flex-end;gap:.25rem;margin-bottom:.5rem}.font-scaler__btn{width:28px;height:28px;border:1px solid #ccc;border-radius:4px;background:var(--card-bg);font-size:1rem;font-weight:600;cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--text);transition:background .1s}.font-scaler__btn:hover{background:var(--accent-light)}.font-scaler__label{font-size:.75rem;color:#666;min-width:2.5rem;text-align:center}.selector-controls{position:sticky;top:.5rem;z-index:5}.selector-toolbar{background:#ffffffeb;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border:1px solid rgba(26,26,26,.08);border-radius:16px;padding:.75rem .85rem;box-shadow:var(--shadow)}.selector-toolbar--sizes{overflow:hidden}.selector-size-scroller{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:.35rem}.selector-size-scroller--overflow{position:relative}.selector-size-row{display:flex;gap:.45rem;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none}.selector-size-row::-webkit-scrollbar{display:none}.selector-size-arrow{width:2.25rem;height:2.25rem;border:1px solid rgba(26,26,26,.12);border-radius:999px;background:#fffffff5;color:#475569;font-family:Georgia,Times New Roman,serif;font-size:1rem;font-weight:700;cursor:pointer;box-shadow:var(--shadow)}.selector-size-arrow:disabled{opacity:.35;cursor:default}.size-chip{flex:0 0 auto;min-height:2.65rem;min-width:2.65rem;padding:.4rem .8rem;border:1px solid rgba(26,26,26,.12);border-radius:999px;background:var(--card-bg);font-family:Georgia,Times New Roman,serif;font-size:.9rem;font-weight:600;color:#475569;cursor:pointer;transition:color .15s,border-color .15s,background .15s}.size-chip:hover{color:var(--text);border-color:#2563eb4d}.size-chip--active{background:var(--black-cell);border-color:var(--black-cell);color:#fff}.definition-bar{width:100%;max-width:min(90vw,500px);min-height:5.8rem;padding:.55rem .75rem .6rem;background:var(--card-bg);border:2px solid var(--black-cell);border-bottom:none;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:.5rem;line-height:1.25;transition:opacity .15s;overflow:hidden}.definition-bar--empty{opacity:.3}.definition-bar__badge{display:inline-block;background:var(--black-cell);color:#fff;font-size:.7rem;font-weight:700;padding:.15rem .4rem;border-radius:3px;white-space:nowrap;letter-spacing:.03em;flex-shrink:0}.definition-bar__text{display:block;font-style:italic;color:var(--text);font-size:var(--definition-font-size, 1.05rem);line-height:1.25;min-height:3.75em;max-height:3.75em;overflow:hidden;text-wrap:pretty}.header-row{display:flex;align-items:center;justify-content:center;gap:1rem;position:relative}.header-points{font-family:Georgia,Times New Roman,serif;font-size:.9rem;font-weight:600;color:var(--accent);white-space:nowrap}.nav-tabs{display:flex;justify-content:center;gap:.45rem;margin-top:.75rem;border-bottom:2px solid var(--black-cell);padding-bottom:.35rem;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none}.nav-tabs::-webkit-scrollbar{display:none}.nav-tab{min-width:2.9rem;min-height:2.9rem;padding:.35rem .65rem;border:1px solid transparent;border-radius:999px;background:#ffffffc7;color:#64748b;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:.35rem;transition:color .15s,border-color .15s,background .15s}.nav-tab:hover{color:var(--text);border-color:#2563eb2e}.nav-tab--active{color:var(--text);background:var(--black-cell);border-color:var(--black-cell);color:#fff}.nav-tab__icon{font-size:1.05rem;line-height:1}.nav-tab__count{display:inline-flex;align-items:center;justify-content:center;min-width:1.15rem;min-height:1.15rem;padding:0 .2rem;border-radius:999px;background:#2563eb1f;color:var(--accent);font-size:.68rem;font-weight:700}.nav-tab--active .nav-tab__count{background:#ffffff2e;color:#fff}.btn-hint{display:flex;flex-direction:column;align-items:center;gap:.1rem;padding:.4rem .75rem;background:#6b7280}.btn-hint:hover{background:#4b5563}.btn-hint__label{font-size:.85rem}.btn-hint__cost{font-size:.65rem;opacity:.8}.btn-tool{background:var(--accent)}.stats-section{margin-bottom:1rem}.panel-title{font-family:Georgia,Times New Roman,serif;font-size:1.05rem;margin-bottom:.75rem;padding-bottom:.25rem;border-bottom:1px solid #ddd}.stats-summary{display:flex;flex-wrap:wrap;gap:1rem}.stat-item{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:9rem;padding:1rem .75rem;background:#ffffffe6;border-radius:12px;box-shadow:var(--shadow)}.stat-value{font-family:Georgia,Times New Roman,serif;font-size:2rem;font-weight:700;color:var(--text);line-height:1.1}.stat-label{font-size:.75rem;color:#999;text-transform:uppercase;letter-spacing:.1em;text-align:center}.challenge-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:.75rem}.challenge-card{background:var(--card-bg);border-radius:12px;padding:.9rem;box-shadow:var(--shadow);border:1px solid rgba(26,26,26,.08);display:flex;flex-direction:column;gap:.45rem}.challenge-card--done{border-color:#16a34a38;background:linear-gradient(180deg,#f0fdf4,#fff)}.challenge-card__top{display:flex;align-items:center;justify-content:space-between;gap:.5rem}.challenge-card__status,.challenge-card__progress{font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:#64748b}.challenge-card__title{font-family:Georgia,Times New Roman,serif;font-size:1rem;font-weight:700}.challenge-card__desc{color:#666;font-size:.85rem;line-height:1.45}.badge-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:.75rem}.badge-card{background:var(--card-bg);border-radius:8px;padding:.75rem;text-align:center;box-shadow:var(--shadow);transition:transform .15s}.badge-card--unlocked{border:2px solid var(--cell-active)}.badge-card--locked{opacity:.4;filter:grayscale(100%);border:2px solid transparent}.badge-icon{font-size:1.8rem;margin-bottom:.25rem}.badge-name{font-family:Georgia,Times New Roman,serif;font-weight:700;font-size:.85rem;margin-bottom:.15rem}.badge-desc{font-size:.7rem;color:#666;line-height:1.3}.history-table{display:flex;flex-direction:column;gap:.25rem}.history-row{display:flex;flex-wrap:wrap;gap:1rem;padding:.4rem .5rem;font-size:.85rem;border-bottom:1px solid #eee}.history-date{flex:0 0 5rem;color:#666}.history-time{flex:0 0 4rem}.history-size{flex:0 0 4.5rem;color:#666}.history-hints{flex:1;color:#999}.history-points{font-weight:600;color:var(--accent);text-align:right}.history-empty{color:#666;line-height:1.45}.completion-score{display:flex;flex-direction:column;align-items:center;gap:.5rem;margin:1rem 0}.completion-score__total{font-family:Georgia,Times New Roman,serif;font-size:2.5rem;font-weight:700;color:var(--accent);line-height:1}.completion-score__label{font-size:.8rem;color:#666;text-transform:uppercase;letter-spacing:.1em}.completion-breakdown{display:flex;flex-direction:column;gap:.25rem;font-size:.85rem;text-align:left;max-width:200px;margin:0 auto .75rem}.completion-breakdown span{display:flex;justify-content:space-between}.completion-badges{display:flex;gap:.5rem;justify-content:center;flex-wrap:wrap;margin:.5rem 0}.completion-badge{font-size:1.5rem;animation:badge-pop .4s ease-out}@keyframes badge-pop{0%{transform:scale(0);opacity:0}70%{transform:scale(1.3)}to{transform:scale(1);opacity:1}}.toast-container{position:fixed;bottom:1.5rem;right:1.5rem;display:flex;flex-direction:column;gap:.5rem;z-index:200;pointer-events:none}.toast{background:var(--black-cell);color:#fff;padding:.6rem 1rem;border-radius:6px;font-size:.85rem;box-shadow:0 4px 12px #0000004d;animation:toast-in .3s ease-out;pointer-events:auto}.toast--warning{background:#b45309}@keyframes toast-in{0%{transform:translateY(1rem);opacity:0}to{transform:translateY(0);opacity:1}}.puzzle-layout{display:flex;flex-direction:column;gap:1.5rem}@media(min-width:768px){.puzzle-layout{flex-direction:row;align-items:flex-start}.grid-container{flex:0 0 auto;width:min(50vw,500px)}.clues-container{flex:1;min-width:0;max-height:80vh;overflow-y:auto}}@media(max-width:767px){.grid{max-width:95vw}.cell__input{font-size:1rem}.cell__number{font-size:.45rem}.toolbar{width:100%;gap:.25rem;flex-wrap:nowrap}.toolbar .btn{flex:1 1 0;min-width:0;font-size:.74rem;padding:.38rem .2rem}.toolbar .btn-hint__label,.toolbar .btn-pencil__label{font-size:.74rem}.toolbar .btn-hint__cost{font-size:.58rem}.toolbar .btn-pencil{min-width:0;gap:.15rem;padding-inline:.2rem}.toolbar .btn-pencil__icon{display:inline-flex;align-items:center;justify-content:center}.toolbar .btn-pencil__label,.toolbar .btn-pencil__state{display:none}.touch-remote{padding:.55rem}.touch-remote__row{gap:.25rem}.touch-remote__row--middle{padding-inline:.75rem}.touch-remote__key{min-height:2.7rem;font-size:.92rem;border-radius:12px}.puzzle-list{grid-template-columns:1fr}.selector-controls{top:.25rem}.selector-toolbar{padding:.65rem .75rem}.selector-size-row{gap:.35rem}.selector-size-scroller{gap:.25rem}.selector-size-arrow{width:2rem;height:2rem;font-size:.95rem}.stats-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.challenge-grid{grid-template-columns:1fr}.stat-item{min-width:0}}@media(max-width:380px){.cell__input{font-size:.85rem}.toolbar .btn{font-size:.7rem}.touch-remote__key{min-height:2.45rem;font-size:.82rem}.touch-remote__row--middle{padding-inline:.4rem}header h1{font-size:1.4rem}.header-row{gap:.45rem}.size-chip{font-size:.84rem;min-height:2.45rem}}
