:root {
  --text: #fcfaf7;
  --background: #1e1710;
  --primary: #cc9b6d;
  --primary-hover: #b07d4e;
  --secondary: #f1ca89;
  --secondary-hover: #e0b86d;
  --accent: #f2dac3;
  --shadow: 0 0px 32px 0 hsla(29, 39%, 50%, 0.782);
  --radius: 14px;
  --gap: 8px;
  --Switch-button: #f7ca7b33;
  --Switch-button-hover: #e0b86d;
}

/* light-mode */
.light-mode {
  --text: #1e1710;
  --background: #fcfaf7;
  --primary: #cc9b6d;
  --primary-hover: #b07d4e;
  --secondary: #e0b86d;
  --secondary-hover: #f2d29c;
  --accent: #5c442a;
  --Switch-button: #d1840054;
  --Switch-button-hover: #764a00c2;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "Courier New", Courier, monospace;
  color: var(--text);
  background: var(--background);
  transition: background 0.3s ease, color 0.3s ease;
}

.calc {
  width: 320px;
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  padding: 24px 20px 20px 20px;
  background: var(--background);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  justify-content: center;
  font-weight: 900;
  position: relative;
}

/* Switch-button*/
.calc_toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--Switch-button);
  color: var(--background);
  border: none;
  border-radius: var(--radius);
  padding: 4px 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: bold;
  transition: background 0.3s ease;
}
.calc_toggle:hover {
  background: var(--Switch-button-hover);
}

.calc_title {
  width: 100%;
  text-align: center;
  font-size: 1.4rem;
  margin-bottom: var(--gap);
  color: var(--secondary);
}

.calc_result {
  width: 100%;
  min-height: 48px;
  border: 2px solid var(--secondary);
  border-radius: var(--radius);
  font-size: 1.6em;
  color: var(--text);
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: var(--gap);
  word-break: break-word;
}

.calc_btn {
  width: calc(25% - var(--gap));
  height: 48px;
  background: var(--primary);
  color: var(--text);
  border-radius: var(--radius);
  border: none;
  font-size: 1.15rem;
  cursor: pointer;
  font-weight: 900;
  margin-bottom: var(--gap);
  transition: background 0.3s ease, transform 0.2s ease;
}

.calc_btn:hover {
  background: var(--primary-hover);
}

.calc_btn:active {
  border: 2px solid var(--accent);
  opacity: 82%;
  transform: scale(0.97);
}

.calc_btn--spanned {
  width: calc(50% - var(--gap));
}

.operator {
  background: var(--secondary);
  color: #1e1710;
  font-weight: 600;
}

.operator:hover {
  background: var(--secondary-hover);
}

.calc_btn--operator,
.calc_btn--spanned {
  background: var(--secondary);
}
.calc_btn--operator:hover,
.calc_btn--spanned:hover {
  background: var(--secondary-hover);
}
