:root {
  --bg-color: #0f172a;
  --text-color: #f8fafc;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --item-bg: #8b5cf6;
}

body {
  margin: 0;
  padding: 80px 0;
  min-height: 100vh;
  box-sizing: border-box;
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.docs-demo-html {
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  width: fit-content;
  padding: 32px;
}

.layout.row {
  display: flex;
  flex-direction: row;
  gap: 32px;
}

/* ★ backdrop-filter を疑似要素に分離
   backdrop-filter が親コンテナに直接適用されていると、
   その中の子要素がGPUレイヤー昇格→解除を経た際に
   テキストの再ラスタライズが正しく行われない（Windows ClearType問題）。
   疑似要素に分離することで、子要素の描画品質に干渉しなくなる。 */
.layout-container {
  position: relative;
  width: 152px;
  height: 182px;
  box-sizing: border-box;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.layout-container::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  z-index: -1;
  pointer-events: none;
}

.item {
  background-color: var(--item-bg);
  color: white;
  width: 120px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  margin: 0;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.item[data-layout-id="item-B"] {
  background-color: #ef4444;
}

.medium.row {
  display: flex;
  justify-content: center;
}

.controls {
  border: none;
  padding: 0;
  margin: 0;
}

.button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.button:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(1px);
}
