.app-drawer {
  font-family: "Inter", sans-serif;
  overflow-x: hidden;
}
.menu-action-icon { flex: 0 0 auto; }
.share-tools button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.board-secondary-actions { display: flex; flex-direction: column; gap: 8px; align-items: inherit; }
.app-drawer:not(.show-setups) .drawer-close {
  position: absolute;
  top: calc(20px + env(safe-area-inset-top));
  right: 20px;
  margin: 0;
  z-index: 1;
}
.app-drawer:not(.show-setups) {
  padding: calc(20px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom));
}
.app-drawer:not(.show-setups) .drawer-pages { flex-grow: 1; display: flex; }
.app-drawer .drawer-page--main { display: flex; align-items: center; padding: 44px 0; }
:is(.app-drawer, .panel) .panel-header-block { gap: 16px; width: 100%; }
:is(.app-drawer, .panel) .sheet-intro { margin: -4px 0 0; font-size: 12px; font-weight: 500; line-height: 1.5; }
:is(.app-drawer, .panel) .share-tools { align-items: flex-start; gap: 16px; margin: 0; }
:is(.app-drawer, .panel) .share-tools #chooseBoardBtn { width: auto; height: 54px; background: white; padding: 12px 24px; font-size: 14px; }
:is(.app-drawer, .panel) .board-secondary-actions { align-items: flex-start; }
:is(.app-drawer, .panel) .board-secondary-actions button { width: auto; min-width: 0; min-height: 30px; height: 30px; padding: 8px 0; gap: 8px; justify-content: flex-start; background: transparent; border-radius: 0; box-shadow: none; font-size: 12px; }
:is(.app-drawer, .panel) .share-tools #chooseBoardBtn:hover { background: #f9e3e1; }
:is(.app-drawer, .panel) .board-secondary-actions button:is(:hover, :active, :focus) { background: transparent; box-shadow: none; }
:is(.app-drawer, .panel) #shareStatus:empty { display: none; }
.drawer-pages {
  position: relative;
  width: 100%;
  flex-shrink: 0;
  overflow: hidden;
}
.drawer-page { width: 100%; transition: transform 220ms ease, visibility 220ms; }
.drawer-page--main { position: relative; transform: translateX(0); }
.drawer-page--setups {
  position: absolute;
  top: 0;
  visibility: hidden;
  transform: translateX(calc(100% + 48px));
}
.show-setups .drawer-page--main {
  position: absolute;
  top: 0;
  visibility: hidden;
  transform: translateX(calc(-100% - 48px));
}
.show-setups .drawer-page--setups {
  position: relative;
  visibility: visible;
  transform: translateX(0);
}
.setup-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
  padding: 6px 12px;
  margin-bottom: 12px;
  border: 0;
  border-radius: 24px;
  background: #f9e3e1;
  color: #6d5b59;
  font: 500 14px "Inter", sans-serif;
  cursor: pointer;
}
.drawer-page h2 { font-size: 16px; line-height: 1.5; margin: 0 0 4px; }
.setup-intro, .setup-footnote, .current-board-note {
  font-size: 12px;
  line-height: 1.5;
  margin: 0 0 12px;
}
.setup-footnote { margin-top: 24px; }
.setup-group-heading { font: 700 14px/1.5 "Inter", sans-serif; margin: 20px 0 12px; }
.setup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.setup-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: 12px;
  border: 2px solid transparent;
  border-radius: 24px;
  background: #f9e3e1;
  color: #6d5b59;
  font: 500 12px/1.5 "Inter", sans-serif;
  cursor: pointer;
}
.setup-card[aria-pressed="true"] { border-color: #6d5b59; }
.setup-card:hover { background: #f3d8d5; }
.setup-card:focus-visible, .setup-back:focus-visible { outline: 2px solid #6d5b59; outline-offset: 3px; }
.setup-preview-slot { display: grid; place-items: center; width: 80px; height: 45px; margin-bottom: 2px; }
.setup-preview { width: 80px; height: 45px; }
.setup-name { display: grid; place-items: center; min-height: 36px; text-align: center; }
.setup-players {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 24px;
  background: #fff2f1;
}
.setup-player-icon { display: grid; place-items: center; width: 16px; height: 16px; }
.replace-board-dialog {
  width: min(340px, calc(100% - 40px));
  padding: 24px;
  border: 0;
  border-radius: 24px;
  background: #fff2f1;
  color: #6d5b59;
  font-family: "Inter", sans-serif;
  box-shadow: 0 8px 32px rgb(62 47 46 / 20%);
}
.replace-board-dialog::backdrop { background: rgb(35 28 27 / 40%); }
.replace-board-dialog p { font-size: 14px; line-height: 1.5; }
.replace-board-actions { display: flex; flex-direction: column; gap: 12px; }
.replace-board-actions button {
  min-height: 44px;
  border: 0;
  border-radius: 24px;
  padding: 12px;
  font: 500 14px "Inter", sans-serif;
  color: #6d5b59;
  background: #f9e3e1;
  cursor: pointer;
}
#replaceBoard { color: #fff2f1; background: #6d5b59; }
.hex-unknown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #6d5b59;
  font: 500 calc(22px * var(--render-scale)) "Inter", sans-serif;
  pointer-events: none;
}
.hex-villages {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hex.has-cloth-villages { z-index: 3; }
.hex-cloth {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  height: auto;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.hex-villages .hex-number {
  left: 50%;
  transform: translate(-50%, -50%);
}
.hex-villages [data-village-corner="north"] { top: 0; }
.hex-villages [data-village-corner="south"] { top: 100%; }
@media (min-width: 1101px) and (hover: hover) {
  .drawer-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 80;
    border: 0;
    background: rgb(35 28 27 / 30%);
  }
  .app-drawer {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 90;
    width: 420px;
    padding: 20px 24px 36px;
    background: #fff2f1;
    border-radius: 0 24px 24px 0;
    overflow-y: auto;
    visibility: hidden;
    transform: translateX(-100%);
    transition: transform 220ms ease, visibility 220ms;
  }
  .app-drawer.is-open {
    visibility: visible;
    transform: translateX(0);
    box-shadow: 8px 0 28px rgb(62 47 46 / 18%);
  }
  .drawer-close {
    align-self: flex-end;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    margin-bottom: 16px;
    border: 0;
    border-radius: 50%;
    background: #f9e3e1;
    color: #6d5b59;
    font-size: 28px;
    cursor: pointer;
  }
}
@media (prefers-reduced-motion: reduce) {
  .app-drawer, .drawer-page { transition: none !important; }
}
