:root {
  --primary-color: #d62828;
  --secondary-color: #0077b6;
}

/* PAGE */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  background: #f4f4f4;
}

/* CONTAINER */
.container {
  background: white;
  border: 2px solid var(--secondary-color);
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* HEADER */
.header {
  text-align: center;
  padding: 10px;
  background: var(--primary-color);
  color: white;
  font-size: 18px;
  width: 100%;
  border-radius: 8px;
  margin-bottom: 15px;
}

/* IMAGE */
.image-wrapper {
  width: 100%;
}

.image-container {
  position: relative;
  width: 100%;
}

.image-container img {
  display: block;
  width: 100%;
  border-radius: 12px;
}

/* INFO BOX */
.info-box {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  width: 88%;
  padding: 16px;
  background: rgba(255,255,255,0.85);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  opacity: 0;
  max-height: 60%;
  overflow-y: auto;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: auto;
}

.info-box.show {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.info-title {
  font-weight: 600;
  text-align: center;
  margin-bottom: 8px;
  color: var(--primary-color);
}

.info-body {
  text-align: left;
  line-height: 1.5;
}

.info-body ul {
  margin: 0;
  padding-left: 18px;
}

/* CAPTION */
.caption {
  margin-top: 8px;
  color: #555;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  cursor: pointer;
  padding-right: 20px;
}

.caption.truncated::after {
  content: "▼";
  position: absolute;
  right: 0;
  bottom: 0;
  color: var(--secondary-color);
  font-weight: bold;
  font-size: 14px;
  line-height: 1;
  background: white;
  padding-left: 2px;
}

.caption.expanded {
  -webkit-line-clamp: unset;
  overflow: visible;
}

.caption.expanded::after {
  display: none;
}

/* PILL SELECTOR */
.selector-row {
  width: 100%;
  margin-top: 12px;
  margin-bottom: 8px;
}

.pill-container {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  padding-bottom: 4px;
}

.pill-container::-webkit-scrollbar {
  height: 8px;
}

.pill-container::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.pill {
  flex: 0 0 auto;
  min-width: 80px;
  text-align: center;
  white-space: nowrap;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #ccc;
  background: #f1f1f1;
  color: #333;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill:hover {
  background: #e0e0e0;
}

.pill.active {
  background: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 2px rgba(0,119,182,0.3);
}

/* BUTTON ROW */
.buttons-row {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-top: 10px;
  height: 120px;
}

.nutshell-btn {
  flex: 1;
  height: 100%;
  border: none;
  border-radius: 8px;
  background: var(--primary-color);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.1s ease;
}

.nutshell-btn:hover {
  background: #b71c1c;
}

.buttons {
  flex: 2;
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 10px;
}

.buttons button {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: #0096c7;
  color: white;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

/* Active vertical button */
.buttons button.active {
  background: #005f87;
  box-shadow: 0 0 0 2px rgba(0,119,182,0.3);
}

/* Empty button hover effect */
.buttons button:empty {
  background: #e0f0ff;
  color: #aaa;
}

.buttons button:empty:hover {
  background: #cce6ff;
}

.buttons button:hover {
  background: #0077b6;
}

.buttons button:active,
.nutshell-btn:active {
  transform: scale(0.97);
}

.nutshell-btn.active {
  background: #a61b1b;
}