* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 20px;
  background: #fff7ec;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  width: min(100%, 420px);
  text-align: center;
  background: #ffffff;
  padding: 32px 24px;
  border-radius: 24px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* ---------- 共通タイトル ---------- */

.tool-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tool-header h1 {
  margin: 0;
  color: #6b4b2a;
  font-size: clamp(26px, 7vw, 36px);
  line-height: 1.2;
  white-space: nowrap;
}

/*
  コッペ画像専用の表示枠です。
  overflow:hidden により、画像内の余白が多少大きくても
  タイトル周辺に広がりません。
*/
.tool-icon-frame {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: grid;
  place-items: center;
}

.tool-header .tool-icon {
  display: block;
  width: 52px !important;
  height: 52px !important;
  object-fit: contain;
  transform: none;
}

/* ---------- サイコロ ---------- */

.dice {
  width: 130px;
  height: 130px;
  object-fit: contain;
  margin: 24px auto;
  display: block;
}

/* ---------- ボタン ---------- */

button {
  appearance: none;
  font: inherit;
  font-size: 20px;
  font-weight: 700;
  padding: 12px 28px;
  border: none;
  border-radius: 999px;
  background: #f6a85b;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 0 #dc8e42;
  transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.2s ease;
}

button:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #dc8e42;
}

button:disabled {
  opacity: 0.65;
  cursor: default;
}

/* ---------- 結果 ---------- */

.result {
  margin-top: 24px;
  font-size: 24px;
  font-weight: 700;
  color: #6b4b2a;
}

@media (max-width: 380px) {
  .container {
    padding: 28px 18px;
  }

  .tool-header {
    gap: 8px;
  }

  .tool-icon-frame {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .tool-header .tool-icon {
    width: 42px !important;
    height: 42px !important;
  }
}
