/*
 * tank.css
 * 水槽本体・背景・光の筋・水面・気泡・砂利・水草のスタイルを定義します。
 */

/* ── 水槽コンテナ ─────────────────────────────────── */
#tank {
  width: min(100%, 900px);
  max-width: calc(100vw - 32px);
  height: 560px;
  min-height: 560px;
  flex: 0 0 auto;
  background: linear-gradient(
    180deg,
    #061220 0%,
    #0a2040 35%,
    #0d2e55 70%,
    #0a2240 100%
  );
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}

@media (max-width: 720px) {
  #tank {
    height: min(110vw, 68vh, 480px);
    height: min(110vw, 68svh, 480px);
    min-height: 340px;
  }
}

/* ガラス枠 */
#tank::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  border: 3px solid rgba(180, 220, 255, 0.12);
  pointer-events: none;
  z-index: 30;
}

/* ガラス左端の反射 */
#tank::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 18px;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0%, transparent 100%);
  border-radius: 16px 0 0 16px;
  pointer-events: none;
  z-index: 30;
}

/* ── ヘッダー ────────────────────────────────────── */
#tank-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.07);
  z-index: 20;
}

.site-title {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.5px;
}

.hint-text {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}

/* ── 光の筋 ──────────────────────────────────────── */
.ray {
  position: absolute;
  top: 44px;
  width: 44px;
  height: 320px;
  background: linear-gradient(180deg, rgba(140, 210, 255, 0.07) 0%, transparent 100%);
  transform-origin: top center;
  pointer-events: none;
  animation: rayWave ease-in-out infinite;
}

@keyframes rayWave {
  0%, 100% {
    transform: rotate(var(--ra)) skewX(0deg);
    opacity: var(--ro);
  }
  50% {
    transform: rotate(calc(var(--ra) + 2deg)) skewX(1deg);
    opacity: calc(var(--ro) * 0.6);
  }
}

/* ── 水面 ────────────────────────────────────────── */
#surface {
  position: absolute;
  top: 44px;
  left: 0;
  right: 0;
  height: 14px;
  overflow: hidden;
  pointer-events: none;
  z-index: 8;
}

/* ── 気泡 ────────────────────────────────────────── */
.bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 35%,
    rgba(255, 255, 255, 0.18),
    rgba(255, 255, 255, 0.03)
  );
  border: 0.5px solid rgba(255, 255, 255, 0.15);
  animation: bubbleRise linear infinite;
  pointer-events: none;
}

@keyframes bubbleRise {
  0%   { transform: translateX(0px)  translateY(0);      opacity: 0.7; }
  25%  { transform: translateX(5px)  translateY(-130px); }
  50%  { transform: translateX(-4px) translateY(-270px); opacity: 0.5; }
  75%  { transform: translateX(6px)  translateY(-400px); }
  100% { transform: translateX(-3px) translateY(-520px); opacity: 0;   }
}

/* ── 砂利レイヤー ─────────────────────────────────── */
#sand {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 52px;
  pointer-events: none;
  z-index: 6;
}

/* ── 水草・岩レイヤー ────────────────────────────── */
#plants {
  position: absolute;
  bottom: 48px;
  left: 0;
  right: 0;
  width: 100%;
  pointer-events: none;
  z-index: 7;
}
