/* V51 phase library and designer, with the original card illustrations. */
#gameScreen #phasePanel .phase-game-plan{pointer-events:auto!important}
#phasePickerDialog [hidden],#phaseEditorDialog [hidden]{display:none!important}
.phase-create-summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px;border:1px solid #ad96655c;border-radius:16px;background:linear-gradient(125deg,#2e203ce0,#102633d9)}
.phase-create-summary small{display:block;font-size:10px;letter-spacing:.13em;color:#dcbf82}.phase-create-summary strong{display:block;margin:4px 0;font-family:Georgia,serif;color:#ffe5b4}.phase-create-summary p{font-size:12px;color:#c4bdca;margin:0}.phase-create-summary .btn{flex-shrink:0;font-size:12px}
#phasePickerDialog{width:min(1120px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto}#phaseEditorDialog{width:min(720px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto}
#phasePickerDialog *,#phaseEditorDialog *{box-sizing:border-box;min-width:0}#phasePickerDialog,#phaseEditorDialog{background:radial-gradient(ellipse at 0 0,#41305288,transparent 60%),linear-gradient(140deg,#182532,#20152d);color:#f2e4cb;border:1px solid #d6b97888;box-shadow:0 15px 80px #0009}
.phase-presets,.phase-filters,.phase-share-actions{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}.phase-presets button,.phase-filters button,.phase-own-actions button,.phase-order-buttons button{border:1px solid #bfa46960;background:#202b39;color:#edd3a0;border-radius:9px;padding:8px 12px;cursor:pointer}.phase-filters [aria-pressed=true]{background:#56432e;border-color:#dcbc75}.phase-picker-columns{display:grid;grid-template-columns:minmax(0,1fr) minmax(310px,.9fr);gap:20px}.phase-picker-columns.is-readonly{grid-template-columns:1fr}.phase-library,.phase-plan{min-width:0}.phase-search{display:grid;gap:6px}.phase-search input{width:100%}.phase-catalog-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;max-height:540px;overflow-y:auto;padding-right:3px;overscroll-behavior:contain}.phase-choice{overflow:hidden;border:1px solid #c5a86a3d;border-radius:14px;background:#0d1722a8}.phase-choice.is-selected{border-color:#efcb87;background:linear-gradient(140deg,#59432d90,#172531)}.phase-choice-main{display:block;width:100%;text-align:left;border:0;border-radius:0;background:transparent;color:#f2e4cb;padding:13px;cursor:pointer}.phase-choice-main:disabled{cursor:default;opacity:1}.phase-choice-top{display:flex;justify-content:space-between;gap:6px;align-items:center;font-size:10px;color:#cdb789;letter-spacing:.05em}.phase-choice-main strong{display:block;margin:7px 0;font:18px Georgia,serif}.phase-choice-main p{font-size:11px;line-height:1.45;color:#c4c6ce;margin:0 0 8px}.phase-choice-mark{display:block;font-size:11px;color:#f1d491;margin-top:9px}.phase-mini-cards{display:flex;gap:4px;align-items:center}.phase-mini-cards img{width:26px;height:39px;object-fit:contain;border-radius:3px}.phase-own-actions{display:flex;gap:6px;padding:0 10px 10px;flex-wrap:wrap}.phase-own-actions button{font-size:10px;padding:5px 8px}
.phase-plan{border:1px solid #c5a86a40;background:#0a1524a8;border-radius:17px;padding:16px}.phase-plan-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}.phase-plan-heading h4{margin:0;font:22px Georgia,serif}.phase-plan-heading strong{color:#f2d591;white-space:nowrap}.is-invalid{color:#ffadac!important}.phase-plan ol{list-style:none;padding:0;margin:0;max-height:600px;overflow:auto;overscroll-behavior:contain}.phase-plan li{display:flex;align-items:flex-start;gap:11px;border-bottom:1px solid #c5a86a25;padding:11px 0}.phase-plan li:last-child{border-bottom:0}.phase-plan li[draggable=true]{cursor:grab}.phase-step{display:grid;place-items:center;width:30px;height:30px;flex-shrink:0;border-radius:50%;border:1px solid #dbbe7b6b;background:#4b3936;color:#f6d995;font:17px Georgia,serif}.phase-plan li>div:nth-child(2){flex:1}.phase-plan li strong{display:block;font-size:13px;line-height:1.35}.phase-plan li p{margin:4px 0 0;color:#b8beca;font-size:11px;line-height:1.4}.phase-order-buttons{display:grid;grid-template-columns:repeat(3,28px);gap:3px;flex-shrink:0}.phase-order-buttons button{padding:0;min-height:30px}.phase-order-buttons button:disabled{opacity:.25}.phase-error{min-height:18px;color:#ffb2af;font-size:12px}.phase-error:empty{margin:0;min-height:0}.phase-editor-group{display:grid;grid-template-columns:1.35fr .5fr 1fr 34px;gap:10px;align-items:end;padding:13px;border:1px solid #d0af6a55;border-radius:13px;margin:0}.phase-editor-group legend{font:14px Georgia;color:#f0cf91;padding:0 8px}.phase-editor-group label{display:grid;gap:5px;font-size:11px}.phase-editor-group select{width:100%;padding:8px}.phase-editor-group>button{border:1px solid #c09b755a;color:#ecd49e;background:#3d2636;border-radius:8px;min-height:38px;font-size:22px}.phase-editor-group>button:disabled{opacity:.3}#phaseEditorGroups{display:grid;gap:12px}.phase-extra-rules{display:grid;gap:8px}.phase-editor-preview{padding:16px;border:1px solid #d0af6a55;border-radius:15px;background:#08162499}.phase-editor-preview p{font-size:13px;color:#d8d7de;line-height:1.5}.phase-editor-preview small{display:block;margin-top:10px;color:#aab9ca;font-size:11px}.phase-preview-cards{display:flex;gap:5px;flex-wrap:wrap}.phase-preview-cards img{width:36px;height:54px;object-fit:contain;border-radius:4px}.phase-requirement{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:#c2c4cd;font-size:11px;line-height:1.4;margin-top:5px}.phase-game-plan{font-size:10px;background:transparent;border:0;color:#e7c986;padding:4px 8px;cursor:pointer}.phase-room-plan{font-size:11px!important;padding:5px 9px!important}.phase-plan-heading,#phasePickerDialog .modal-actions{flex-shrink:0}
@media(max-width:900px){.phase-picker-columns{grid-template-columns:1fr}.phase-catalog-list{max-height:280px;grid-template-columns:repeat(2,minmax(0,1fr))}.phase-plan ol{max-height:440px}.phase-create-summary{align-items:flex-start;flex-wrap:wrap}.phase-editor-group{grid-template-columns:minmax(0,1fr) 64px 30px}.phase-editor-group label:nth-of-type(3){grid-column:1 / 3}.phase-editor-group>button{grid-column:3;grid-row:1 / 3}.phase-plan{padding:13px}.phase-plan-heading h4{font-size:20px}.phase-requirement{font-size:9px}.phase-game-plan{font-size:9px}}
@media(max-width:420px){#phasePickerDialog,#phaseEditorDialog{padding:16px}.phase-catalog-list{gap:7px}.phase-choice-main{padding:10px}.phase-choice-main strong{font-size:16px}.phase-presets button,.phase-filters button{font-size:11px;padding:7px 10px}.phase-order-buttons{grid-template-columns:repeat(3,25px)}.phase-plan li{gap:8px}.phase-plan-heading{gap:5px}.phase-editor-preview{padding:12px}.phase-plan-heading strong{font-size:12px}}
/* Three to five groups share one player heading on a small table. */
@media(max-width:900px),(pointer:coarse){
 #gameScreen #meldArea.mp-melds-center-v24 .player-meld-cluster.mp-phase-many-groups{width:100%!important;gap:3px!important}
 #gameScreen #meldArea.mp-melds-center-v24 .player-meld-cluster.mp-phase-many-groups::before{content:attr(data-owner-name);flex:0 0 100%;width:100%;text-align:center;font:bold 10px Georgia,serif;color:#f5d99b;padding:2px 0}
 #gameScreen #meldArea.mp-melds-center-v24 .player-meld-cluster.mp-phase-many-groups>.table-meld::before{display:none!important}
 #gameScreen #meldArea.mp-melds-center-v24 .player-meld-cluster.mp-phase-many-groups .meld-cards{gap:2px!important}
}
