:root {
  font-family: ui-rounded, "Hiragino Maru Gothic ProN", "Noto Sans JP", sans-serif;
  color: #593349;
  --wine: #883957;
  --gold: #bb9550;
  --cream: #fffaf3;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow: hidden;
  background: #fae8e8;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
input:focus-visible {
  outline: 3px solid #ba9250;
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.55;
}
[hidden] {
  display: none !important;
}
#world {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
header {
  position: fixed;
  inset: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  z-index: 5;
  pointer-events: none;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand > span {
  font-size: 34px;
  color: #b78d4d;
}
.brand small {
  display: block;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: #8f6270;
  margin-bottom: 4px;
}
.brand strong {
  font-size: 17px;
  letter-spacing: 0.03em;
}
.round {
  border: 1px solid #fff;
  background: #fffaf3e8;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  font-size: 22px;
  color: var(--wine);
  pointer-events: auto;
  box-shadow: 0 5px 20px #6c3d4510;
}
.round small {
  font-size: 8px;
  display: block;
  line-height: 1;
}
.select-panel {
  position: fixed;
  z-index: 3;
  top: 98px;
  bottom: 22px;
  left: 28px;
  width: 484px;
  background: #fffaf5f5;
  border: 1px solid white;
  border-radius: 25px;
  padding: 23px;
  overflow: auto;
  scrollbar-width: thin;
  box-shadow: 0 15px 60px #864f5420;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.17em;
  color: #ac844e;
}
h1 {
  font-size: 26px;
  letter-spacing: -0.025em;
  margin: 7px 0;
}
p {
  font-size: 13px;
  line-height: 1.8;
}
.intro p {
  margin: 0;
  color: #9a7483;
}
.selection-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 15px 0 10px;
}
.selection-top h2 {
  font-size: 17px;
  margin: 0;
}
.selection-top > span {
  font-size: 11px;
  color: #9a7483;
  flex-shrink: 0;
}
.dog-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.dog-card {
  position: relative;
  min-width: 0;
  border: 1px solid #e8d9d5;
  border-radius: 12px;
  background: #fff8ee;
  padding: 3px 2px 6px;
  color: #745162;
}
.dog-card canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1.25;
}
.dog-card span {
  display: flex;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1.2;
  word-break: normal;
}
.dog-card.selected {
  border: 2px solid var(--wine);
  padding: 2px 1px 5px;
  background: #f8e4e9;
}
.dog-card.selected:after {
  content: "✓";
  position: absolute;
  right: 3px;
  top: 3px;
  background: var(--wine);
  color: white;
  font-size: 10px;
  border-radius: 50%;
  width: 15px;
  height: 15px;
}
.coat-picker {
  display: flex;
  gap: 13px;
  align-items: center;
  margin: 17px 0;
}
.coat-picker > span {
  font-size: 12px;
  margin-right: 5px;
}
.coat-picker button {
  background: var(--swatch);
  width: 27px;
  height: 27px;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #dac4c4;
}
.coat-picker button.active {
  box-shadow: 0 0 0 2px var(--wine);
}
.stats {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
}
.stat {
  flex: 1;
}
.stat label {
  font-size: 11px;
  display: block;
  color: #987481;
  margin-bottom: 6px;
}
.bars {
  display: flex;
  gap: 3px;
}
.bars i {
  height: 5px;
  flex: 1;
  border-radius: 5px;
  background: #e9dcda;
}
.bars i.on {
  background: #bd9458;
}
.selection-actions {
  position: sticky;
  bottom: -23px;
  margin-top: 5px;
  padding: 9px 0 3px;
  background: #fffaf5;
  box-shadow: 0 -8px 15px #fffaf5;
}
.primary,
.secondary {
  width: 100%;
  border: 0;
  border-radius: 13px;
  min-height: 48px;
  padding: 12px 15px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.primary {
  background: var(--wine);
  color: #fff9ee;
  box-shadow: 0 6px 18px #86375320;
}
.primary span {
  margin-left: 9px;
}
.secondary {
  background: #f5e6e4;
  color: var(--wine);
  margin-top: 10px;
}
.text-button,
.ranks-link {
  border: 0;
  background: none;
  color: #956c71;
  padding: 12px;
  font-size: 12px;
}
.ranks-link {
  display: block;
  margin: auto;
  color: #9d753e;
  font-weight: 600;
}
.controls-note {
  font-size: 11px;
  text-align: center;
  color: #92727e;
  margin: 8px 0 0;
  line-height: 1.7;
}
#previewCaption {
  position: fixed;
  left: 55%;
  right: 3%;
  bottom: 12%;
  text-align: center;
  pointer-events: none;
}
#previewCaption span {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: #a67e52;
}
#previewCaption strong {
  display: block;
  font-size: 24px;
  margin: 8px 0;
}
#previewCaption p {
  color: #966e80;
  font-size: 12px;
}
.hud-top {
  position: fixed;
  left: 28px;
  right: 28px;
  top: 90px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.progress-card {
  background: #fffaf2ee;
  border: 1px solid white;
  border-radius: 16px;
  padding: 12px 16px;
  width: 290px;
  min-width: 0;
}
.progress-card > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
#dogName {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.progress-card strong {
  white-space: nowrap;
  font-size: 18px;
}
.progress-track {
  height: 6px;
  background: #eddadc;
  border-radius: 10px;
  margin-top: 8px;
  position: relative;
  overflow: hidden;
}
.progress-track i {
  height: 100%;
  display: block;
  background: #a95371;
  width: 0;
}
.mark {
  position: absolute;
  top: 0;
  height: 100%;
  width: 2px;
  background: #fff;
}
.m1 {
  left: 33%;
}
.m2 {
  left: 66%;
}
.time-card {
  border: 1px solid white;
  background: #fffaf2ed;
  padding: 10px 15px;
  border-radius: 16px;
  flex-shrink: 0;
}
.time-card small {
  display: block;
  font-size: 8px;
  letter-spacing: 0.16em;
  color: #987981;
}
.time-card strong {
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}
#pause {
  margin-left: auto;
}
.area-progress {
  position: fixed;
  top: 170px;
  left: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: #a98a90;
  padding: 8px 14px;
  background: #fffaf2de;
  border-radius: 24px;
  white-space: nowrap;
}
.area-progress .active {
  font-weight: 700;
  color: #8d3455;
}
.area-progress b {
  font-weight: 400;
  color: #c4a66e;
}
#hint {
  position: fixed;
  top: 91px;
  left: 50%;
  transform: translateX(-25%);
  background: #fffaf1d9;
  border: 1px solid white;
  padding: 10px 18px;
  border-radius: 22px;
  color: #8d5b71;
  font-size: 12px;
  max-width: 40%;
  text-align: center;
}
#feedback {
  position: fixed;
  top: 25%;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  color: #994665;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  text-shadow:
    0 2px white,
    0 -2px white,
    2px 0 white,
    -2px 0 white;
  white-space: nowrap;
}
.bottom-hint {
  position: fixed;
  left: 28px;
  right: 28px;
  bottom: 102px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #8b526a;
  pointer-events: none;
}
.bottom-hint span {
  background: #fffaf2da;
  border-radius: 16px;
  padding: 7px 12px;
}
.desktop-keys {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: #996779;
  white-space: nowrap;
}
#touchControls {
  position: fixed;
  bottom: max(21px, env(safe-area-inset-bottom));
  left: 26px;
  right: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.dpad {
  display: flex;
  gap: 12px;
}
.dpad button,
#jump {
  pointer-events: auto;
  width: 65px;
  height: 63px;
  border: 2px solid #fff9;
  border-radius: 20px;
  background: #fff9efe8;
  box-shadow: 0 5px 20px #873c5820;
  color: var(--wine);
  font-size: 23px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.dpad button.pressed,
