.acwf-app {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 24px;
  align-items: start;
}

.acwf-stage-card {
  position: relative;
  border-radius: 18px;
  border: 1px solid rgba(247, 201, 72, 0.25);
  overflow: hidden;
  padding: 20px 16px 24px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  background: radial-gradient(ellipse at 50% 15%, #16305c 0%, #09152b 65%, #050b18 100%);
  transition: background 0.4s ease;
}

.acwf-stage-card[data-theme="cozy-cabin"] {
  background: radial-gradient(ellipse at 50% 18%, #47211a 0%, #210f12 65%, #120709 100%);
  border-color: rgba(247, 179, 72, 0.35);
}

.acwf-stage-card[data-theme="frosted-pine"] {
  background: radial-gradient(ellipse at 50% 15%, #123b4a 0%, #09212c 65%, #041118 100%);
  border-color: rgba(125, 211, 252, 0.35);
}

.acwf-stage-card[data-theme="aurora-pro"] {
  background:
    radial-gradient(ellipse at 25% 15%, rgba(52, 211, 153, 0.28), transparent 55%),
    radial-gradient(ellipse at 78% 22%, rgba(167, 139, 250, 0.28), transparent 55%),
    radial-gradient(ellipse at 50% 100%, #0b1b36 0%, #060d1f 100%);
  border-color: rgba(110, 231, 183, 0.45);
}

/* Reserved /_a/ custom artwork slot for future HD tree PNG replacement */
.tree-asset-slot {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.92;
  pointer-events: none;
  z-index: 0;
}

.acwf-stage-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.acwf-tree-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(7, 16, 34, 0.65);
  border: 1px solid rgba(247, 201, 72, 0.35);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #f7c948;
}

.acwf-progress-pill {
  font-size: 13px;
  font-weight: 600;
  color: #dce5f7;
  background: rgba(7, 16, 34, 0.65);
  border: 1px solid rgba(240, 244, 255, 0.14);
  border-radius: 999px;
  padding: 5px 12px;
}

.acwf-tree-viewport {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  aspect-ratio: 3 / 4;
}

.acwf-tree-svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.45));
}

.acwf-star-top {
  transform-origin: 210px 44px;
  animation: starPulse 3.2s ease-in-out infinite;
}

@keyframes starPulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(247, 201, 72, 0.8)); }
  50% { filter: drop-shadow(0 0 18px rgba(247, 201, 72, 1)); }
}

.acwf-ornaments-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.acwf-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px dashed rgba(247, 201, 72, 0.55);
  background: rgba(7, 16, 34, 0.62);
  color: #f7d774;
  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.acwf-node:hover {
  transform: translate(-50%, -50%) scale(1.14);
  border-color: #f7c948;
  box-shadow: 0 0 14px rgba(247, 201, 72, 0.55);
  z-index: 6;
}

.acwf-node.is-hung {
  border-style: solid;
  border-color: rgba(247, 201, 72, 0.85);
  background: radial-gradient(circle at 30% 30%, #263f70, #0d1b36);
  box-shadow: 0 0 12px rgba(247, 201, 72, 0.45);
  animation: ornamentGlow 2.8s ease-in-out infinite;
}

.acwf-node.is-opened {
  border-color: #6ee7b7;
  background: radial-gradient(circle at 30% 30%, #2f7d4f, #123c26);
  box-shadow: 0 0 18px rgba(110, 231, 183, 0.65);
  animation: none;
}

.acwf-node.is-shaking {
  animation: nodeShake 0.42s ease-in-out;
}

@keyframes ornamentGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(247, 201, 72, 0.35); }
  50% { box-shadow: 0 0 18px rgba(247, 201, 72, 0.78); }
}

@keyframes nodeShake {
  0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
  25% { transform: translate(-56%, -50%) rotate(-8deg); }
  50% { transform: translate(-44%, -50%) rotate(8deg); }
  75% { transform: translate(-53%, -50%) rotate(-4deg); }
}

.acwf-node-icon { font-size: 16px; line-height: 1; }
.acwf-node-day {
  position: absolute;
  bottom: -6px;
  right: -5px;
  background: #071022;
  color: #f7c948;
  border: 1px solid rgba(247, 201, 72, 0.6);
  border-radius: 999px;
  font-size: 10px;
  line-height: 1;
  padding: 2px 4px;
  min-width: 17px;
  text-align: center;
}

.acwf-stage-legend {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 12px;
  color: #9eb0d0;
}

