/* Chain World: consolidated production files. */

/* Source: admin/assets/admin.css */
:root{--green:#0d7d5b;--deep:#082f28;--mint:#e9f7f2;--line:#dcebe6;--ink:#173e35;--muted:#718b84;--gold:#f2b92d;--danger:#d75050;--shadow:0 18px 50px rgba(7,51,40,.11)}
*{box-sizing:border-box}html,body{min-height:100%;margin:0}body{font-family:Inter,"Segoe UI",Arial,sans-serif;color:var(--ink);background:#f3f8f6}button,input,select{font:inherit}button{cursor:pointer}.hidden{display:none!important}.eyebrow{margin:0 0 5px;color:#16926d;font-size:11px;font-weight:900;letter-spacing:.13em;text-transform:uppercase}.muted{color:var(--muted)}
.login-view{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at 20% 10%,rgba(62,210,150,.22),transparent 35%),linear-gradient(145deg,#062720,#0b7657)}.login-card{width:min(100%,430px);padding:36px;border:1px solid rgba(255,255,255,.58);border-radius:30px;background:rgba(255,255,255,.97);box-shadow:0 35px 100px rgba(0,30,23,.35)}.login-card h1{margin:5px 0 7px;font-size:32px}.admin-logo{width:62px;height:62px;margin:13px 0 20px;border-radius:20px;display:grid;place-items:center;color:#fff;background:linear-gradient(145deg,#20b883,#087153);box-shadow:0 10px 0 #066147;font-size:41px;font-weight:900;transform:rotate(-5deg)}.back-link{color:#6c8a82;text-decoration:none;font-size:13px;font-weight:700}.form-stack{display:grid;gap:14px}.login-card .form-stack{margin-top:24px}.form-stack label,.level-fields>label{display:grid;gap:6px;color:#49685f;font-size:12px;font-weight:800}.form-stack input,.form-stack select,.level-fields input,.search-input{width:100%;min-height:46px;border:1px solid var(--line);border-radius:13px;padding:0 13px;color:var(--ink);background:#fff;outline:none}.form-stack input:focus,.form-stack select:focus,.level-fields input:focus,.search-input:focus{border-color:#21a77c;box-shadow:0 0 0 3px rgba(33,167,124,.1)}.primary,.success-button,.soft-button{min-height:46px;border:0;border-radius:13px;padding:0 17px;font-weight:850}.primary{color:#fff;background:linear-gradient(145deg,#18a978,#087052);box-shadow:0 5px 0 #075f47}.primary:active{transform:translateY(3px);box-shadow:0 2px 0 #075f47}.primary.compact{min-height:42px}.form-error{min-height:18px;margin:0;color:var(--danger);font-size:12px}.test-access{margin-top:18px;padding:13px;border-radius:14px;display:flex;align-items:center;gap:9px;background:#edf7f3;color:#64847b;font-size:11px}.test-access span{margin-right:auto}.test-access b,.test-access code{color:#17493d;font-size:12px}
.admin-view{min-height:100vh;display:grid;grid-template-columns:250px 1fr}.sidebar{position:sticky;top:0;height:100vh;padding:25px 18px;display:flex;flex-direction:column;color:#fff;background:linear-gradient(180deg,#083c31,#062b25)}.sidebar-brand{display:flex;align-items:center;gap:11px;margin-bottom:30px;font-size:13px;line-height:1.05;text-transform:uppercase}.sidebar-brand>span{width:43px;height:43px;border-radius:14px;display:grid;place-items:center;color:#087052;background:#fff;font-size:31px;font-weight:900;transform:rotate(-6deg)}.sidebar-brand b{display:block;font-size:15px;letter-spacing:.08em}.sidebar-brand small{display:block;margin-top:5px;color:rgba(255,255,255,.48);font-size:9px;letter-spacing:.12em}.sidebar nav{display:grid;gap:7px}.nav-button{width:100%;min-height:48px;padding:0 12px;border:1px solid transparent;border-radius:13px;display:flex;align-items:center;gap:10px;color:rgba(255,255,255,.65);background:transparent;text-align:left;font-weight:750;font-size:13px}.nav-button span{width:27px;text-align:center;font-size:19px}.nav-button:hover,.nav-button.active{color:#fff;border-color:rgba(255,255,255,.12);background:rgba(255,255,255,.09)}.game-link{margin-top:auto;padding:13px;border-radius:13px;color:#0c4a3c;background:#8ce3b9;text-align:center;text-decoration:none;font-size:12px;font-weight:900}.logout-button{margin-top:9px;padding:11px;border:0;color:rgba(255,255,255,.55);background:transparent;font-size:12px}.workspace{min-width:0;padding:25px clamp(20px,4vw,52px) 60px}.workspace-header{height:68px;margin-bottom:23px;display:flex;align-items:center;gap:14px}.workspace-header h1{margin:0;font-size:27px}.account-pill{margin-left:auto;display:flex;align-items:center;gap:9px}.account-pill>span{width:40px;height:40px;border-radius:13px;display:grid;place-items:center;color:#fff;background:#15956d;font-weight:900}.account-pill b,.account-pill small{display:block}.account-pill b{font-size:12px}.account-pill small{margin-top:2px;color:#8aa099;font-size:10px}.mobile-menu{display:none;width:42px;height:42px;border:0;border-radius:12px;background:#e4f1ed;color:#174b3e}.notice{margin:0 0 18px;padding:13px 16px;border:1px solid #b9e5d4;border-radius:13px;color:#0d6f52;background:#e5f8f0;font-size:13px;font-weight:750}.notice.error{border-color:#f1c0c0;color:#a63232;background:#fff0f0}.section-actions,.editor-heading,.panel-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}.section-actions{margin-bottom:20px}.section-actions h2,.editor-heading h2{margin:0 0 4px;font-size:24px}.section-actions p,.panel-heading p,.publish-panel p{margin:0;color:var(--muted);font-size:12px}.stats-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:16px}.stat-card{padding:17px;border:1px solid var(--line);border-radius:16px;background:#fff}.stat-card span,.moves-box span{display:block;color:var(--muted);font-size:10px;font-weight:800;text-transform:uppercase}.stat-card b{display:block;margin-top:6px;font-size:25px}.table-card,.panel{border:1px solid var(--line);border-radius:20px;background:#fff;box-shadow:0 8px 28px rgba(16,79,63,.05)}.level-row{display:grid;grid-template-columns:58px minmax(180px,1.4fr) 100px 115px 215px;align-items:center;gap:13px;padding:15px 18px;border-bottom:1px solid #e9f1ee}.level-row:last-child{border-bottom:0}.level-number{width:44px;height:44px;border-radius:14px;display:grid;place-items:center;color:#0d684f;background:#e5f6ef;font-weight:900}.level-info b,.level-info small{display:block}.level-info small{margin-top:3px;color:var(--muted);font-size:10px}.difficulty-badge,.status-badge{width:max-content;padding:6px 9px;border-radius:999px;font-size:10px;font-weight:850}.difficulty-badge{color:#805d00;background:#fff4c9}.status-badge.draft{color:#6f7d79;background:#e9efed}.status-badge.tested{color:#166395;background:#e3f2fb}.status-badge.published{color:#0d7657;background:#daf4ea}.row-actions{display:flex;justify-content:flex-end;gap:6px}.row-actions button{min-height:34px;padding:0 10px;border:1px solid var(--line);border-radius:10px;color:#315c51;background:#fff;font-size:10px;font-weight:800}.row-actions button:hover{border-color:#19a779;color:#087052}.empty-state{padding:45px;text-align:center;color:var(--muted)}
.editor-heading{margin-bottom:18px}.soft-button{border:1px solid var(--line);color:#315c51;background:#fff}.soft-button:disabled,.success-button:disabled,.primary:disabled{opacity:.45;cursor:not-allowed;transform:none;box-shadow:none}.success-button{color:#fff;background:#15996f}.editor-layout{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:18px;align-items:start}.editor-main{display:grid;gap:18px}.panel{padding:20px}.level-fields{display:grid;grid-template-columns:1.2fr 1.5fr 90px 90px;gap:13px}.difficulty-field{grid-column:1/-1;margin:4px 0 0;padding:0;border:0}.difficulty-field legend{margin-bottom:8px;color:#49685f;font-size:12px;font-weight:800}.difficulty-field>label{display:inline-flex;margin:0 8px 8px 0}.difficulty-field input{position:absolute;opacity:0}.difficulty-field span{min-width:150px;padding:11px 13px;border:1px solid var(--line);border-radius:13px;display:grid;color:#315c51;background:#fff;font-size:12px;font-weight:850}.difficulty-field small{margin-top:3px;color:var(--muted);font-size:10px}.difficulty-field input:checked+span{border-color:#1aa477;color:#087052;background:#e7f7f1;box-shadow:0 0 0 2px rgba(26,164,119,.09)}.moves-box{grid-column:1/-1;margin-top:3px;padding:15px;border-radius:15px;display:grid;grid-template-columns:1fr auto 1fr auto 1.2fr;align-items:center;gap:12px;background:#f0f7f4}.moves-box>div{text-align:center}.moves-box b{display:block;margin-top:4px;font-size:22px}.moves-box i{color:#9cb0aa;font-style:normal;font-size:21px}.moves-box .total{padding:9px;border-radius:11px;color:#fff;background:#15966e}.moves-box .total span{color:rgba(255,255,255,.7)}.panel-heading h3,.publish-panel h3,.accounts-layout h3{margin:0 0 4px}.panel-heading>b{color:#16936d}.chain-slots-editor{margin-top:15px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.editor-slot{position:relative;min-height:93px;padding:11px;border:1px dashed #c8ddd6;border-radius:14px;display:flex;align-items:center;gap:9px;color:#97aaa5;background:#f8fbfa;transition:.18s}.editor-slot.drag-over{border-color:#17a276;background:#e9f8f2;transform:translateY(-2px)}.editor-slot.filled{border-style:solid;color:var(--ink);background:#fff;box-shadow:0 6px 15px rgba(16,84,66,.07)}.slot-index{flex:0 0 auto;width:27px;height:27px;border-radius:9px;display:grid;place-items:center;color:#0d7456;background:#dff4eb;font-size:10px;font-weight:900}.slot-copy{min-width:0}.slot-copy b,.slot-copy small{display:block}.slot-copy b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}.slot-copy small{margin-top:3px;color:var(--muted);font-size:9px;line-height:1.25}.slot-remove{position:absolute;top:5px;right:5px;width:23px;height:23px;border:0;border-radius:8px;color:#9a625f;background:#fff0ef}.publish-panel{display:flex;align-items:center;justify-content:space-between;gap:18px}.publish-actions{display:flex;gap:8px;flex:0 0 auto}.chain-library{position:sticky;top:18px}.round-button{width:38px;height:38px;border:0;border-radius:12px;color:#fff;background:#15986f;font-size:21px}.search-input{margin-top:13px}.search-input.wide{max-width:520px;margin:0 0 17px}.library-list{max-height:650px;overflow:auto;margin-top:12px;display:grid;gap:8px}.library-chain{width:100%;padding:11px;border:1px solid var(--line);border-radius:13px;color:var(--ink);background:#fff;cursor:grab;text-align:left}.library-chain:hover,.library-chain.selected{border-color:#1aa779;box-shadow:0 0 0 2px rgba(26,167,121,.08)}.library-chain b,.library-chain small{display:block}.library-chain b{font-size:11px}.library-chain small{margin-top:3px;color:var(--muted);font-size:9px}.mini-chain{margin-top:7px;display:flex;align-items:center;gap:3px;overflow:hidden}.mini-chain span{padding:3px 5px;border-radius:6px;color:#5a6f69;background:#f0f5f3;font-size:8px;white-space:nowrap}.mini-chain i{color:#aab8b4;font-size:8px}.chain-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.chain-grid .library-chain{cursor:default;padding:16px}.accounts-layout{display:grid;grid-template-columns:360px minmax(0,1fr);gap:17px}.accounts-list{margin-top:13px}.account-row{padding:12px 0;border-bottom:1px solid #e8f0ed;display:flex;align-items:center;gap:10px}.account-row:last-child{border-bottom:0}.account-avatar{width:37px;height:37px;border-radius:12px;display:grid;place-items:center;color:#fff;background:#1a9c73;font-weight:900}.account-copy b,.account-copy small{display:block}.account-copy b{font-size:12px}.account-copy small{margin-top:3px;color:var(--muted);font-size:10px}.account-role{margin-left:auto;padding:5px 8px;border-radius:999px;color:#176f55;background:#e3f5ee;font-size:9px;font-weight:850}
.modal-backdrop{position:fixed;z-index:50;inset:0;padding:20px;display:grid;place-items:center;background:rgba(5,36,29,.66);backdrop-filter:blur(8px)}.modal-card{position:relative;width:min(100%,760px);padding:27px;border-radius:24px;background:#fff;box-shadow:0 30px 90px rgba(0,25,20,.35)}.modal-card h2{margin:3px 0 18px}.modal-close{position:absolute;top:12px;right:12px;width:35px;height:35px;border:0;border-radius:11px;color:#4b6e65;background:#eaf2ef;font-size:22px}.five-cards{display:grid;grid-template-columns:1fr auto 1fr auto 1fr auto 1fr auto 1fr;align-items:end;gap:5px}.five-cards label{min-width:0}.five-cards input{padding:0 8px}.five-cards span{padding-bottom:15px;color:#9aaba6}.test-backdrop{padding:12px}.test-modal-card{width:min(100%,920px);height:min(95vh,920px);padding:13px;border-radius:23px;background:#fff;display:flex;flex-direction:column}.test-modal-head{padding:4px 52px 11px 8px;display:flex;align-items:center;justify-content:space-between}.test-modal-head h2{margin:0}.modal-close.static{position:static}.test-modal-card iframe{flex:1;width:100%;border:0;border-radius:17px;background:#073b31}
@media(max-width:1100px){.editor-layout{grid-template-columns:1fr}.chain-library{position:static}.library-list{max-height:350px}.chain-grid{grid-template-columns:repeat(2,1fr)}.level-row{grid-template-columns:52px minmax(150px,1fr) 90px 100px}.level-row .moves-cell{display:none}.row-actions{grid-column:2/-1;justify-content:flex-start}.chain-slots-editor{grid-template-columns:repeat(2,1fr)}}
@media(max-width:760px){.admin-view{display:block}.sidebar{position:fixed;z-index:40;left:-270px;width:250px;transition:.2s}.sidebar.open{left:0;box-shadow:20px 0 60px rgba(0,30,23,.3)}.workspace{padding:15px 12px 45px}.mobile-menu{display:block}.account-pill div{display:none}.stats-row{grid-template-columns:repeat(2,1fr)}.section-actions,.editor-heading{align-items:flex-start;flex-wrap:wrap}.level-row{grid-template-columns:46px 1fr;padding:13px}.level-row>.difficulty-badge,.level-row>.status-badge,.level-row>.moves-cell{grid-column:2}.row-actions{grid-column:1/-1}.level-fields{grid-template-columns:1fr 1fr}.level-fields>label:nth-child(-n+2){grid-column:1/-1}.chain-slots-editor{grid-template-columns:1fr}.publish-panel{align-items:flex-start;flex-direction:column}.publish-actions{width:100%}.publish-actions button{flex:1}.chain-grid{grid-template-columns:1fr}.accounts-layout{grid-template-columns:1fr}.five-cards{grid-template-columns:1fr}.five-cards span{display:none}.modal-card{max-height:94vh;overflow:auto}.test-modal-card{height:96vh}.login-card{padding:27px 22px}}

/* Аккуратная таблица уровней: действия больше не попадают под боковое меню. */
.table-card{overflow:hidden}
.level-row{min-height:76px;transition:background .16s ease}
.level-row:hover{background:#fbfefd}
.level-info{min-width:0}
.level-info b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.moves-cell{white-space:nowrap}
.moves-cell b,.moves-cell small{display:block}
.moves-cell small{margin-top:3px;color:var(--muted);font-size:10px}
.row-actions{min-width:0;flex-wrap:wrap;align-items:center}
.row-actions button{white-space:nowrap}
.row-actions button[data-action="edit"]{border-color:#bfe5d7;color:#087052;background:#eaf8f3}
.row-actions button[data-action="test"]{border-color:#d5e4df;background:#f8fbfa}
.row-actions button[data-action="publish"]{border-color:#15996f;color:#fff;background:#15996f}
.row-actions button[data-action="delete"]{border-color:#f0cecb;color:#ac433b;background:#fff4f3}

@media(min-width:1481px){
  .level-row{grid-template-columns:58px minmax(240px,1fr) max-content max-content minmax(150px,170px) minmax(280px,max-content)}
  .row-actions{grid-column:6;grid-row:1;justify-content:flex-end}
}

@media(min-width:1101px) and (max-width:1480px){
  .level-row{grid-template-columns:52px minmax(190px,1fr) 100px 115px 175px;row-gap:9px}
  .row-actions{grid-column:2/-1;grid-row:2;justify-content:flex-start;padding-top:2px}
}

@media(min-width:761px) and (max-width:1100px){
  .level-row{grid-template-columns:52px minmax(180px,1fr) 90px 105px;row-gap:9px}
  .level-row .moves-cell{display:none}
  .row-actions{grid-column:2/-1;grid-row:2;justify-content:flex-start;padding-top:2px}
}

@media(max-width:760px){
  .level-row{row-gap:9px}
  .row-actions{justify-content:flex-start;padding-top:3px}
  .row-actions button{flex:1 1 auto;min-height:38px}
}

/* Действия с цепочками в общей библиотеке. */
.chain-grid .chain-admin-card{min-height:142px;display:flex;flex-direction:column;cursor:default}
.chain-card-copy{min-width:0}
.chain-card-title{display:flex;align-items:center;justify-content:space-between;gap:10px}
.chain-card-title>b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
.chain-card-title>span{flex:0 0 auto;padding:4px 7px;border-radius:999px;color:#52756b;background:#edf5f2;font-size:8px;font-weight:800}
.chain-card-copy>small{min-height:26px;line-height:1.35}
.chain-card-actions{margin-top:auto;padding-top:12px;display:grid;grid-template-columns:1fr 1fr;gap:8px}
.chain-card-actions button{min-height:36px;border:1px solid #bfe5d7;border-radius:10px;color:#087052;background:#eaf8f3;font-size:10px;font-weight:850}
.chain-card-actions button:hover{border-color:#15996f;background:#ddf4eb}
.chain-card-actions button.danger{border-color:#f0cecb;color:#ac433b;background:#fff4f3}
.chain-card-actions button.danger:hover{border-color:#dc6c62;background:#ffe9e7}

@media(max-width:760px){
  .chain-grid .chain-admin-card{min-height:132px}
  .chain-card-actions button{min-height:40px}
}

/* Source: admin/assets/admin-v5.css */
:root {
  --bg:#061124;
  --surface:#0b1d36;
  --surface-soft:#102743;
  --ink:#e9faff;
  --muted:#86a9ba;
  --line:rgba(71,211,255,.2);
  --accent:#39dfff;
  --accent-green:#62ef79;
  --danger:#ff6f7c;
}

body { color:var(--ink); background:#061124; }
body::before {
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(circle at 13% 8%,rgba(41,211,255,.13),transparent 28%),
    radial-gradient(circle at 86% 76%,rgba(66,240,128,.09),transparent 30%),
    linear-gradient(150deg,#071933,#030917 68%);
}

.login-view,.admin-view { position:relative; z-index:1; }
.login-card,.panel,.table-card,.stat-card,.modal-card,.test-modal-card {
  color:var(--ink);
  border-color:var(--line);
  background:linear-gradient(155deg,rgba(14,38,68,.97),rgba(5,19,42,.97));
  box-shadow:0 18px 55px rgba(0,5,20,.34),inset 0 1px rgba(255,255,255,.04);
}
.login-card { border:1px solid rgba(73,213,255,.27); }
.admin-logo,.sidebar-brand>span { color:#052343; background:linear-gradient(145deg,#3de3ff,#63f078); }
.back-link,.muted,.section-actions p,.panel-heading p,.publish-panel p,.level-info small,.account-pill small { color:var(--muted); }
.form-stack label,.level-fields>label { color:#b6dbe5; }
input,select,.search-input {
  color:#eaffff !important;
  border-color:rgba(74,200,235,.24) !important;
  background:#07172d !important;
}
input:focus,select:focus,.search-input:focus { border-color:#37d7ff !important; box-shadow:0 0 0 3px rgba(55,215,255,.12) !important; }

.admin-view { grid-template-columns:270px 1fr; }
.sidebar {
  border-right:1px solid rgba(65,214,255,.18);
  background:linear-gradient(180deg,#071b37,#030b1c);
  box-shadow:14px 0 40px rgba(0,5,20,.18);
}
.sidebar-brand { color:#eaffff; }
.sidebar-brand small { color:#61acc2; }
.nav-button { color:#77a5b8; }
.nav-button:hover,.nav-button.active { color:#fff; border-color:rgba(67,214,255,.22); background:linear-gradient(90deg,rgba(31,178,230,.21),rgba(41,232,134,.08)); }
.game-link { color:#042344; background:linear-gradient(135deg,#3cddff,#63ef76); box-shadow:0 5px 0 #168a78; }
.logout-button { color:#7199aa; }
.workspace { background:transparent; }
.workspace-header { border-bottom:1px solid rgba(63,206,244,.13); }
.account-pill>span { color:#062344; background:linear-gradient(145deg,#3edcff,#64ee75); }
.mobile-menu { color:#55e5ff; background:#0b2849; }
.eyebrow { color:#48dfff !important; }

.primary,.success-button {
  color:#042343;
  border:0;
  background:linear-gradient(135deg,#38dfff,#68ef78);
  box-shadow:0 5px 0 #168c79,0 9px 20px rgba(0,5,20,.25);
}
.primary:hover,.success-button:hover { filter:brightness(1.08); }
.soft-button,.round-button { color:#9cefff; border-color:rgba(70,215,255,.28); background:#0a2748; }
.notice { color:#bdfcef; border-color:rgba(81,238,177,.35); background:rgba(28,119,91,.28); }
.notice.error { color:#ffd5d8; border-color:rgba(255,111,124,.35); background:rgba(130,38,49,.3); }

.stat-card { border-color:rgba(69,207,244,.16); }
.stat-card span,.moves-box span { color:#79a6b7; }
.stat-card b { color:#dffcff; }
.level-row { border-color:rgba(70,209,246,.11); }
.level-row:hover { background:rgba(29,127,173,.08); }
.level-number { color:#092440; background:linear-gradient(145deg,#54dcff,#68ec89); box-shadow:0 4px 0 #178a86; }
.difficulty-badge { color:#ffe59a; background:rgba(179,125,20,.24); }
.status-badge.draft { color:#a9bfca; background:rgba(99,123,137,.2); }
.status-badge.tested { color:#88e8ff; background:rgba(29,139,190,.24); }
.status-badge.published { color:#8ff0b5; background:rgba(25,151,87,.22); }
.row-actions button,.chain-card-actions button { color:#b8ecf6; border-color:rgba(72,205,239,.22); background:#0a223f; }
.row-actions button:hover,.chain-card-actions button:hover { color:#fff; border-color:#42dfff; }
.chain-card-actions button.danger,.row-actions button.danger,.remove-card-image { color:#ff9ba4; border-color:rgba(255,111,124,.25); background:rgba(94,26,40,.42); }
.translation-toolbar {
  grid-column:1/-1;
  padding:13px 14px;
  border:1px solid rgba(67,211,247,.2);
  border-radius:15px;
  display:grid;
  grid-template-columns:minmax(190px,1fr) minmax(190px,260px) auto;
  align-items:end;
  gap:13px;
  color:#dffaff;
  background:linear-gradient(135deg,rgba(13,52,83,.92),rgba(8,31,57,.96));
}
.translation-toolbar b,.translation-toolbar small { display:block; }
.translation-toolbar small { margin-top:4px; color:#7faebd; font-size:10px; }
.translation-toolbar label { display:grid; gap:5px; color:#9fd5df; font-size:10px; font-weight:850; }
.translation-toolbar select { width:100%; min-height:42px; padding:0 11px; border-radius:11px; }
.translation-progress { min-width:72px; min-height:42px; padding:0 10px; border:1px solid rgba(255,196,78,.25); border-radius:11px; display:grid; place-items:center; color:#ffe59a; background:rgba(129,86,13,.24); font-weight:900; }
.translation-progress.complete { color:#8ff0b5; border-color:rgba(85,234,157,.32); background:rgba(19,111,74,.28); }
.chain-translation-toolbar { margin:8px 0 2px; }
.active-language-name { color:#50def8; font-size:9px; font-weight:900; }

.difficulty-field { border-color:rgba(69,210,247,.16); background:rgba(4,15,34,.45); }
.difficulty-field label span { color:#c6e9ef; border-color:rgba(67,208,244,.16); background:#0a203a; }
.difficulty-field input:checked+span { color:#062343; border-color:#63ed7c; background:linear-gradient(135deg,#45dcff,#6bf07b); }
.moves-box { color:#b7dce5; border-color:rgba(66,209,245,.16); background:#07182e; }
.moves-box .total { color:#85f5aa; }
.publish-panel { border-color:rgba(85,234,157,.25); background:linear-gradient(145deg,rgba(20,75,79,.48),rgba(6,29,53,.9)); }

.chain-library { background:linear-gradient(160deg,#0d2745,#07162d); }
.library-chain { color:#def8ff; border-color:rgba(74,205,239,.16); background:#091c34; }
.library-chain:hover,.library-chain.selected { border-color:#42dfff; background:#0b2c4c; box-shadow:0 0 0 3px rgba(65,220,255,.08); }
.library-chain>small,.chain-card-copy>small { color:#78a8b8; }
.editor-slot { border-color:rgba(73,204,238,.18); background:#081b32; }
.editor-slot.filled { border-color:rgba(80,231,158,.28); background:linear-gradient(145deg,rgba(19,75,75,.6),rgba(8,33,56,.9)); }
.slot-index { color:#062544; background:linear-gradient(145deg,#44dfff,#66ed7c); }

.mini-chain { gap:5px; align-items:center; overflow:hidden; }
.mini-chain i { flex:0 0 auto; color:#54dff7; }
.mini-card-item {
  min-width:0;
  flex:1 1 0;
  padding:3px;
  border:1px solid rgba(92,221,250,.18);
  border-radius:9px;
  display:grid !important;
  gap:2px;
  color:#dffaff !important;
  background:#07182d !important;
  text-align:center;
}
.mini-card-item img,.mini-card-fallback { width:100%; height:38px; border-radius:6px; object-fit:cover; }
.mini-card-fallback { display:grid; place-items:center; color:#55e4ff; background:#0c3155; }
.mini-card-item em { overflow:hidden; font-size:7px; font-style:normal; text-overflow:ellipsis; text-transform:uppercase; white-space:nowrap; }

.modal-backdrop { background:rgba(0,5,18,.78); backdrop-filter:blur(12px); }
.modal-card { width:min(96vw,960px); max-height:94vh; padding:27px; overflow:auto; }
.modal-close { color:#72e7ff; background:#0b2a4a; }
.image-spec { padding:14px 16px; border:1px solid rgba(80,218,251,.2); border-radius:15px; display:flex; gap:12px; color:#c8edf4; background:rgba(8,39,70,.62); }
.image-spec-icon { flex:0 0 42px; height:42px; border-radius:12px; display:grid; place-items:center; color:#062442; background:linear-gradient(145deg,#44dfff,#64ef7a); font-size:23px; }
.image-spec b { display:block; margin-bottom:4px; }
.image-spec p { margin:0; color:#87b2c0; font-size:11px; line-height:1.45; }
.image-spec strong { color:#aff8ff; }
.five-card-editors { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; }
.chain-card-editor { position:relative; min-width:0; padding:9px; border:1px solid rgba(71,207,244,.18); border-radius:16px; background:#07182e; }
.card-editor-number { position:absolute; z-index:2; top:14px; left:14px; width:24px; height:24px; border-radius:8px; display:grid; place-items:center; color:#062343; background:#61ec8a; font-size:10px; font-weight:900; }
.card-image-preview { position:relative; aspect-ratio:1; margin-bottom:9px; border:1px solid rgba(76,211,247,.3); border-radius:13px; overflow:hidden; background:#0a2a4a; }
.card-image-preview img { width:100%; height:100%; display:block; object-fit:cover; }
.card-image-preview>span,.card-image-preview>small { display:none; }
.card-image-preview.empty { display:grid; place-items:center; align-content:center; color:#54dff6; border-style:dashed; }
.card-image-preview.empty img { display:none; }
.card-image-preview.empty>span,.card-image-preview.empty>small { display:block; }
.card-image-preview.empty>span { font-size:28px; }
.card-image-preview.empty>small { color:#739ead; font-size:9px; }
.card-editor-fields { display:grid; gap:7px; }
.card-editor-fields label { min-width:0; }
.card-editor-fields input[type=text] { min-width:0; }
.image-upload-button { min-height:35px; padding:0 8px; border:1px solid rgba(68,216,250,.24); border-radius:9px; display:grid !important; place-items:center; color:#a7eff9 !important; background:#0b2b4d; cursor:pointer; text-align:center; }
.image-upload-button input { display:none; }
.remove-card-image { min-height:31px; border:1px solid; border-radius:9px; font-size:9px; font-weight:800; cursor:pointer; }
.image-upload-status { min-height:14px; color:#ff9ba4; font-size:8px; line-height:1.25; }
.image-upload-status.ready { color:#78eaa3; }
#chainFormError { min-height:18px; }

.accounts-list .account-row { border-color:rgba(71,204,239,.12); }
.account-avatar { color:#062442; background:linear-gradient(145deg,#44dfff,#66ef79); }
.account-role { color:#8fe9ff; background:#0a2948; }
.test-modal-card { background:#041126; }

@media(max-width:1100px) {
  .admin-view { grid-template-columns:235px 1fr; }
  .five-card-editors { grid-template-columns:repeat(3,1fr); }
}
@media(max-width:760px) {
  .sidebar { width:260px; }
  .five-card-editors { grid-template-columns:1fr; }
  .chain-card-editor { display:grid; grid-template-columns:115px 1fr; gap:10px; }
  .card-image-preview { margin:0; }
  .modal-card { padding:22px 14px; }
  .mini-card-item img,.mini-card-fallback { height:31px; }
  .translation-toolbar { grid-template-columns:1fr; align-items:stretch; }
  .translation-progress { min-height:36px; }
}

/* Source: admin/assets/brand-v10.css */
/* Shared identity with the supplied Chain World emblem. */
.admin-brand-emblem { display:block; width:136px; height:auto; margin:18px auto 10px; filter:drop-shadow(0 6px 14px #020817); }
.sidebar-brand img { object-fit:contain; width:64px; height:54px; flex:0 0 auto; }
.primary,.success-button,.game-link { color:#092b31; border:1px solid #adf663; background:linear-gradient(150deg,#69edff,#a2ed44); }
.sidebar { background:linear-gradient(180deg,#092a4c,#03121f); }

/* Source: admin/assets/modern-v14.css */
/* V14 shared light palette. Loaded last; existing editor and table geometry stay. */
:root {
  --bg:#e8f4ef;
  --surface:#fcfff9;
  --surface-soft:#edf7ed;
  --green:#348e7c;
  --deep:#234e46;
  --mint:#e6f4e9;
  --ink:#254b43;
  --muted:#6c8778;
  --line:#c9ded0;
  --accent:#489d94;
  --accent-green:#7cbb95;
  --danger:#b56258;
  --shadow:0 12px 35px #35664d12;
}
html { color-scheme:light; background:#eaf4ed; }
body { color:var(--ink); background:#edf6ee; font-family:"Avenir Next",Avenir,"Segoe UI",Arial,sans-serif; }
body::before { background:linear-gradient(145deg,#e2f1e9,#f6faf0 60%,#ecf5e9); }
h1,h2 { color:#2c5145; font-family:Georgia,"Times New Roman",serif; letter-spacing:-.025em; }
button:focus-visible,a:focus-visible { outline:3px solid #4b9b7f; outline-offset:3px; }
.login-view { background:linear-gradient(145deg,#e4f1e9ad,#ecf6e9e0),url('../../assets/lake-background.png') center/cover; }
.login-card,.panel,.table-card,.stat-card,.modal-card,.test-modal-card {
  color:var(--ink);
  border-color:#c8ddcd;
  background:linear-gradient(155deg,#fffefaf7,#f5fbf1f7);
  box-shadow:inset 0 1px #fff,0 10px 30px #2f614414;
}
.login-card { border-color:#fffef2; }
.admin-brand-emblem { filter:drop-shadow(0 4px 7px #3b755720); }
.back-link,.muted,.section-actions p,.panel-heading p,.publish-panel p,.level-info small,.account-pill small { color:var(--muted); }
.form-stack label,.level-fields>label { color:#5d7c66; }
input,select,.search-input {
  color:#2f5140!important;
  border-color:#bfd6bd!important;
  background:#fffff8!important;
}
input::placeholder { color:#94a18a; }
input:focus,select:focus,.search-input:focus { border-color:#6bac86!important; box-shadow:0 0 0 3px #68af8124!important; }
input[type="color"] { padding:5px; }
.sidebar { color:#355c48; border-color:#c0d7c0; background:linear-gradient(180deg,#e9f5e8,#dcebd9); box-shadow:6px 0 20px #31613d0a; }
.sidebar-brand { color:#2b5847; }
.sidebar-brand small { color:#739675; }
.nav-button { color:#638568; }
.nav-button:hover,.nav-button.active { color:#2b785e; border-color:#b7d4b6; background:linear-gradient(90deg,#fafff7,#e1f0db); }
.game-link { color:#fff; border-color:#a7cfa7; background:linear-gradient(145deg,#7dbe96,#3f9a85); box-shadow:0 3px 0 #6b9f79; }
.logout-button { color:#779777; }
.workspace-header { border-color:#cbdfc6; }
.account-pill>span,.account-avatar { color:#fff; background:linear-gradient(145deg,#7bbb91,#469982); }
.mobile-menu { color:#4b8365; background:#e0ecd8; }
.eyebrow { color:#6a9a75!important; }
.primary,.success-button { color:#fff; border:1px solid #b5d6ad; background:linear-gradient(145deg,#78bc95,#3e9b89); box-shadow:inset 0 1px #ddfbd277,0 3px 0 #609b7a,0 6px 12px #456f4020; }
.primary:active { box-shadow:0 1px 0 #609b7a; }
.primary:hover,.success-button:hover { filter:brightness(1.035); }
.soft-button,.round-button { color:#467c5f; border:1px solid #c2d8b9; background:#f8fff1; box-shadow:0 2px 0 #d8e6ca; }
.notice { color:#3f7b52; border-color:#b8d6af; background:#eaf8e0; }
.notice.error { color:#a66651; border-color:#e4c8b0; background:#fff6e7; }
.test-access { color:#77916d; background:#edf6e3; }
.test-access b,.test-access code { color:#4c7452; }
.stat-card { border-color:#d0e1c5; }
.stat-card span,.moves-box span { color:#7b9471; }
.stat-card b { color:#457353; }
.level-row { border-color:#dde9d2; }
.level-row:hover { background:#f3faed; }
.level-number { color:#417858; background:linear-gradient(145deg,#e7f4da,#c8e4ba); box-shadow:0 2px 0 #b1cca5; }
.difficulty-badge { color:#9a7c36; background:#fbf0c9; }
.status-badge.draft { color:#889378; background:#ebeee0; }
.status-badge.tested { color:#4b8183; background:#e0efdf; }
.status-badge.published { color:#4e8756; background:#e1f2d6; }
.row-actions button,.chain-card-actions button { color:#557954; border-color:#c6dbbc; background:#f9fff0; }
.row-actions button:hover,.chain-card-actions button:hover { color:#2c7853; border-color:#79b184; }
.row-actions button[data-action="edit"] { color:#477b55; border-color:#bdd8b5; background:#edf8e4; }
.row-actions button[data-action="test"] { color:#5c815e; border-color:#c9dec0; background:#f9fff0; }
.row-actions button[data-action="publish"] { color:#fff; border-color:#69a17a; background:#73aa7e; }
.chain-card-actions button.danger,.row-actions button.danger,.row-actions button[data-action="delete"],.remove-card-image { color:#ad6e58; border-color:#e3cab3; background:#fff6e9; }
.chain-card-actions button.danger:hover { color:#9d5c47; border-color:#d8af92; background:#ffeedc; }
.translation-toolbar { color:#4a6c49; border-color:#ccdcb9; background:linear-gradient(135deg,#f0f8e4,#e8f2da); }
.translation-toolbar small { color:#83996f; }
.translation-toolbar label { color:#719360; }
.translation-progress { color:#9a823f; border-color:#e5d99d; background:#faf3d8; }
.translation-progress.complete { color:#60945b; border-color:#c0d8a7; background:#e9f6d9; }
.active-language-name { color:#73a16e; }
.difficulty-field { border-color:#d5e3c1; background:none; }
.difficulty-field legend { color:#6c8758; }
.difficulty-field label span { color:#6c875a; border-color:#d0debf; background:#fcfff2; }
.difficulty-field input:checked+span { color:#3f7751; border-color:#8fbc88; background:linear-gradient(145deg,#ecf6d9,#cfe8c4); box-shadow:0 0 0 2px #a0c78d19; }
.difficulty-field small { color:#879b72; }
.moves-box { color:#607e50; border-color:#d5e3c0; background:#eef6df; }
.moves-box i { color:#a1b08b; }
.moves-box .total { color:#fff; background:#7aaa77; }
.moves-box .total span { color:#f0ffe0; }
.publish-panel { border-color:#c7dfb6; background:linear-gradient(145deg,#f3fce5,#e7f2d9); }
.chain-library { background:linear-gradient(160deg,#fcfff4,#edf6df); }
.library-chain { color:#59794b; border-color:#d0e1bc; background:#fffff5; }
.library-chain:hover,.library-chain.selected { border-color:#9abd80; background:#f2fadd; box-shadow:0 0 0 2px #c2d9a333; }
.library-chain>small,.chain-card-copy>small { color:#8b9d71; }
.chain-card-title>span { color:#89a367; background:#f0f5df; }
.editor-slot { color:#a4b18b; border-color:#cbddb5; background:#f6fbea; }
.editor-slot.filled { color:#527243; border-color:#c5d9a9; background:linear-gradient(145deg,#fffff6,#f1f9e1); box-shadow:0 4px 10px #5c7f3820; }
.editor-slot.drag-over { border-color:#79ab72; background:#edf8d9; }
.slot-index { color:#5a864c; background:linear-gradient(145deg,#e5f5cb,#cfdfb5); }
.slot-remove { color:#ad8567; background:#fff3df; }
.slot-copy small { color:#849b69; }
.mini-chain i { color:#a2b580; }
.mini-card-item { color:#587441!important; border-color:#dde8c8; background:#fffff2!important; }
.mini-card-fallback { color:#87a564; background:#f0f8dc; }
.modal-backdrop { background:#395b3470; backdrop-filter:blur(7px); }
.modal-close { color:#7a9460; background:#eaf3d8; }
.image-spec { color:#627d48; border-color:#d5e4bd; background:#f2f8df; }
.image-spec-icon { color:#618d4a; background:linear-gradient(145deg,#e2f4bf,#c4df9f); }
.image-spec p { color:#8a9b6a; }
.image-spec strong { color:#618347; }
.chain-card-editor { border-color:#dce6c4; background:#faffeb; }
.card-editor-number { color:#6c8b44; background:#e0efb6; }
.card-image-preview { border-color:#cedeb0; background:#edf5d5; }
.card-image-preview.empty { color:#94ae6b; }
.card-image-preview.empty>small { color:#9cac7c; }
.image-upload-button { color:#748f50!important; border-color:#d2e1b0; background:#eff7d7; }
.image-upload-status { color:#ae8664; }
.image-upload-status.ready { color:#7ca366; }
.accounts-list .account-row { border-color:#dde6c8; }
.account-role { color:#71934e; background:#eef5d9; }
.test-modal-card { background:#f3f8e6; }
.test-modal-card iframe { background:#e8f3e6; }
@media(max-width:760px) { .sidebar.open { box-shadow:15px 0 40px #375c3130; } }

/* Source: assets/card-art-v18.css */
.cw-card-art { display:block; width:100%; min-width:0; overflow:hidden; border-radius:5px; pointer-events:none; }
#app .card-front>.cw-card-art,#cardDragLayer .card-front>.cw-card-art {
  height:auto; min-height:0; flex:1 1 0; border:0; background:#f3f8ee;
}
.mini-card-item>.cw-card-art { width:100%; height:38px; flex:none; border-radius:6px; background:#f3f8ee; }
.card-image-preview>.cw-card-art { width:100%; height:100%; background:#f3f8ee; }
.card-image-preview.empty>.cw-card-art { display:none; }
@media(max-width:600px) { .mini-card-item>.cw-card-art { height:31px; } }

/* The chain workshop: generated cards, shared review queue, and resumable tests. */
:root { --ink:#244e4c; --muted:#6e8c83; --line:#c9dfd3; }
.workspace { min-width:0; }
.pending-tests { margin-bottom:18px; background:linear-gradient(125deg,#fafff5,#e9f7ef); }
.pending-tests-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(235px,1fr)); gap:10px; margin-top:15px; }
.pending-test { display:flex; gap:10px; align-items:center; padding:12px; border:1px solid #d5e6d9; border-radius:15px; background:#ffffffb3; }
.pending-test>div { flex:1; min-width:0; }
.pending-test b,.pending-test small { display:block; }
.pending-test b { font-size:13px; font-weight:750; }
.pending-test small { margin-top:4px; color:#6e8c83; font-size:11px; line-height:1.5; }
.pending-test .level-number { width:36px; height:36px; flex:0 0 auto; }
.pending-test button { min-height:38px; padding:0 11px; font-size:11px; flex:0 0 auto; }
button:focus-visible,summary:focus-visible { outline:3px solid #6baaa2; outline-offset:3px; }
.ai-entry { white-space:nowrap; min-height:37px; padding:0 12px; }
#chainForm { width:min(1200px,100%); min-width:0; background:linear-gradient(130deg,#fffff8,#f1faf3); border:1px solid #d4e3d2; }
#chainForm>h2 { margin-bottom:0; font-family:Georgia,serif; letter-spacing:-.03em; font-size:clamp(25px,4vw,36px); color:#295f59; }
#chainForm label { line-height:1.5; }
#chainForm input,#chainForm select { font-size:13px; color:#365e56!important; background:#fcfff9!important; border-color:#cbded0!important; }
#chainForm input[readonly] { color:#5a766d!important; background:#f3f8ee!important; }
#chainForm input:focus,#chainForm select:focus { border-color:#6bafa0!important; box-shadow:0 0 0 3px #82c1ae22!important; }
.ai-studio { padding:20px; border:1px solid #c5dfd0; border-radius:21px; background:radial-gradient(ellipse at top right,#fffbda99,transparent 65%),linear-gradient(135deg,#e5f5ed,#f4faf0); }
.ai-studio-heading { display:flex; align-items:center; gap:14px; }
.ai-studio-icon { flex:0 0 49px; height:49px; display:grid; place-items:center; font-size:28px; color:#487a60; border:1px solid #c9dbc3; border-radius:17px; background:linear-gradient(140deg,#fffff5,#ddeed6); box-shadow:inset 0 1px white,0 3px 0 #bbd5be; }
.ai-studio h3,.chain-preview-heading h3 { margin:0 0 5px; font-size:18px; letter-spacing:-.025em; color:#2f6258; }
.ai-studio p,.chain-preview-heading p { margin:0; color:#759184; line-height:1.6; font-size:12px; }
.ai-generate-controls { display:flex; align-items:end; gap:12px; margin-top:20px; flex-wrap:wrap; }
.ai-generate-controls>label { width:180px; display:grid; gap:5px; }
.ai-generate-controls select { width:100%; min-height:46px; border-radius:12px; padding:8px 12px; }
.ai-generate-controls button { min-height:46px; margin-bottom:2px; }
.ai-progress { margin-top:17px; padding:13px; border:1px solid #bddbcd; border-radius:13px; display:flex; align-items:center; gap:12px; background:#fbfff7; color:#46786b; font-size:13px; line-height:1.5; }
.ai-progress>span:nth-child(2) { flex:1; }
.ai-progress button { min-height:33px; padding:6px 10px; font-size:10px; }
.ai-spinner { flex:0 0 19px; height:19px; border:2px solid #d4e7da; border-top-color:#4eaa94; border-radius:50%; animation:admin-ai-spin 1s linear infinite; }
.ai-studio .ai-help { margin-top:15px; font-size:11px; }
.ai-drafts { margin-top:14px; border-top:1px solid #d1e3d5; padding-top:12px; }
.ai-drafts>summary { cursor:pointer; color:#5e8573; font-size:12px; font-weight:650; }
.ai-drafts-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:8px; padding-top:12px; }
.ai-draft-row { padding:10px 12px; border:1px solid #d3e3d3; border-radius:12px; background:#fdfff8; color:#436f61; text-align:left; }
.ai-draft-row b,.ai-draft-row span { display:block; }
.ai-draft-row b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
.ai-draft-row span { margin-top:4px; color:#839b8b; font-size:10px; }
.chain-preview-heading { display:flex; align-items:center; justify-content:space-between; gap:15px; margin-top:10px; }
#chainCardEditors { grid-template-columns:repeat(auto-fit,minmax(175px,1fr)); align-items:start; gap:18px 13px; }
#chainCardEditors .chain-card-editor { display:block; padding:11px; border:1px solid #d3e2d2; border-radius:20px; background:#eef6ea9c; }
.admin-playing-card { position:relative; width:min(100%,190px); margin:0 auto 15px; padding:24px 7px 9px; aspect-ratio:0.68; display:flex; flex-direction:column; gap:8px; border:2px solid #fffff8; border-radius:16px; background:linear-gradient(155deg,#fffff8,#f0faeb); box-shadow:0 0 0 1px #c4dcc9,inset 0 0 0 2px #d8e9d6,0 3px 0 #b7d1bc,0 7px 15px #376b4820; }
.admin-playing-card .card-editor-number { top:7px; left:0; right:0; width:auto; height:auto; border-radius:0; background:transparent; color:#71927a; text-align:center; font-size:10px; font-weight:650; }
.admin-playing-card .card-image-preview { width:100%; aspect-ratio:1; border:0; border-radius:10px; margin:0; flex:1; min-height:0; background:linear-gradient(140deg,#e7f6e9,#f4f9e8); }
.admin-playing-card .card-image-preview img,.admin-playing-card .card-image-preview>.cw-card-art { width:100%; height:100%; object-fit:contain; background:transparent; }
.admin-playing-card .card-image-preview>small { text-align:center; padding:0 8px; font-size:10px; }
.card-preview-word { display:flex; align-items:center; justify-content:center; min-height:35px; color:#315e4e; font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; font-size:14px; font-weight:650; text-align:center; line-height:1.18; overflow-wrap:anywhere; padding:0 4px; }
#chainCardEditors .card-editor-fields label { font-size:10px; font-weight:600; color:#648372; }
#chainCardEditors .card-editor-fields input { padding:8px; width:100%; min-height:39px; font-size:12px; }
.ai-card-actions { display:grid; gap:7px; }
.ai-managed .ai-card-actions { display:grid; }
.ai-managed .manual-card-control { display:none!important; }
.ai-card-actions button { min-height:37px; padding:7px 8px; border-color:#c4dcca; background:#fbfff5; font-size:10px; font-weight:600; }
.chain-card-editor.ai-working { border-color:#71b69b; box-shadow:0 0 0 3px #95c9b129; }
.chain-card-editor.ai-working .image-upload-status { color:#34775f; font-weight:650; }
.level-chain-count-toolbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:14px; margin-top:18px; padding:15px 17px; border:1px solid #d2e5d5; border-radius:16px; background:linear-gradient(120deg,#f6fbeb,#edf8f1); }
.level-chain-count-toolbar label { font-size:13px; font-weight:700; color:#386c5d; }
.level-chain-count-toolbar p { margin:5px 0 0; font-size:11px; line-height:1.5; color:#729083; }
.level-chain-count-stepper { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.level-chain-count-stepper button { min-width:44px; min-height:44px; padding:8px; border-radius:12px; font-size:21px; }
.level-chain-count-stepper input { width:68px; min-height:44px; padding:8px 3px 8px 9px; border:1px solid #b7d6c3; border-radius:12px; background:#fffff7; color:#326e5d; text-align:center; font-family:inherit; font-size:18px; font-weight:700; line-height:1.2; }
.level-chain-count-stepper input:focus { outline:2px solid #89bda4; outline-offset:2px; }
.level-chain-count-stepper button:focus-visible { outline:2px solid #89bda4; outline-offset:2px; }
#chainCardEditors .image-upload-status { min-height:26px; font-size:10px; line-height:1.4; text-align:center; }
#chainCardEditors .image-upload-status.ready { color:#6c9677; }
#chainSubmitButton { position:sticky; bottom:0; width:100%; margin-top:4px; z-index:3; min-height:50px; background:linear-gradient(135deg,#77b997,#40968a); box-shadow:0 -8px 20px #f4faf0cc,0 3px 0 #5e9675; }
.chain-level-target { padding:14px; border:1px solid #caddc7; border-radius:14px; background:#eef7e8; }
.chain-level-target select { margin-top:6px; width:100%; }
.test-window-actions { display:flex; gap:10px; align-items:center; }
.test-window-actions .soft-button { min-height:36px; padding:0 12px; }
.test-window-note { margin:0; padding:0 18px 12px; font-size:11px; color:#78937f; line-height:1.5; }
.test-modal-card { display:flex; flex-direction:column; height:min(94dvh,1000px); overflow:hidden; }
.test-modal-card iframe { flex:1; min-height:0; width:100%; height:auto; border:0; }
.test-dock { position:fixed; z-index:45; right:22px; bottom:22px; display:flex; align-items:center; gap:14px; max-width:calc(100vw - 32px); padding:13px; border:1px solid #bad7c7; border-radius:19px; background:#fafff5; box-shadow:0 12px 35px #345c402a; }
.test-dock b,.test-dock small { display:block; }
.test-dock b { font-size:13px; color:#386654; }
.test-dock small { margin-top:3px; font-size:10px; color:#819a86; }
.test-dock .primary { min-height:37px; padding:0 12px; }
.test-dock .modal-close { width:30px; height:30px; }
@keyframes admin-ai-spin { to { transform:rotate(360deg); } }
@media(max-width:760px) {
  #chainForm { padding:21px 14px; max-height:95dvh; }
  .ai-studio { padding:15px; }
  .ai-studio-heading { align-items:flex-start; gap:11px; }
  .ai-studio h3 { font-size:17px; }
  .ai-studio-icon { flex-basis:39px; height:39px; border-radius:13px; }
  .ai-generate-controls>label { width:100%; }
  .ai-generate-controls>button { flex:1 1 130px; padding:8px; font-size:12px; }
  .ai-progress { flex-wrap:wrap; }
  .ai-progress button { margin-left:30px; }
  #chainCardEditors { grid-template-columns:repeat(2,minmax(0,1fr)); gap:15px 8px; }
  #chainCardEditors .chain-card-editor { padding:8px; }
  .admin-playing-card { padding:22px 5px 6px; border-radius:13px; }
  .card-preview-word { font-size:12px; min-height:30px; }
  .chain-preview-heading h3 { font-size:17px; }
  .pending-tests .panel-heading { align-items:flex-start; }
  .pending-tests-list { grid-template-columns:1fr; }
  .test-dock { bottom:12px; right:12px; gap:9px; }
  .test-window-note { font-size:10px; }
  .test-modal-card { width:100%; height:96dvh; }
}
@media(max-width:380px) { #chainCardEditors { grid-template-columns:1fr; } .chain-card-editor .admin-playing-card { max-width:170px; } }
@media(prefers-reduced-motion:reduce) { .ai-spinner { animation-duration:2.5s; } }

/* Account creation and the retained first administrator. */
.primary-account-note { margin:0 0 18px; padding:15px 18px; border:1px solid #bcdcca; border-radius:17px; color:#426b57; background:linear-gradient(120deg,#f9fce9,#e7f5eb); font-size:13px; line-height:1.55; }
#accountForm { align-self:start; gap:14px; }
#accountForm h3,#accountForm .eyebrow { margin:0; }
#accountForm label>small { display:block; margin-top:7px; line-height:1.5; font-size:11px; }
#accountFormError:empty { display:none; }
#accountForm .form-error { margin:0; font-size:12px; }
#accountRoleHelp { margin:0; font-size:12px; line-height:1.55; }
.account-form-success { margin:0; padding:12px; border:1px solid #b8d9bd; border-radius:12px; background:#edf8e8; color:#315f43; font-size:12px; line-height:1.5; }
.account-total { display:grid; place-items:center; min-width:30px; min-height:30px; border-radius:11px; color:#44745d; background:#e9f5e5; font-size:13px; font-weight:650; }
.accounts-list .account-row { flex-wrap:wrap; gap:12px; padding:15px 6px; }
.accounts-list .primary-account { padding:16px 12px; border:1px solid #d0e2c1; border-radius:16px; background:#f5fae9; margin-bottom:6px; }
.account-copy { flex:1; min-width:100px; overflow-wrap:anywhere; }
.account-avatar { flex:0 0 37px; }
.account-badges { display:flex; flex-wrap:wrap; gap:5px; margin-top:7px; }
.account-badges:empty { display:none; }
.account-primary-badge,.account-you-badge { padding:3px 7px; border-radius:7px; color:#638b4e; background:#e5f0d5; font-size:10px; line-height:1.3; }
.account-you-badge { color:#397e72; background:#dff2ed; }
@media(max-width:950px) { .accounts-layout { grid-template-columns:1fr; } }

/* Existing card art is also the visual reference for the AI illustrator. */
.ai-house-style { display:flex; align-items:center; gap:17px; margin:18px 0; padding:14px; border:1px solid #cfdfc9; border-radius:17px; background:linear-gradient(120deg,#fafff3,#eaf6ea); }
.ai-house-style b { display:block; color:#416b50; font-size:13px; font-weight:650; }
.ai-house-style p { margin:5px 0 0; color:#6a8a72; font-size:12px; line-height:1.5; }
.ai-style-samples { display:flex; flex:0 0 auto; gap:6px; }
.ai-style-samples>svg { display:block; width:54px; height:66px; padding:6px 2px; border:2px solid #fffff4; border-radius:9px; background:#eff9ed; box-shadow:0 0 0 1px #cadfc6,0 3px 0 #c2d9bd; overflow:hidden; }
@media(max-width:600px) { .ai-house-style { align-items:flex-start; gap:12px; flex-direction:column; } .ai-style-samples>svg { width:47px; height:56px; } }

/* Shared level editor and library actions. */
.editor-heading>div:not(.editor-actions) { flex:1; min-width:150px; }
.editor-actions { display:flex; align-items:center; flex-wrap:wrap; gap:9px; }
.editor-actions .danger { color:#a5624c; border-color:#e3c7b7; background:#fff5ea; }
.editor-actions .danger:hover { color:#87422d; border-color:#c18d75; background:#ffeddd; }
.editor-actions .danger:disabled { opacity:.45; cursor:not-allowed; }
.pending-test { flex-wrap:wrap; }
.pending-test>.pending-test-actions { flex:1 0 100%; display:flex; flex-wrap:wrap; gap:8px; padding-top:4px; }
.pending-test-actions button { flex:1; }
.library-entry { min-width:0; border:1px solid #d0e1bc; border-radius:14px; overflow:hidden; background:#fffff5; }
.library-entry>.library-chain { border:0; border-radius:13px 13px 0 0; box-shadow:none; }
.library-entry>.library-chain.selected { background:#eaf5d9; box-shadow:inset 0 0 0 2px #92b778; }
.library-entry>.library-chain[draggable],.editor-slot[draggable] { -webkit-user-select:none; user-select:none; cursor:grab; }
.library-entry>.library-chain .mini-chain { pointer-events:none; }
.library-entry>.library-chain img { -webkit-user-drag:none; }
.library-chain.chain-dragging,.editor-slot.chain-dragging { opacity:.55; cursor:grabbing; }
.library-entry>.library-chain:focus-visible,.editor-slot:focus-visible { outline:3px solid #79ab72; outline-offset:2px; }
.library-entry>.chain-card-actions { padding:0 10px 10px; margin:0; gap:7px; }
.library-entry>.chain-card-actions button { min-height:40px; padding:6px; font-size:11px; }
.library-entry button:focus-visible,.editor-actions button:focus-visible,.pending-test-actions button:focus-visible { outline:3px solid #619f8b; outline-offset:-3px; }
@media(max-width:760px) {
  .editor-actions { width:100%; display:grid; grid-template-columns:repeat(auto-fit,minmax(145px,1fr)); }
  .editor-actions button { width:100%; }
}

/* Theme selection and saved-level usage filters. */
.ai-theme-controls { display:grid; grid-template-columns:minmax(0,1fr); gap:12px; margin-top:16px; }
.ai-theme-controls label { min-width:0; }
.ai-theme-controls select,.ai-theme-controls input { width:100%; }
#chainThemeHelp { margin:10px 0 16px; line-height:1.5; }
.library-toolbar { display:flex; align-items:flex-end; flex-wrap:wrap; gap:12px; }
.library-toolbar .library-search-label { flex:1 1 240px; }
.library-filters { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.library-toolbar>.library-filters { flex:1 1 350px; }
.library-filters label,.library-search-label { display:grid; gap:6px; min-width:0; color:#507663; font-size:11px; font-weight:650; }
.library-filters select { width:100%; min-width:0; min-height:44px; padding:8px 10px; border:1px solid #c5dcc7; border-radius:12px; font-family:inherit; font-size:12px; }
.library-toolbar .search-input { margin:0; min-height:44px; }
.library-toolbar>.soft-button { min-height:44px; }
.chain-library>.library-filters { margin-top:12px; grid-template-columns:1fr; }
.library-filter-help { margin:10px 0 7px; color:#738b78; font-size:11px; line-height:1.5; }
.library-summary { margin:8px 0 14px; color:#446b54; font-size:12px; font-weight:600; line-height:1.6; }
.chain-library .library-summary { font-size:10px; }
.chain-library .library-list { margin-top:0; }
.chain-usage-badge,.chain-assigned-badge { display:inline-block; max-width:100%; padding:5px 8px; margin:9px 6px 0 0; border:1px solid #c5ddc7; border-radius:9px; color:#416d51; background:#edf6e8; font-size:10px; font-weight:600; line-height:1.3; white-space:normal; }
.chain-usage-badge.unused { color:#8b6b34; border-color:#e7d8b1; background:#fff8df; }
.chain-assigned-badge { color:#3a7a75; border-color:#bcded5; background:#e6f5ef; }
.library-list>.empty-state { padding:25px 12px; font-size:12px; line-height:1.6; }
.chain-grid>.empty-state { grid-column:1/-1; }
.library-filters select:focus-visible,.library-toolbar button:focus-visible { outline:3px solid #619f8b; outline-offset:2px; }
@media(max-width:600px) {
  .library-toolbar>.library-filters { flex-basis:100%; }
  .library-toolbar>.soft-button { width:100%; }
  .library-filters { grid-template-columns:1fr; }
  .library-summary { font-size:11px; }
}

/* Keep the editor within its grid and contain the visually hidden radios.
   The shared input rule gave absolute radios a viewport-wide hit area. */
.admin-view { width:100%; grid-template-columns:270px minmax(0,1fr); }
.editor-main,.editor-layout,.editor-main>.panel,.level-fields>label,.translation-toolbar>* { min-width:0; }
.editor-main { grid-template-columns:minmax(0,1fr); }
.level-fields { grid-template-columns:minmax(0,1fr) minmax(0,1fr) 90px; }
.level-fields>#reshuffleLevelButton { align-self:center; }
#levelCompositionHelp { grid-column:2/-1; }
.level-fields>.translation-toolbar { grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr)); }
.moves-box { grid-template-columns:minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1.2fr); }
.moves-box>div { min-width:0; overflow-wrap:anywhere; }
.publish-panel { flex-wrap:wrap; }
.publish-actions { min-width:0; max-width:100%; flex-wrap:wrap; }
.publish-actions button { flex:1 1 145px; min-width:0; }
.difficulty-field { min-width:0; max-width:100%; }
.difficulty-field>label { position:relative; max-width:100%; cursor:pointer; }
.difficulty-field input[type=radio] {
  position:absolute; top:0; left:0; width:1px; height:1px; min-height:0;
  margin:0; padding:0; border:0; overflow:hidden; clip-path:inset(50%); opacity:0;
}
.difficulty-field input[type=radio]:focus-visible+span { outline:3px solid #619f8b; outline-offset:3px; }
@media(min-width:761px) and (max-width:1100px) {
  .admin-view { grid-template-columns:235px minmax(0,1fr); }
}
@media(max-width:1100px) {
  .editor-layout { grid-template-columns:minmax(0,1fr); }
  .level-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .level-fields>label:first-of-type,#reshuffleLevelButton,#levelCompositionHelp { grid-column:1/-1; }
}
@media(max-width:400px) {
  .moves-box { gap:5px; padding:10px; }
}