#jump.pressed {
  transform: translateY(3px);
  filter: brightness(0.9);
}
#jump {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #9a4768;
  color: white;
  font-size: 11px;
  font-weight: 700;
}
#jump span {
  display: block;
  font-size: 30px;
  line-height: 1.1;
  margin-bottom: 3px;
}
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: #54264150;
  backdrop-filter: blur(8px);
  z-index: 20;
}
.modal {
  position: relative;
  text-align: center;
  width: min(430px, 100%);
  max-height: 94dvh;
  overflow: auto;
  padding: 29px;
  background: #fffaf3;
  border: 1px solid white;
  border-radius: 25px;
  box-shadow: 0 20px 90px #481b3730;
}
.modal h2 {
  font-size: 23px;
  margin: 15px 0 10px;
  line-height: 1.5;
}
.modal p {
  color: #977481;
  font-size: 12px;
}
.modal-symbol {
  font-size: 38px;
}
.win-ribbon {
  display: inline-block;
  border: 1px solid #c6a16b;
  color: #9b7043;
  padding: 6px 20px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.win-stat {
  border-block: 1px solid #e9d6d1;
  padding: 12px;
  margin: 15px 0;
}
.win-stat span {
  font-size: 11px;
  color: #927080;
  display: block;
}
.win-stat strong {
  display: block;
  font:
    36px Georgia,
    serif;
  color: var(--wine);
  letter-spacing: 0.03em;
  margin-top: 5px;
}
.best {
  font-size: 11px !important;
}
.score-input {
  display: flex;
  gap: 7px;
  margin: 10px 0;
}
.score-input input {
  width: 0;
  flex: 1;
  background: white;
  border: 1px solid #d9c6c8;
  border-radius: 9px;
  padding: 10px;
  font-size: 13px;
}
.score-input button {
  border: 0;
  background: #b18a52;
  color: white;
  border-radius: 9px;
  padding: 10px;
  font-size: 12px;
}
#submitScore label {
  font-size: 12px;
  font-weight: 600;
}
#submitScore small {
  display: block;
  font-size: 9px;
  line-height: 1.8;
  color: #a18791;
}
#postStatus {
  margin: 8px 0;
  font-size: 11px;
}
.close {
  position: absolute;
  right: 14px;
  top: 10px;
  border: 0;
  background: none;
  color: #986d7f;
  font-size: 26px;
}
#rankList {
  max-height: 49dvh;
  overflow: auto;
  text-align: left;
}
.rank-row {
  display: grid;
  grid-template-columns: 30px 1fr 80px;
  gap: 5px;
  border-bottom: 1px solid #ecdcd6;
  padding: 12px 0;
  align-items: center;
  font-size: 12px;
}
.rank-no {
  font:
    22px Georgia,
    serif;
  color: #b08a4c;
}
.rank-row small {
  display: block;
  font-size: 9px;
  color: #a38a93;
  margin-top: 4px;
}
.score {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.rank-empty {
  font-size: 12px;
  padding: 25px 10px;
  line-height: 1.8;
  text-align: center;
  color: #927180;
}
#loading {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #fff8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #98506d;
}
#loading > span {
  font-size: 34px;
  animation: hop 1s ease-in-out infinite;
}
@keyframes hop {
  50% {
    transform: translateY(-10px);
  }
}
@media (max-height: 760px) and (min-width: 761px) {
  .select-panel {
    padding: 17px 20px;
    top: 90px;
    bottom: 14px;
    width: 452px;
  }
  .intro h1 {
    font-size: 23px;
  }
  .dog-card canvas {
    aspect-ratio: 1.75;
  }
  .dog-card span {
    font-size: 9px;
    min-height: 23px;
  }
  .selection-top {
    margin: 10px 0 8px;
  }
  .coat-picker {
    margin: 12px 0;
  }
  .selection-actions {
    bottom: -17px;
  }
  .controls-note {
    font-size: 10px;
  }
  .ranks-link {
    padding: 8px;
  }
  .stats {
    margin-bottom: 8px;
  }
}
@media (max-width: 760px) {
  header {
    padding: 14px 16px;
  }
  .brand {
    gap: 8px;
  }
  .brand > span {
    font-size: 26px;
  }
  .brand small {
    font-size: 8px;
    letter-spacing: 0.13em;
  }
  .brand strong {
    font-size: 13px;
  }
  .round {
    width: 39px;
    height: 39px;
    font-size: 20px;
  }
  .select-panel {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: 68dvh;
    padding: 14px 17px;
    border-radius: 25px 25px 0 0;
  }
  .intro .eyebrow,
  .intro p {
    display: none;
  }
  .intro h1 {
    font-size: 20px;
    margin: 0 0 9px;
  }
  .selection-top {
    margin: 8px 0;
  }
  .selection-top h2 {
    font-size: 14px;
  }
  .dog-grid {
    gap: 4px;
  }
  .dog-card {
    border-radius: 9px;
  }
  .dog-card canvas {
    aspect-ratio: 1.6;
  }
  .dog-card span {
    font-size: 9px;
    min-height: 24px;
  }
  .coat-picker {
    margin: 13px 0;
    gap: 13px;
  }
  .coat-picker button {
    width: 24px;
    height: 24px;
  }
  .stats {
    margin-bottom: 9px;
  }
  .stat label {
    font-size: 10px;
  }
  .selection-actions {
    bottom: -14px;
    padding: 6px 0;
  }
  .primary,
  .secondary {
    min-height: 44px;
    font-size: 14px;
  }
  .controls-note {
    font-size: 10px;
    margin-top: 7px;
  }
  .controls-note br {
    display: none;
  }
  .ranks-link {
    padding: 8px;
    font-size: 11px;
  }
  #previewCaption {
    display: none;
  }
  .hud-top {
    left: 12px;
    right: 12px;
    top: 76px;
    gap: 6px;
    align-items: flex-start;
  }
  .progress-card {
    padding: 10px 11px;
    width: auto;
    flex: 1;
  }
  .progress-card > div:first-child {
    font-size: 10px;
  }
  .progress-card strong {
    font-size: 15px;
  }
  .time-card {
    padding: 9px 10px;
  }
  .time-card strong {
    font-size: 16px;
  }
  .time-card small {
    font-size: 7px;
  }
  #pause {
    width: 35px;
    height: 35px;
    font-size: 17px;
    flex-shrink: 0;
  }
  .area-progress {
    top: 141px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    gap: 7px;
    padding: 7px 11px;
  }
  #hint {
    top: 182px;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 24px);
    width: max-content;
    font-size: 10px;
    padding: 7px 12px;
  }
  #feedback {
    top: 29%;
    font-size: 18px;
  }
  .bottom-hint {
    bottom: 115px;
    left: 15px;
    right: 15px;
    font-size: 9px;
  }
  .bottom-hint span {
    padding: 6px 9px;
  }
  #touchControls {
    left: 19px;
    right: 20px;
    bottom: max(24px, env(safe-area-inset-bottom));
  }
  .dpad {
    gap: 10px;
  }
  .dpad button {
    width: 60px;
    height: 61px;
  }
  .desktop-keys {
    display: none;
  }
  #jump {
    width: 78px;
    height: 78px;
  }
  .modal {
    padding: 23px;
  }
  .modal h2 {
    font-size: 20px;
  }
  .win-stat strong {
    font-size: 32px;
  }
  .win-screen .modal {
    padding: 20px 23px;
  }
  .win-screen .modal h2 {
    margin: 12px 0 5px;
  }
  .win-screen .modal p {
    margin: 8px 0;
  }
  .win-stat {
    padding: 10px;
    margin: 10px 0;
  }
}
@media (max-height: 580px) and (orientation: landscape) {
  header {
    padding: 9px 15px;
  }
  .brand strong {
    font-size: 12px;
  }
  .brand small {
    font-size: 7px;
  }
  .select-panel {
    top: 58px;
    bottom: 0;
    left: 0;
    width: 52%;
    max-height: none;
  }
  .intro h1 {
    font-size: 17px;
  }
  .dog-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  .dog-card canvas {
    aspect-ratio: 2;
  }
  .dog-card span {
    font-size: 8px;
    min-height: 20px;
  }
  .coat-picker {
    margin: 8px 0;
  }
  .hud-top {
    top: 55px;
  }
  .area-progress {
    top: 121px;
    left: 20px;
    transform: none;
  }
  #hint {
    top: 61px;
    left: auto;
    right: 70px;
    transform: none;
    width: auto;
    max-width: 40%;
    font-size: 10px;
  }
  #feedback {
    top: 35%;
    font-size: 17px;
  }
  .bottom-hint {
    bottom: 92px;
  }
  #touchControls {
    bottom: 12px;
  }
  .dpad button {
    width: 55px;
    height: 50px;
  }
  #jump {
    width: 65px;
    height: 65px;
  }
  .desktop-keys {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

.balance-note {
  font-size: 10px;
  color: #9c7888;
  line-height: 1.6;
  margin: 0 0 8px;
}
.photo-collection {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.photo-collection:empty {
  display: none;
}
.photo-collection figure {
  margin: 0;
  padding: 5px 5px 7px;
  background: white;
  box-shadow: 0 2px 10px #b7799417;
  transform: rotate(-2deg);
  border: 1px solid #f0dfe6;
  border-radius: 5px;
}
.photo-collection figure:nth-child(even) {
  transform: rotate(2deg);
}
.photo-collection canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 3px;
}
.photo-collection figcaption {
  font-size: 9px;
  color: #b48294;
  margin-top: 4px;
}
.bottom-hint {
  gap: 8px;
}
.bottom-hint #ribbonCount {
  font-weight: 600;
}
.score small {
  font-size: 9px;
  font-weight: 400;
  line-height: 1.4;
  margin-top: 4px;
  white-space: nowrap;
}
.rank-row {
  grid-template-columns: 26px 1fr 104px;
}
@media (max-width: 760px) {
  .balance-note {
    font-size: 9px;
  }
  .bottom-hint {
    left: 12px;
    right: 12px;
    font-size: 8px;
  }
  .bottom-hint span {
    padding: 6px 8px;
  }
  .photo-collection {
    gap: 7px;
    margin: 10px 0;
  }
}

