.aquarium-layout {
  position: relative;
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 276px;
  gap: 10px;
}

.tank {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--ink) 78%, transparent);
  border-radius: 24px;
  background: #e6f1ec;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.42), var(--shadow-soft);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.tank.is-dragging { border-color: var(--blue); box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.42), 0 0 0 4px var(--color-secondary-soft), var(--shadow-soft); }
.tank.is-removing { border-color: var(--coral); box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.42), 0 0 0 5px var(--color-attention-soft), var(--shadow-soft); }

#aquarium-canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 21px;
  cursor: crosshair;
  touch-action: none;
}

.tank.is-dragging #aquarium-canvas { cursor: grabbing; }

.tank-corner {
  position: absolute;
  width: 34px;
  height: 34px;
  pointer-events: none;
}

.tank-corner::before,
.tank-corner::after { content: ""; position: absolute; background: rgba(255, 255, 255, 0.58); }
.tank-corner::before { width: 24px; height: 2px; }
.tank-corner::after { width: 2px; height: 24px; }
.tank-corner--top { top: 12px; left: 12px; }
.tank-corner--top::before,
.tank-corner--top::after { top: 0; left: 0; }
.tank-corner--bottom { right: 12px; bottom: 12px; transform: rotate(180deg); }

.pause-overlay {
  position: absolute;
  z-index: 4;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 12px;
  border: 1px solid rgba(31, 37, 34, 0.18);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(245, 251, 247, 0.9);
  box-shadow: 0 8px 22px rgba(31, 37, 34, 0.12);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.pause-overlay span { margin-right: 5px; }

.observation-notice {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 15px;
  max-width: calc(100% - 30px);
  padding: 8px 12px;
  border: 1px solid rgba(31, 37, 34, 0.16);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(245, 251, 247, 0.92);
  box-shadow: 0 10px 26px rgba(31, 37, 34, 0.14);
  font-size: 0.69rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.observation-notice.is-visible { opacity: 1; transform: translate(-50%, 0); }
.observation-notice[data-type="remove"] { background: color-mix(in srgb, var(--coral) 32%, white); }
.observation-notice[data-type="hybrid"] { background: color-mix(in srgb, var(--blue) 20%, white); }

.species-card {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: 0 16px 38px rgba(31, 37, 34, 0.09);
  overflow: hidden;
}

.species-card::after {
  content: "";
  position: absolute;
  right: -56px;
  bottom: -62px;
  width: 150px;
  height: 150px;
  border: 32px solid var(--color-primary-soft);
  border-radius: 50%;
  pointer-events: none;
}

.species-close {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  font-size: 1.1rem;
}
.species-close:hover { color: var(--ink); background: var(--color-cell); }

.species-header {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding-right: 22px;
}

.species-header p { margin: 0 0 2px; color: var(--muted); font-size: 0.58rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.species-header h2 { font-size: 1.45rem; line-height: 0.98; overflow-wrap: anywhere; }

.species-icon {
  --species-hue: 82;
  position: relative;
  width: 54px;
  height: 42px;
  display: block;
  border: 2px solid var(--ink);
  border-radius: 56% 48% 52% 44%;
  background: hsl(var(--species-hue) 65% 57%);
  transform: rotate(-3deg);
}

.species-icon::before {
  content: "";
  position: absolute;
  left: -15px;
  top: 10px;
  width: 18px;
  height: 20px;
  border: 2px solid var(--ink);
  background: hsl(calc(var(--species-hue) + 42) 72% 66%);
  clip-path: polygon(100% 50%, 0 0, 12% 100%);
}

.species-icon::after { content: ""; position: absolute; right: 9px; top: 10px; width: 8px; height: 8px; border: 2px solid var(--ink); border-radius: 50%; background: white; }
.species-icon--orb { width: 46px; height: 46px; border-radius: 50%; }
.species-icon--dart { clip-path: polygon(100% 50%, 16% 5%, 0 50%, 16% 95%); border-radius: 0; }
.species-icon--ribbon { height: 28px; border-radius: 62% 38% 58% 42%; transform: rotate(8deg); }

.species-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.species-summary span { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255, 255, 255, 0.48); }
.species-summary small { color: var(--muted); font-size: 0.51rem; font-weight: 900; letter-spacing: 0.07em; }
.species-summary strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.05rem; }

.trait-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.trait-tags span { padding: 5px 7px; border-radius: 999px; color: var(--ink); background: var(--color-secondary-soft); font-size: 0.58rem; font-weight: 800; }
.trait-tags span:nth-child(2) { background: var(--color-attention-soft); }
.trait-tags span:nth-child(3) { background: var(--color-primary-soft); }

.trait-bars { display: grid; gap: 7px; }
.trait-bars span { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 7px; color: var(--muted); font-size: 0.58rem; font-weight: 800; }
.trait-bars i { --value: 50%; position: relative; height: 5px; overflow: hidden; border-radius: 99px; background: var(--color-cell); }
.trait-bars i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--value); border-radius: inherit; background: var(--blue); transition: width 180ms ease; }
.trait-bars span:nth-child(2) i::after { background: var(--coral); }
.trait-bars span:nth-child(3) i::after { background: var(--lime); }

.culture-status { position: relative; z-index: 1; display: grid; gap: 4px; margin-top: auto; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.58); }
.culture-status > span { width: fit-content; padding: 4px 7px; border-radius: 999px; color: var(--muted); background: var(--color-cell); font-size: 0.57rem; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; }
.culture-status > span.is-awake { color: white; background: var(--blue); }
.culture-status > span.is-extinct { color: var(--ink); background: var(--coral); }
.culture-status small { color: var(--muted); font-size: 0.59rem; line-height: 1.35; }
