:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --text: #171717;
  --muted: #777;
  --border: #e8e8e5;
  --accent: #111;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  position: relative;
  min-height: 100vh;
  padding: 50px 20px;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.rules {
  position: relative;
  width: min(700px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px 60px 24px 28px;
  box-shadow: var(--shadow);
}

.close-rule-box {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
  transition: transform 0.2s ease;
}

.close-rule-box:hover {
  transform: rotate(45deg);
}

.rules h3 {
  margin: 0;
  cursor: pointer;
  user-select: none;
}

.container-rule {
  max-height: 500px;
  overflow: hidden;
  opacity: 1;
  transition:
    max-height 0.3s ease,
    opacity 0.25s ease,
    margin-top 0.3s ease;
}

.container-rule ul {
  margin: 20px 0;
}

.container-rule.hidden {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

.heading-rule {
  font-size: 16px;
  margin: 0;
}

.rock,
.paper,
.scissor {
  width: 120px;
  height: 120px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.rock:hover,
.paper:hover,
.scissor:hover {
  transform: translateY(-5px);
  border-color: #ccc;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.1);
}

.rock:active,
.paper:active,
.scissor:active {
  transform: scale(0.94);
}

.rock img,
.paper img,
.scissor img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.extra {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.extra button {
  padding: 11px 18px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.extra button:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.result-html {
  margin-top: 8px;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.result-discription {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.small-img {
  width: 38px;
  height: 38px;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.small-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.medium-img {
  width: 52px;
  height: 52px;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.medium-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.scrore-borad {
  min-width: 180px;
  padding: 18px 25px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-align: center;
  line-height: 1.9;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow);
}

.history-container {
  width: min(700px, 100%);
  position: relative;
  height: 310px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
}

.history-container ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-container li {
  min-height: 56px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  flex-shrink: 0;
}

.his-moves-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.his-time {
  color: #999;
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
}

.hide {
  display: none;
}

.close-his {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e5e5;
  border-radius: 50%;
  background: #d72525;
  color: #000000;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  rotate: 45deg;
  transition: all 0.2s ease;
}

.close-his:hover {
  background: #111;
  color: #fff;
  border-color: #111;
  transform: rotate(90deg);
}

.close-his:active {
  transform: rotate(90deg) scale(0.9);
}

.history-container {
  position: relative;
  padding-top: 52px;
}

.all-html-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 15px;
}

.alert-dailog-box {
  position: fixed;
  inset: 0;
  z-index: 1000;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.alert-box-container {
  position: relative;
  width: min(400px, calc(100% - 40px));
  padding: 28px;

  text-align: center;

  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;

  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.close-alert-dailog-box {
  position: absolute;
  top: 14px;
  right: 16px;

  width: 32px;
  height: 32px;

  border: none;
  border-radius: 50%;

  background: rgba(255, 255, 255, 0.1);
  color: inherit;

  font-size: 22px;
  line-height: 1;

  cursor: pointer;
  rotate: 45deg;

  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.close-alert-dailog-box:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: rotate(45deg);
}

.emoji {
  font-size: 42px;
  margin-bottom: 12px;
}

.message {
  margin: 0 0 24px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.5;
}

.confirm-yes,
.confirm-no {
  min-width: 90px;
  padding: 10px 20px;

  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;

  font-size: 15px;
  font-weight: 600;

  cursor: pointer;

  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.confirm-yes {
  background: rgba(255, 255, 255, 0.18);
}

.confirm-no {
  margin-left: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.confirm-yes:hover,
.confirm-no:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.22);
}

.alert-dailog-box.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.universal-alert-box {
  position: fixed;
  inset: 0;
  z-index: 1000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 20px;

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  background: rgba(0, 0, 0, 0.15);

  opacity: 1;
  visibility: visible;

  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.uni-alert-container {
  position: relative;

  width: min(380px, 100%);
  padding: 32px 28px 26px;

  text-align: center;

  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.18),
    rgba(255, 255, 255, 0.06)
  );

  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;

  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);

  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.22),
    0 8px 25px rgba(0, 0, 0, 0.12),
    inset 0 1px 1px rgba(255, 255, 255, 0.35);
}

.close-uni-alert {
  position: absolute;
  top: 12px;
  right: 12px;

  width: 30px;
  height: 30px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;

  background: rgba(255, 255, 255, 0.08);
  color: inherit;

  font-size: 22px;
  line-height: 1;

  cursor: pointer;

  rotate: 45deg;

  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.close-uni-alert:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: rotate(45deg);
}

.emoji-uni {
  font-size: 38px;
  margin-bottom: 10px;
}

.message-uni {
  margin: 0;

  font-size: 17px;
  font-weight: 500;
  line-height: 1.5;
}

.universal-alert-box.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 600px) {
  body {
    padding: 25px 15px;
    gap: 20px;
  }

  .rules {
    padding: 20px;
  }

  .container-rule ul {
    grid-template-columns: 1fr;
  }

  .rock,
  .paper,
  .scissor {
    width: 90px;
    height: 90px;
    padding: 17px;
  }

  .result-html {
    font-size: 28px;
  }

  .history-container li {
    flex-direction: column;
    align-items: flex-start;
  }

  .his-time {
    text-align: left;
  }
  .alert-box-container {
    padding: 24px 20px;
  }

  .message {
    font-size: 16px;
  }

  .uni-alert-container {
    width: 100%;
    padding: 30px 22px 24px;
  }

  .message-uni {
    font-size: 16px;
  }
}

@media (min-width: 700px) {
  body > .rock,
  body > .paper,
  body > .scissor {
    display: inline-block;
    margin: 0 7px;
  }
}
