html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #0A0A0A;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: min(10px, 2vmin);
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100dvh;
}

.timelock-card {
  width: min(95vw, min(420px, 95vh / 1.4));
  aspect-ratio: 1/1.4;
  min-height: min(95vh, 420px * 1.4);
  border-radius: 0;
  padding: min(12px, 2vh);
  background: #1A1A1A;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: min(8px, 1vh);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform-style: preserve-3d;
  transition: all 0.3s ease;
}

.timelock-card.locked {
  box-shadow: 0 2px 8px rgba(255, 96, 0, 0.1);
  border-color: rgba(255, 96, 0, 0.2);
}

.timelock-card.unlocked {
  box-shadow: 0 2px 8px rgba(0, 255, 157, 0.1);
  border-color: rgba(0, 255, 157, 0.2);
}

.timelock-card.withdrawn {
  box-shadow: 0 2px 8px rgba(136, 136, 136, 0.1);
  border-color: rgba(136, 136, 136, 0.2);
  opacity: 0.7;
}

.timelock-card.invalid {
  box-shadow: 0 2px 8px rgba(255, 0, 0, 0.15);
  border-color: rgba(255, 0, 0, 0.3);
}

.card-header {
  text-align: center;
  background: #2A2A2A;
  padding: min(6px, 1vh);
  color: #FFFFFF;
  font-weight: 600;
  font-size: min(16px, 2.5vh);
  letter-spacing: 0.5px;
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.timelock-card.locked .card-header {
  background: rgba(255, 96, 0, 0.1);
  border-bottom: 1px solid rgba(255, 96, 0, 0.2);
}

.timelock-card.unlocked .card-header {
  background: rgba(0, 255, 157, 0.1);
  border-bottom: 1px solid rgba(0, 255, 157, 0.2);
}

.timelock-card.withdrawn .card-header {
  background: rgba(136, 136, 136, 0.1);
  border-bottom: 1px solid rgba(136, 136, 136, 0.2);
}

.timelock-card.invalid .card-header {
  background: rgba(255, 0, 0, 0.15);
  border-bottom: 1px solid rgba(255, 0, 0, 0.3);
}

.asset-frame {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: none;
  border: 1px dotted rgba(255, 255, 255, 0.1);
}

.timelock-card.locked .asset-frame {
  background: none;
  box-shadow: none;
  border-color: rgba(255, 96, 0, 0.2);
}

.timelock-card.unlocked .asset-frame {
  background: none;
  box-shadow: none;
  border-color: rgba(0, 255, 157, 0.2);
}

.timelock-card.withdrawn .asset-frame {
  background: none;
  box-shadow: none;
  border-color: rgba(136, 136, 136, 0.2);
}

.timelock-card.invalid .asset-frame {
  background: none;
  box-shadow: none;
  border-color: rgba(255, 0, 0, 0.3);
}

.asset-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.asset-frame img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  width: 100%;
  height: 100%;
  display: block;
}

.asset-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #2A2A2A;
}

[data-inscription-target="content"] {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

[data-inscription-target="content"] img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.fallback-icon {
  font-size: 72px;
  color: #888888;
  opacity: 0.7;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #FF6000;
  border-top: 3px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.info-box {
  background: #2A2A2A;
  padding: min(8px, 1.5vh);
  border-radius: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}

.timelock-card.locked .info-box {
  background: rgba(255, 96, 0, 0.05);
  border-color: rgba(255, 96, 0, 0.2);
}

.timelock-card.unlocked .info-box {
  background: rgba(0, 255, 157, 0.05);
  border-color: rgba(0, 255, 157, 0.2);
}

.timelock-card.withdrawn .info-box {
  background: rgba(136, 136, 136, 0.05);
  border-color: rgba(136, 136, 136, 0.2);
}

.timelock-card.invalid .info-box {
  background: rgba(255, 0, 0, 0.1);
  border-color: rgba(255, 0, 0, 0.3);
}

.value {
  color: #888888;
  font-size: min(12px, 2vh);
  word-break: break-all;
  font-weight: 400;
  font-family: "SF Mono", SFMono-Regular, ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  line-height: 1.2;
}

.status {
  text-align: center;
  background: #1A1A1A;
  color: #FFFFFF;
  font-size: min(13px, 2vh);
  font-weight: 600;
  padding: min(16px, 2.5vh);
  border-radius: 0;
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 2px;
}

.status.locked {
  color: #FF6000;
  background: rgba(255, 96, 0, 0.12);
  border-color: #FF6000;
}

.status.unlocked {
  color: #00FF9D;
  background: rgba(0, 255, 157, 0.12);
  border-color: #00FF9D;
}

.status.withdrawn {
  color: #888888;
  background: rgba(136, 136, 136, 0.12);
  border-color: #888888;
}

.status.loading {
  color: #888888;
  background: rgba(136, 136, 136, 0.12);
  border-color: #888888;
}

.status.invalid {
  color: #FF0000;
  background: rgba(255, 0, 0, 0.15);
  border-color: #FF0000;
}

.status-text {
  font-size: min(0.95em, 1.8vh);
  font-weight: 600;
  letter-spacing: 1.5px;
}

.status-time {
  font-size: min(0.95em, 1.8vh);
  font-weight: 600;
  letter-spacing: 1.5px;
}

.status-time .unit {
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

.footer {
  text-align: center;
  font-size: min(10px, 1.6vh);
  color: #888888;
  font-weight: 500;
  font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: 2px 0;
}

a {
  color: #FF6000;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover,
a:visited {
  color: #FF6000;
}

.info-icon, .close-icon {
  background: none;
  border: none;
  color: #FFFFFF;
  cursor: pointer;
  font-size: min(16px, 2.5vh);
  line-height: 1;
  padding: 0;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  position: absolute;
  right: min(12px, 2vh);
}

.info-icon:hover, .close-icon:hover {
  opacity: 1;
}

.explanation-card {
  display: none;
  width: min(95vw, min(420px, 95vh / 1.4));
  aspect-ratio: 1/1.4;
  min-height: min(95vh, 420px * 1.4);
  border-radius: 0;
  padding: min(12px, 2vh);
  background: #1A1A1A;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
  flex-direction: column;
  gap: min(8px, 1vh);
  border: 1px solid rgba(255, 96, 0, 0.2);
  transform-style: preserve-3d;
  transition: all 0.3s ease;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.explanation-card.visible {
  display: flex;
}

.explanation-card .card-header {
  background: rgba(255, 96, 0, 0.1);
  border-bottom: 1px solid rgba(255, 96, 0, 0.2);
  font-size: min(16px, 2.5vh);
  padding: min(6px, 1vh);
}

.explanation-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: min(12px, 1.5vh);
  padding: min(12px, 1.5vh);
  overflow-y: auto;
  color: #FFFFFF;
  font-size: min(14px, 2vh);
  line-height: 1.4;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin: 0;
}

.explanation-content p {
  margin: 0;
  opacity: 0.95;
}

.explanation-content p:first-child {
  font-size: min(15px, 2.2vh);
  font-weight: 500;
  color: #FF6000;
  opacity: 1;
}

.explanation-content pre {
  margin: 8px 0;
  padding: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.explanation-content .script {
  color: #4a9eff;
  font-family: monospace;
  font-size: 0.9em;
}

.explanation-content .link {
  color: #FF6000;
  text-decoration: none;
}

.explanation-content .link:hover {
  text-decoration: underline;
}

.explanation-content p:last-child {
  margin-top: auto;
  padding-top: min(16px, 2vh);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-style: italic;
  opacity: 0.8;
}
