/* MAIN-1 650×561: original pixel art; Green.dll 0x31c8..0x34df:
 * ORIGINAL_VERIFIED button L/T/R/B. Aperture clipping is RECONSTRUCTED from
 * the bitmap. Start popup/status text/mobile layout are NEW_IMPLEMENTATION.
 * Full provenance and unknowns: native-ui-layout.mjs. No original is overwritten.
 */
.native-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

/* Compact landscape already reserves a side pane for chat. Keep the original
 * action-icon strip in the same remaining width so that no44px target is hidden
 * underneath that pane; the strip retains its existing horizontal scrolling.
 */
@media (max-width: 1000px) and (max-height: 520px) {
  body.mobile-chat-open .game-window.native-skin > .native-controls {
    width: calc(100% - var(--mobile-chat-width));
  }
}
.native-icon {
  position: absolute;
  display: block;
  pointer-events: auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  color: #20272a;
  image-rendering: pixelated;
}
.native-icon-art {
  display: block;
  width: 100%;
  height: 100%;
  background-image: var(--icon-image);
  background-repeat: no-repeat;
  background-size: 100% 300%;
  background-position: 0 0;
  image-rendering: pixelated;
  pointer-events: none;
}
.native-icon:hover {
  filter: none;
}
.native-icon:hover .native-icon-art {
  background-position: 0 50%;
}
.native-icon:active {
  transform: none;
}
.native-icon:active .native-icon-art {
  background-position: 0 100%;
}
.native-icon:disabled {
  opacity: 1;
  cursor: default;
}
.native-icon:disabled .native-icon-art {
  background-position: 0 0;
}
.native-icon:focus-visible {
  outline: 2px solid #74517e;
  outline-offset: 1px;
  z-index: 1;
}
body:has(.native-skin) {
  background: #acbfc0;
}
body:has(.native-skin) dialog {
  color: #20282c;
  background: #fcfcd9;
  border: 2px solid #819294;
  border-radius: 0;
  box-shadow:
    1px 1px #fcfcfc,
    3px 3px #4e5a5d;
  font-family: Gulim, "굴림", "Malgun Gothic", sans-serif;
}
body:has(.native-skin) dialog::backdrop {
  backdrop-filter: none;
  background: #23303a80;
}
body:has(.native-skin) .panel-head {
  background: #aebfc0;
  border-color: #819294;
}
body:has(.native-skin) .panel-head h2 {
  color: #4f355c;
}
body:has(.native-skin)
  button:not([data-game-fullscreen]):not(.native-icon):not(.reversi-cell),
body:has(.native-skin) select {
  color: #253037;
  background: #c0cece;
  border-color: #f5f9f8 #6a7d7f #6a7d7f #f5f9f8;
  border-radius: 0;
  box-shadow: 1px 1px #7b8d8f;
}
body:has(.native-skin) input {
  color: #20282c;
  border-color: #829294;
  background: #fcfcd9;
  border-radius: 0;
}
body:has(.native-skin) .primary {
  color: #fff;
  background: #73517c !important;
}
body:has(.native-skin) h1 {
  color: #63456e;
}

/* Match the existing compact-mode query exactly, including wide short PC
 * windows. Enlargement is uniform; every source rectangle remains proportional.
 */
