/* Personal presentation only: independent of letters, score and shared sessions. */
.grid-badge{font:700 10px/1 system-ui,sans-serif;border:1px solid #81a5a75e;border-radius:7px;padding:5px 6px;color:#b7cdd0;margin-left:1px;white-space:nowrap}
.board.size-3{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr))}
.board.size-4{grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(4,minmax(0,1fr))}
.board.size-5{grid-template-columns:repeat(5,minmax(0,1fr));grid-template-rows:repeat(5,minmax(0,1fr));gap:clamp(3px,.95vw,6px)}
.board.size-6{grid-template-columns:repeat(6,minmax(0,1fr));grid-template-rows:repeat(6,minmax(0,1fr));gap:clamp(2px,.7vw,5px)}
.board.size-3 .tile{font-size:clamp(24px,18cqw,78px)}
.board.size-4 .tile{font-size:clamp(21px,13cqw,61px)}
.board.size-5 .tile{font-size:clamp(17px,10cqw,49px);border-radius:10px}
.board.size-6 .tile{font-size:clamp(14px,7.9cqw,39px);border-radius:8px}
.board.size-5 .tile .qu,.board.size-6 .tile .qu{letter-spacing:-1px}
#settings-dialog{width:min(calc(100vw - 25px),430px)}
.theme-picker{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:9px 0 13px}
.theme-choice{border:1px solid #5a7d90;border-radius:12px;padding:9px 5px;background:#ffffff0a;color:#e8eef0;display:flex;flex-direction:column;align-items:center;gap:6px;font-size:12px;font-weight:700;min-width:0}
.theme-choice[aria-pressed="true"]{background:#edc68d21;border-color:#efc68a;color:#ffdfaa;box-shadow:inset 0 0 0 1px #eec68750}
.theme-swatch{display:grid;place-items:center;height:42px;width:46px;border-radius:9px;font-size:19px;font-weight:800}
.swatch-classic{background:linear-gradient(140deg,#fff8e8,#e4d2af);color:#164665}
.swatch-terminal{background:#020f08;color:#4aff75;font-family:monospace;border:1px solid #26c060}
.theme-note{margin-top:0!important;margin-bottom:16px}
#grid-select{margin-bottom:5px}
@media(max-width:390px){.grid-badge{padding:4px;margin-left:0;font-size:9px}.brand-name{font-size:15px}.theme-picker{gap:6px}.theme-choice{padding:7px 2px}}

/* === Terminal: purposeful monochrome phosphor green === */
html[data-theme="terminal"] body{background:#040f0a;color:#baffbe;font-family:ui-monospace,SFMono-Regular,Consolas,monospace}
html[data-theme="terminal"] .brand-name,html[data-theme="terminal"] .hud-item strong{font-family:ui-monospace,SFMono-Regular,Consolas,monospace}
html[data-theme="terminal"] .brand-name span,html[data-theme="terminal"] .brand-mark{color:#6cfa80}
html[data-theme="terminal"] .board-frame{background:#031108;border:1px solid #3ac35c;border-radius:13px;box-shadow:0 0 24px #19e44b1c,inset 0 0 10px #14c5450c}
html[data-theme="terminal"] .tile{background:#061b0d;color:#7dfd88;text-shadow:0 0 5px #45fa72a9;border:1px solid #308e45;border-radius:5px;box-shadow:inset 0 0 3px #3bff653b,0 3px 0 #0c351b;font-family:ui-monospace,SFMono-Regular,Consolas,monospace}
html[data-theme="terminal"] .tile.active{background:#65e887;color:#05200e;text-shadow:none;border-color:#9cffac}
html[data-theme="terminal"] .submit-button{background:#6bef86;color:#04170b;box-shadow:0 3px #24843b}
html[data-theme="terminal"] .hud,html[data-theme="terminal"] .word-bar{background:#071c0d;border-color:#267e3e}
html[data-theme="terminal"] .action{color:#8ff6a0;background:#071b0d;border-color:#267b3e}
html[data-theme="terminal"] .grid-badge{color:#6cfa80;border-color:#267b3e}

/* Eight handcrafted worlds: independent presentation, same puzzle logic. */
html[data-theme="tabletop"],html[data-theme="library"],html[data-theme="tidepool"],
html[data-theme="arcade"],html[data-theme="garden"],html[data-theme="clockwork"],
html[data-theme="observatory"],html[data-theme="paper"]{
  --reject-glow:var(--world-active);
}
html[data-theme="tabletop"] .brand-name,html[data-theme="library"] .brand-name,
html[data-theme="garden"] .brand-name,html[data-theme="clockwork"] .brand-name,
html[data-theme="observatory"] .brand-name,html[data-theme="paper"] .brand-name{
  font-family:Georgia,serif;
}
html[data-theme="paper"] .tile{clip-path:polygon(2% 0,98% 1%,100% 96%,0 100%)}
html[data-theme="clockwork"] .tile{background-image:radial-gradient(circle at 85% 15%,#fff8 1px,transparent 2px),linear-gradient(155deg,var(--world-tile1),var(--world-tile2));}
html[data-theme="arcade"] .tile{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;text-shadow:0 0 10px #36f5eb;box-shadow:inset 0 0 11px #a0fff033,0 0 7px #ff77e244,0 4px var(--world-shadow)}
html[data-theme="tidepool"] .tile{box-shadow:inset 0 5px 15px #fff6,inset 0 -8px 18px #20a7ba44,0 4px 5px #063e52}
html[data-theme="garden"] .tile{border-radius:18px 13px 17px 12px;box-shadow:inset 0 2px 2px #fff8,0 5px #577860,0 7px 9px #0b1e1aa0}
html[data-theme="library"] .tile,html[data-theme="paper"] .tile{letter-spacing:.012em}
html[data-theme="observatory"] body::before{content:"";position:fixed;inset:0;pointer-events:none;background-image:radial-gradient(#ffeec3bb 1px,transparent 1.5px);background-size:57px 79px;opacity:.17}
html[data-theme="observatory"] .app{position:relative}
.theme-swatch[class*="swatch-tabletop"],.theme-swatch[class*="swatch-library"],
.theme-swatch[class*="swatch-tidepool"],.theme-swatch[class*="swatch-arcade"],
.theme-swatch[class*="swatch-garden"],.theme-swatch[class*="swatch-clockwork"],
.theme-swatch[class*="swatch-observatory"],.theme-swatch[class*="swatch-paper"]{
 color:#fff3db;border:1px solid #fff7;font-family:Georgia,serif;
 text-shadow:0 1px 5px #000b;font-size:25px;
}

html[data-theme="tabletop"]{
 --world-tile1:#fff6df;--world-tile2:#d9bf99;
 --world-active:#f4d48a;--world-shadow:#7a553e;
 --trace-color:#f2d5a2;--reject-glow:#f4d48a;
}
html[data-theme="tabletop"] body{
 background:radial-gradient(ellipse at 30% -15%,#7b5039,#34221c 55%,#160f11);}
html[data-theme="tabletop"] .board-frame{
 background:linear-gradient(152deg,#70432d,#291916);
 border:2px solid #e5c990;box-shadow:0 12px 27px #0008,inset 0 0 16px #7b503966;}
html[data-theme="tabletop"] .tile{
 background:linear-gradient(155deg,#fff6df,#d9bf99);color:#583524;
 border:1px solid #e5c990;font-family:Georgia,serif;
 box-shadow:inset 0 2px #ffffff88,0 4px #7a553e,0 6px 8px #0007;}
html[data-theme="tabletop"] .tile.active{
 background:linear-gradient(150deg,#fff7c9,#f4d48a);
 color:#583524;text-shadow:none;box-shadow:inset 0 0 7px #fff9,0 1px #7a553e,0 0 12px #f4d48a66;}
html[data-theme="tabletop"] .hud,html[data-theme="tabletop"] .word-bar{
 background:#2f201ad9;border-color:#e5c99083;}
html[data-theme="tabletop"] .submit-button{background:#e7bb78;color:#583524;}
html[data-theme="tabletop"] .action{background:#70432d44;border-color:#e5c99077;color:#f2d5a2;}
html[data-theme="tabletop"] .brand-name span,html[data-theme="tabletop"] .brand-mark{
 color:#f2d5a2;}
.swatch-tabletop{background:linear-gradient(140deg,#7b5039,#160f11);}

html[data-theme="library"]{
 --world-tile1:#f5e8c5;--world-tile2:#ccba93;
 --world-active:#f6c878;--world-shadow:#44365a;
 --trace-color:#eaca91;--reject-glow:#f6c878;
}
html[data-theme="library"] body{
 background:radial-gradient(ellipse at 30% -15%,#484776,#131e38 55%,#0b0e20);}
html[data-theme="library"] .board-frame{
 background:linear-gradient(152deg,#382f53,#131728);
 border:2px solid #d4a56c;box-shadow:0 12px 27px #0008,inset 0 0 16px #48477666;}
html[data-theme="library"] .tile{
 background:linear-gradient(155deg,#f5e8c5,#ccba93);color:#46354a;
 border:1px solid #d4a56c;font-family:Georgia,serif;
 box-shadow:inset 0 2px #ffffff88,0 4px #44365a,0 6px 8px #0007;}
html[data-theme="library"] .tile.active{
 background:linear-gradient(150deg,#ffeab4,#f6c878);
 color:#46354a;text-shadow:none;box-shadow:inset 0 0 7px #fff9,0 1px #44365a,0 0 12px #f6c87866;}
html[data-theme="library"] .hud,html[data-theme="library"] .word-bar{
 background:#16172ddc;border-color:#d4a56c83;}
html[data-theme="library"] .submit-button{background:#f2cf92;color:#46354a;}
html[data-theme="library"] .action{background:#382f5344;border-color:#d4a56c77;color:#eaca91;}
html[data-theme="library"] .brand-name span,html[data-theme="library"] .brand-mark{
 color:#eaca91;}
.swatch-library{background:linear-gradient(140deg,#484776,#0b0e20);}

html[data-theme="tidepool"]{
 --world-tile1:#e7fffa;--world-tile2:#99cfcf;
 --world-active:#9df4e1;--world-shadow:#207c84;
 --trace-color:#a2fcda;--reject-glow:#9df4e1;
}
html[data-theme="tidepool"] body{
 background:radial-gradient(ellipse at 30% -15%,#248d9a,#154d71 55%,#082637);}
html[data-theme="tidepool"] .board-frame{
 background:linear-gradient(152deg,#5badb1,#0b4965);
 border:2px solid #a0f5dd;box-shadow:0 12px 27px #0008,inset 0 0 16px #248d9a66;}
html[data-theme="tidepool"] .tile{
 background:linear-gradient(155deg,#e7fffa,#99cfcf);color:#15526a;
 border:1px solid #a0f5dd;font-family:system-ui,sans-serif;
 box-shadow:inset 0 2px #ffffff88,0 4px #207c84,0 6px 8px #0007;}
html[data-theme="tidepool"] .tile.active{
 background:linear-gradient(150deg,#f0fffe,#9df4e1);
 color:#15526a;text-shadow:none;box-shadow:inset 0 0 7px #fff9,0 1px #207c84,0 0 12px #9df4e166;}
html[data-theme="tidepool"] .hud,html[data-theme="tidepool"] .word-bar{
 background:#0b3c56cf;border-color:#a0f5dd83;}
html[data-theme="tidepool"] .submit-button{background:#a5f3e2;color:#15526a;}
html[data-theme="tidepool"] .action{background:#5badb144;border-color:#a0f5dd77;color:#a2fcda;}
html[data-theme="tidepool"] .brand-name span,html[data-theme="tidepool"] .brand-mark{
 color:#a2fcda;}
.swatch-tidepool{background:linear-gradient(140deg,#248d9a,#082637);}

html[data-theme="arcade"]{
 --world-tile1:#201944;--world-tile2:#11112c;
 --world-active:#fe76d8;--world-shadow:#7734bd;
 --trace-color:#fe8de1;--reject-glow:#fe76d8;
}
html[data-theme="arcade"] body{
 background:radial-gradient(ellipse at 30% -15%,#55207a,#160d3e 55%,#090922);}
html[data-theme="arcade"] .board-frame{
 background:linear-gradient(152deg,#42137b,#17124a);
 border:2px solid #ff74e6;box-shadow:0 12px 27px #0008,inset 0 0 16px #55207a66;}
html[data-theme="arcade"] .tile{
 background:linear-gradient(155deg,#201944,#11112c);color:#a6fcfd;
 border:1px solid #ff74e6;font-family:system-ui,sans-serif;
 box-shadow:inset 0 2px #ffffff88,0 4px #7734bd,0 6px 8px #0007;}
html[data-theme="arcade"] .tile.active{
 background:linear-gradient(150deg,#fff4fd,#fe76d8);
 color:#a6fcfd;text-shadow:none;box-shadow:inset 0 0 7px #fff9,0 1px #7734bd,0 0 12px #fe76d866;}
html[data-theme="arcade"] .hud,html[data-theme="arcade"] .word-bar{
 background:#160e36e0;border-color:#ff74e683;}
html[data-theme="arcade"] .submit-button{background:#ff81df;color:#a6fcfd;}
html[data-theme="arcade"] .action{background:#42137b44;border-color:#ff74e677;color:#fe8de1;}
html[data-theme="arcade"] .brand-name span,html[data-theme="arcade"] .brand-mark{
 color:#fe8de1;}
.swatch-arcade{background:linear-gradient(140deg,#55207a,#090922);}

html[data-theme="garden"]{
 --world-tile1:#faf6df;--world-tile2:#c8dbbf;
 --world-active:#d4e99b;--world-shadow:#4f795f;
 --trace-color:#e5d8a7;--reject-glow:#d4e99b;
}
html[data-theme="garden"] body{
 background:radial-gradient(ellipse at 30% -15%,#4e785c,#253d39 55%,#14232b);}
html[data-theme="garden"] .board-frame{
 background:linear-gradient(152deg,#49634a,#283e37);
 border:2px solid #d4bd83;box-shadow:0 12px 27px #0008,inset 0 0 16px #4e785c66;}
html[data-theme="garden"] .tile{
 background:linear-gradient(155deg,#faf6df,#c8dbbf);color:#3d5943;
 border:1px solid #d4bd83;font-family:Georgia,serif;
 box-shadow:inset 0 2px #ffffff88,0 4px #4f795f,0 6px 8px #0007;}
html[data-theme="garden"] .tile.active{
 background:linear-gradient(150deg,#fafad4,#d4e99b);
 color:#3d5943;text-shadow:none;box-shadow:inset 0 0 7px #fff9,0 1px #4f795f,0 0 12px #d4e99b66;}
html[data-theme="garden"] .hud,html[data-theme="garden"] .word-bar{
 background:#1c3a32d9;border-color:#d4bd8383;}
html[data-theme="garden"] .submit-button{background:#e5d8a0;color:#3d5943;}
html[data-theme="garden"] .action{background:#49634a44;border-color:#d4bd8377;color:#e5d8a7;}
html[data-theme="garden"] .brand-name span,html[data-theme="garden"] .brand-mark{
 color:#e5d8a7;}
.swatch-garden{background:linear-gradient(140deg,#4e785c,#14232b);}

html[data-theme="clockwork"]{
 --world-tile1:#eadab5;--world-tile2:#b79a6b;
 --world-active:#f2d178;--world-shadow:#6e553b;
 --trace-color:#f3c87b;--reject-glow:#f2d178;
}
html[data-theme="clockwork"] body{
 background:radial-gradient(ellipse at 30% -15%,#73543c,#33373a 55%,#191e27);}
html[data-theme="clockwork"] .board-frame{
 background:linear-gradient(152deg,#6e533f,#342b2d);
 border:2px solid #cda05a;box-shadow:0 12px 27px #0008,inset 0 0 16px #73543c66;}
html[data-theme="clockwork"] .tile{
 background:linear-gradient(155deg,#eadab5,#b79a6b);color:#4e3931;
 border:1px solid #cda05a;font-family:Georgia,serif;
 box-shadow:inset 0 2px #ffffff88,0 4px #6e553b,0 6px 8px #0007;}
html[data-theme="clockwork"] .tile.active{
 background:linear-gradient(150deg,#ffe4a3,#f2d178);
 color:#4e3931;text-shadow:none;box-shadow:inset 0 0 7px #fff9,0 1px #6e553b,0 0 12px #f2d17866;}
html[data-theme="clockwork"] .hud,html[data-theme="clockwork"] .word-bar{
 background:#25272be0;border-color:#cda05a83;}
html[data-theme="clockwork"] .submit-button{background:#ebbf79;color:#4e3931;}
html[data-theme="clockwork"] .action{background:#6e533f44;border-color:#cda05a77;color:#f3c87b;}
html[data-theme="clockwork"] .brand-name span,html[data-theme="clockwork"] .brand-mark{
 color:#f3c87b;}
.swatch-clockwork{background:linear-gradient(140deg,#73543c,#191e27);}

html[data-theme="observatory"]{
 --world-tile1:#edecdd;--world-tile2:#bfc5df;
 --world-active:#dbbcf4;--world-shadow:#424e91;
 --trace-color:#dfc795;--reject-glow:#dbbcf4;
}
html[data-theme="observatory"] body{
 background:radial-gradient(ellipse at 30% -15%,#393d82,#151d47 55%,#090f28);}
html[data-theme="observatory"] .board-frame{
 background:linear-gradient(152deg,#2e3766,#101932);
 border:2px solid #d5bd89;box-shadow:0 12px 27px #0008,inset 0 0 16px #393d8266;}
html[data-theme="observatory"] .tile{
 background:linear-gradient(155deg,#edecdd,#bfc5df);color:#333c74;
 border:1px solid #d5bd89;font-family:Georgia,serif;
 box-shadow:inset 0 2px #ffffff88,0 4px #424e91,0 6px 8px #0007;}
html[data-theme="observatory"] .tile.active{
 background:linear-gradient(150deg,#faf3ff,#dbbcf4);
 color:#333c74;text-shadow:none;box-shadow:inset 0 0 7px #fff9,0 1px #424e91,0 0 12px #dbbcf466;}
html[data-theme="observatory"] .hud,html[data-theme="observatory"] .word-bar{
 background:#151d43df;border-color:#d5bd8983;}
html[data-theme="observatory"] .submit-button{background:#e1c787;color:#333c74;}
html[data-theme="observatory"] .action{background:#2e376644;border-color:#d5bd8977;color:#dfc795;}
html[data-theme="observatory"] .brand-name span,html[data-theme="observatory"] .brand-mark{
 color:#dfc795;}
.swatch-observatory{background:linear-gradient(140deg,#393d82,#090f28);}

html[data-theme="paper"]{
 --world-tile1:#fff1de;--world-tile2:#e6c6ac;
 --world-active:#f4bda3;--world-shadow:#b37875;
 --trace-color:#f3dac0;--reject-glow:#f4bda3;
}
html[data-theme="paper"] body{
 background:radial-gradient(ellipse at 30% -15%,#984e52,#56384c 55%,#2c233b);}
html[data-theme="paper"] .board-frame{
 background:linear-gradient(152deg,#ba766f,#733f43);
 border:2px solid #f5d3ad;box-shadow:0 12px 27px #0008,inset 0 0 16px #984e5266;}
html[data-theme="paper"] .tile{
 background:linear-gradient(155deg,#fff1de,#e6c6ac);color:#75454b;
 border:1px solid #f5d3ad;font-family:Georgia,serif;
 box-shadow:inset 0 2px #ffffff88,0 4px #b37875,0 6px 8px #0007;}
html[data-theme="paper"] .tile.active{
 background:linear-gradient(150deg,#fff2dc,#f4bda3);
 color:#75454b;text-shadow:none;box-shadow:inset 0 0 7px #fff9,0 1px #b37875,0 0 12px #f4bda366;}
html[data-theme="paper"] .hud,html[data-theme="paper"] .word-bar{
 background:#55313dda;border-color:#f5d3ad83;}
html[data-theme="paper"] .submit-button{background:#f2cbab;color:#75454b;}
html[data-theme="paper"] .action{background:#ba766f44;border-color:#f5d3ad77;color:#f3dac0;}
html[data-theme="paper"] .brand-name span,html[data-theme="paper"] .brand-mark{
 color:#f3dac0;}
.swatch-paper{background:linear-gradient(140deg,#984e52,#2c233b);}
