 :root {
      --bg: #ffffff;
      --text: #333;
      --btn: #90caf9;
      --btn-op: #42a5f5;
      --btn-eq: #1e88e5;
      --btn-clear: #ef5350;
      --shadow: rgba(0,0,0,0.1);
    }

    body.dark {
      --bg: #1e1e1e;
      --text: #f1f1f1;
      --btn: #4fc3f7;
      --btn-op: #29b6f6;
      --btn-eq: #039be5;
      --btn-clear: #e57373;
      --shadow: rgba(255,255,255,0.1);
    }

    * {
      box-sizing: border-box;
    }

    body {
      background: var(--bg);
      font-family: 'Segoe UI', sans-serif;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      height: 100vh;
      margin: 0;
      color: var(--text);
      transition: background 0.3s, color 0.3s;
    }

    .calculadora {
      background: var(--bg);
      padding: 20px;
      border-radius: 20px;
      box-shadow: 0 10px 25px var(--shadow);
      width: 320px;
      transition: background 0.3s, box-shadow 0.3s;
    }

    .pantalla {
      width: 100%;
      height: 60px;
      background: #f1f1f1;
      border: none;
      border-radius: 10px;
      margin-bottom: 20px;
      text-align: right;
      font-size: 2rem;
      padding: 10px;
      color: var(--text);
    }

    body.dark .pantalla {
      background: #333;
    }

    .botones {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 10px;
    }

    .boton {
      padding: 20px;
      background: var(--btn);
      color: white;
      font-size: 1.5rem;
      border: none;
      border-radius: 10px;
      cursor: pointer;
      transition: transform 0.1s ease, background 0.2s;
    }

    .boton:active {
      transform: scale(0.95);
    }

    .operador {
      background: var(--btn-op);
    }

    .igual {
      background: var(--btn-eq);
      grid-column: span 2;
    }

    .clear {
      background: var(--btn-clear);
      grid-column: span 2;
    }

    .modo {
      margin-top: 20px;
      padding: 10px 20px;
      background: #ccc;
      border: none;
      border-radius: 10px;
      cursor: pointer;
      font-weight: bold;
      transition: background 0.3s;
    }

    .modo:hover {
      background: #bbb;
    }