.em-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 12px 24px 20px;
  color: #292a22;
}
.em-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 10px;
}
.em-head-left {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
}
.em-wrap h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.em-sub {
  margin: 0;
  font-size: 14px;
  color: #696a5e;
  font-weight: 600;
}
.em-modes {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.em-modes a,
.em-tier-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 7px;
  border: 1px solid #dddcd1;
  background: #fffdf8;
  color: #292a22;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.em-modes a[aria-current="page"],
.em-tier-btn[aria-pressed="true"] {
  background: #3a614a;
  border-color: #3a614a;
  color: #ffffff;
}
.em-modes a:hover:not([aria-current="page"]),
.em-tier-btn:hover:not([aria-pressed="true"]) {
  border-color: #3a614a;
  color: #3a614a;
}
.em-subbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin: 0 auto 10px;
  max-width: 540px;
}
.em-tiers {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.em-nav-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.em-mini-btn {
  min-height: 34px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid #dddcd1;
  background: #fffdf8;
  color: #292a22;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.em-mini-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.em-mini-btn:hover:not(:disabled) {
  border-color: #3a614a;
}
.em-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 auto 10px;
  max-width: 540px;
}
.em-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #dddcd1;
  background: #fffdf8;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.em-stat-label {
  color: #696a5e;
  font-weight: 600;
}
.em-stat-val {
  font-weight: 800;
  color: #292a22;
}
.em-stat.is-sealed {
  background: #f5edd3;
  border-color: #d4a63a;
}
.em-stat.is-sealed .em-stat-val {
  color: #6b4c08;
}
.em-stat.is-leak {
  background: #fdf0ed;
  border-color: #e4a399;
}
.em-stat.is-leak .em-stat-val {
  color: #a32f20;
}
.em-best-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid #dddcd1;
  background: #efeee3;
  color: #292a22;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.em-best-btn:hover {
  border-color: #3a614a;
}
.em-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.em-canvas-shell {
  position: relative;
  width: 100%;
  max-width: 540px;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  background: #2c5340;
  border: 2px solid #244535;
  touch-action: manipulation;
}
.em-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
  outline: none;
}
.em-canvas:focus-visible {
  box-shadow: inset 0 0 0 3px #f5c23b;
}
.em-status-line {
  width: 100%;
  max-width: 540px;
  min-height: 22px;
  margin: 8px 0 0;
  font-size: 13px;
  color: #696a5e;
  text-align: center;
}
.em-status-line strong {
  color: #292a22;
}
.em-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 540px;
  margin: 10px auto 0;
}
.em-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid #cccac0;
  background: #fffdf8;
  color: #292a22;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.em-btn:hover:not(:disabled) {
  background: #efeee3;
}
.em-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.em-btn.is-active {
  background: #fdf0ed;
  border-color: #bc3e2d;
  color: #bc3e2d;
}
.em-btn-primary {
  background: #3a614a;
  border-color: #3a614a;
  color: #ffffff;
}
.em-btn-primary:hover:not(:disabled) {
  background: #2f513d;
  color: #ffffff;
}
.em-btn-accent {
  background: #bc3e2d;
  border-color: #bc3e2d;
  color: #ffffff;
}
.em-btn-accent:hover:not(:disabled) {
  background: #a32f20;
  color: #ffffff;
}
.em-btn:focus-visible,
.em-mini-btn:focus-visible,
.em-best-btn:focus-visible,
.em-modes a:focus-visible,
.em-tier-btn:focus-visible {
  outline: 3px solid #bc3e2d;
  outline-offset: 2px;
}
.em-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  width: 100%;
  max-width: 540px;
  margin: 10px auto 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #efeee3;
  font-size: 12px;
  color: #4f5046;
}
.em-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.em-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.em-guard {
  width: 100%;
  max-width: 540px;
  margin: 12px auto 0;
  padding: 14px 16px;
  border-radius: 10px;
  border: 2px solid #d4a63a;
  background: #fff9e6;
}
.em-guard p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.45;
}
.em-guard-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.em-result {
  width: 100%;
  max-width: 540px;
  margin: 14px auto 0;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #dddcd1;
  background: #fffdf8;
}
.em-result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.em-medal {
  font-size: 20px;
  font-weight: 800;
}
.em-score-big {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #3a614a;
}
.em-breakdown {
  margin: 0 0 12px;
  font-size: 14px;
  color: #54554b;
}
.em-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.em-dist {
  margin: 12px 0;
  padding-top: 10px;
  border-top: 1px solid #e7e5da;
}
.em-dist-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #696a5e;
}
.em-dist-row {
  display: grid;
  grid-template-columns: 78px 1fr 40px;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.em-dist-bar-bg {
  height: 10px;
  border-radius: 5px;
  background: #efeee3;
  overflow: hidden;
}
.em-dist-bar {
  height: 100%;
  border-radius: 5px;
  background: #3a614a;
}
.em-dist-row.is-mine .em-dist-bar {
  background: #bc3e2d;
}
.em-share-fallback {
  width: 100%;
  min-height: 76px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid #cccac0;
  border-radius: 6px;
  background: #f9f7f0;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
}
.em-next-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e7e5da;
  font-size: 14px;
}
.em-next-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 7px 14px;
  border-radius: 8px;
  background: #bc3e2d;
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
}
.em-next-link:hover {
  background: #a32f20;
  color: #ffffff;
}
.em-archive-panel {
  width: 100%;
  max-width: 540px;
  margin: 10px auto 0;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #dddcd1;
  background: #fffdf8;
}
.em-archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}
.em-arch-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid #e2e0d5;
  background: #f9f7f0;
  color: #292a22;
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.em-arch-item.is-current {
  border-color: #3a614a;
  background: #eaf2ec;
}
.em-arch-item strong {
  font-size: 12px;
}
.em-arch-item span {
  color: #696a5e;
  font-size: 11px;
}
.em-related-strip {
  width: 100%;
  max-width: 540px;
  margin: 12px auto 0;
  font-size: 13px;
  color: #696a5e;
  text-align: center;
}
.em-related-strip a {
  color: #3a614a;
  font-weight: 700;
}
@media (max-width: 600px) {
  .em-wrap {
    padding: 8px 14px 16px;
  }
  .em-wrap h1 {
    font-size: 24px;
  }
  .em-hud {
    gap: 6px;
  }
  .em-stat {
    padding: 5px 9px;
    font-size: 13px;
  }
  .em-actions {
    gap: 6px;
  }
  .em-btn {
    font-size: 13px;
    padding: 8px 6px;
  }
}