:root {
  --zbtool-shell-padding: 24px;
  --dino-border: #e6ebf2;
  --dino-soft: #f8fafc;
  --dino-bg: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  --dino-shadow: 0 24px 44px -34px rgba(15, 23, 42, 0.3);
}

.panel-work,
.panel-related,
.panel-comments {
  display: grid;
  gap: 18px;
}

.dino-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(340px, 0.95fr);
  gap: 22px;
  align-items: start;
}

.dino-main,
.dino-side {
  display: grid;
  gap: 18px;
}

.dino-side {
  align-content: start;
}

.dino-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.tool-block {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--dino-border);
  border-radius: 22px;
  background: var(--dino-bg);
  box-shadow: var(--dino-shadow);
}

.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.section-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #eef8f1 0%, #dff3e5 100%);
  color: #13633a;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid #c3e8d0;
}

.section-pill-soft {
  background: linear-gradient(180deg, #f7f9ff 0%, #eef3ff 100%);
  border-color: #d8e1f7;
  color: #29527c;
}

.board-flags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.board-flag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: #fff7e8;
  border: 1px solid #ffd8a8;
  color: #8a5100;
  font-size: 13px;
}

.tool-tip {
  min-height: 24px;
  color: #334155;
  font-size: 14px;
  line-height: 1.7;
}

.tool-tip.error {
  color: #b42318;
}

