/* LP Market デモ: win95.css の部品の上に、販売サイト固有の配置だけを足す */

body {
  -webkit-text-size-adjust: 100%;
}

p {
  margin: 0;
  line-height: 1.6;
}

h1,
h2,
h3 {
  letter-spacing: 0;
}

/* ── ウィンドウ ── */
.title-bar {
  flex-wrap: nowrap;
}

.title-label span:last-child {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.title-close {
  width: 22px;
  height: 20px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 2px solid;
  border-color: var(--hi) var(--sh-2) var(--sh-2) var(--hi);
  box-shadow: inset 1px 1px var(--hi-2), inset -1px -1px var(--sh);
  color: var(--text);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.title-close:active {
  border-color: var(--sh-2) var(--hi) var(--hi) var(--sh-2);
  box-shadow: inset 1px 1px var(--sh), inset -1px -1px var(--hi-2);
}

.window-body {
  gap: 12px;
  padding: 10px;
}

/* ── 共通ヘッダー（簡易説明 → ロゴ → ドメイン） ── */
.ident {
  padding: 4px 4px 12px;
  border-bottom: 1px solid var(--sh);
  box-shadow: 0 1px var(--hi);
}

.ident__desc {
  font-size: 13px;
}

.ident__logo {
  display: inline-block;
  margin: 4px 0 2px;
  color: var(--text);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
}

.ident__logo small {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 400;
}

.ident__domain {
  font-size: 12px;
  color: #303030;
}

/* ── ボタン（リンクとして使う場合を含む） ── */
.win-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.win-button--default {
  min-height: 32px;
  padding: 5px 18px;
  outline: 1px solid var(--sh-2);
  font-weight: 700;
}

.win-button:disabled {
  cursor: not-allowed;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

/* ── タブ ── */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding-left: 4px;
  margin-bottom: -2px;
  position: relative;
  z-index: 1;
}

.tab {
  min-height: 30px;
  padding: 5px 14px 4px;
  margin-top: 3px;
  background: var(--surface);
  border: 2px solid;
  border-bottom: 0;
  border-color: var(--hi) var(--sh-2) transparent var(--hi);
  box-shadow: inset 1px 1px var(--hi-2), inset -1px 0 var(--sh);
  font-size: 13px;
}

.tab[aria-selected='true'] {
  margin-top: 0;
  padding-bottom: 7px;
  font-weight: 700;
}

.tab:focus-visible {
  outline: 1px dotted var(--sh-2);
  outline-offset: -5px;
}

.tab-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 2px solid;
  border-color: var(--hi) var(--sh-2) var(--sh-2) var(--hi);
  box-shadow: inset 1px 1px var(--hi-2), inset -1px -1px var(--sh);
}

.tab-panel[hidden] {
  display: none;
}

/* ── グループボックス内の文章 ── */
.group-box {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
}

.group-box legend {
  font-weight: 700;
}

.lead p + p {
  margin-top: 6px;
}

/* ── 買うと届くもの ── */
.deliver {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.deliver li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.deliver strong {
  display: block;
  margin-bottom: 2px;
}

.icon32 {
  width: 32px;
  height: 32px;
}

.icon32 svg {
  width: 32px;
  height: 32px;
  fill: #ffff80;
  stroke: var(--sh-2);
  stroke-width: 2;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.icon32--white svg {
  fill: var(--hi);
}

.icon32--blue svg {
  fill: #80c0ff;
}

.icon32--cyan svg {
  fill: #80ffff;
}

/* ── 一覧のツールバー ── */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 12px;
}

.toolbar label {
  display: grid;
  gap: 3px;
  flex: 1 1 200px;
  min-width: 0;
}

.toolbar label[hidden] {
  display: none;
}

.toolbar select {
  height: 28px;
}

.toolbar__count {
  margin-left: auto;
  padding: 4px 0;
  white-space: nowrap;
}

.legend-list {
  margin: 0;
  padding: 6px 8px;
  display: grid;
  gap: 4px;
  background: var(--hi);
  border: 2px solid;
  border-color: var(--sh-2) var(--hi) var(--hi) var(--sh-2);
  box-shadow: inset 1px 1px var(--sh), inset -1px -1px var(--hi-2);
}

.legend-list div {
  display: grid;
  grid-template-columns: 7em minmax(0, 1fr);
  gap: 8px;
}

.legend-list dt {
  font-weight: 700;
}

.legend-list dd {
  margin: 0;
}

/* ── 商品カード ── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
  min-width: 0;
}

.card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 2px solid;
  border-color: var(--hi) var(--sh-2) var(--sh-2) var(--hi);
  box-shadow: inset 1px 1px var(--hi-2), inset -1px -1px var(--sh);
  color: var(--text);
  text-decoration: none;
}

.card:hover .card__title,
.card:focus-visible .card__title {
  background: linear-gradient(90deg, var(--title-active), var(--title-active-2));
}

.card:focus-visible {
  outline: 1px dotted var(--sh-2);
  outline-offset: 2px;
}

.card__title {
  margin: 2px;
  padding: 3px 5px;
  background: var(--title-inactive);
  color: var(--hi);
  font-weight: 700;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.card__thumb {
  position: relative;
  margin: 4px 6px 0;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--hi);
  border: 2px solid;
  border-color: var(--sh) var(--hi) var(--hi) var(--sh);
}

.card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.card__thumb--name {
  padding: 8px;
  color: var(--hi);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.card__thumb .icon32 {
  width: 48px;
  height: 48px;
}

.card__thumb .icon32 svg {
  width: 48px;
  height: 48px;
}

.card__flag {
  position: absolute;
  top: 4px;
  left: 4px;
  padding: 1px 6px;
  background: #ffffe1;
  border: 1px solid var(--sh-2);
  font-size: 12px;
}

.card__body {
  flex: 1 1 auto;
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 8px 8px 6px;
}

.card__cat {
  font-size: 12px;
}

.card__sum {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 8px;
  margin: 0 6px 6px;
  padding-top: 6px;
  border-top: 1px solid var(--sh);
  box-shadow: inset 0 1px var(--hi);
}

.price {
  font-size: 17px;
  font-weight: 700;
}

.price small {
  margin-left: 2px;
  font-size: 12px;
  font-weight: 400;
}

.card__type {
  font-size: 12px;
}

.empty {
  padding: 16px;
  background: var(--hi);
  border: 2px solid;
  border-color: var(--sh-2) var(--hi) var(--hi) var(--sh-2);
}

/* ── 購入の流れ ── */
.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 8px;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
}

.steps li::before {
  content: counter(step);
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  background: var(--title-active);
  color: var(--hi);
  font-weight: 700;
}

.steps strong {
  display: block;
}

/* ── 商品詳細 ── */
.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr);
  gap: 12px;
  align-items: start;
}

