/* ==========================================
   Pond Hopper Game Card Styles
   ========================================== */

pond-hopper-card {
  display: flex;
  justify-content: center;
  flex: 0 1 auto;
}

pond-hopper-card .game-card {
  width: 100%;
  max-width: 500px;
  box-sizing: border-box;
  background-color: var(--bg-card-body);
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}

pond-hopper-card .game-body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 520px;
  padding: 20px;
  box-sizing: border-box;
}

.ph-title {
  font-size: 0.95rem;
}

.ph-help-label {
  font-size: 0.8rem;
  font-weight: bold;
  margin-bottom: 6px;
  color: var(--color-accent, #d1db9e);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ph-items-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  background: rgba(30, 35, 25, 0.6);
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ph-item-row:not(:last-child) {
  border-bottom: 1px dashed rgba(181, 190, 138, 0.3);
}

.ph-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 0.8rem;
}

#phCanvasWrapper {
  position: relative;
  display: inline-block;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #b5be8a;
  background-color: var(--bg-dark);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  margin-bottom: 4px;
}

canvas#pondHopperCanvas {
  background-color: var(--bg-dark);
  display: block;
}

.ph-control-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ph-control-mode-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 280px;
  margin: 4px auto 2px auto;
  font-size: 0.75rem;
  color: #b5be8a;
  gap: 8px;
  box-sizing: border-box;
}

#phColorBtn {
  padding: 2px 6px;
  font-size: 0.68rem;
  margin-top: 0;
  min-width: 90px;
  max-width: 155px;
  white-space: nowrap;
  text-align: center;
  box-sizing: border-box;
}

#phControlModeBtn {
  padding: 2px 10px;
  font-size: 0.75rem;
  margin-top: 0;
}

.ph-pads-container {
  position: relative;
  width: 240px;
  height: 240px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2px auto;
}

.ph-trackpad {
  display: grid;
  grid-template-areas:
    ".    up    ."
    "left center right"
    ".    down    .";
  grid-template-columns: 46px 46px 46px;
  grid-template-rows: 38px 38px 38px;
  gap: 4px;
  justify-content: center;
  align-items: center;
  background: rgba(30, 35, 25, 0.5);
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(181, 190, 138, 0.3);
  position: absolute;
  touch-action: none;
}

.ph-trackpad .control-btn {
  background: rgba(181, 190, 138, 0.1);
  border: 1px solid rgba(181, 190, 138, 0.25);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  cursor: pointer;
  color: #b5be8a;
  font-size: 0.85rem;
  transition: transform 0.08s ease, background 0.15s ease;
}

.ph-trackpad .control-btn:hover {
  background: rgba(181, 190, 138, 0.25);
}

.ph-trackpad .control-btn:active {
  background: rgba(181, 190, 138, 0.25);
  transform: scale(0.92);
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(20%);
}

.ph-trackpad .pad-up { grid-area: up; }
.ph-trackpad .pad-left { grid-area: left; }
.ph-trackpad .pad-center { grid-area: center; background: rgba(255, 255, 255, 0.02); border-radius: 4px; }
.ph-trackpad .pad-right { grid-area: right; }
.ph-trackpad .pad-down { grid-area: down; }

.ph-swipe-pad {
  width: 240px;
  height: 240px;
  background: rgba(30, 35, 25, 0.6);
  border: 1px solid rgba(181, 190, 138, 0.3);
  border-radius: 12px;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  box-sizing: border-box;
  overflow: hidden;
}

.ph-swipe-svg {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}

.ph-swipe-label {
  transition: opacity 0.12s ease, fill 0.12s ease;
}

.ph-swipe-label.ph-swipe-label-active {
  opacity: 1;
  fill: #f1c40f;
}

.ph-action-row {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 240px;
  justify-content: center;
  margin-top: 4px;
}

.ph-action-row .action-btn {
  flex: 1;
  margin-top: 0;
}

pond-hopper-card .game-help-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-card-body);
  border-radius: 20px;
  z-index: 50;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

pond-hopper-card .game-help-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

@keyframes phSlowBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.ph-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(20, 24, 18, 0.85);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  text-align: center;
  padding: 0 10px;
  z-index: 2;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: auto;
}

.ph-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.ph-overlay .ph-neon-red {
  font-weight: bold;
  font-size: 1.1rem;
  color: #ff4d4d;
  text-shadow: 0 0 8px #ff0000, 0 0 15px #ff0000, 0 0 25px #ff0000;
}

.ph-overlay .ph-blink-text {
  animation: phSlowBlink 2.5s infinite ease-in-out;
}

.ph-help-canvas {
  flex-shrink: 0;
  border: 1px solid #283618;
}

.ph-help-canvas-car {
  background: #22252a;
}

.ph-help-canvas-log {
  background: #2a9d8f;
}

.ph-help-canvas-lily {
  background: #425438;
}