
:root{--navy:#17365D;--blue:#1769AA;--orange:#E97821;--bg:#f4f6f8;--card:#fff;--line:#d8dee7;--text:#1c2430;--muted:#667085;--danger:#a61b1b;--green:#137333;--shadow:0 12px 30px rgba(23,54,93,.10)}
*{box-sizing:border-box}body{margin:0;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--text)}
body::before{content:"";position:fixed;inset:0;background:url("/assets/logo.png") center 46% / min(72vw,520px) auto no-repeat;opacity:.055;pointer-events:none;z-index:-1}
.session-strip{position:fixed;top:10px;right:10px;z-index:40;display:flex;flex-direction:column;align-items:flex-end;gap:6px}
.user-menu-button{background:rgba(255,255,255,.88);color:var(--navy);border:1px solid var(--line);border-radius:999px;padding:8px 12px;box-shadow:var(--shadow);backdrop-filter:blur(4px);max-width:46vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.user-menu-panel{min-width:210px;max-width:280px;background:rgba(255,255,255,.96);border:1px solid var(--line);border-radius:14px;padding:10px;box-shadow:var(--shadow);backdrop-filter:blur(6px)}
.user-box{text-align:left;font-size:.9rem;color:var(--navy);background:transparent;border:0;border-radius:0;padding:0;box-shadow:none}.user-box:empty{display:none}.user-box button{margin-left:0;margin-top:8px;display:block;width:100%;padding:8px 10px}
.tabs{position:sticky;top:0;z-index:5;display:flex;gap:4px;overflow-x:auto;background:rgba(255,255,255,.92);border-bottom:1px solid var(--line);padding:6px;backdrop-filter:blur(6px)}.tab,button{border:0;background:var(--navy);color:#fff;border-radius:10px;padding:9px 12px;font-weight:750;cursor:pointer}.tab{background:#edf2f7;color:var(--navy);white-space:nowrap}.tab.active{background:var(--navy);color:#fff}button.secondary{background:#e8eef5;color:var(--navy)}button.danger{background:#ffe5e5;color:var(--danger)}button:disabled{opacity:.45;cursor:not-allowed}
main{max-width:980px;margin:0 auto;padding:10px}.panel{display:none}.panel.active{display:block}.app-section.locked{display:none}.hidden{display:none!important}.grid{display:grid;gap:10px}.grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}.grid.compact{gap:8px}.card{background:rgba(255,255,255,.94);border:1px solid var(--line);border-radius:15px;padding:12px;margin-bottom:10px;box-shadow:var(--shadow);backdrop-filter:blur(3px)}h1,h2,h3,p{margin-top:0}h2{font-size:1.05rem;margin-bottom:7px}label{display:block;font-weight:750;margin:7px 0}input,select{display:block;width:100%;margin-top:4px;padding:9px 10px;border:1px solid var(--line);border-radius:10px;font:inherit;background:#fff}.row{display:flex;gap:7px;align-items:center;flex-wrap:wrap;margin:7px 0}.small{font-size:.84rem;color:var(--muted)}.checkline{display:flex;align-items:center;gap:8px}.checkline input{width:auto;margin:0}
.entry{text-align:center;margin:16px auto 14px}.entry-logo{width:min(260px,65vw);background:#fff;border-radius:28px;padding:18px;box-shadow:var(--shadow)}.auth-logo{width:min(260px,68vw)}.entry h1{font-size:2.35rem;margin:10px 0 0;color:var(--navy);letter-spacing:.04em}.entry p{color:var(--muted);font-size:1.05rem}.auth-card{max-width:850px;margin:0 auto 10px}.auth-action-row{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px;margin-bottom:10px}.auth-mode{background:#e8eef5;color:var(--navy)}.auth-mode.selected{background:var(--navy);color:#fff}.auth-form h2{margin-bottom:5px}.auth-checkline{align-items:flex-start;font-weight:650;line-height:1.35}.auth-checkline input{margin-top:2px}.auth-checkline a{color:var(--blue);font-weight:800}.form-message{padding:8px 10px;border-radius:10px;margin:8px 0;font-size:.9rem;border:1px solid var(--line);background:#eef8f1;color:#245431}.form-message.error{background:#fff1f1;color:#7a1f1f;border-color:#f0b8b8}.form-message.success{background:#eef8f1;color:#245431;border-color:#b7dfc2}
.lobby-view{min-height:70vh;display:flex;align-items:flex-start;justify-content:center;padding-top:4vh}.lobby-hero{text-align:center;width:100%}.lobby-logo{width:min(460px,88vw);background:#fff;border-radius:34px;padding:22px;box-shadow:var(--shadow);margin-bottom:18px}.lobby-action-row{display:grid;grid-template-columns:1fr 1fr;gap:16px;max-width:560px;margin:0 auto}.lobby-action{font-size:1.15rem;padding:16px 18px;border-radius:16px}.setup-card,.room-created-card{max-width:560px;margin:28px auto}.room-created-card{text-align:center}.big-room-code{font-size:3rem;letter-spacing:.14em;font-weight:900;color:var(--navy);padding:16px;border:2px dashed var(--line);border-radius:18px;background:#f8fafc;margin:12px 0}.center-row{justify-content:center}
.game-shell{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1.05fr) minmax(280px,.9fr);gap:10px;align-items:start}.condition-panel{grid-column:1}.route-reference-panel{grid-column:2}.score-combined-panel{grid-column:3;grid-row:1 / span 2}.pending-panel{grid-column:1}.room-info-panel{grid-column:2}.log-section{grid-column:1 / -1}.game-section{scroll-margin-top:14px}.panel-head{display:flex;justify-content:space-between;gap:8px;align-items:start}.deck-info{display:flex;gap:8px;color:var(--muted);font-size:.84rem;white-space:nowrap}
.condition-card{border:2px solid var(--navy);border-radius:14px;padding:8px;min-height:96px;max-height:132px;background:linear-gradient(#fff,#f8fafc);overflow:auto}.condition-card.empty{border-style:dashed;color:var(--muted);display:flex;align-items:center;justify-content:center}.condition-card.logo-transition{display:flex;align-items:center;justify-content:center;border-style:solid;min-height:96px;background:rgba(255,255,255,.72)}.condition-card.logo-transition::before{content:"";display:block;width:min(140px,46vw);height:92px;background:url("/assets/logo.png") center / contain no-repeat;animation:logoFadeInOut 1.15s ease-in-out forwards}@keyframes logoFadeInOut{0%{opacity:0;transform:scale(.92)}28%{opacity:.88;transform:scale(1.02)}66%{opacity:.88;transform:scale(1)}100%{opacity:0;transform:scale(.96)}}.condition-card.card-reveal{animation:cardRevealSmooth .36s ease-out}@keyframes cardRevealSmooth{0%{opacity:0;transform:translateY(8px)}100%{opacity:1;transform:translateY(0)}}.number{color:var(--muted);font-size:.78rem}.name{color:var(--navy);font-size:1.08rem;font-weight:900;margin:.12rem 0}.badge{display:inline-block;padding:3px 7px;border-radius:999px;background:#e8eef5;color:var(--navy);font-weight:800;font-size:.72rem;margin:2px 3px 5px 0}.badge.orange{background:#fde8d7;color:#8a3a05}.badge.blue{background:#dfeefa;color:#0c4776}.badge.green{background:#e0f2e9;color:var(--green)}.condition-note{display:none!important}
.condition-help{margin-top:5px;border-top:1px solid var(--line);padding-top:5px}.condition-help.collapsed{border-top:0;padding-top:4px}.compact-help-btn{padding:6px 8px;font-size:.8rem}.condition-explanation{margin-top:7px;background:#f8fafc;border:1px solid var(--line);border-radius:12px;padding:9px;font-size:.9rem;max-height:150px;overflow:auto}.condition-question-row{display:grid;grid-template-columns:1fr auto;gap:7px;margin-top:7px}
.orange-dot,.blue-dot{width:12px;height:12px;border-radius:50%;display:inline-block}.orange-dot{background:var(--orange)}.blue-dot{background:var(--blue)}.route-reference-panel{padding-bottom:8px}.route-reference-panel p{font-size:.78rem;line-height:1.15;margin-bottom:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.route-buttons{display:grid;grid-template-columns:1fr 1fr 1fr;gap:5px;margin:6px 0}.route-buttons button{padding:7px 8px;font-size:.84rem}.route-btn{background:#e8eef5;color:var(--navy)}.route-btn.selected{background:var(--blue);color:#fff}.route-rules{margin:4px 0}.route-rules summary{cursor:pointer;display:inline-block;background:#e8eef5;color:var(--navy);border-radius:10px;padding:5px 8px;font-size:.78rem;font-weight:800}.route-rules[open] summary{background:var(--blue);color:#fff}.hand-table-wrap{max-height:none;overflow:visible}.hand-table{width:100%;border-collapse:collapse;font-size:.72rem;line-height:1.05}.hand-table th,.hand-table td{border-bottom:1px solid var(--line);padding:2px 3px}.hand-table th{text-align:left;color:var(--navy)}.hand-table td:nth-child(2),.hand-table td:nth-child(4){font-weight:900;text-align:right}.compact-list{font-size:.78rem;line-height:1.15;margin:5px 0 2px;padding-left:19px}.compact-list li{margin:3px 0}
.score-combined-panel{scroll-margin-top:12px;scroll-margin-bottom:45vh}.score-entry-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.player-score-entry{border:1px solid var(--line);border-radius:12px;padding:7px;background:#f8fafc}.player-total-line{display:grid;grid-template-columns:auto 1fr auto auto;gap:8px;align-items:center}.player-total-line strong:last-child{font-size:1.45rem}.score-action-row{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.compact-status{padding:7px;border-radius:10px;background:#eef3f8;border:1px solid var(--line);margin:8px 0;font-size:.86rem}.pending-box,.status,#roomInfo{padding:9px;border-radius:12px;background:#eef3f8;border:1px solid var(--line)}.room-info-actions{display:grid;grid-template-columns:1fr 1fr 1fr;gap:7px;margin-top:8px}.score-combined-panel.keyboard-focus{outline:2px solid rgba(23,105,170,.22);outline-offset:2px}.score-combined-panel.keyboard-focus input:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(23,105,170,.14)}
.log-details summary{font-weight:800;cursor:pointer}.log{max-height:300px;overflow:auto;padding-left:22px}.log li{border-bottom:1px solid var(--line);padding:8px 0}.filters{display:grid;grid-template-columns:2fr 1fr 1fr;gap:10px}.card-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px;margin-top:14px}.mini-card{border:1px solid var(--line);border-radius:14px;padding:12px;background:#fff}.rule-section{border-top:1px solid var(--line);padding:14px 0}.rule-section h3{color:var(--navy)}.helper-answer{margin-top:12px;padding:14px;border-radius:14px;border:1px solid var(--line);background:#f8fafc;min-height:80px}.history-item{border:1px solid var(--line);border-radius:14px;padding:12px;margin:10px 0;background:#fff}footer{text-align:center;color:var(--muted);padding:20px}.create-account{margin-top:12px}.create-account summary{cursor:pointer;font-weight:800;color:var(--navy)}
@media(max-width:760px){main{padding:7px}.grid.two,.filters{grid-template-columns:1fr}.game-shell{display:block}.condition-card{min-height:96px;max-height:140px}.tab,button{padding:9px 10px}.card{padding:10px;margin-bottom:9px}.entry-logo{width:min(230px,70vw)}.entry h1{font-size:2rem}.lobby-logo{width:min(420px,92vw);padding:18px}.lobby-action-row{max-width:520px}.room-info-actions{grid-template-columns:1fr 1fr 1fr}.score-entry-grid{grid-template-columns:1fr 1fr}.big-room-code{font-size:2.35rem}.user-menu-button{max-width:55vw}.user-menu-panel{max-width:88vw}.condition-explanation{max-height:180px}}
@media(max-width:430px){.tabs{padding:5px}.tab{padding:8px 9px}.auth-action-row{grid-template-columns:1fr}.lobby-action-row{grid-template-columns:1fr 1fr;gap:10px}.lobby-action{font-size:1rem;padding:13px 10px}.route-buttons{grid-template-columns:1fr}.hand-table{font-size:.68rem}.hand-table th,.hand-table td{padding:1px 2px}.route-reference-panel p{font-size:.72rem}.score-entry-grid{grid-template-columns:1fr 1fr}.player-score-entry{padding:7px}.player-total-line{grid-template-columns:auto 1fr;gap:4px}.player-total-line span:nth-child(3){display:none}.player-total-line strong:last-child{font-size:1.2rem}.score-action-row{grid-template-columns:1fr}.room-info-actions{grid-template-columns:1fr}.route-rules summary{width:100%;text-align:center}.condition-question-row{grid-template-columns:1fr}}


/* Test 9 navigation and setup refinements */
.setup-top-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-bottom:10px;
}
#localGuestNameWrap{
  margin-left:26px;
}
.new-game-setup-view,
.join-game-view,
.room-created-view,
.lobby-view{
  scroll-margin-top:0;
}


/* Test 10 visual and UX updates */
#authJoinCode,
#joinCode,
#adminRoomCodeInput{
  text-transform:uppercase;
}
#authJoinCode::placeholder,
#joinCode::placeholder,
#adminRoomCodeInput::placeholder{
  text-transform:uppercase;
}
.card{
  border-top:3px solid rgba(23,105,170,.38);
}
.condition-panel{
  border-top-color:var(--orange);
}
.route-reference-panel{
  border-top-color:var(--blue);
}
.score-combined-panel{
  border-top-color:var(--orange);
}
.pending-panel{
  border-top-color:rgba(23,105,170,.55);
}
.room-info-panel{
  border-top-color:rgba(233,120,33,.55);
}
.lobby-action:first-child,
#createRoomBtn,
#submitScoreBtn{
  background:linear-gradient(135deg,var(--orange),#c75f12);
}
.lobby-action.secondary,
#joinGameBtn,
#copyRoomLinkBtn.secondary{
  background:linear-gradient(135deg,var(--blue),var(--navy));
  color:#fff;
}
.route-btn.selected{
  background:linear-gradient(135deg,var(--blue),var(--navy));
  color:#fff;
}
.badge.green{
  background:#fff0e4;
  color:#9b490d;
}
.badge.blue{
  background:#e0effa;
  color:#0c4776;
}
.condition-card.logo-transition::before{
  animation:logoFadeInOut 2.05s ease-in-out forwards;
}
@keyframes logoFadeInOut{
  0%{opacity:0;transform:scale(.9)}
  24%{opacity:.9;transform:scale(1.03)}
  58%{opacity:.9;transform:scale(1)}
  100%{opacity:0;transform:scale(.96)}
}
.condition-free-card{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:10px;
  align-items:center;
  width:100%;
}
.condition-free-logo{
  width:58px;
  height:58px;
  background:url("/assets/logo.png") center / contain no-repeat;
  opacity:.82;
}
.condition-free-title{
  color:var(--navy);
  font-weight:900;
  margin-bottom:2px;
}
.condition-free-reason{
  color:var(--muted);
  font-size:.88rem;
  line-height:1.2;
}
@media(max-width:430px){
  .condition-free-card{gap:7px}
  .condition-free-logo{width:48px;height:48px}
  .condition-free-reason{font-size:.8rem}
}


/* Test 11 settings + dark mode */
.settings-block{
  border-top:1px solid var(--line);
  margin-top:10px;
  padding-top:10px;
}
.settings-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin:7px 0;
}
.settings-title{
  font-weight:900;
  color:var(--navy);
}
.settings-suggestions{
  margin:8px 0 0;
  padding-left:18px;
  color:var(--muted);
  font-size:.8rem;
  line-height:1.25;
}
.theme-toggle{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:5px;
}
.theme-toggle button{
  padding:6px 8px;
  font-size:.82rem;
}
.theme-toggle button.selected{
  background:linear-gradient(135deg,var(--blue),var(--navy));
  color:#fff;
}
html[data-theme="dark"]{
  --bg:#081420;
  --card:#101d2b;
  --line:#2b425a;
  --text:#e8eef5;
  --muted:#9fb0c0;
  --navy:#7fb5e6;
  --blue:#2b82c2;
  --orange:#ff9638;
  --shadow:0 12px 30px rgba(0,0,0,.28);
}
html[data-theme="dark"] body{
  background:#081420;
  color:var(--text);
}
html[data-theme="dark"] body::before{
  opacity:.045;
}
html[data-theme="dark"] .card,
html[data-theme="dark"] .user-menu-panel,
html[data-theme="dark"] .user-menu-button{
  background:rgba(16,29,43,.94);
  color:var(--text);
}
html[data-theme="dark"] input,
html[data-theme="dark"] select{
  background:#0b1723;
  color:var(--text);
  border-color:var(--line);
}
html[data-theme="dark"] .pending-box,
html[data-theme="dark"] .status,
html[data-theme="dark"] #roomInfo,
html[data-theme="dark"] .player-score-entry,
html[data-theme="dark"] .condition-explanation,
html[data-theme="dark"] .mini-card,
html[data-theme="dark"] .history-item{
  background:#0c1926;
  color:var(--text);
  border-color:var(--line);
}
html[data-theme="dark"] .condition-card{
  background:linear-gradient(#0f1f2f,#0b1723);
}
html[data-theme="dark"] button.secondary,
html[data-theme="dark"] .route-btn,
html[data-theme="dark"] .auth-mode{
  background:#16283a;
  color:#dceaf7;
}
html[data-theme="dark"] .tab{
  background:#16283a;
  color:#dceaf7;
}
html[data-theme="dark"] .tab.active{
  background:var(--blue);
  color:#fff;
}
html[data-theme="dark"] .badge.orange,
html[data-theme="dark"] .badge.green{
  background:#3b2414;
  color:#ffb777;
}
html[data-theme="dark"] .badge.blue{
  background:#16344d;
  color:#9ed0ff;
}
html[data-theme="dark"] .settings-title,
html[data-theme="dark"] .rule-section h3,
html[data-theme="dark"] .hand-table th,
html[data-theme="dark"] .name{
  color:#b9dcff;
}


/* Test 12 clarity updates */

/* Remove white logo cards so the logo floats over the app background */
.entry-logo,
.auth-logo,
.lobby-logo{
  background:transparent !important;
  box-shadow:none !important;
  border-radius:0 !important;
  padding:0 !important;
}
.condition-free-logo,
.condition-card.logo-transition::before,
body::before{
  filter:none;
}

/* Strong selected states for light and dark mode */
button.selected,
.route-btn.selected,
.auth-mode.selected,
.theme-toggle button.selected,
.tab.active{
  position:relative;
  border:2px solid var(--orange) !important;
  box-shadow:0 0 0 3px rgba(233,120,33,.22), 0 8px 18px rgba(23,54,93,.18) !important;
  transform:translateY(-1px);
}
button.selected::after,
.route-btn.selected::after,
.auth-mode.selected::after,
.theme-toggle button.selected::after,
.tab.active::after{
  content:"✓";
  display:inline-block;
  margin-left:6px;
  font-weight:900;
}
.route-btn:not(.selected),
.auth-mode:not(.selected),
.theme-toggle button:not(.selected){
  border:1px solid var(--line);
}
html[data-theme="dark"] button.selected,
html[data-theme="dark"] .route-btn.selected,
html[data-theme="dark"] .auth-mode.selected,
html[data-theme="dark"] .theme-toggle button.selected,
html[data-theme="dark"] .tab.active{
  background:linear-gradient(135deg,#1f7fbd,#0f446b) !important;
  color:#fff !important;
  border-color:var(--orange) !important;
  box-shadow:0 0 0 3px rgba(255,150,56,.35), 0 0 22px rgba(31,127,189,.35) !important;
}
html[data-theme="dark"] .route-btn:not(.selected),
html[data-theme="dark"] .auth-mode:not(.selected),
html[data-theme="dark"] .theme-toggle button:not(.selected){
  background:#152536 !important;
  color:#dbeafa !important;
  border:1px solid #3a5570;
}

/* Condition-card readability */
.condition-card .name{
  font-size:1.28rem !important;
  line-height:1.08;
  letter-spacing:.01em;
}
.condition-card p{
  font-size:.94rem;
  line-height:1.25;
}

/* Hand reference points alignment */
.hand-table th.points-head{
  text-align:right !important;
  font-size:.68rem;
  color:var(--muted);
}
.hand-table td:nth-child(2),
.hand-table td:nth-child(4){
  text-align:right !important;
  white-space:nowrap;
}
.hand-table th:nth-child(1),
.hand-table th:nth-child(3){
  font-size:0;
}


/* Test 12 Updated: floating user menu follows light/dark theme */
.session-strip{
  color:var(--text);
}

.user-menu-button{
  background:linear-gradient(135deg,var(--blue),var(--navy)) !important;
  color:#fff !important;
  border:2px solid rgba(233,120,33,.75) !important;
  box-shadow:0 0 0 3px rgba(233,120,33,.16), 0 10px 24px rgba(23,54,93,.22) !important;
}

.user-menu-button:hover,
.user-menu-button:focus{
  outline:none;
  box-shadow:0 0 0 4px rgba(233,120,33,.28), 0 10px 28px rgba(23,54,93,.30) !important;
}

.user-menu-panel{
  background:rgba(255,255,255,.96) !important;
  color:#1c2430 !important;
  border:2px solid rgba(23,105,170,.30) !important;
  box-shadow:0 12px 30px rgba(23,54,93,.16), inset 0 3px 0 rgba(233,120,33,.70) !important;
}

.user-box,
.user-box .small,
.settings-suggestions{
  color:#1c2430 !important;
}

.user-box .small,
.settings-suggestions{
  color:#667085 !important;
}

.settings-title{
  color:#17365D !important;
}

.theme-toggle button:not(.selected),
.user-box button.secondary{
  background:#e8eef5 !important;
  color:#17365D !important;
  border:1px solid #d8dee7 !important;
}

.theme-toggle button.selected{
  background:linear-gradient(135deg,var(--blue),var(--navy)) !important;
  color:#fff !important;
  border:2px solid var(--orange) !important;
}

html[data-theme="dark"] .user-menu-button{
  background:linear-gradient(135deg,#12263a,#081420) !important;
  color:#f3f7fb !important;
  border:2px solid var(--orange) !important;
  box-shadow:0 0 0 3px rgba(255,150,56,.22), 0 0 24px rgba(43,130,194,.35) !important;
}

html[data-theme="dark"] .user-menu-button:hover,
html[data-theme="dark"] .user-menu-button:focus{
  box-shadow:0 0 0 4px rgba(255,150,56,.35), 0 0 30px rgba(43,130,194,.45) !important;
}

html[data-theme="dark"] .user-menu-panel{
  background:rgba(10,22,34,.98) !important;
  color:#e8eef5 !important;
  border:2px solid rgba(255,150,56,.55) !important;
  box-shadow:0 14px 34px rgba(0,0,0,.42), inset 0 3px 0 rgba(43,130,194,.75) !important;
}

html[data-theme="dark"] .user-box,
html[data-theme="dark"] .user-box .small,
html[data-theme="dark"] .settings-suggestions{
  color:#e8eef5 !important;
}

html[data-theme="dark"] .user-box .small,
html[data-theme="dark"] .settings-suggestions{
  color:#9fb0c0 !important;
}

html[data-theme="dark"] .settings-title{
  color:#ffb777 !important;
}

html[data-theme="dark"] .theme-toggle button:not(.selected),
html[data-theme="dark"] .user-box button.secondary{
  background:#152536 !important;
  color:#dbeafa !important;
  border:1px solid #3a5570 !important;
}

html[data-theme="dark"] .theme-toggle button.selected{
  background:linear-gradient(135deg,#2b82c2,#0f446b) !important;
  color:#fff !important;
  border:2px solid var(--orange) !important;
}


/* Test 13 corrections */

/* SVG logo everywhere, no white box/background */
.entry-logo,
.auth-logo,
.lobby-logo{
  background:transparent !important;
  box-shadow:none !important;
  border-radius:0 !important;
  padding:0 !important;
}
.entry-logo,
.auth-logo{
  width:min(300px,72vw);
}
.lobby-logo{
  width:min(500px,92vw);
}

/* Remove all selected checkmarks, keep strong selected visual treatment */
button.selected::after,
.route-btn.selected::after,
.auth-mode.selected::after,
.theme-toggle button.selected::after,
.tab.active::after{
  content:none !important;
  display:none !important;
}
button.selected,
.route-btn.selected,
.auth-mode.selected,
.theme-toggle button.selected,
.tab.active{
  border:3px solid var(--orange) !important;
  box-shadow:0 0 0 4px rgba(233,120,33,.25), 0 8px 18px rgba(23,54,93,.20) !important;
}

/* Guest join button should look like a primary game action */
#authGuestJoinBtn{
  background:linear-gradient(135deg,var(--blue),var(--navy)) !important;
  color:#fff !important;
  border:2px solid rgba(233,120,33,.70) !important;
  box-shadow:0 0 0 2px rgba(233,120,33,.13);
}

/* Smaller floating username button and tab padding to avoid overlap */
.user-menu-button{
  font-size:.72rem !important;
  line-height:1 !important;
  padding:7px 9px !important;
  max-width:116px !important;
  min-width:0 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  letter-spacing:.02em;
}
.tabs{
  padding-right:128px !important;
}

/* Force floating menu to obey dark theme */
html[data-theme="dark"] .session-strip,
html[data-theme="dark"] .session-strip *,
html[data-theme="dark"] .user-menu-panel,
html[data-theme="dark"] .user-menu-panel *,
html[data-theme="dark"] .user-box,
html[data-theme="dark"] .user-box *{
  color:#e8eef5 !important;
}
html[data-theme="dark"] .user-menu-panel{
  background:#0a1622 !important;
  border:2px solid rgba(255,150,56,.65) !important;
  box-shadow:0 14px 34px rgba(0,0,0,.48), inset 0 3px 0 rgba(43,130,194,.80) !important;
}
html[data-theme="dark"] .user-menu-button{
  background:linear-gradient(135deg,#102336,#07131f) !important;
  color:#fff !important;
  border:2px solid var(--orange) !important;
}
html[data-theme="dark"] .settings-suggestions,
html[data-theme="dark"] .user-box .small{
  color:#9fb0c0 !important;
}
html[data-theme="dark"] .settings-title{
  color:#ffb777 !important;
}
html[data-theme="dark"] .theme-toggle button:not(.selected),
html[data-theme="dark"] .user-box button.secondary{
  background:#152536 !important;
  color:#dbeafa !important;
  border:1px solid #3a5570 !important;
}
html[data-theme="dark"] #authGuestJoinBtn{
  background:linear-gradient(135deg,#2b82c2,#0f446b) !important;
  color:#fff !important;
  border:2px solid var(--orange) !important;
}

/* Slightly reduce route button text width issues on small screens */
@media(max-width:430px){
  .tabs{padding-right:104px !important;}
  .user-menu-button{max-width:94px !important;font-size:.66rem !important;padding:7px 7px !important;}
  .entry-logo,.auth-logo{width:min(280px,74vw);}
  .lobby-logo{width:min(450px,92vw);}
}


/* Test 14: restore original logo art */
.entry-logo,
.auth-logo,
.lobby-logo{
  background:transparent !important;
  box-shadow:none !important;
  border-radius:0 !important;
  padding:0 !important;
}


/* Test 15 route/scoring and series updates */
.route-view-note{
  margin:-2px 0 6px;
}
.score-route-choice{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:6px;
  margin:8px 0;
}
.score-route-choice .route-btn.selected{
  border:3px solid var(--orange) !important;
  background:linear-gradient(135deg,var(--blue),var(--navy)) !important;
  color:#fff !important;
  box-shadow:0 0 0 4px rgba(233,120,33,.24), 0 8px 18px rgba(23,54,93,.20) !important;
}
.hand-score-menu{
  border:1px solid var(--line);
  border-radius:12px;
  padding:8px;
  margin:8px 0;
  background:#f8fafc;
}
.hand-score-menu summary{
  cursor:pointer;
  font-weight:900;
  color:var(--navy);
}
.hand-score-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-top:8px;
}
.series-status{
  padding:7px 9px;
  border-radius:10px;
  background:#eef3f8;
  border:1px solid var(--line);
  color:var(--muted);
  font-weight:800;
  margin-bottom:8px;
}
.score-combined-panel input[readonly]{
  background:#eef3f8;
  color:var(--muted);
}
html[data-theme="dark"] .hand-score-menu,
html[data-theme="dark"] .series-status,
html[data-theme="dark"] .score-combined-panel input[readonly]{
  background:#0c1926 !important;
  color:#dbeafa !important;
  border-color:#3a5570 !important;
}
html[data-theme="dark"] .hand-score-menu summary{
  color:#b9dcff !important;
}
@media(max-width:430px){
  .score-route-choice{grid-template-columns:1fr;}
  .hand-score-grid{grid-template-columns:1fr;}
}


/* Test 16 score-section cleanup */
.score-combined-panel .panel-head{
  display:grid;
  grid-template-columns:1fr auto;
  align-items:start;
}
.score-combined-panel .panel-head h2{
  margin-bottom:0;
}
.score-route-badge{
  white-space:nowrap !important;
  min-width:max-content;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:1;
  padding:8px 12px;
  border-radius:999px;
  font-size:.88rem;
}
.score-round-meta{
  color:var(--muted);
  font-weight:800;
  font-size:.86rem;
  margin:4px 0 8px;
}
#seriesStatus{
  display:none !important;
}
.player-score-entry{
  position:relative;
}
.match-star{
  font-size:1.05rem;
  line-height:1;
  height:1.05rem;
  margin:0 0 4px 2px;
  text-shadow:0 1px 5px rgba(0,0,0,.24);
}
.orange-star{
  color:var(--orange);
}
.blue-star{
  color:var(--blue);
}
html[data-theme="dark"] .blue-star{
  color:#4eb0ff;
}
html[data-theme="dark"] .orange-star{
  color:#ff9638;
}
@media(max-width:430px){
  .score-combined-panel .panel-head{
    grid-template-columns:1fr auto;
    column-gap:8px;
  }
  .score-route-badge{
    font-size:.76rem;
    padding:7px 9px;
    max-width:none;
  }
  .score-round-meta{
    font-size:.78rem;
  }
}


/* Test 18: Light theme only for now */
html,
html[data-theme="light"],
html[data-theme="dark"]{
  --navy:#17365D;
  --blue:#1769AA;
  --orange:#E97821;
  --bg:#f4f6f8;
  --card:#fff;
  --line:#d8dee7;
  --text:#1c2430;
  --muted:#667085;
  --danger:#a61b1b;
  --green:#137333;
  --shadow:0 12px 30px rgba(23,54,93,.10);
}
html[data-theme="dark"] body{
  background:var(--bg) !important;
  color:var(--text) !important;
}
html[data-theme="dark"] .card,
html[data-theme="dark"] .user-menu-panel,
html[data-theme="dark"] .user-menu-button,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] .pending-box,
html[data-theme="dark"] .status,
html[data-theme="dark"] #roomInfo,
html[data-theme="dark"] .player-score-entry,
html[data-theme="dark"] .condition-explanation,
html[data-theme="dark"] .mini-card,
html[data-theme="dark"] .history-item,
html[data-theme="dark"] .hand-score-menu,
html[data-theme="dark"] .score-combined-panel input[readonly]{
  background:rgba(255,255,255,.94) !important;
  color:var(--text) !important;
  border-color:var(--line) !important;
}
html[data-theme="dark"] input,
html[data-theme="dark"] select{
  background:#fff !important;
}
html[data-theme="dark"] .user-menu-button{
  background:linear-gradient(135deg,var(--blue),var(--navy)) !important;
  color:#fff !important;
  border:2px solid rgba(233,120,33,.75) !important;
}
html[data-theme="dark"] .user-box,
html[data-theme="dark"] .user-box *,
html[data-theme="dark"] .settings-title,
html[data-theme="dark"] .settings-suggestions,
html[data-theme="dark"] .user-box .small{
  color:var(--text) !important;
}
html[data-theme="dark"] .user-box .small,
html[data-theme="dark"] .settings-suggestions{
  color:var(--muted) !important;
}
html[data-theme="dark"] .tab{
  background:#edf2f7 !important;
  color:var(--navy) !important;
}
html[data-theme="dark"] .tab.active{
  background:var(--navy) !important;
  color:#fff !important;
}
.theme-toggle{
  display:none !important;
}


/* Test 19 dice roller */
.dice-roll-panel{
  border:1px solid var(--line);
  border-radius:14px;
  padding:9px;
  margin:8px 0 10px;
  background:#f8fafc;
}
.dice-panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.dice-panel-head h3{
  margin:0;
  color:var(--navy);
  font-size:.98rem;
}
.dice-action-row{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:6px;
  margin:8px 0;
}
.dice-action-row button{
  padding:8px 8px;
  font-size:.78rem;
  line-height:1.1;
}
.dice-status{
  margin:4px 0 7px;
}
.dice-board{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.dice-player-card{
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  padding:7px;
}
.dice-player-title{
  display:flex;
  align-items:center;
  gap:6px;
  font-size:.82rem;
  margin-bottom:6px;
}
.dice-row{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  min-height:34px;
}
.die{
  width:31px;
  height:31px;
  border-radius:8px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:950;
  font-size:1rem;
  color:#fff;
  border:2px solid rgba(255,255,255,.45);
  box-shadow:0 2px 8px rgba(0,0,0,.18);
  user-select:none;
}
.orange-dice .die{
  background:linear-gradient(135deg,#ff9d3d,#d65f13);
}
.blue-dice .die{
  background:linear-gradient(135deg,#3e9de0,#115f98);
}
.die.selectable{
  cursor:pointer;
}
.die.selectable:hover{
  transform:translateY(-1px);
}
.die.selected{
  border:3px solid #fff !important;
  outline:3px solid var(--orange);
  box-shadow:0 0 0 3px rgba(23,54,93,.22), 0 4px 12px rgba(0,0,0,.28);
}
.blue-dice .die.selected{
  outline-color:var(--blue);
}
.die.locked-view{
  opacity:.74;
}
.dice-selected-note{
  min-height:1rem;
  margin-top:5px;
}
@media(max-width:430px){
  .dice-action-row{
    grid-template-columns:1fr;
  }
  .dice-board{
    grid-template-columns:1fr;
  }
  .die{
    width:34px;
    height:34px;
  }
}


/* Test 20 admin, readiness, dice states */
.admin-tab.hidden,
.hidden{ display:none !important; }

.admin-panel .admin-actions{
  display:grid;
  grid-template-columns:1fr 1fr 1fr 1fr 1fr;
  gap:8px;
  align-items:end;
}
.admin-output{
  margin-top:12px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#0f172a;
  color:#e5e7eb;
  overflow:auto;
  max-height:520px;
  font-size:.78rem;
  white-space:pre-wrap;
}
.admin-summary{
  margin-top:10px;
  color:var(--muted);
  font-weight:800;
}
.secondary-dice-actions{
  grid-template-columns:1fr !important;
}
.cancellation-preview{
  margin-top:9px;
  padding:9px;
  border:1px solid rgba(23,54,93,.2);
  border-radius:12px;
  background:#fff8ed;
  color:var(--text);
  font-size:.86rem;
  line-height:1.45;
}
.small-button{
  padding:6px 8px;
  margin-top:6px;
  font-size:.78rem;
}
.play-again-status{
  margin-top:8px;
  padding:8px;
  border:1px dashed var(--line);
  border-radius:10px;
  background:#f8fafc;
}
.die.cancelled{
  background:#a0a7b3 !important;
  color:#3f4652 !important;
  opacity:.48;
  text-decoration:line-through;
  box-shadow:none;
}
.die.rerolled{
  box-shadow:0 0 0 3px rgba(19,115,51,.22), 0 2px 8px rgba(0,0,0,.18);
}
.die.kept{
  opacity:.92;
}
.die.rolling{
  animation:dieShake .7s ease-in-out;
}
@keyframes dieShake{
  0%{ transform:rotate(0deg) scale(1); }
  20%{ transform:rotate(-8deg) scale(1.05); }
  45%{ transform:rotate(9deg) scale(.98); }
  70%{ transform:rotate(-5deg) scale(1.03); }
  100%{ transform:rotate(0deg) scale(1); }
}
@media(max-width:700px){
  .admin-panel .admin-actions{
    grid-template-columns:1fr;
  }
}

.settings-check{
  display:flex;
  gap:8px;
  align-items:center;
  margin:8px 0;
  color:var(--text);
  font-size:.86rem;
  font-weight:800;
}
.settings-check input{
  width:auto;
}


/* Test 21: stronger dice animation and clearer preview notes */
.preview-rule{
  display:inline-block;
  margin:4px 0;
  font-weight:800;
  color:var(--navy);
}
.preview-notes{
  margin:4px 0 0 18px;
  padding:0;
}
.die.rolling{
  animation:dieRollTest21 1.26s cubic-bezier(.2,.75,.25,1) infinite !important;
  filter:brightness(1.16) saturate(1.25);
  box-shadow:0 0 0 4px rgba(233,120,33,.28), 0 10px 20px rgba(23,54,93,.28) !important;
}
.blue-dice .die.rolling{
  box-shadow:0 0 0 4px rgba(23,105,170,.30), 0 10px 20px rgba(23,54,93,.28) !important;
}
.die.roll-settled{
  animation:dieSettleTest21 .55s ease-out;
}
@keyframes dieRollTest21{
  0%{ transform:translateY(0) rotate(0deg) scale(1); }
  12%{ transform:translateY(-7px) rotate(-14deg) scale(1.13); }
  25%{ transform:translateY(3px) rotate(16deg) scale(.97); }
  38%{ transform:translateY(-6px) rotate(-12deg) scale(1.10); }
  52%{ transform:translateY(2px) rotate(14deg) scale(.99); }
  68%{ transform:translateY(-5px) rotate(-10deg) scale(1.08); }
  84%{ transform:translateY(1px) rotate(8deg) scale(1.02); }
  100%{ transform:translateY(0) rotate(0deg) scale(1); }
}
@keyframes dieSettleTest21{
  0%{ transform:scale(1.18); filter:brightness(1.22); }
  100%{ transform:scale(1); filter:none; }
}


/* Test 23: condition-aware reroll restrictions */
.die.condition-locked{
  opacity:.42;
  filter:grayscale(.65);
  cursor:not-allowed !important;
  box-shadow:none !important;
  position:relative;
}
.die.condition-locked::after{
  content:"";
  position:absolute;
  inset:5px;
  border-top:3px solid rgba(255,255,255,.9);
  transform:rotate(-35deg);
}
.die.forced-reroll{
  outline:3px dashed var(--danger);
}
.reroll-rule-note{
  display:inline-block;
  margin-top:3px;
  color:var(--muted);
  font-weight:700;
  line-height:1.25;
}
.dice-selected-note{
  line-height:1.25;
}


/* Test 24: hand route availability */
.route-btn:disabled,
button:disabled.route-btn{
  opacity:.45;
  cursor:not-allowed;
  filter:grayscale(.25);
}


/* Test 26 layout: Condition, Roll, Score, Check, Game Info */
.roll-panel .dice-roll-panel{
  margin-top:8px;
}
.score-entry-panel .route-view-note{
  margin-top:0;
}
.roll-route-reference{
  margin-top:12px;
  border-top:1px solid var(--line);
  padding-top:10px;
}
.roll-route-reference h3{
  margin:0 0 8px;
  color:var(--navy);
  font-size:.98rem;
}
.route-reference-drop{
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  padding:8px 10px;
  margin:7px 0;
}
.route-reference-drop summary{
  cursor:pointer;
  font-weight:900;
  color:var(--navy);
}
.route-reference-drop[open]{
  box-shadow:0 8px 18px rgba(23,54,93,.08);
}


/* Test 27: detected hand score and ordered reroll status */
.detected-hand-box{
  border:1px solid var(--line);
  background:#fffaf1;
  border-radius:12px;
  padding:10px 12px;
  margin:10px 0;
  color:var(--navy);
}


/* Test 28: physical-first condition deck labels */
.deck-info .badge{
  align-self:center;
}
.condition-panel .deck-info{
  gap:8px;
  flex-wrap:wrap;
}