@media (min-width: 701px) and (min-height: 521px) and (pointer: fine),
  (min-width: 1001px) and (pointer: fine) {
  .shell:has(> .native-skin) {
    width: calc(100% - 24px);
    margin: 0 auto;
    padding-top: 12px;
  }
  .shell:has(> .native-skin) > .masthead {
    margin: 0 0 10px;
  }
  .game-window.native-skin {
    --native-scale: 1;
    position: relative;
    display: block;
    width: var(--native-width, 650px);
    max-width: 100%;
    aspect-ratio: 650 / 561;
    margin: 0 auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    overflow: visible;
    background-color: #aebfc0;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    image-rendering: pixelated;
    box-shadow: 1px 2px 0 #677b7e;
    font-family: Gulim, "굴림", "Malgun Gothic", sans-serif;
  }
  .native-skin > .stage {
    position: absolute;
    left: calc(5 / 650 * 100%);
    top: calc(20 / 561 * 100%);
    width: calc(640 / 650 * 100%);
    height: calc(367 / 561 * 100%);
    aspect-ratio: auto;
    border: 0;
    background: #fcfcfc;
    overflow: hidden;
  }
  .native-skin > .stage canvas {
    display: block;
    width: 100%;
    height: 100%;
  }
  .native-skin .stage-top,
  .native-skin .stage-bottom {
    display: none;
  }
  .native-skin > .toolbar {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    justify-content: flex-end;
    min-height: 44px;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    z-index: 6;
  }
  .native-skin > .toolbar > :not([data-game-fullscreen]) {
    display: none;
  }
  .native-skin.native-menu-open > .toolbar {
    top: calc(20 / 561 * 100%);
    left: calc(5 / 650 * 100%);
    right: auto;
    width: min(280px, 90%);
    max-height: calc(100% - 24px);
    overflow: auto;
    display: flex;
    flex-wrap: wrap;
    align-content: start;
    justify-content: flex-start;
    gap: 6px;
    padding: 8px;
    background: #aebfc0;
    border: 2px solid;
    border-color: #f8fcfc #687d7e #687d7e #f8fcfc;
    box-shadow: 2px 2px #4b5a5d;
  }
  .native-skin.native-menu-open > .toolbar > :not(.mobile-only) {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
  }
  .native-skin.native-menu-open > .toolbar .place {
    flex-basis: 100%;
  }
  .native-skin.native-menu-open > .toolbar .place > span {
    display: none;
  }
  .native-skin.native-menu-open > .toolbar #population {
    flex-basis: 100%;
  }
  .native-skin > .titlebar {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    width: auto;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #34464a;
    text-shadow: none;
  }
  .native-skin > .titlebar > strong,
  .native-skin .title-button {
    display: none;
  }
  .native-skin > .titlebar > div {
    font:
      11px Gulim,
      "굴림",
      sans-serif;
  }
  .native-skin > .chat-panel {
    position: absolute;
    left: calc(5 / 650 * 100%);
    top: calc(410 / 561 * 100%);
    width: calc(408 / 650 * 100%);
    height: calc(146 / 561 * 100%);
    padding: 0;
    border: 0;
    background: transparent;
  }
  .native-skin .chat-heading {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .native-skin #chat-log {
    position: absolute;
    inset: 0 0 auto;
    height: calc(84 / 146 * 100%);
    margin: 0;
    padding: calc(3px * var(--native-scale)) calc(5px * var(--native-scale));
    list-style: none;
    border: 0;
    box-shadow: none;
    background: transparent;
    overflow-y: auto;
    font-size: calc(12px * var(--native-scale));
    line-height: 1.45;
    color: #20272a;
  }
  .native-skin #chat-log .name {
    color: #674672;
    font-weight: 400;
  }
  .native-skin #chat-form {
    position: absolute;
    top: calc(89 / 146 * 100%);
    left: 0;
    right: 0;
    height: calc(57 / 146 * 100%);
    margin: 0;
    padding: calc(3px * var(--native-scale));
    gap: calc(3px * var(--native-scale));
    align-items: stretch;
  }
  .native-skin #chat-text {
    width: 0;
    flex: 1;
    padding: calc(3px * var(--native-scale));
    border: 0;
    background: transparent;
    font-size: calc(12px * var(--native-scale));
  }
  .native-skin #chat-form button {
    min-width: calc(42px * var(--native-scale));
    padding: calc(3px * var(--native-scale));
    font-size: calc(11px * var(--native-scale));
  }
  .native-skin > .control-strip {
    position: absolute;
    left: calc(470 / 650 * 100%);
    top: calc(393 / 561 * 100%);
    width: calc(173 / 650 * 100%);
    height: calc(163 / 561 * 100%);
    padding: calc(7px * var(--native-scale)) calc(6px * var(--native-scale));
    display: block;
    border: 0;
    background: transparent;
    overflow: auto;
  }
  .native-skin .identity {
    min-width: 0;
    gap: 0;
  }
  .native-skin .identity strong {
    color: #664775;
    font-size: calc(12px * var(--native-scale));
    overflow-wrap: anywhere;
  }
  .native-skin .identity small {
    font-size: calc(10px * var(--native-scale));
    color: #5b6462;
    line-height: 1.5;
  }
  .native-skin .portrait,
  .native-skin .emotes,
  .native-skin .movement-note {
    display: none;
  }
  .native-status {
    display: grid;
    grid-template-columns: calc(24px * var(--native-scale)) minmax(0, 1fr);
    gap: calc(5px * var(--native-scale));
    margin: calc(9px * var(--native-scale)) 0 0;
    font-size: calc(10px * var(--native-scale));
    line-height: 1.3;
  }
  .native-status dt {
    color: #795b7e;
  }
  .native-status dd {
    margin: 0;
    color: #283333;
    overflow-wrap: anywhere;
  }
  .shell:has(> .native-skin) > .footnote {
    display: none;
  }
}