.game-shell {
  padding: 16px;
  border-radius: 28px;
  background: linear-gradient(180deg, #fffdf8 0%, #f6f1e3 100%);
  border: 1px solid #eadcb9;
}

.game-stage {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: #f6f8fc;
}

#dino-canvas {
  display: block;
  width: 100%;
  height: auto;
  min-height: 340px;
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: #0f172a;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.58) 100%);
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.game-overlay.is-hidden {
  opacity: 0;
}

.game-overlay strong {
  font-size: 28px;
  line-height: 1.2;
}

.game-overlay span {
  max-width: 460px;
  padding: 0 16px;
  font-size: 14px;
  line-height: 1.8;
  color: #334155;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-row button {
  min-width: 108px;
}

.action-row button,
.zbtool-comments .com_info button {
  border: 1px solid #ced7e3;
  background: #f7fafc;
  color: #334155;
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.action-row button:hover,
.zbtool-comments .com_info button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -18px rgba(51, 65, 85, 0.45);
  background: #ffffff;
}

.action-row button.primary {
  background: linear-gradient(180deg, #1f8a4b 0%, #176c39 100%);
  border-color: #176c39;
  color: #fff;
  box-shadow: 0 16px 26px -18px rgba(23, 108, 57, 0.9);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.status-panel {
  align-content: start;
}

.stat-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid #e3e8f0;
  background: var(--dino-soft);
}

.stat-card.stat-wide {
  grid-column: 1 / -1;
}

.stat-card span {
  font-size: 12px;
  color: #64748b;
}

.stat-card strong {
  font-size: 18px;
  line-height: 1.3;
  color: #0f172a;
  font-weight: 700;
}

.settings-panel,
.mission-panel {
  align-content: start;
}

.control-grid {
  display: grid;
  gap: 14px;
}

.settings-panel .control-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.control {
  display: grid;
  gap: 8px;
}

.control span {
  color: #475569;
  font-size: 13px;
}

.control select {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid #d7dfe9;
  padding: 0 12px;
  font-size: 14px;
  background: #fff;
  color: #0f172a;
}

.mission-text,
.helper-list,
.empty-state {
  margin: 0;
  line-height: 1.9;
  color: #64748b;
}

.mission-text {
  font-size: 15px;
  color: #334155;
}

.guide-panel-wide {
  gap: 12px;
  padding-bottom: 18px;
}

.mission-progress {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: #edf2f7;
}

.mission-bar {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #33c26b 0%, #169857 100%);
  transition: width 0.2s ease;
}

.helper-list {
  padding-left: 18px;
  columns: 2;
  column-gap: 28px;
}

.helper-list li {
  break-inside: avoid;
  margin-bottom: 8px;
}

.panel-related h2,
.zbtool-comments h3 {
  display: block !important;
  margin: 0 0 18px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  text-indent: 0 !important;
  color: #333 !important;
  font-size: 18px !important;
  line-height: 1.4 !important;
  font-weight: 400 !important;
}

.panel-related .zbtool-related-list li {
  box-shadow: 1px 2px 8px rgba(15, 23, 42, 0.08);
}

.zbtool-comments .compost {
  margin: 15px 0;
}

.zbtool-comments .com_name {
  display: block;
  color: #5781bf;
}

.zbtool-comments .com_name a,
.zbtool-comments .clbody .cinfo h5,
.zbtool-comments .clbody .cinfo span a,
.zbtool-comments .clbody p a {
  color: #5781bf;
}

.zbtool-comments .com_info {
  margin-top: 15px;
  overflow: hidden;
}

.zbtool-comments .com_info ul {
  display: inline-block;
  float: left;
  list-style: none;
  margin: 0;
  padding: 0;
}

.zbtool-comments .com_info li {
  float: left;
  margin: 0 15px 15px 0;
}

.zbtool-comments .com_info li input {
  width: 160px;
  height: 30px;
  line-height: 30px;
  padding: 0 0 0 4px;
  border: 1px solid #ddd;
  box-sizing: border-box;
  background: #fff;
  font-size: 14px;
}

.zbtool-comments .com_box {
  margin-bottom: 15px;
}

.zbtool-comments .com_box textarea {
  display: block;
  width: 100%;
  min-height: 150px;
  border: 1px solid #ddd;
  padding: 10px;
  box-sizing: border-box;
  background: #fff;
  font-size: 14px;
  line-height: 1.6;
}

.zbtool-comments .com_info button {
  background: #5781bf;
  border: 0;
  border-radius: 3px;
  padding: 8px 20px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}

.zbtool-comments .com_info button:hover {
  background: #6b90c7;
}

.zbtool-comments .comlist ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid #ededed;
}

.zbtool-comments .comlist ul ul {
  margin-left: 28px;
}

.zbtool-comments .comlist li {
  display: block;
  overflow: hidden;
  padding: 15px 0;
}

.zbtool-comments .comlist li img {
  float: left;
  width: 40px;
  height: 40px;
  max-width: none;
  border-radius: 50%;
  object-fit: cover;
}

.zbtool-comments .comlist li .clbody {
  margin-left: 50px;
}

.zbtool-comments .clbody .cinfo {
  display: block;
  overflow: hidden;
}

.zbtool-comments .clbody .cinfo h5 {
  float: left;
  margin: 0;
  font-size: 14px;
  line-height: 18px;
  font-weight: 400;
}

.zbtool-comments .clbody .cinfo span {
  float: right;
}

.zbtool-comments .clbody em {
  display: block;
  color: #888;
  height: 24px;
  line-height: 24px;
  font-size: 12px;
  font-style: normal;
}

.zbtool-comments .clbody p {
  margin: 0;
  line-height: 24px;
  color: #4a4a4a;
  overflow: hidden;
}

.pagebar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pagebar a,
.pagebar .now-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #d6deea;
  text-decoration: none;
  color: #334155;
  background: #fff;
}

.pagebar .now-page {
  background: #eef6ff;
  border-color: #c8def6;
  color: #225282;
}

@media (max-width: 980px) {
  .dino-layout {
    grid-template-columns: 1fr;
  }

  .dino-bottom-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .tool-block {
    padding: 16px;
    border-radius: 18px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card.stat-wide {
    grid-column: auto;
  }

  .dino-side {
    grid-template-columns: 1fr;
  }

  .dino-bottom-grid,
  .settings-panel .control-grid {
    grid-template-columns: 1fr;
  }

  .game-shell {
    padding: 10px;
    border-radius: 20px;
  }

  .game-stage {
    border-radius: 18px;
  }

  .game-overlay strong {
    font-size: 22px;
  }

  #dino-canvas {
    min-height: 280px;
  }

  .helper-list {
    columns: 1;
    column-gap: 0;
  }

  .zbtool-comments .comlist ul ul {
    margin-left: 16px;
  }
}
