.op-shell {
  --op-ink: #f4fbff;
  --op-muted: #aebed7;
  width: 100%;
  margin: 0 auto;
  padding: clamp(12px, 2.2vw, 26px);
  border: 1px solid rgba(137, 218, 232, .18);
  border-radius: 28px;
  color: var(--op-ink);
  background: radial-gradient(circle at 83% -6%, rgba(104, 227, 227, .18), transparent 31%), radial-gradient(circle at 0 90%, rgba(149, 99, 236, .16), transparent 34%), #10162b;
  box-shadow: 0 22px 80px rgba(3, 7, 22, .36);
}
.op-shell, .op-shell * {box-sizing:border-box;}

.op-shell button {cursor: pointer; touch-action: manipulation;}
.op-shell button:disabled {cursor: not-allowed; opacity: .45;}
.op-shell button:focus-visible {outline: 3px solid #b1f6ec; outline-offset: 3px;}
.op-shell .op-hero {display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px;}
.op-shell .op-hero h2 {font-size: clamp(1.65rem, 3.4vw, 2.8rem); line-height: 1.07; letter-spacing: -.04em; margin: 4px 0 5px;}
.op-shell .op-hero p {margin: 0; color: var(--op-muted); font-size: .95rem;}
.op-shell .op-eyebrow {font-size: .65rem; letter-spacing: .19em; font-weight: 900; color: #8bece4;}
.op-shell #opMissions {border-radius: 12px; white-space: nowrap; border-color: rgba(132, 236, 231, .27);}
.op-shell .op-hud {display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-bottom: 10px;}
.op-shell .op-hud > div {min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 9px 14px; border-radius: 13px; border: 1px solid rgba(174, 227, 235, .12); background: rgba(255, 255, 255, .055);}
.op-shell .op-hud small {color: var(--op-muted); font-size: .63rem; font-weight: 900; letter-spacing: .13em; white-space: nowrap;}
.op-shell .op-hud strong {color: #eeffff; font-size: .98rem; white-space: nowrap;}
.op-shell .op-layout {display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 285px); gap: 12px; align-items: stretch;}
.op-shell .op-stage {min-width: 0; position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: 20px; background: #111b32; border: 1px solid rgba(136, 218, 231, .2);}
.op-shell canvas {display: block; width: 100%; height: clamp(460px, 59vw, 680px); min-width: 0; touch-action: none; outline: none;}
.op-shell .op-loading {position: absolute; inset: 0 0 42px; z-index: 3; display: grid; place-items: center; background: rgba(13, 25, 44, .8); color: #dafaf9; font-weight: 800; letter-spacing: .08em; text-align: center; padding: 20px;}
.op-shell .op-overlay {position: absolute; inset: 0 0 42px; z-index: 2; display: flex; justify-content: center; align-items: center; padding: 16px; overflow: auto; background: rgba(12, 19, 36, .72); backdrop-filter: blur(7px);}
.op-shell .op-overlay[hidden], .op-shell .op-loading[hidden] {display: none;}
.op-shell .op-card {max-width: 600px; width: 100%; max-height: 100%; overflow: auto; padding: clamp(16px, 2.2vw, 28px); border: 1px solid rgba(166, 237, 236, .35); border-radius: 23px; background: linear-gradient(155deg, rgba(35, 55, 79, .96), rgba(24, 31, 60, .98)); box-shadow: 0 23px 85px rgba(0, 0, 0, .45); text-align: center; scrollbar-width: thin;}
.op-shell .op-card-kicker {color: #96f4e6; letter-spacing: .16em; font-size: .68rem; font-weight: 900;}
.op-shell .op-card h3 {font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1.1; margin: 6px 0 8px; letter-spacing: -.04em;}
.op-shell .op-card p {color: #c8d7e6; font-size: .91rem; margin: 0 auto 16px; max-width: 52ch;}
.op-shell .op-card button {border: 1px solid rgba(174, 218, 235, .22); background: #263a59; color: #f2ffff; border-radius: 10px; font-weight: 800; min-height: 39px;}
.op-shell .op-card button:hover {border-color: #a9f6ec; background: #31516a;}
.op-shell .op-card .op-primary {display: inline-flex; align-items: center; justify-content: center; padding: 9px 18px; min-height: 46px; border: 0; border-radius: 12px; background: linear-gradient(120deg, #78eee0, #9ba9ff); color: #132239; box-shadow: 0 7px 20px rgba(89, 214, 217, .25);}
.op-shell .op-card .op-primary:hover {background: linear-gradient(120deg, #b6fff5, #c3cdff);}
.op-shell .op-level-grid {display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 6px; margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(166, 217, 234, .19);}
.op-shell .op-level-grid button {display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 44px; padding: 2px 1px;}
.op-shell .op-level-grid small {font-size: .72rem; font-weight: 900; letter-spacing: .06em;}
.op-shell .op-level-grid span {line-height: 1; font-size: .75rem; color: #ffdb93; min-height: 11px;}
.op-shell .op-result .op-result-icon {display: block; font-size: 3.1rem; line-height: 1.2; color: #ffd17e;}
.op-shell .op-result > button {margin: 4px; padding: 7px 14px;}
.op-shell .op-underbar {min-height: 42px; display: flex; align-items: center; justify-content: space-between; padding: 0 11px 0 15px; background: rgba(24, 36, 62, .92); font-size: .68rem; font-weight: 900; color: #c0e5e6; letter-spacing: .13em; text-transform: uppercase;}
.op-shell .op-underbar button {width: 32px; height: 30px; border: 1px solid rgba(161, 226, 234, .25); border-radius: 8px; background: #2d4662; color: #e8fbff; font-size: 1.2rem; line-height: 1;}
.op-shell .op-panel {display: flex; flex-direction: column; min-width: 0; padding: 17px; border: 1px solid rgba(171, 225, 236, .15); border-radius: 20px; background: linear-gradient(180deg, rgba(40, 53, 82, .76), rgba(28, 37, 65, .8));}
.op-shell .op-chapter > span {font-size: .63rem; letter-spacing: .18em; color: #a2e9e6; font-weight: 900;}
.op-shell .op-chapter h3 {font-size: 1.6rem; line-height: 1.14; margin: 5px 0 8px; letter-spacing: -.03em;}
.op-shell .op-chapter p {color: #b8c9dc; font-size: .87rem; margin: 0 0 17px;}
.op-shell .op-legend {display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 0; border-top: 1px solid rgba(183, 229, 238, .13); border-bottom: 1px solid rgba(183, 229, 238, .13);}
.op-shell .op-legend span {padding: 5px 7px; background: rgba(157, 225, 237, .095); border-radius: 7px; font-size: .72rem; font-weight: 700; color: #d3ecf2;}
.op-shell .op-pad {display: grid; align-self: center; grid-template-columns: repeat(3, 54px); grid-template-rows: repeat(3, 48px); gap: 4px; margin: 17px auto 5px; user-select: none; -webkit-user-select: none;}
.op-shell .op-pad button {border-radius: 13px; border: 1px solid rgba(154, 228, 234, .37); background: linear-gradient(160deg, #3a5f78, #273c62); color: #e6ffff; font-size: 1.35rem; font-weight: 900; box-shadow: inset 0 1px rgba(255, 255, 255, .17), 0 4px 9px rgba(0, 0, 0, .14);}
.op-shell .op-pad button:active {transform: translateY(2px); background: #5a9aab;}
.op-shell .op-pad [data-op-dir="up"] {grid-column: 2; grid-row: 1;}
.op-shell .op-pad [data-op-dir="left"] {grid-column: 1; grid-row: 2;}
.op-shell .op-pad #opWait {grid-column: 2; grid-row: 2; font-size: .95rem; color: #ffdab1;}
.op-shell .op-pad [data-op-dir="right"] {grid-column: 3; grid-row: 2;}
.op-shell .op-pad [data-op-dir="down"] {grid-column: 2; grid-row: 3;}
.op-shell .op-hint {color: var(--op-muted); font-size: .79rem; line-height: 1.46; margin: 8px 0 14px;}
.op-shell .op-actions {display: flex; gap: 7px; margin-top: auto;}
.op-shell .op-actions button {flex: 1; min-height: 38px; border: 1px solid rgba(160, 222, 230, .29); border-radius: 10px; background: rgba(97, 153, 178, .2); font-weight: 800; font-size: .79rem;}
.op-shell .op-actions button:hover {background: rgba(103, 191, 207, .32);}
.op-shell .op-message {min-height: 2.6em; margin: 13px 0 0; color: #bdf4e9; font-size: .82rem; line-height: 1.35;}

@media (max-width: 780px) {
  .op-shell {border-radius: 17px; padding: 10px;}
  .op-shell .op-hero {padding: 4px 3px; margin-bottom: 10px; align-items: center;}
  .op-shell .op-hero h2 {font-size: 1.55rem;}
  .op-shell .op-hero p {font-size: .78rem;}
  .op-shell #opMissions {font-size: .76rem; padding: 7px 9px;}
  .op-shell .op-hud {gap: 5px;}
  .op-shell .op-hud > div {display: block; padding: 6px 8px; min-height: 48px;}
  .op-shell .op-hud small {display: block; font-size: .55rem;}
  .op-shell .op-hud strong {display: block; margin-top: 2px; font-size: .85rem;}
  .op-shell .op-layout {grid-template-columns: 1fr; gap: 9px;}
  .op-shell canvas {height: clamp(390px, 97vw, 550px);}
  .op-shell .op-panel {padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px;}
  .op-shell .op-chapter {grid-column: 1;}
  .op-shell .op-chapter h3 {font-size: 1.2rem; margin: 3px 0;}
  .op-shell .op-chapter p {font-size: .76rem; margin: 0;}
  .op-shell .op-legend {grid-column: 1; padding: 4px 0; align-content: start; border-bottom: 0;}
  .op-shell .op-pad {grid-column: 2; grid-row: 1 / span 3; grid-template-columns: repeat(3, 48px); grid-template-rows: repeat(3, 44px); margin: 0;}
  .op-shell .op-hint {grid-column: 1; font-size: .71rem; margin: 0;}
  .op-shell .op-actions {grid-column: 1 / -1;}
  .op-shell .op-message {grid-column: 1 / -1; margin: 0; min-height: 0;}
  .op-shell .op-level-grid {grid-template-columns: repeat(6, minmax(0, 1fr));}
  .op-shell .op-card {padding: 16px;}
}

@media (max-width: 420px) {
  .op-shell .op-hero h2 {font-size: 1.37rem;}
  .op-shell .op-eyebrow {font-size: .55rem;}
  .op-shell canvas {height: 380px;}
  .op-shell .op-pad {grid-template-columns: repeat(3, 42px); grid-template-rows: repeat(3, 42px);}
  .op-shell .op-pad button {font-size: 1.2rem;}
  .op-shell .op-legend span {font-size: .66rem;}
  .op-shell .op-card p {font-size: .8rem;}
}

.op-shell:is(:fullscreen,.campaign-viewport) {display: flex; flex-direction: column; width: 100%; height: 100dvh; max-width: none; border: 0; border-radius: 0; overflow: auto; padding: 8px;}
.op-shell:is(:fullscreen,.campaign-viewport) .op-hero {display: none;}
.op-shell:is(:fullscreen,.campaign-viewport) .op-hud {margin-bottom: 5px;}
.op-shell:is(:fullscreen,.campaign-viewport) .op-layout {flex: 1; min-height: 0;}
.op-shell:is(:fullscreen,.campaign-viewport) .op-stage {min-height: 0;}
.op-shell:is(:fullscreen,.campaign-viewport) canvas {height: 100%; min-height: 0; flex: 1;}
.op-shell:is(:fullscreen,.campaign-viewport) .op-panel {overflow: auto;}
@media (max-width: 780px) {
  .op-shell:is(:fullscreen,.campaign-viewport) .op-layout {display: flex; flex-direction: column;}
  .op-shell:is(:fullscreen,.campaign-viewport) .op-stage {flex: 1;}
  .op-shell:is(:fullscreen,.campaign-viewport) .op-panel {flex: 0 0 auto; max-height: 173px;}
  .op-shell:is(:fullscreen,.campaign-viewport) .op-chapter p, .op-shell:is(:fullscreen,.campaign-viewport) .op-legend, .op-shell:is(:fullscreen,.campaign-viewport) .op-hint, .op-shell:is(:fullscreen,.campaign-viewport) .op-actions, .op-shell:is(:fullscreen,.campaign-viewport) .op-message {display: none;}
  .op-shell:is(:fullscreen,.campaign-viewport) .op-pad {grid-template-columns: repeat(3, 42px); grid-template-rows: repeat(3, 38px); grid-row: 1 / span 2;}
}

@media (prefers-reduced-motion: reduce) {
  .op-shell *, .op-shell *::before, .op-shell *::after {scroll-behavior: auto !important; transition-duration: .01ms !important;}
}
.op-shell .op-actions { flex-wrap:wrap; }
.op-shell .op-actions button { min-height:44px; }
#opStasis { border-color:#91f2ef; color:#bafff4; }
#opStasis:disabled { opacity:.55; }
.op-shell .op-underbar button {min-width:44px;min-height:44px;}
@media (max-width:780px) {
 .op-shell:is(:fullscreen,.campaign-viewport) .op-panel {display:grid;grid-template-columns:auto minmax(0,1fr);max-height:178px;padding:8px;gap:8px;}
 .op-shell:is(:fullscreen,.campaign-viewport) .op-chapter {display:none;}
 .op-shell:is(:fullscreen,.campaign-viewport) .op-pad {grid-column:1;grid-row:1;grid-template-columns:repeat(3,44px);grid-template-rows:repeat(3,44px);}
 .op-shell:is(:fullscreen,.campaign-viewport) .op-actions {display:grid;grid-column:2;grid-row:1;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;margin:0;align-self:center;}
 .op-shell:is(:fullscreen,.campaign-viewport) .op-actions button {min-width:0;font-size:.67rem;line-height:1.2;padding:4px;}
}

.op-shell.campaign-viewport {position:fixed;inset:0;z-index:1200;width:100vw;max-width:none;height:100dvh;margin:0;box-sizing:border-box;}
.op-shell .op-underbar>div{display:flex;gap:6px}.op-paused .op-stage::after{content:'EN PAUSE';position:absolute;inset:0 0 44px;display:grid;place-items:center;background:#081b38a6;color:#f2faff;font-weight:900;letter-spacing:.16em;pointer-events:none;z-index:1}.op-shell .op-pad button{min-width:44px;min-height:44px}
@media (orientation:landscape) and (max-height:500px) {
 .op-shell:is(:fullscreen,.campaign-viewport) .op-layout{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:8px;}
 .op-shell:is(:fullscreen,.campaign-viewport) .op-panel{display:grid;grid-template-columns:140px minmax(0,1fr);align-content:center;align-items:center;gap:8px;padding:8px;max-height:none;}
 .op-shell:is(:fullscreen,.campaign-viewport) .op-chapter,.op-shell:is(:fullscreen,.campaign-viewport) .op-legend,.op-shell:is(:fullscreen,.campaign-viewport) .op-hint,.op-shell:is(:fullscreen,.campaign-viewport) .op-message{display:none;}
 .op-shell:is(:fullscreen,.campaign-viewport) .op-pad{grid-column:1;grid-row:1;grid-template-columns:repeat(3,44px);grid-template-rows:repeat(3,44px);margin:0;}
 .op-shell:is(:fullscreen,.campaign-viewport) .op-actions{display:grid;grid-column:2;grid-row:1;grid-template-columns:1fr;gap:5px;margin:0;}
 .op-shell:is(:fullscreen,.campaign-viewport) .op-actions button{min-width:0;min-height:44px;padding:4px;font-size:.65rem;}
}