#item {
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  width: 76px;
  min-height: 69px;
  border: 2px solid #ddbc86;
  border-radius: 18px;
  background: #fff4dcf2;
  color: #a57b46;
  box-shadow: 0 5px 18px #9f6c5c14;
  padding: 7px 5px;
}
#item > span {
  display: block;
  font-size: 25px;
  line-height: 1.1;
}
#item small {
  font-size: 9px;
  line-height: 1.3;
  display: block;
  margin-top: 5px;
}
#item:disabled {
  opacity: 0.68;
}
#item:not(:disabled) {
  border-color: #c090bc;
  background: #fff0f7;
  color: #a05986;
}
#item.pressed {
  transform: translateY(2px);
}
@media (max-width: 760px) {
  #item {
    width: 66px;
    min-height: 66px;
    margin-left: auto;
    margin-right: 11px;
  }
  #item small {
    font-size: 8px;
  }
  #touchControls {
    gap: 8px;
  }
  .dpad {
    gap: 8px;
  }
  .dpad button {
    width: 54px;
  }
  #jump {
    flex-shrink: 0;
  }
}

.desktop-keys {
  bottom: 105px;
  padding: 6px 12px;
  background: #fffaf2cf;
  border-radius: 16px;
  font-size: 11px;
}
@media (max-width: 760px) {
  #feedback {
    top: max(228px, 29dvh);
  }
}
@media (max-height: 580px) and (orientation: landscape) {
  #feedback {
    top: 161px;
  }
}