.detail__main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.preview {
  min-width: 0;
  background: var(--hi);
  border: 2px solid;
  border-color: var(--sh-2) var(--hi) var(--hi) var(--sh-2);
  box-shadow: inset 1px 1px var(--sh), inset -1px -1px var(--hi-2);
}

.preview__url {
  padding: 3px 6px;
  border-bottom: 1px solid var(--sh);
  background: var(--surface);
  font-size: 12px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.preview iframe {
  display: block;
  width: 100%;
  height: min(74vh, 780px);
  border: 0;
}

.preview__empty {
  min-height: 320px;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
}

.buy {
  position: sticky;
  top: 10px;
}

.buy h1 {
  font-size: 22px;
  line-height: 1.3;
}

.buy__tagline {
  font-weight: 700;
}

.spec {
  margin: 0;
  display: grid;
  gap: 4px;
}

.spec div {
  display: grid;
  grid-template-columns: 6em minmax(0, 1fr);
  gap: 6px;
}

.spec dt {
  font-weight: 700;
}

.spec dd {
  margin: 0;
}

.buy .price {
  font-size: 24px;
}

.note {
  font-size: 12px;
  text-align: right;
}

.bullets {
  margin: 0;
  padding-left: 1.3em;
  display: grid;
  gap: 4px;
  line-height: 1.5;
}

.sample {
  display: grid;
  gap: 6px;
}

.sample__box {
  padding: 6px 8px;
  background: var(--hi);
  border: 2px solid;
  border-color: var(--sh-2) var(--hi) var(--hi) var(--sh-2);
  line-height: 1.6;
}

.faq {
  margin: 0;
  display: grid;
  gap: 8px;
}

.faq dt {
  font-weight: 700;
}

.faq dd {
  margin: 2px 0 0;
  line-height: 1.6;
}

/* ── エラー表示 ── */
.dialog {
  width: min(100%, 440px);
  margin: 24px auto;
}

.dialog__body {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 14px 12px 6px;
}

.dialog .actions {
  padding: 8px 12px 12px;
}

.dialog__mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: #c00000;
  color: var(--hi);
  font-weight: 700;
  font-size: 20px;
}

/* ── WebGL の演出（site-gl.js） ── */
.site-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  image-rendering: pixelated;
}

.desktop {
  position: relative;
  z-index: 1;
}

.crt-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.card__flag {
  z-index: 2;
}

.preview-tabs {
  margin-bottom: -2px;
}

.preview-panel[hidden] {
  display: none;
}

.preview-panel--video {
  display: grid;
  gap: 6px;
}

.preview-panel--video .note {
  text-align: left;
}

.monitor {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #000;
  border: 2px solid;
  border-color: var(--sh-2) var(--hi) var(--hi) var(--sh-2);
  box-shadow: inset 1px 1px var(--sh), inset -1px -1px var(--hi-2);
}

.monitor .crt-canvas {
  inset: 2px;
  width: calc(100% - 4px);
  height: calc(100% - 4px);
}

/* ── タスクバー（スマホでも 1 段に収める） ── */
.taskbar {
  flex-wrap: nowrap;
}

.task-buttons {
  flex: 1 1 0;
  flex-wrap: nowrap;
  gap: 4px;
  overflow: hidden;
}

.task-button {
  flex: 0 1 180px;
  display: flex;
  align-items: center;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-button span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.start-items a {
  white-space: nowrap;
}

@media (max-width: 860px) {
  .detail {
    grid-template-columns: minmax(0, 1fr);
  }

  .buy {
    position: static;
  }

  /* 教材は商品名と価格を先に読めるよう、購入欄を内容より上に出す */
  .detail--knowhow .buy {
    order: -1;
  }

  .preview iframe {
    height: 70vh;
  }
}

@media (max-width: 680px) {
  .window-body {
    padding: 8px;
  }

  .tab-panel {
    padding: 8px;
  }

  .ident__logo {
    font-size: 26px;
  }

  .legend-list div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .toolbar__count {
    margin-left: 0;
  }

  .clock-panel {
    flex: 0 0 auto;
    min-width: 58px;
    padding: 5px 6px;
  }

  .start-button {
    padding: 4px 8px;
  }
}
