:root{color-scheme:light;font-family:"Helvetica Neue",Arial,sans-serif;color:#233e35}
*{box-sizing:border-box}html,body,main{width:100%;height:100%;margin:0;overflow:hidden}body{background:#276159}main{position:relative;isolation:isolate}
button{font:inherit;cursor:pointer;color:inherit;-webkit-tap-highlight-color:transparent}button:focus-visible{outline:3px solid #ffb998;outline-offset:3px}svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round;pointer-events:none;flex-shrink:0}
#water,#effects,.shade{position:absolute;inset:0;width:100%;height:100%;display:block}#water{touch-action:none}#effects,.shade{pointer-events:none}.shade{background:linear-gradient(180deg,rgba(7,34,29,.27),transparent 20%,transparent 77%,rgba(4,32,29,.18))}
h2,.name{font-family:"Baskerville","Baskervville","Times New Roman",serif;font-weight:400}#population{display:flex;align-items:center;gap:7px}#population i{width:6px;height:6px;display:block;border-radius:50%;background:#b7e8a6}
.modes {
  --menu-gap: 14px;
  --rail-padding: 5px;
  color: #f5fff9;
  text-shadow: 0 1px 3px #133c3799;
  position: absolute;
  right: max(28px, env(safe-area-inset-right));
  top: 49%;
  transform: translateY(-50%);
  display: grid;
  gap: 4px;
  padding: var(--rail-padding);
  border-radius: 32px;
  z-index: 2;
}
.menu-group { position: relative; }
[data-menu], .rail-action {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  width: 52px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 26px;
  background: transparent;
  color: inherit;
  font-size: 11px;
}
[data-menu] svg, .rail-action svg { width: 21px; height: 21px; }
.rail-action { white-space: nowrap; }
.flyout {
  position: absolute;
  right: calc(100% + var(--menu-gap) + var(--rail-padding));
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
  width: 174px;
  border-radius: 24px;
  --panel-padding: 11px 8px 8px;
}
.flyout::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 0;
  bottom: 0;
  width: calc(var(--menu-gap) + var(--rail-padding) + 1px);
}
#catalog-panel { width: 218px; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 2px 6px 10px;
}
.panel-head h2 { margin: 0; font-size: 17px; line-height: 1.35; }
#population { font-size: 10px; color: #dcf3e6; white-space: nowrap; gap: 5px; }
#population i { width: 4px; height: 4px; background: #b3eac3; }
.weather-options,.varieties { display: grid; gap: 2px; }
.weather-options button,.card {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  color: inherit;
  background: transparent;
  text-align: left;
  transition: background .15s;
}
.weather-options button { min-height: 37px; gap: 11px; padding: 0 10px; font-size: 13px; }
.weather-options svg { width: 17px; height: 17px; }
.weather-options .check { margin-left: auto; width: 14px; visibility: hidden; }
.weather-options [aria-pressed=true] .check { visibility: visible; }
.card { min-height: 45px; padding: 4px; gap: 10px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.card:active { cursor: grabbing; }
.card img { width: 59px; height: 36px; padding: 2px 3px; object-fit: contain; border-radius: 6px; background: #e5faea20; pointer-events: none; }
.card.kohaku img { background: #ffc6ac30; }
.card.golden img { background: #ffe29b29; }
.card.platinum img { background: #c7eef02d; }
.card-footer { display: flex; align-items: center; justify-content: space-between; flex: 1; min-width: 0; gap: 5px; }
.name { font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
.plus { display: grid; place-items: center; margin-right: 4px; width: 18px; height: 18px; color: #e1f2e6; }
.plus svg { width: 12px; height: 12px; }
.ui,.shade { transition: opacity .22s; }
.recording .ui,.recording .shade { opacity: 0; visibility: hidden; pointer-events: none; }
#restore { position: absolute; top: 15px; right: 15px; opacity: 0; display: grid; place-items: center; border-radius: 50%; width: 42px; height: 42px; }
#restore:hover,#restore:focus-visible { opacity: 1; }
#ghost { position: fixed; pointer-events: none; z-index: 4; transform: translate(-50%,-50%); width: 126px; height: 70px; filter: drop-shadow(0 9px 7px #153c3980); }
#ghost img { width: 100%; height: 100%; object-fit: contain; }
.notice { position: absolute; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translateX(-50%); border-radius: 16px; font-size: 12px; line-height: 30px; padding: 0 14px; pointer-events: none; opacity: 0; transition: opacity .24s; white-space: nowrap; }
.notice.on { opacity: 1; }
.recording .notice { display: none; }
#failure { position: absolute; inset: 37% 10% auto; text-align: center; color: white; background: #1e4943; padding: 24px; border-radius: 10px; }
[hidden] { display: none!important; }

#restore,.notice {
  --glass-tint: rgba(10, 44, 39, .30);
  color: #f5fff9;
  text-shadow: 0 1px 3px #092e2bd6;
  background:
    linear-gradient(150deg, #edfff52a, transparent 32%, #123e3914 68%, #bbfff217),
    var(--glass-tint);
  border: 1px solid;
  border-color: #f0fff1a6 #d4fff740 #e3fff584 #cefff45c;
  box-shadow: inset 1px 1px 2px #f3fff94d, inset -1px -1px 2px #d8fff12e, 0 3px 9px #0c302625;
  -webkit-backdrop-filter: blur(2.5px) saturate(1.14);
  backdrop-filter: blur(2.5px) saturate(1.14);
}
#menu-surface {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  visibility: hidden;
  transform-origin: 0 0;
}
.flyout-content {
  display: flow-root;
  padding: var(--panel-padding);
  border: 1px solid transparent;
  border-radius: inherit;
  opacity: 1;
  transition: opacity 160ms ease-out;
}
.flyout[data-arrival="open"] .flyout-content { transition-delay: 95ms; }
.flyout[data-arrival="close"] .flyout-content {
  opacity: 0;
  transition: opacity 90ms ease-out;
}
@starting-style {
  .flyout:is([data-arrival="open"],[data-arrival="switch"]) .flyout-content { opacity: 0; }
}
[data-menu][aria-expanded=true], .rail-action[aria-pressed=true] {
  color: #d2ffdc;
  text-shadow: 0 1px 3px #153c31;
}
.weather-options [aria-pressed=true] {
  background: linear-gradient(105deg, #d0ffe519, #dcfff007);
  color: #e2ffeb;
}
@media (hover:hover) {
  #restore:hover { --glass-tint: rgba(17, 64, 55, .53); }
  [data-menu][aria-expanded=false]:hover,.rail-action:hover,.weather-options [aria-pressed=false]:hover,.card:hover { background: #effff226; }
}
@media (prefers-reduced-transparency:reduce) {
  #restore,.notice { --glass-tint: #254d47; }
}
@media (max-width:700px) {
  .modes { --rail-padding: 4px; right: max(12px,env(safe-area-inset-right)); border-radius: 27px; }
  [data-menu], .rail-action { width: 42px; height: 48px; gap: 3px; font-size: 10px; }
  [data-menu] svg, .rail-action svg { width: 18px; height: 18px; }
  .flyout { width: 154px; }
  #catalog-panel { width: min(204px,calc(100vw - 90px)); }
  .weather-options button { min-height: 41px; }
}
:lang(zh-CN) :is(h2,.name) { font-family: "Songti SC","Noto Serif CJK SC","Source Han Serif SC",SimSun,serif; }
@media (max-height:490px) {
  .modes { top: 55%; }
  [data-menu], .rail-action { height: 38px; gap: 2px; }
  .flyout { --panel-padding: 8px; }
  .panel-head { margin-bottom: 5px; }
  .weather-options,.varieties { max-height: calc(100dvh - 150px); overflow-y: auto; overscroll-behavior: contain; }
  .weather-options button { min-height: 32px; }
  .card { min-height: 36px; }
  .card img { height: 30px; }
  .card { touch-action: pan-y; }
}
@media (max-height:490px) and (min-width:480px) {
  #catalog-panel { width: 320px; }
  .varieties { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .card { gap: 5px; }
  .card img { width: 46px; }
  .card .name { font-size: 14px; }
}
@media (prefers-reduced-motion:reduce) { * { transition: none!important; } }