#encounterStatus {
  position: fixed;
  z-index: 4;
  top: 25%;
  left: 50%;
  transform: translateX(-50%);
  width: min(330px, calc(100% - 30px));
  padding: 12px 16px 10px;
  border: 1px solid #fff;
  border-radius: 18px;
  background: #fff9edf2;
  box-shadow: 0 5px 25px #ab718d20;
  text-align: center;
  pointer-events: none;
  color: #934b71;
}
#encounterStatus strong {
  display: block;
  font-size: 13px;
  line-height: 1.5;
}
#encounterCountdown {
  display: block;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  margin: 4px 0;
  color: #a77545;
}
#encounterProgress {
  height: 5px;
  background: #eed8df;
  border-radius: 8px;
  overflow: hidden;
  margin: 4px 8px;
}
#encounterBar {
  height: 100%;
  display: block;
  background: #c995b5;
  width: 0;
  border-radius: 8px;
}
#encounterStatus small {
  display: block;
  font-size: 9px;
  color: #a88289;
  margin-top: 5px;
}
@media (max-width: 760px) {
  #encounterStatus {
    top: max(224px, 28dvh);
    padding: 9px 12px 8px;
    width: min(310px, calc(100% - 30px));
  }
  #encounterStatus strong {
    font-size: 12px;
  }
}
@media (max-height: 580px) and (orientation: landscape) {
  #encounterStatus {
    top: 157px;
    left: 72%;
    width: 265px;
    padding: 7px 10px;
  }
  #encounterStatus small {
    display: none;
  }
}