.acwf-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
.acwf-dot-empty { border: 1.5px dashed #f7c948; }
.acwf-dot-hung { background: #f7c948; box-shadow: 0 0 6px #f7c948; }
.acwf-dot-opened { background: #6ee7b7; box-shadow: 0 0 6px #6ee7b7; }

/* Right Panel */
.acwf-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.acwf-card {
  background: #0f1d38;
  border: 1px solid rgba(240, 244, 255, 0.12);
  border-radius: 14px;
  padding: 20px;
}

.acwf-card h2 {
  font-size: 22px;
  margin: 0 0 6px;
}

.acwf-tagline {
  color: #9eb0d0;
  font-size: 14px;
  margin: 0 0 14px;
}

.acwf-theme-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.acwf-theme-btn {
  background: #071022;
  border: 1px solid rgba(240, 244, 255, 0.14);
  border-radius: 10px;
  color: #dce5f7;
  padding: 9px 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.acwf-theme-btn[aria-pressed="true"] {
  border-color: #f7c948;
  background: rgba(247, 201, 72, 0.14);
  color: #f7c948;
}

.acwf-share-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.acwf-code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #071022;
  border: 1px solid rgba(247, 201, 72, 0.35);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.acwf-code-val {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #f7c948;
}

.acwf-status-msg {
  margin: 10px 0 0;
  font-size: 13px;
  color: #6ee7b7;
  min-height: 18px;
}

.acwf-lookup-row {
  display: flex;
  gap: 8px;
}
.acwf-lookup-row input {
  flex: 1;
  min-width: 0;
  background: #071022;
  border: 1px solid rgba(240, 244, 255, 0.14);
  border-radius: 10px;
  padding: 10px 12px;
  color: #f0f4ff;
  font-size: 14px;
}

.acwf-my-trees {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.acwf-tree-chip {
  background: rgba(247, 201, 72, 0.12);
  border: 1px solid rgba(247, 201, 72, 0.35);
  color: #f7c948;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.acwf-pro-strip {
  border-color: rgba(110, 231, 183, 0.3);
  background: linear-gradient(135deg, rgba(16, 42, 67, 0.9), rgba(15, 29, 56, 0.95));
}

.acwf-pro-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* Modal */
.acwf-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 9, 20, 0.82);
  backdrop-filter: blur(6px);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.acwf-modal {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: #0f1d38;
  border: 1px solid rgba(247, 201, 72, 0.4);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  position: relative;
}

.acwf-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(240, 244, 255, 0.18);
  background: rgba(7, 16, 34, 0.6);
  color: #f0f4ff;
  font-size: 18px;
  cursor: pointer;
}

.acwf-icon-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 14px;
}

.acwf-icon-opt {
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(240, 244, 255, 0.14);
  background: #071022;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.acwf-icon-opt[aria-pressed="true"] {
  border-color: #f7c948;
  background: rgba(247, 201, 72, 0.2);
  box-shadow: 0 0 10px rgba(247, 201, 72, 0.35);
}

.acwf-unwrap-box {
  text-align: center;
  padding: 8px 0;
}

.acwf-unwrap-emoji {
  font-size: 52px;
  line-height: 1.1;
  margin-bottom: 10px;
  display: inline-block;
  animation: popBurst 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes popBurst {
  0% { transform: scale(0.4) rotate(-14deg); opacity: 0; }
  70% { transform: scale(1.18) rotate(5deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.acwf-note-quote {
  background: #071022;
  border: 1px solid rgba(247, 201, 72, 0.3);
  border-radius: 12px;
  padding: 16px;
  font-size: 16px;
  line-height: 1.6;
  color: #f0f4ff;
  margin: 14px 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.acwf-countdown {
  display: inline-block;
  background: rgba(224, 82, 99, 0.16);
  border: 1px solid rgba(224, 82, 99, 0.45);
  color: #fda4af;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  margin: 10px 0 14px;
}

.acwf-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #9eb0d0;
  margin: 6px 0 14px;
}

.acwf-owner-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(7, 16, 34, 0.65);
  border: 1px dashed rgba(247, 201, 72, 0.35);
  font-size: 13px;
  color: #9eb0d0;
}

@media (max-width: 880px) {
  .acwf-app { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .acwf-node { width: 34px; height: 34px; }
  .acwf-node-icon { font-size: 14px; }
  .acwf-share-grid { grid-template-columns: 1fr; }
  .acwf-icon-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}