/* ---- v13 brush-up: readable HUD, active item timer ---- */
#activeEffect {
  position: fixed;
  z-index: 4;
  right: 24px;
  bottom: 112px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2px 7px;
  min-width: 168px;
  padding: 7px 12px 8px;
  border: 1.5px solid #e6c98f;
  border-radius: 999px;
  background: linear-gradient(180deg, #fffaf0f5, #fff0f6f5);
  box-shadow: 0 4px 16px #b27a8f26, inset 0 0 0 2px #ffffff90;
  color: #9a4d74;
  pointer-events: none;
}
#activeEffect span {
  font-size: 17px;
  color: #c39a4f;
  grid-row: span 2;
}
#activeEffect b {
  font-size: 12px;
  white-space: nowrap;
}
#activeEffect small {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #a77a3b;
}
#activeEffect i {
  grid-column: 2 / 4;
  display: block;
  height: 5px;
  border-radius: 6px;
  background: #f1dbe3;
  overflow: hidden;
}
#activeEffect em {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #e9a3c4, #d9b56a);
}
#item small {
  white-space: nowrap;
}
@media (max-width: 760px) {
  #activeEffect {
    right: 12px;
    bottom: calc(158px + env(safe-area-inset-bottom));
    min-width: 150px;
  }
  .bottom-hint {
    font-size: 11px;
  }
  #item small {
    font-size: 10px;
  }
  #encounterStatus small {
    font-size: 10px;
  }
}
@media (max-height: 580px) and (orientation: landscape) {
  #activeEffect {
    bottom: 92px;
  }
  /* Small landscape phones: keep the progress card compact so the hint no longer covers TIME. */
  .progress-card {
    flex: 0 1 250px;
  }
  #pause {
    margin-left: 0;
  }
  #hint {
    max-width: max(170px, calc(100% - 470px));
  }
}

/* ---- v14: dog name, fastest-dog ranking, record card ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.name-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0 0 10px;
  padding: 10px 14px;
  border: 1.5px dashed #e3bccb;
  border-radius: 999px;
  background: #fff8f4;
  color: #8b3f65;
  font-size: 14px;
  text-align: left;
}
.name-chip b {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.name-chip small {
  font-size: 11px;
  color: #b08a4c;
  border-left: 1px solid #ecd6dd;
  padding-left: 8px;
}
.name-chip.empty {
  border-style: solid;
  border-color: #d58fae;
  background: #fff0f6;
}
.name-sheet {
  border: 0;
  border-radius: 26px;
  padding: 26px 22px 18px;
  width: min(360px, calc(100% - 32px));
  background: linear-gradient(180deg, #fffaf3, #fff1f6);
  box-shadow: 0 18px 60px #8a3a5c40, inset 0 0 0 2px #fff, inset 0 0 0 4px #ecd2a0;
  color: #593349;
  text-align: center;
}
.name-sheet::backdrop {
  background: #5a2b4255;
  backdrop-filter: blur(3px);
}
.name-sheet h2 {
  margin: 6px 0 4px;
  font-size: 21px;
}
.name-lead {
  margin: 0 0 14px;
  font-size: 13px;
  color: #966e80;
}
.name-sheet input {
  width: 100%;
  font-size: 18px;
  padding: 12px 14px;
  border: 2px solid #e8c9d4;
  border-radius: 14px;
  background: #fff;
  color: #593349;
  text-align: center;
}
.name-sheet input:focus {
  outline: none;
  border-color: #c77a9d;
  box-shadow: 0 0 0 4px #f6d8e5;
}
.name-error {
  min-height: 18px;
  margin: 6px 0 8px;
  font-size: 12px;
  color: #b23c6a;
}
.name-sheet .primary {
  width: 100%;
}
.name-sheet .text-button {
  margin-top: 6px;
}
.name-note {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: #a08390;
}
.new-record {
  margin: 4px auto 8px;
  padding: 8px 14px 9px;
  border-radius: 16px;
  background: linear-gradient(90deg, #fbe0ea, #fff4d6, #fbe0ea);
  background-size: 200% 100%;
  color: #b0456f;
  font-weight: 800;
  letter-spacing: 0.12em;
  font-size: 16px;
  box-shadow: inset 0 0 0 1.5px #e6c27a;
  animation: record-shine 2.4s linear infinite;
}
.new-record span {
  color: #c49a4f;
  margin: 0 6px;
}
.new-record small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  letter-spacing: 0;
  font-weight: 600;
  color: #9a6a3a;
}
@keyframes record-shine {
  to {
    background-position: -200% 0;
  }
}
.rank-result {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin: 8px 0 10px;
  padding: 0;
}
.rank-result li {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  padding: 8px 6px;
  border-radius: 12px;
  background: #fff8f2;
  box-shadow: inset 0 0 0 1px #f0dccf;
  font-size: 12px;
  color: #8b5a70;
}
.rank-result strong {
  font-size: 19px;
  color: #86264b;
}
.rank-result small {
  font-size: 11px;
  color: #a98a90;
}
.rank-result li.top {
  background: #fff3d6;
  box-shadow: inset 0 0 0 1.5px #ddb764;
}
.share-button {
  margin-bottom: 4px;
}
.rank-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin: 6px 0 8px;
  padding: 4px;
  border-radius: 999px;
  background: #f6e6ea;
}
.rank-tabs button {
  border: 0;
  border-radius: 999px;
  padding: 8px 0;
  background: transparent;
  color: #9a6a80;
  font-size: 13px;
}
.rank-tabs button[aria-selected="true"] {
  background: #fff;
  color: #86264b;
  font-weight: 700;
  box-shadow: 0 2px 8px #b2718f26;
}
.rank-caption {
  font-size: 11px;
  color: #a38a93;
  margin: 0 0 4px;
}
.rank-row.mine {
  background: #fff1f6;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1.5px #e7a9c4;
  padding-left: 6px;
  padding-right: 6px;
}
.rank-row small {
  font-size: 11px;
}
@media (prefers-reduced-motion: reduce) {
  .new-record {
    animation: none;
  }
}
.countdown {
  position: fixed;
  z-index: 6;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  font:
    800 112px/1 ui-rounded,
    "Hiragino Maru Gothic ProN",
    sans-serif;
  color: #c2547f;
  text-shadow:
    0 4px 0 #fff,
    0 -3px 0 #fff,
    4px 0 0 #fff,
    -4px 0 0 #fff,
    0 10px 30px #b2718f66;
}
.countdown.go {
  font-size: 54px;
  color: #b8893b;
  white-space: nowrap;
}
.countdown.pop {
  animation: count-pop 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
@keyframes count-pop {
  from {
    transform: translate(-50%, -50%) scale(1.8);
    opacity: 0;
  }
  35% {
    opacity: 1;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .countdown.pop {
    animation: none;
  }
}
